mesa/st: enable AMD_vertex_shader_viewport_index
authorIlia Mirkin <imirkin@alum.mit.edu>
Wed, 2 Jul 2014 16:17:59 +0000 (12:17 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 3 Jul 2014 23:39:25 +0000 (19:39 -0400)
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 <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Tobias Droste <tdroste@gmx.de>
docs/relnotes/10.3.html
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_program.c

index 6090a921912a648b3d0f657b156f999c50fd5502..2e718fc8a7eef8c917bf1189945196a3e6127ed2 100644 (file)
@@ -55,7 +55,7 @@ Note: some of the new features are only available with certain drivers.
 <li>GL_ARB_viewport_array on nvc0</li>
 <li>GL_ARB_seamless_cubemap_per_texture on i965, llvmpipe, nvc0, r600, radeonsi, softpipe</li>
 <li>GL_ARB_fragment_layer_viewport on nv50, nvc0, llvmpipe, r600</li>
-<li>GL_AMD_vertex_shader_viewport_index on i965/gen7+</li>
+<li>GL_AMD_vertex_shader_viewport_index on i965/gen7+, r600</li>
 </ul>
 
 
index 982413568a412cdb1008232e88aad4b894468a22..b8b3d504a762f5b9a6a35fb22eb8a522fb8ae7a3 100644 (file)
@@ -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)
index 1df411c3b87b5c457d8ad53ff2daead541c34e61..3570557fee6ae79f1ba32a2829c2bfd0f0352d84 100644 (file)
@@ -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: