fixing image clear in vkCmdBeginRenderpass
Build / build (push) Failing after 0s
Test / build_and_test (push) Failing after 0s

This commit is contained in:
2026-06-19 01:59:14 +02:00
parent aaf6653b3f
commit 59716cc794
5 changed files with 12 additions and 12 deletions
+2 -2
View File
@@ -32,8 +32,8 @@
// Soft dependencies // Soft dependencies
.SPIRV_Interpreter = .{ .SPIRV_Interpreter = .{
.url = "git+https://github.com/Kbz-8/SPIRV-Interpreter#391f4415d9a77d15455f4d7efab65fc8cc931bc5", .url = "git+https://github.com/Kbz-8/SPIRV-Interpreter#f82e3e1629af4dc751a80a3a4b04ff1b43725c24",
.hash = "SPIRV_Interpreter-0.0.1-ajmpn6mrBwDO21UuGIRs3iP-0Z9GyhivF3N8V_X4tLzX", .hash = "SPIRV_Interpreter-0.0.1-ajmpn6mrBwDl75NH4NndKIOjnn-1ooUY-0NRyWR2eW-P",
.lazy = true, .lazy = true,
}, },
//.SPIRV_Interpreter = .{ //.SPIRV_Interpreter = .{
+3 -3
View File
@@ -293,7 +293,7 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
image, image,
attachment.format, attachment.format,
attachment.subresource_range, attachment.subresource_range,
null, impl.render_area,
); );
} else { } else {
var subresource_range = attachment.subresource_range; var subresource_range = attachment.subresource_range;
@@ -306,7 +306,7 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
image, image,
attachment.format, attachment.format,
subresource_range, subresource_range,
null, impl.render_area,
); );
} }
@@ -318,7 +318,7 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
image, image,
attachment.format, attachment.format,
subresource_range, subresource_range,
null, impl.render_area,
); );
} }
} }
+4 -4
View File
@@ -327,7 +327,7 @@ fn readImageFloat4(context: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32,
.cube => cube_face, .cube => cube_face,
else => 0, else => 0,
}; };
pixel = image.readFloat4( pixel = SoftSampler.swizzleFloat4(image.readFloat4(
image_coord, image_coord,
.{ .{
.aspect_mask = image_view.interface.subresource_range.aspect_mask, .aspect_mask = image_view.interface.subresource_range.aspect_mask,
@@ -335,7 +335,7 @@ fn readImageFloat4(context: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32,
.array_layer = array_layer, .array_layer = array_layer,
}, },
image_view.interface.format, image_view.interface.format,
) catch return SpvRuntimeError.Unknown; ) catch return SpvRuntimeError.Unknown, image_view.interface.components);
} }
return .{ return .{
.x = pixel[0], .x = pixel[0],
@@ -368,7 +368,7 @@ fn readImageInt4(context: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32, l
.cube => cube_face, .cube => cube_face,
else => 0, else => 0,
}; };
pixel = image.readInt4( pixel = SoftSampler.swizzleInt4(image.readInt4(
image_coord, image_coord,
.{ .{
.aspect_mask = image_view.interface.subresource_range.aspect_mask, .aspect_mask = image_view.interface.subresource_range.aspect_mask,
@@ -376,7 +376,7 @@ fn readImageInt4(context: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32, l
.array_layer = array_layer, .array_layer = array_layer,
}, },
image_view.interface.format, image_view.interface.format,
) catch return SpvRuntimeError.Unknown; ) catch return SpvRuntimeError.Unknown, image_view.interface.components);
} }
return .{ return .{
.x = pixel[0], .x = pixel[0],
+2 -2
View File
@@ -285,7 +285,7 @@ fn swizzleFloatComponent(color: F32x4, swizzle: vk.ComponentSwizzle, comptime id
}; };
} }
fn swizzleFloat4(color: F32x4, components: vk.ComponentMapping) F32x4 { pub fn swizzleFloat4(color: F32x4, components: vk.ComponentMapping) F32x4 {
return .{ return .{
swizzleFloatComponent(color, components.r, 0), swizzleFloatComponent(color, components.r, 0),
swizzleFloatComponent(color, components.g, 1), swizzleFloatComponent(color, components.g, 1),
@@ -307,7 +307,7 @@ fn swizzleIntComponent(color: U32x4, swizzle: vk.ComponentSwizzle, comptime iden
}; };
} }
fn swizzleInt4(color: U32x4, components: vk.ComponentMapping) U32x4 { pub fn swizzleInt4(color: U32x4, components: vk.ComponentMapping) U32x4 {
return .{ return .{
swizzleIntComponent(color, components.r, 0), swizzleIntComponent(color, components.r, 0),
swizzleIntComponent(color, components.g, 1), swizzleIntComponent(color, components.g, 1),
+1 -1
View File
@@ -86,7 +86,7 @@ inline fn run(data: RunData) !void {
const buffer_memory = if (buffer.interface.memory) |memory| memory else return VkError.InvalidDeviceMemoryDrv; const buffer_memory = if (buffer.interface.memory) |memory| memory else return VkError.InvalidDeviceMemoryDrv;
const input_index = switch (binding_info.input_rate) { const input_index = switch (binding_info.input_rate) {
.vertex => vertex_index, .vertex => vertex_index,
.instance => data.instance_index, .instance => data.first_instance + data.instance_index,
else => return VkError.ValidationFailed, else => return VkError.ValidationFailed,
}; };
const offset = buffer.interface.offset + vertex_buffer.offset + (binding_info.stride * input_index) + attribute.offset; const offset = buffer.interface.offset + vertex_buffer.offset + (binding_info.stride * input_index) + attribute.offset;