r600g: move selecting the pixel shader earlier.
authorDave Airlie <airlied@redhat.com>
Tue, 27 Jan 2015 03:34:50 +0000 (13:34 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 27 Jan 2015 23:51:02 +0000 (09:51 +1000)
In order to detect that a pixel shader has a prim id
input when we have no geometry shader we need to reorder
the shader selection so the pixel shader is selected
first, then the vertex shader key can take into account
the primitive id input requirement and lack of geom shader.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_state_common.c

index 09d8952844fa5b9c6351b3ec9fd6ec83b83a1a6d..10306207b46cc095d61a52d57902bd991aa2d5e2 100644 (file)
@@ -1170,6 +1170,10 @@ static bool r600_update_derived_state(struct r600_context *rctx)
                }
        }
 
+       r600_shader_select(ctx, rctx->ps_shader, &ps_dirty);
+       if (unlikely(!rctx->ps_shader->current))
+               return false;
+
        update_gs_block_state(rctx, rctx->gs_shader != NULL);
 
        if (rctx->gs_shader) {
@@ -1232,9 +1236,6 @@ static bool r600_update_derived_state(struct r600_context *rctx)
                }
        }
 
-       r600_shader_select(ctx, rctx->ps_shader, &ps_dirty);
-       if (unlikely(!rctx->ps_shader->current))
-               return false;
 
        if (unlikely(ps_dirty || rctx->pixel_shader.shader != rctx->ps_shader->current ||
                rctx->rasterizer->sprite_coord_enable != rctx->ps_shader->current->sprite_coord_enable ||