anv: Don't use bogus alpha swizzles
For RGB formats in Vulkan, we use the corresponding RGBA format with a swizzle of RGB1. While this swizzle is exactly what we want for texturing, it's not allowed for rendering according to the docs. While we haven't been getting hangs or anything, we should probably obey the docs. This commit just sanitizes all render swizzles so that the alpha channel maps to ALPHA. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
This commit is contained in:
@@ -528,6 +528,7 @@ genX(cmd_buffer_setup_attachments)(struct anv_cmd_buffer *cmd_buffer,
|
||||
|
||||
struct isl_view view = iview->isl;
|
||||
view.usage |= ISL_SURF_USAGE_RENDER_TARGET_BIT;
|
||||
view.swizzle = anv_swizzle_for_render(view.swizzle);
|
||||
isl_surf_fill_state(isl_dev,
|
||||
state->attachments[i].color_rt_state.map,
|
||||
.surf = &iview->image->color_surface.isl,
|
||||
|
Reference in New Issue
Block a user