mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
anv: Zero out the last dword of UBO/SSBO descriptors in the shader
This way, NIR can constant fold it. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8635>
This commit is contained in:
parent
422798caef
commit
8a61e3a0c0
1 changed files with 8 additions and 1 deletions
|
|
@ -549,7 +549,14 @@ build_ssbo_descriptor_load(nir_builder *b, const VkDescriptorType desc_type,
|
|||
.range_base = 0,
|
||||
.range = ~0);
|
||||
|
||||
return desc_load;
|
||||
/* The last element of the vec4 is always zero.
|
||||
*
|
||||
* See also struct anv_address_range_descriptor
|
||||
*/
|
||||
return nir_vec4(b, nir_channel(b, desc_load, 0),
|
||||
nir_channel(b, desc_load, 1),
|
||||
nir_channel(b, desc_load, 2),
|
||||
nir_imm_int(b, 0));
|
||||
}
|
||||
|
||||
static bool
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue