Commit efa4fc0e authored by Jason Ekstrand's avatar Jason Ekstrand Committed by Jason Ekstrand

st/mesa: Let NIR lower UBO and SSBO access when we have it

Reviewed-by: Caio Marcelo de Oliveira Filho's avatarCaio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
parent be2990d8
Pipeline #24168 passed with stages
in 41 minutes and 35 seconds
......@@ -329,7 +329,13 @@ void st_init_limits(struct pipe_screen *screen,
if (!screen->get_param(screen, PIPE_CAP_NIR_COMPACT_ARRAYS))
options->LowerCombinedClipCullDistance = true;
options->LowerBufferInterfaceBlocks = true;
bool prefer_nir = PIPE_SHADER_IR_NIR ==
screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_PREFERRED_IR);
/* NIR can do the lowering on our behalf and we'll get better results
* because it can actually optimize SSBO access.
*/
options->LowerBufferInterfaceBlocks = !prefer_nir;
}
c->MaxUserAssignableUniformLocations =
......
......@@ -415,6 +415,10 @@ st_glsl_to_nir(struct st_context *st, struct gl_program *prog,
st_nir_opts(nir, is_scalar);
NIR_PASS_V(nir, gl_nir_lower_buffers, shader_program);
/* Do a round of constant folding to clean up address calculations */
NIR_PASS_V(nir, nir_opt_constant_folding);
if (lower_64bit) {
bool lowered_64bit_ops = false;
bool progress = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment