diff options
author | Jason Ekstrand <[email protected]> | 2018-12-14 11:21:50 -0600 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-01-08 00:38:29 +0000 |
commit | a700a82bdac19433533ccf31ab635350cb58203b (patch) | |
tree | 6952630c4fcc7217e3d10cb3931ced29f551aad6 /src/compiler/spirv | |
parent | c9a4135e1486766b85437201fec26d467b44705a (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 <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/compiler/spirv')
-rw-r--r-- | src/compiler/spirv/vtn_variables.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/compiler/spirv/vtn_variables.c b/src/compiler/spirv/vtn_variables.c index 70bec69a052..f33eb5509a0 100644 --- a/src/compiler/spirv/vtn_variables.c +++ b/src/compiler/spirv/vtn_variables.c @@ -1497,10 +1497,10 @@ vtn_storage_class_to_mode(struct vtn_builder *b, case SpvStorageClassUniform: if (interface_type->block) { mode = vtn_variable_mode_ubo; - nir_mode = 0; + nir_mode = nir_var_ubo; } else if (interface_type->buffer_block) { mode = vtn_variable_mode_ssbo; - nir_mode = 0; + nir_mode = nir_var_ssbo; } else { /* Default-block uniforms, coming from gl_spirv */ mode = vtn_variable_mode_uniform; @@ -1509,7 +1509,7 @@ vtn_storage_class_to_mode(struct vtn_builder *b, break; case SpvStorageClassStorageBuffer: mode = vtn_variable_mode_ssbo; - nir_mode = 0; + nir_mode = nir_var_ssbo; break; case SpvStorageClassUniformConstant: mode = vtn_variable_mode_uniform; |