radv: lower deref operations for global memory for both backends

To match ACO.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5316>
This commit is contained in:
Samuel Pitoiset
2020-06-04 08:27:50 +02:00
committed by Marge Bot
parent 10b73e2b52
commit 1588644543
2 changed files with 3 additions and 6 deletions

View File

@@ -651,12 +651,6 @@ setup_nir(isel_context *ctx, nir_shader *nir)
/* the variable setup has to be done before lower_io / CSE */
setup_variables(ctx, nir);
/* optimize and lower memory operations */
if (nir_lower_explicit_io(nir, nir_var_mem_global, nir_address_format_64bit_global)) {
nir_opt_constant_folding(nir);
nir_opt_cse(nir);
}
bool lower_to_scalar = false;
bool lower_pack = false;
nir_variable_mode robust_modes = (nir_variable_mode)0;

View File

@@ -668,6 +668,9 @@ radv_shader_compile_to_nir(struct radv_device *device,
nir_var_mem_shared, nir_address_format_32bit_offset);
}
nir_lower_explicit_io(nir, nir_var_mem_global,
nir_address_format_64bit_global);
/* Lower large variables that are always constant with load_constant
* intrinsics, which get turned into PC-relative loads from a data
* section next to the shader.