@@ -44,6 +44,15 @@ impl ViewNode for MainTransparentPass2dNode {
44
44
45
45
let diagnostics = render_context. diagnostic_recorder ( ) ;
46
46
47
+ let color_attachments = [ Some ( target. get_color_attachment ( ) ) ] ;
48
+ // NOTE: For the transparent pass we load the depth buffer. There should be no
49
+ // need to write to it, but store is set to `true` as a workaround for issue #3776,
50
+ // https://github.com/bevyengine/bevy/issues/3776
51
+ // so that wgpu does not clear the depth buffer.
52
+ // As the opaque and alpha mask passes run first, opaque meshes can occlude
53
+ // transparent ones.
54
+ let depth_stencil_attachment = Some ( depth. get_attachment ( StoreOp :: Store ) ) ;
55
+
47
56
render_context. add_command_buffer_generation_task ( move |render_device| {
48
57
// Command encoder setup
49
58
let mut command_encoder =
@@ -58,14 +67,8 @@ impl ViewNode for MainTransparentPass2dNode {
58
67
59
68
let render_pass = command_encoder. begin_render_pass ( & RenderPassDescriptor {
60
69
label : Some ( "main_transparent_pass_2d" ) ,
61
- color_attachments : & [ Some ( target. get_color_attachment ( ) ) ] ,
62
- // NOTE: For the transparent pass we load the depth buffer. There should be no
63
- // need to write to it, but store is set to `true` as a workaround for issue #3776,
64
- // https://github.com/bevyengine/bevy/issues/3776
65
- // so that wgpu does not clear the depth buffer.
66
- // As the opaque and alpha mask passes run first, opaque meshes can occlude
67
- // transparent ones.
68
- depth_stencil_attachment : Some ( depth. get_attachment ( StoreOp :: Store ) ) ,
70
+ color_attachments : & color_attachments,
71
+ depth_stencil_attachment,
69
72
timestamp_writes : None ,
70
73
occlusion_query_set : None ,
71
74
} ) ;
0 commit comments