fixing image clear in vkCmdBeginRenderpass
This commit is contained in:
@@ -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