From 77cf4c3051b33d3013bd4b5cdad25537ef006af5 Mon Sep 17 00:00:00 2001 From: Aeden McClain Date: Sun, 26 Jan 2025 19:22:52 -0800 Subject: [PATCH] Fix for vulkan sysgpu backend when only some attachments are cleared Signed-off-by: Aeden McClain --- src/sysgpu/vulkan.zig | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/src/sysgpu/vulkan.zig b/src/sysgpu/vulkan.zig index 5b384fed96..c9998f7fbc 100644 --- a/src/sysgpu/vulkan.zig +++ b/src/sysgpu/vulkan.zig @@ -3181,18 +3181,16 @@ pub const RenderPassEncoder = struct { } else null, }); - if (attach.load_op == .clear) { - try clear_values.append(.{ - .color = .{ - .float_32 = [4]f32{ - @floatCast(attach.clear_value.r), - @floatCast(attach.clear_value.g), - @floatCast(attach.clear_value.b), - @floatCast(attach.clear_value.a), - }, + try clear_values.append(.{ + .color = .{ + .float_32 = [4]f32{ + @floatCast(attach.clear_value.r), + @floatCast(attach.clear_value.g), + @floatCast(attach.clear_value.b), + @floatCast(attach.clear_value.a), }, - }); - } + }, + }); extent = view.extent; } @@ -3216,14 +3214,12 @@ pub const RenderPassEncoder = struct { .read_only = attach.depth_read_only == .true or attach.stencil_read_only == .true, }; - if (attach.depth_load_op == .clear or attach.stencil_load_op == .clear) { - try clear_values.append(.{ - .depth_stencil = .{ - .depth = attach.depth_clear_value, - .stencil = attach.stencil_clear_value, - }, - }); - } + try clear_values.append(.{ + .depth_stencil = .{ + .depth = attach.depth_clear_value, + .stencil = attach.stencil_clear_value, + }, + }); extent = view.extent; }