spirv, radv, anv: Replace ptr_type with addr_format

Instead of setting the glsl types of the pointers for each resource,
set the nir_address_format, from which we can derive the glsl_type,
and in the future the bit pattern representing a NULL pointer.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Caio Marcelo de Oliveira Filho
2019-05-01 14:15:32 -07:00
parent 6bc9cdb1b7
commit 31a7476335
5 changed files with 46 additions and 36 deletions

View File

@@ -284,11 +284,11 @@ radv_shader_compile_to_nir(struct radv_device *device,
.trinary_minmax = true,
.variable_pointers = true,
},
.ubo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
.ssbo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT, 2),
.phys_ssbo_ptr_type = glsl_vector_type(GLSL_TYPE_UINT64, 1),
.push_const_ptr_type = glsl_uint_type(),
.shared_ptr_type = glsl_uint_type(),
.ubo_addr_format = nir_address_format_32bit_index_offset,
.ssbo_addr_format = nir_address_format_32bit_index_offset,
.phys_ssbo_addr_format = nir_address_format_64bit_global,
.push_const_addr_format = nir_address_format_logical,
.shared_addr_format = nir_address_format_32bit_offset,
};
entry_point = spirv_to_nir(spirv, module->size / 4,
spec_entries, num_spec_entries,