[Mesa-dev] [PATCH 22/92] st/glsl_to_nir: switch between nir_lower_io and nir_lower_uniforms_to_ubo
Nicolai Hähnle
nhaehnle at gmail.com
Mon Jun 26 14:10:01 UTC 2017
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
src/mesa/state_tracker/st_glsl_to_nir.cpp | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index c8a7464..184eb17 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -364,23 +364,29 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, nir_shader *nir)
assert(!"should not be reached");
return;
}
NIR_PASS_V(nir, nir_lower_atomics_to_ssbo,
st->ctx->Const.Program[nir->stage].MaxAtomicBuffers);
st_nir_assign_uniform_locations(prog, shader_program,
&nir->uniforms, &nir->num_uniforms);
+ bool lower_io = screen->get_param(screen, PIPE_CAP_NIR_LOWER_IO);
+
+ if (!lower_io)
+ NIR_PASS_V(nir, nir_lower_uniforms_to_ubo);
NIR_PASS_V(nir, nir_lower_system_values);
- NIR_PASS_V(nir, nir_lower_io, nir_var_all, st_glsl_type_size,
- (nir_lower_io_options)0);
+ if (lower_io)
+ NIR_PASS_V(nir, nir_lower_io, nir_var_all, st_glsl_type_size,
+ (nir_lower_io_options)0);
+
if (screen->get_param(screen, PIPE_CAP_NIR_SAMPLERS_AS_DEREF))
NIR_PASS_V(nir, nir_lower_samplers_as_deref, shader_program);
else
NIR_PASS_V(nir, nir_lower_samplers, shader_program);
}
struct gl_program *
st_nir_get_mesa_program(struct gl_context *ctx,
struct gl_shader_program *shader_program,
struct gl_linked_shader *shader)
--
2.9.3
More information about the mesa-dev
mailing list