From b6c1390354bbcb99687fa60774697cfa90b5f271 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Tue, 26 Mar 2024 09:58:05 +0100 Subject: [PATCH] nir_to_spirv: Allow LOD for external images External images translate to 2D images in ntv, so we will have to emit OpImageQuerySizeLod instead of OpImageQuerySize (thanks Faith for pointing that out). This quells VUID-VkShaderModuleCreateInfo-pCode-08737 Image must have either 'MS'=1 or 'Sampled'=0 or 'Sampled'=2 %32 = OpImageQuerySize %v2int %31 triggred by piglit spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3 on Zink. Fixes: 3f783a3c507e16bffb2e460484fbf65eb11ba826 zink: omit Lod image operand in ntv when not using an image texture dim Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c index e1a68c1b75d..b2b5abd9865 100644 --- a/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c +++ b/src/gallium/drivers/zink/nir_to_spirv/nir_to_spirv.c @@ -3549,6 +3549,9 @@ tex_instr_is_lod_allowed(nir_tex_instr *tex) tex->sampler_dim == GLSL_SAMPLER_DIM_2D || tex->sampler_dim == GLSL_SAMPLER_DIM_3D || tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE || + /* External images are interpreted as 2D in type_to_dim, + * so LOD is allowed */ + tex->sampler_dim == GLSL_SAMPLER_DIM_EXTERNAL || /* RECT will always become 2D, so this is fine */ tex->sampler_dim == GLSL_SAMPLER_DIM_RECT); }