From: Erik Faye-Lund Date: Tue, 2 Feb 2021 11:34:45 +0000 (+0100) Subject: zik: correct spir-v caps for textures and images X-Git-Tag: upstream/21.2.3~8513 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84fd3b7709a4823711fcfa643fdc68f03b16f0e4;p=platform%2Fupstream%2Fmesa.git zik: correct spir-v caps for textures and images There's a couple of minor issues with these the way they where: 1. All shader stages can perform texturing. So let's check for textures instead of fragment-shader 2. Not all implementations support StorageImageExtendedFormats. We don't expose image support for those implementations, but we shouldn't enable the cap just because we're texturing. Both of these issues can be tackled by splitting these into texturing and images conditionals. Reviewed-By: Mike Blumenkrantz Part-of: --- 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 2a2e4ea..97f9188 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 @@ -3348,8 +3348,12 @@ nir_to_spirv(struct nir_shader *s, const struct zink_so_info *so_info, spirv_builder_emit_cap(&ctx.builder, SpvCapabilityMultiViewport); } - if (s->info.stage == MESA_SHADER_FRAGMENT || s->info.num_images) { + if (s->info.num_textures) { spirv_builder_emit_cap(&ctx.builder, SpvCapabilitySampled1D); + spirv_builder_emit_cap(&ctx.builder, SpvCapabilityImageQuery); + } + + if (s->info.num_images) { spirv_builder_emit_cap(&ctx.builder, SpvCapabilityImage1D); spirv_builder_emit_cap(&ctx.builder, SpvCapabilityImageQuery); spirv_builder_emit_cap(&ctx.builder, SpvCapabilityStorageImageExtendedFormats);