From 349df23eb0d119e3f22ff6149824497414f07505 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 27 Jan 2015 13:39:51 +1000 Subject: 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 Signed-off-by: Dave Airlie --- src/gallium/drivers/r600/r600_state.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/drivers/r600/r600_state.c') 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; -- cgit v1.2.3