spirv: Reuse helpers in vtn_handle_type()
And change vtn_storage_class_to_mode() to accept NULL as interface_type. In this case, if we have a SpvStorageClassUniform, we assume it is uses an ubo_addr_format, like the code being replaced by the helper. That assumption is a problem, but no different than the previous code. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -1723,7 +1723,8 @@ vtn_storage_class_to_mode(struct vtn_builder *b,
|
||||
nir_variable_mode nir_mode;
|
||||
switch (class) {
|
||||
case SpvStorageClassUniform:
|
||||
if (interface_type->block) {
|
||||
/* Assume it's an UBO if we lack the interface_type. */
|
||||
if (!interface_type || interface_type->block) {
|
||||
mode = vtn_variable_mode_ubo;
|
||||
nir_mode = nir_var_mem_ubo;
|
||||
} else if (interface_type->buffer_block) {
|
||||
|
Reference in New Issue
Block a user