This cap should only ever be emitted for fragment-shaders, but we
accidentally emit it for all shaders. Let's tighten the check to avoid a
validator warning when emitting non-fragment shaders without support for
VK_EXT_shader_stencil_export.
Fixes:
8724d4fb361 ("zink: check shader stencil output")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10249>
spirv_builder_emit_mem_model(&ctx.builder, SpvAddressingModelLogical,
SpvMemoryModelGLSL450);
- if (s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) {
+ if (s->info.stage == MESA_SHADER_FRAGMENT &&
+ s->info.outputs_written & BITFIELD64_BIT(FRAG_RESULT_STENCIL)) {
spirv_builder_emit_extension(&ctx.builder, "SPV_EXT_shader_stencil_export");
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityStencilExportEXT);
}