From 743a9d85e2ca5aef93e40fe7833742a067a5943d Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 12 Sep 2019 21:13:08 -0400 Subject: radeonsi: add FMASK slots for shader images (for MSAA images) Acked-by: Pierre-Eric Pelloux-Prayer --- src/gallium/drivers/radeonsi/si_state.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/radeonsi/si_state.h') diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index e3e6cf293e1..88e01512cd6 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -37,6 +37,7 @@ #define SI_NUM_SAMPLERS 32 /* OpenGL textures units per shader */ #define SI_NUM_CONST_BUFFERS 16 #define SI_NUM_IMAGES 16 +#define SI_NUM_IMAGE_SLOTS (SI_NUM_IMAGES * 2) /* the second half are FMASK slots */ #define SI_NUM_SHADER_BUFFERS 16 struct si_screen; @@ -647,14 +648,16 @@ static inline unsigned si_get_shaderbuf_slot(unsigned slot) static inline unsigned si_get_sampler_slot(unsigned slot) { - /* samplers are in slots [8..39], ascending */ - return SI_NUM_IMAGES / 2 + slot; + /* 32 samplers are in sampler slots [16..47], 16 dw per slot, ascending */ + /* those are equivalent to image slots [32..95], 8 dw per slot, ascending */ + return SI_NUM_IMAGE_SLOTS / 2 + slot; } static inline unsigned si_get_image_slot(unsigned slot) { - /* images are in slots [15..0] (sampler slots [7..0]), descending */ - return SI_NUM_IMAGES - 1 - slot; + /* image slots are in [31..0] (sampler slots [15..0]), descending */ + /* images are in slots [31..16], while FMASKs are in slots [15..0] */ + return SI_NUM_IMAGE_SLOTS - 1 - slot; } #endif -- cgit v1.2.3