Commit e07c5467 authored by Alejandro Piñeiro's avatar Alejandro Piñeiro

v3dv/format: use XYZ1 swizzle for three-component formats

So far for the formats E5B9G9R9_UFLOAT_PACK32 and
B10G11R11_UFLOAT_PACK32 we were using a XYZW swizzle. But from Vulkan
spec those are three-component, without alpha, formats. So we should
use XYZ1 instead, as we were already doing for other three-component
formats.

Curiously the only case where this raised a problem were when using
clamp to border with transparent black. This change allows us to
remove the code that handled only that specific case.
Reviewed-by: Iago Toral's avatarIago Toral Quiroga <itoral@igalia.com>
Part-of: <!7355>
parent d8562b74
Pipeline #220207 waiting for manual action with stages
in 24 seconds
......@@ -2928,27 +2928,6 @@ cmd_buffer_populate_v3d_key(struct v3d_key *key,
if (key->tex[combined_idx].return_size == 32) {
v3d_key_return_size = 32;
}
/* Note: In general, we don't need to do anything for the swizzle, as
* that is handled with the swizzle info at the Texture State, and the
* default values for key->tex[].swizzle were already filled up at
* the pipeline creation time.
*
* The only exeption in which we want to apply a texture swizzle
* lowering in the shader is to force alpha to 1 when using clamp
* to border with transparent black in combination with specific
* formats.
*/
if (sampler && sampler->clamp_to_transparent_black_border) {
switch (vk_format) {
case VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:
case VK_FORMAT_B10G11R11_UFLOAT_PACK32:
key->tex[combined_idx].swizzle[3] = PIPE_SWIZZLE_1;
break;
default:
break;
}
}
}
v3d_key_update_return_size(cmd_buffer->state.pipeline, key,
v3d_key_return_size);
......
......@@ -134,8 +134,8 @@ static const struct v3dv_format format_table[] = {
FORMAT(A8B8G8R8_SRGB_PACK32, SRGB8_ALPHA8, RGBA8, SWIZ_XYZW, 16, true), /* RGBA8 sRGB */
FORMAT(A2B10G10R10_UNORM_PACK32,RGB10_A2, RGB10_A2, SWIZ_XYZW, 16, true),
FORMAT(A2B10G10R10_UINT_PACK32, RGB10_A2UI, RGB10_A2UI, SWIZ_XYZW, 16, true),
FORMAT(E5B9G9R9_UFLOAT_PACK32, NO, RGB9_E5, SWIZ_XYZW, 16, true),
FORMAT(B10G11R11_UFLOAT_PACK32, R11F_G11F_B10F,R11F_G11F_B10F, SWIZ_XYZW, 16, true),
FORMAT(E5B9G9R9_UFLOAT_PACK32, NO, RGB9_E5, SWIZ_XYZ1, 16, true),
FORMAT(B10G11R11_UFLOAT_PACK32, R11F_G11F_B10F,R11F_G11F_B10F, SWIZ_XYZ1, 16, true),
/* Depth */
FORMAT(D16_UNORM, D16, DEPTH_COMP16, SWIZ_X001, 32, false),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment