fixing triggered assertion in blitter
Build / build (push) Successful in 1m13s
Test / build_and_test (push) Failing after 2m21s

This commit is contained in:
2026-05-09 23:52:06 +02:00
parent 13b898a7cd
commit 1e02a5bc3e
8 changed files with 156 additions and 47 deletions
+42 -5
View File
@@ -142,20 +142,57 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
for (impl.render_pass.interface.attachments, impl.framebuffer.interface.attachments, 0..) |desc, attachment, index| {
const image: *SoftImage = @alignCast(@fieldParentPtr("interface", attachment.image));
const clear_format = try image.getClearFormat();
var clear_mask: vk.ImageAspectFlags = .{};
switch (desc.load_op) {
.clear => {
.clear => clear_mask = .{ .color_bit = true, .depth_bit = true },
else => {},
}
switch (desc.stencil_load_op) {
.clear => clear_mask = .{ .stencil_bit = true },
else => {},
}
clear_mask = clear_mask.intersect(base.format.toAspect(attachment.format));
if (clear_mask.toInt() != 0) {
if (clear_mask.color_bit) {
try blitter.clear(
(impl.clear_values orelse return VkError.Unknown)[index],
clear_format,
try image.getClearFormat(),
image,
attachment.format,
attachment.subresource_range,
null,
);
},
else => {},
} else {
var subresource_range = attachment.subresource_range;
if (clear_mask.depth_bit) {
subresource_range.aspect_mask = .{ .depth_bit = true };
try blitter.clear(
(impl.clear_values orelse return VkError.Unknown)[index],
.d32_sfloat,
image,
attachment.format,
subresource_range,
null,
);
}
if (clear_mask.stencil_bit) {
subresource_range.aspect_mask = .{ .stencil_bit = true };
try blitter.clear(
(impl.clear_values orelse return VkError.Unknown)[index],
.s8_uint,
image,
attachment.format,
subresource_range,
null,
);
}
}
}
}
}