nir/spirv: Split up Uniform and UniformConstant storage classes
We were originally handling them together because I was rather unclear on the distinction. However, keeping them combined keeps the confusion. Split them up so that it's more clear from the code how we expect the two storage classes to be used. Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
This commit is contained in:
parent
32a60dbef3
commit
4e0280d37d
|
@ -1298,21 +1298,25 @@ vtn_storage_class_to_mode(SpvStorageClass class,
|
||||||
nir_variable_mode nir_mode;
|
nir_variable_mode nir_mode;
|
||||||
switch (class) {
|
switch (class) {
|
||||||
case SpvStorageClassUniform:
|
case SpvStorageClassUniform:
|
||||||
case SpvStorageClassUniformConstant:
|
|
||||||
if (interface_type->block) {
|
if (interface_type->block) {
|
||||||
mode = vtn_variable_mode_ubo;
|
mode = vtn_variable_mode_ubo;
|
||||||
nir_mode = 0;
|
nir_mode = 0;
|
||||||
} else if (interface_type->buffer_block) {
|
} else if (interface_type->buffer_block) {
|
||||||
mode = vtn_variable_mode_ssbo;
|
mode = vtn_variable_mode_ssbo;
|
||||||
nir_mode = 0;
|
nir_mode = 0;
|
||||||
} else if (glsl_type_is_image(interface_type->type)) {
|
} else {
|
||||||
|
assert(!"Invalid uniform variable type");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SpvStorageClassUniformConstant:
|
||||||
|
if (glsl_type_is_image(interface_type->type)) {
|
||||||
mode = vtn_variable_mode_image;
|
mode = vtn_variable_mode_image;
|
||||||
nir_mode = nir_var_uniform;
|
nir_mode = nir_var_uniform;
|
||||||
} else if (glsl_type_is_sampler(interface_type->type)) {
|
} else if (glsl_type_is_sampler(interface_type->type)) {
|
||||||
mode = vtn_variable_mode_sampler;
|
mode = vtn_variable_mode_sampler;
|
||||||
nir_mode = nir_var_uniform;
|
nir_mode = nir_var_uniform;
|
||||||
} else {
|
} else {
|
||||||
assert(!"Invalid uniform variable type");
|
assert(!"Invalid uniform constant variable type");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SpvStorageClassPushConstant:
|
case SpvStorageClassPushConstant:
|
||||||
|
|
Loading…
Reference in New Issue