From: Ilia Mirkin Date: Wed, 2 Jul 2014 16:17:59 +0000 (-0400) Subject: mesa/st: enable AMD_vertex_shader_viewport_index X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0fb6f1bf1d0729486443996c620ea1b766489e15;p=mesa.git mesa/st: enable AMD_vertex_shader_viewport_index The assumption is that any driver capable of emitting layer from the vertex shader and supporting viewports should be able to also handle emitting viewport index from the vertex shader. Signed-off-by: Ilia Mirkin Reviewed-by: Marek Olšák Tested-by: Tobias Droste --- diff --git a/docs/relnotes/10.3.html b/docs/relnotes/10.3.html index 6090a921912..2e718fc8a7e 100644 --- a/docs/relnotes/10.3.html +++ b/docs/relnotes/10.3.html @@ -55,7 +55,7 @@ Note: some of the new features are only available with certain drivers.
  • GL_ARB_viewport_array on nvc0
  • GL_ARB_seamless_cubemap_per_texture on i965, llvmpipe, nvc0, r600, radeonsi, softpipe
  • GL_ARB_fragment_layer_viewport on nv50, nvc0, llvmpipe, r600
  • -
  • GL_AMD_vertex_shader_viewport_index on i965/gen7+
  • +
  • GL_AMD_vertex_shader_viewport_index on i965/gen7+, r600
  • diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 982413568a4..b8b3d504a76 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -816,6 +816,8 @@ void st_init_extensions(struct st_context *st) ctx->Const.ViewportBounds.Max = 16384.0; ctx->Extensions.ARB_viewport_array = GL_TRUE; ctx->Extensions.ARB_fragment_layer_viewport = GL_TRUE; + if (ctx->Extensions.AMD_vertex_shader_layer) + ctx->Extensions.AMD_vertex_shader_viewport_index = GL_TRUE; } } if (ctx->Const.MaxProgramTextureGatherComponents > 0) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 1df411c3b87..3570557fee6 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -262,6 +262,10 @@ st_prepare_vertex_program(struct gl_context *ctx, stvp->output_semantic_name[slot] = TGSI_SEMANTIC_LAYER; stvp->output_semantic_index[slot] = 0; break; + case VARYING_SLOT_VIEWPORT: + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_VIEWPORT_INDEX; + stvp->output_semantic_index[slot] = 0; + break; case VARYING_SLOT_TEX0: case VARYING_SLOT_TEX1: