path: root/src/gallium/drivers
diff options
authorJason Ekstrand <>2018-12-14 11:21:50 -0600
committerJason Ekstrand <>2019-01-08 00:38:29 +0000
commita700a82bdac19433533ccf31ab635350cb58203b (patch)
tree6952630c4fcc7217e3d10cb3931ced29f551aad6 /src/gallium/drivers
parentc9a4135e1486766b85437201fec26d467b44705a (diff)
nir: Distinguish between normal uniforms and UBOs
Previously, NIR had a single nir_var_uniform mode used for atomic counters, UBOs, samplers, images, and normal uniforms. This commit splits this into nir_var_uniform and nir_var_ubo where nir_var_uniform is still a bit of a catch-all but the nir_var_ubo is specific to UBOs. While we're at it, we also rename shader_storage to ssbo to follow the convention. We need this so that we can distinguish between normal uniforms and UBO access at the deref level without going all the way back variable and seeing if it has an interface type. Reviewed-by: Alejandro PiƱeiro <> Reviewed-by: Caio Marcelo de Oliveira Filho <>
Diffstat (limited to 'src/gallium/drivers')
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c
index 4c6eb8ec808..64acf41679b 100644
--- a/src/gallium/drivers/radeonsi/si_shader_nir.c
+++ b/src/gallium/drivers/radeonsi/si_shader_nir.c
@@ -675,7 +675,8 @@ void si_nir_scan_shader(const struct nir_shader *nir,
* so we don't need to worry about the ordering.
if (variable->interface_type != NULL) {
- if (variable->data.mode == nir_var_uniform) {
+ if (variable->data.mode == nir_var_uniform ||
+ variable->data.mode == nir_var_ubo) {
unsigned block_count;
if (base_type != GLSL_TYPE_INTERFACE) {
@@ -699,7 +700,7 @@ void si_nir_scan_shader(const struct nir_shader *nir,
_mesa_set_add(ubo_set, variable->interface_type);
- if (variable->data.mode == nir_var_shader_storage) {
+ if (variable->data.mode == nir_var_ssbo) {
/* TODO: make this more accurate */
info->shader_buffers_declared =
u_bit_consecutive(0, SI_NUM_SHADER_BUFFERS);