diff options
author | Samuel Pitoiset <[email protected]> | 2017-03-31 16:09:24 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-14 10:04:36 +0200 |
commit | 2ce04d7c1af2bf3c3b3e869131615991226d9031 (patch) | |
tree | e4280ef11ed20ab722884bedfee1cb2b49393d6f /src/gallium/drivers | |
parent | 08ba871549e56b4c2c265e6fab9bf86367a23faa (diff) |
radeonsi: add si_init_descriptor_list() helper
This will be used in order to initialize resident descriptors
for bindless textures/images.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/radeonsi/si_descriptors.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c index 22888a68dd7..66db4a8cc4b 100644 --- a/src/gallium/drivers/radeonsi/si_descriptors.c +++ b/src/gallium/drivers/radeonsi/si_descriptors.c @@ -95,6 +95,21 @@ static uint32_t null_image_descriptor[8] = { * descriptor */ }; +static void si_init_descriptor_list(uint32_t *desc_list, + unsigned element_dw_size, + unsigned num_elements, + const uint32_t *null_descriptor) +{ + int i; + + /* Initialize the array to NULL descriptors if the element size is 8. */ + if (null_descriptor) { + assert(element_dw_size % 8 == 0); + for (i = 0; i < num_elements * element_dw_size / 8; i++) + memcpy(desc_list + i * 8, null_descriptor, 8 * 4); + } +} + static void si_init_descriptors(struct si_context *sctx, struct si_descriptors *desc, unsigned shader_userdata_index, |