summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2017-05-19 22:42:12 +0200
committerNicolai Hähnle <[email protected]>2017-07-31 14:55:29 +0200
commit2cf8c8461931c5b23cac4d9cf834f120150ff869 (patch)
tree237f7d9901b801d79b437e5d10ab1de9ce80d9fa
parent06d038c4bd479207576bcbfee9f6c3dc7ee64b94 (diff)
st/glsl_to_nir: use nir_lower_samplers_as_deref when requested by the driver
Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/mesa/state_tracker/st_glsl_to_nir.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index 5c4ae813055..c8a7464a008 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -317,6 +317,8 @@ sort_varyings(struct exec_list *var_list)
void
st_finalize_nir(struct st_context *st, struct gl_program *prog, nir_shader *nir)
{
+ struct pipe_screen *screen = st->pipe->screen;
+
NIR_PASS_V(nir, nir_split_var_copies);
NIR_PASS_V(nir, nir_lower_var_copies);
NIR_PASS_V(nir, nir_lower_io_types);
@@ -372,7 +374,10 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, nir_shader *nir)
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);
- NIR_PASS_V(nir, nir_lower_samplers, shader_program);
+ 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 *