aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-10-07 22:48:41 -0400
committerMarek Olšák <[email protected]>2019-10-10 15:49:19 -0400
commit1f718bfc78353e94971c2f40c947d915273d61ec (patch)
tree0cb5bd9b455d7f11f66d9a6d2b531d2abc5b5ae2 /src/gallium/auxiliary
parente4f7d2576ea02582b1a21f6d1f8acc3b27dda27a (diff)
tgsi_to_nir: use nir_shader_compiler_options::lower_to_scalar
Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/nir/tgsi_to_nir.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index fca1074e6d2..3753ac75e92 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -100,7 +100,6 @@ struct ttn_compile {
/* How many TGSI_FILE_IMMEDIATE vec4s have been parsed so far. */
unsigned next_imm;
- bool cap_scalar;
bool cap_face_is_sysval;
bool cap_position_is_sysval;
bool cap_point_is_sysval;
@@ -2432,7 +2431,6 @@ static void
ttn_read_pipe_caps(struct ttn_compile *c,
struct pipe_screen *screen)
{
- c->cap_scalar = screen->get_shader_param(screen, c->scan->processor, PIPE_SHADER_CAP_SCALAR_ISA);
c->cap_packed_uniforms = screen->get_param(screen, PIPE_CAP_PACKED_UNIFORMS);
c->cap_samplers_as_deref = screen->get_param(screen, PIPE_CAP_NIR_SAMPLERS_AS_DEREF);
c->cap_face_is_sysval = screen->get_param(screen, PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL);
@@ -2577,7 +2575,7 @@ ttn_compile_init(const void *tgsi_tokens,
}
static void
-ttn_optimize_nir(nir_shader *nir, bool scalar)
+ttn_optimize_nir(nir_shader *nir)
{
bool progress;
do {
@@ -2585,7 +2583,7 @@ ttn_optimize_nir(nir_shader *nir, bool scalar)
NIR_PASS_V(nir, nir_lower_vars_to_ssa);
- if (scalar) {
+ if (nir->options->lower_to_scalar) {
NIR_PASS_V(nir, nir_lower_alu_to_scalar, NULL, NULL);
NIR_PASS_V(nir, nir_lower_phis_to_scalar);
}
@@ -2646,7 +2644,7 @@ ttn_finalize_nir(struct ttn_compile *c)
if (!c->cap_samplers_as_deref)
NIR_PASS_V(nir, nir_lower_samplers);
- ttn_optimize_nir(nir, c->cap_scalar);
+ ttn_optimize_nir(nir);
nir_shader_gather_info(nir, c->build.impl);
nir_validate_shader(nir, "TTN: after all optimizations");
}