anv: fix anv_nir_lower_ubo_loads pass
In order to use load_global_const_block_intel we need to ensure the 64bit address in src[0] is uniform. This is not the case in the vkd3d-proton test_bindless_cbv tests for example. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Cc: mesa-stable Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22624>
This commit is contained in:
committed by
Marge Bot
parent
d6e9479d4b
commit
9fb9ae5ac6
@@ -47,7 +47,7 @@ lower_ubo_load_instr(nir_builder *b, nir_instr *instr, UNUSED void *_data)
|
||||
unsigned byte_size = bit_size / 8;
|
||||
|
||||
nir_ssa_def *val;
|
||||
if (nir_src_is_const(load->src[1])) {
|
||||
if (!nir_src_is_divergent(load->src[0]) && nir_src_is_const(load->src[1])) {
|
||||
uint32_t offset = nir_src_as_uint(load->src[1]);
|
||||
|
||||
/* Things should be component-aligned. */
|
||||
|
||||
@@ -954,8 +954,16 @@ anv_pipeline_lower_nir(struct anv_pipeline *pipeline,
|
||||
NIR_PASS(_, nir, nir_copy_prop);
|
||||
NIR_PASS(_, nir, nir_opt_constant_folding);
|
||||
|
||||
/* Required for nir_divergence_analysis() which is needed for
|
||||
* anv_nir_lower_ubo_loads.
|
||||
*/
|
||||
NIR_PASS(_, nir, nir_convert_to_lcssa, true, true);
|
||||
nir_divergence_analysis(nir);
|
||||
|
||||
NIR_PASS(_, nir, anv_nir_lower_ubo_loads);
|
||||
|
||||
NIR_PASS(_, nir, nir_opt_remove_phis);
|
||||
|
||||
enum nir_lower_non_uniform_access_type lower_non_uniform_access_types =
|
||||
nir_lower_non_uniform_texture_access | nir_lower_non_uniform_image_access;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user