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 <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8832>
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);