fixing image clear in vkCmdBeginRenderpass
This commit is contained in:
+2
-2
@@ -32,8 +32,8 @@
|
||||
|
||||
// Soft dependencies
|
||||
.SPIRV_Interpreter = .{
|
||||
.url = "git+https://github.com/Kbz-8/SPIRV-Interpreter#391f4415d9a77d15455f4d7efab65fc8cc931bc5",
|
||||
.hash = "SPIRV_Interpreter-0.0.1-ajmpn6mrBwDO21UuGIRs3iP-0Z9GyhivF3N8V_X4tLzX",
|
||||
.url = "git+https://github.com/Kbz-8/SPIRV-Interpreter#f82e3e1629af4dc751a80a3a4b04ff1b43725c24",
|
||||
.hash = "SPIRV_Interpreter-0.0.1-ajmpn6mrBwDl75NH4NndKIOjnn-1ooUY-0NRyWR2eW-P",
|
||||
.lazy = true,
|
||||
},
|
||||
//.SPIRV_Interpreter = .{
|
||||
|
||||
@@ -293,7 +293,7 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
|
||||
image,
|
||||
attachment.format,
|
||||
attachment.subresource_range,
|
||||
null,
|
||||
impl.render_area,
|
||||
);
|
||||
} else {
|
||||
var subresource_range = attachment.subresource_range;
|
||||
@@ -306,7 +306,7 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
|
||||
image,
|
||||
attachment.format,
|
||||
subresource_range,
|
||||
null,
|
||||
impl.render_area,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ pub fn beginRenderPass(interface: *Interface, render_pass: *base.RenderPass, fra
|
||||
image,
|
||||
attachment.format,
|
||||
subresource_range,
|
||||
null,
|
||||
impl.render_area,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ fn readImageFloat4(context: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32,
|
||||
.cube => cube_face,
|
||||
else => 0,
|
||||
};
|
||||
pixel = image.readFloat4(
|
||||
pixel = SoftSampler.swizzleFloat4(image.readFloat4(
|
||||
image_coord,
|
||||
.{
|
||||
.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,
|
||||
},
|
||||
image_view.interface.format,
|
||||
) catch return SpvRuntimeError.Unknown;
|
||||
) catch return SpvRuntimeError.Unknown, image_view.interface.components);
|
||||
}
|
||||
return .{
|
||||
.x = pixel[0],
|
||||
@@ -368,7 +368,7 @@ fn readImageInt4(context: *anyopaque, dim: spv.SpvDim, x: i32, y: i32, z: i32, l
|
||||
.cube => cube_face,
|
||||
else => 0,
|
||||
};
|
||||
pixel = image.readInt4(
|
||||
pixel = SoftSampler.swizzleInt4(image.readInt4(
|
||||
image_coord,
|
||||
.{
|
||||
.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,
|
||||
},
|
||||
image_view.interface.format,
|
||||
) catch return SpvRuntimeError.Unknown;
|
||||
) catch return SpvRuntimeError.Unknown, image_view.interface.components);
|
||||
}
|
||||
return .{
|
||||
.x = pixel[0],
|
||||
|
||||
@@ -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 .{
|
||||
swizzleFloatComponent(color, components.r, 0),
|
||||
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 .{
|
||||
swizzleIntComponent(color, components.r, 0),
|
||||
swizzleIntComponent(color, components.g, 1),
|
||||
|
||||
@@ -86,7 +86,7 @@ inline fn run(data: RunData) !void {
|
||||
const buffer_memory = if (buffer.interface.memory) |memory| memory else return VkError.InvalidDeviceMemoryDrv;
|
||||
const input_index = switch (binding_info.input_rate) {
|
||||
.vertex => vertex_index,
|
||||
.instance => data.instance_index,
|
||||
.instance => data.first_instance + data.instance_index,
|
||||
else => return VkError.ValidationFailed,
|
||||
};
|
||||
const offset = buffer.interface.offset + vertex_buffer.offset + (binding_info.stride * input_index) + attribute.offset;
|
||||
|
||||
Reference in New Issue
Block a user