zink: set multiviewport cap in ntv when gl_ViewportIndex is a written output
this cap varies based on the shader stage, but it must be enabled any time this output is written Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6349>
This commit is contained in:
parent
09be30b9e4
commit
8a2ddcb4a9
|
@ -2263,6 +2263,13 @@ nir_to_spirv(struct nir_shader *s, const struct zink_so_info *so_info)
|
||||||
unreachable("invalid stage");
|
unreachable("invalid stage");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (s->info.outputs_written & BITFIELD64_BIT(VARYING_SLOT_VIEWPORT)) {
|
||||||
|
if (s->info.stage < MESA_SHADER_GEOMETRY)
|
||||||
|
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityShaderViewportIndex);
|
||||||
|
else
|
||||||
|
spirv_builder_emit_cap(&ctx.builder, SpvCapabilityMultiViewport);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: only enable when needed
|
// TODO: only enable when needed
|
||||||
if (s->info.stage == MESA_SHADER_FRAGMENT) {
|
if (s->info.stage == MESA_SHADER_FRAGMENT) {
|
||||||
spirv_builder_emit_cap(&ctx.builder, SpvCapabilitySampled1D);
|
spirv_builder_emit_cap(&ctx.builder, SpvCapabilitySampled1D);
|
||||||
|
|
Loading…
Reference in New Issue