radeonsi: generalize the SI_VS_SHADER_POINTER_MASK macro
authorMarek Olšák <marek.olsak@amd.com>
Sat, 7 Oct 2017 19:53:10 +0000 (21:53 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 17 Oct 2017 20:03:03 +0000 (22:03 +0200)
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_blit.c
src/gallium/drivers/radeonsi/si_state.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 03aa4f7737f1290c13ad43e6c82c9c9dd9e9a39c..fd8559ac98c3dd45a135568736fb34c5d4d6f058 100644 (file)
@@ -95,7 +95,7 @@ static void si_blitter_end(struct pipe_context *ctx)
 
        /* Restore shader pointers because the VS blit shader changed all
         * non-global VS user SGPRs. */
-       sctx->shader_pointers_dirty |= SI_VS_SHADER_POINTER_MASK;
+       sctx->shader_pointers_dirty |= SI_DESCS_SHADER_MASK(VERTEX);
        sctx->vertex_buffer_pointer_dirty = true;
        si_mark_atom_dirty(sctx, &sctx->shader_pointers.atom);
 }
index 8122ddb392eabea3efc56ac067e7f0f944da2c07..bc7e7b3e426ee7e95bf4e0f57f858882aaf02707 100644 (file)
@@ -247,9 +247,9 @@ enum {
 #define SI_NUM_DESCS                   (SI_DESCS_FIRST_SHADER + \
                                         SI_NUM_SHADERS * SI_NUM_SHADER_DESCS)
 
-#define SI_VS_SHADER_POINTER_MASK \
+#define SI_DESCS_SHADER_MASK(name) \
        u_bit_consecutive(SI_DESCS_FIRST_SHADER + \
-                         PIPE_SHADER_VERTEX * SI_NUM_SHADER_DESCS, \
+                         PIPE_SHADER_##name * SI_NUM_SHADER_DESCS, \
                          SI_NUM_SHADER_DESCS)
 
 /* This represents descriptors in memory, such as buffer resources,
index 9468fde52364b38b420351ebfd7d9b256399dd64..ed48eddf419ab5dcc7db83731a72a0af2f648113 100644 (file)
@@ -1544,7 +1544,7 @@ void si_draw_rectangle(struct blitter_context *blitter,
        info.instance_count = num_instances;
 
        /* Don't set per-stage shader pointers for VS. */
-       sctx->shader_pointers_dirty &= ~SI_VS_SHADER_POINTER_MASK;
+       sctx->shader_pointers_dirty &= ~SI_DESCS_SHADER_MASK(VERTEX);
        sctx->vertex_buffer_pointer_dirty = false;
 
        si_draw_vbo(pipe, &info);