lavapipe: do not use NONE-swizzle

The NONE-swizzle isn't supported for texture views in LLVMpipe, because
it's not meant for this purpose in the first place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26192>
This commit is contained in:
Erik Faye-Lund
2023-11-15 10:10:58 +01:00
committed by Marge Bot
parent 1fbec9f532
commit e233eee492
2 changed files with 8 additions and 6 deletions

View File

@@ -110,7 +110,8 @@ static inline unsigned vk_conv_wrap_mode(enum VkSamplerAddressMode addr_mode)
}
}
static inline enum pipe_swizzle vk_conv_swizzle(VkComponentSwizzle swiz)
static inline enum pipe_swizzle vk_conv_swizzle(VkComponentSwizzle swiz,
enum pipe_swizzle identity)
{
switch (swiz) {
case VK_COMPONENT_SWIZZLE_ZERO:
@@ -126,7 +127,8 @@ static inline enum pipe_swizzle vk_conv_swizzle(VkComponentSwizzle swiz)
case VK_COMPONENT_SWIZZLE_A:
return PIPE_SWIZZLE_W;
case VK_COMPONENT_SWIZZLE_IDENTITY:
return identity;
default:
return PIPE_SWIZZLE_NONE;
unreachable("Invalid VkComponentSwizzle value");
}
}

View File

@@ -230,10 +230,10 @@ lvp_create_samplerview(struct pipe_context *pctx, struct lvp_image_view *iv, VkF
templ.u.tex.last_layer = iv->vk.base_array_layer + iv->vk.layer_count - 1;
templ.u.tex.first_level = iv->vk.base_mip_level;
templ.u.tex.last_level = iv->vk.base_mip_level + iv->vk.level_count - 1;
templ.swizzle_r = vk_conv_swizzle(iv->vk.swizzle.r);
templ.swizzle_g = vk_conv_swizzle(iv->vk.swizzle.g);
templ.swizzle_b = vk_conv_swizzle(iv->vk.swizzle.b);
templ.swizzle_a = vk_conv_swizzle(iv->vk.swizzle.a);
templ.swizzle_r = vk_conv_swizzle(iv->vk.swizzle.r, PIPE_SWIZZLE_X);
templ.swizzle_g = vk_conv_swizzle(iv->vk.swizzle.g, PIPE_SWIZZLE_Y);
templ.swizzle_b = vk_conv_swizzle(iv->vk.swizzle.b, PIPE_SWIZZLE_Z);
templ.swizzle_a = vk_conv_swizzle(iv->vk.swizzle.a, PIPE_SWIZZLE_W);
/* depth stencil swizzles need special handling to pass VK CTS
* but also for zink GL tests.