summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_state.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2015-01-27 13:39:51 +1000
committerDave Airlie <[email protected]>2015-01-28 09:51:21 +1000
commit349df23eb0d119e3f22ff6149824497414f07505 (patch)
tree048b6c2ba1a2cfb032664e2ce2ee61ee6f214000 /src/gallium/drivers/r600/r600_state.c
parentcc2fc095bfae1c0494240e4f06931e2ca90e182c (diff)
r600g: add support for primitive id without geom shader (v2)
GLSL 1.50 specifies a fragment shader may have a primitive id input without a geometry shader present. On r600 hw there is a special GS scenario for this, you have to enable GS_SCENARIO_A and pass the primitive id through the vertex shader which operates in GS_A mode. This is a first pass attempt at this, and passes the piglit tests that test for this. v1.1: clean up debug print + no need to assign key value to setup output. v2: add r600 support Reviewed-by: Glenn Kennard <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r--src/gallium/drivers/r600/r600_state.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 9a4b9725ab8..3c2fdfaed42 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -1943,6 +1943,11 @@ static void r600_emit_shader_stages(struct r600_context *rctx, struct r600_atom
uint32_t v2 = 0, primid = 0;
+ if (rctx->vs_shader->current->shader.vs_as_gs_a) {
+ v2 = S_028A40_MODE(V_028A40_GS_SCENARIO_A);
+ primid = 1;
+ }
+
if (state->geom_enable) {
uint32_t cut_val;