From 69325fa88ddf425ac208c49b9e9e331d61b9cb5c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 7 Oct 2017 21:53:10 +0200 Subject: [PATCH] radeonsi: generalize the SI_VS_SHADER_POINTER_MASK macro MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_blit.c | 2 +- src/gallium/drivers/radeonsi/si_state.h | 4 ++-- src/gallium/drivers/radeonsi/si_state_draw.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c index 03aa4f7737f..fd8559ac98c 100644 --- a/src/gallium/drivers/radeonsi/si_blit.c +++ b/src/gallium/drivers/radeonsi/si_blit.c @@ -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); } diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 8122ddb392e..bc7e7b3e426 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -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, diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c index 9468fde5236..ed48eddf419 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.c +++ b/src/gallium/drivers/radeonsi/si_state_draw.c @@ -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); -- 2.30.2