[Mesa-dev] [PATCH v2 1/2] spirv: Add SpvCapabilityShaderViewportIndexLayerEXT
Caio Marcelo de Oliveira Filho
caio.oliveira at intel.com
Fri Feb 23 22:06:23 UTC 2018
On Fri, Feb 23, 2018 at 11:34:31AM -0800, Caio Marcelo de Oliveira Filho wrote:
> Hi,
>
> > diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c
> > index 9eb85c24e9..ba2b74c2c2 100644
> > --- a/src/compiler/spirv/vtn_variables.c
> > +++ b/src/compiler/spirv/vtn_variables.c
> > @@ -1192,6 +1192,11 @@ vtn_get_builtin_location(struct vtn_builder *b,
> > *mode = nir_var_shader_in;
> > else if (b->shader->info.stage == MESA_SHADER_GEOMETRY)
> > *mode = nir_var_shader_out;
> > + else if (b->options && b->options->caps.shader_viewport_index_layer &&
> > + (b->shader->info.stage == MESA_SHADER_VERTEX ||
> > + b->shader->info.stage == MESA_SHADER_TESS_CTRL ||
>
> I'm a bit unsure about this being exported to Tesselation Control
> Shader, but the extension spec does refer to Tesselation shaders (and
> not explicitly the evaluation, like in other places).
The version of the spec that includes the extensions says explicitly
in section 14.6.
The ViewportIndex decoration must be used only within vertex,
tessellation evaluation, geometry, and fragment shaders.
So I'll send a v3 of this patch. I wonder if the extension text (both
for the Vulkan and SPIR-V) should be more explicit about this too.
Thanks,
Caio
More information about the mesa-dev
mailing list