diff options
author | Marek Olšák <[email protected]> | 2017-05-13 17:16:27 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-05-18 22:15:02 +0200 |
commit | f07c15ef807fb50659bf7a648393991f582f6a7f (patch) | |
tree | 655aa9b467c21b3455362fd55ab5b645c37fd3dd /src/gallium/drivers/radeonsi/si_state.h | |
parent | 5df24c3fa627243c259f5266359098463e41d172 (diff) |
radeonsi: merge sampler and image descriptor lists into one
Sampler slots: slot[8], .. slot[39] (ascending)
Image slots: slot[7], .. slot[0] (descending)
Each image occupies 1/2 of each slot, so there are 16 images in total,
therefore the layout is: slot[15], .. slot[0]. (in 1/2 slot increments)
Updating image slot 2n+i (i <= 1) also dirties and re-uploads slot 2n+!i.
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_state.h')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_state.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state.h b/src/gallium/drivers/radeonsi/si_state.h index 90d09720968..c4ef90372fb 100644 --- a/src/gallium/drivers/radeonsi/si_state.h +++ b/src/gallium/drivers/radeonsi/si_state.h @@ -196,8 +196,7 @@ enum { */ enum { SI_SHADER_DESCS_CONST_AND_SHADER_BUFFERS, - SI_SHADER_DESCS_SAMPLERS, - SI_SHADER_DESCS_IMAGES, + SI_SHADER_DESCS_SAMPLERS_AND_IMAGES, SI_NUM_SHADER_DESCS, }; @@ -229,7 +228,7 @@ struct si_descriptors { unsigned ce_offset; /* elements of the list that are changed and need to be uploaded */ - unsigned dirty_mask; + uint64_t dirty_mask; /* Whether CE is used to upload this descriptor array. */ bool uses_ce; @@ -387,4 +386,16 @@ static inline unsigned si_get_shaderbuf_slot(unsigned slot) return SI_NUM_SHADER_BUFFERS - 1 - slot; } +static inline unsigned si_get_sampler_slot(unsigned slot) +{ + /* samplers are in slots [8..39], ascending */ + return SI_NUM_IMAGES / 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; +} + #endif |