summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Arceri <tarceri@itsqueeze.com>2022-05-06 11:23:06 +1000
committerMarge Bot <emma+marge@anholt.net>2022-05-17 02:12:21 +0000
commit3ceaf589d62ed81d74042219098c9428730ead99 (patch)
tree476ba340a5a634d162161a6f8cfb241fd95f6a9d
parent643774cdab0b66442b054bf32019c2884a6265c1 (diff)
softpipe: switch to NIR loop unrolling
shader-db results: total instructions in shared programs: 2788746 -> 2788886 (<.01%) instructions in affected programs: 2126 -> 2266 (6.59%) total loops in shared programs: 1357 -> 892 (-34.27%) loops in affected programs: 468 -> 3 (-99.36%) total temps in shared programs: 288754 -> 288725 (-0.01%) temps in affected programs: 1623 -> 1594 (-1.79%) total const in shared programs: 1954525 -> 1954621 (<.01%) const in affected programs: 207 -> 303 (46.38%) total imm in shared programs: 101023 -> 100891 (-0.13%) imm in affected programs: 198 -> 66 (-66.67%) Reviewed-by: Emma Anholt <emma@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16543>
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_exec.h4
-rw-r--r--src/gallium/drivers/softpipe/sp_screen.c1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.h b/src/gallium/auxiliary/tgsi/tgsi_exec.h
index 226385ae3a3..bd3de6978ae 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_exec.h
+++ b/src/gallium/auxiliary/tgsi/tgsi_exec.h
@@ -469,6 +469,7 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
case PIPE_SHADER_CAP_FP16_CONST_BUFFERS:
case PIPE_SHADER_CAP_INT16:
case PIPE_SHADER_CAP_GLSL_16BIT_CONSTS:
+ case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
return 0;
case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
return PIPE_MAX_SAMPLERS;
@@ -492,9 +493,6 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
return PIPE_MAX_SHADER_BUFFERS;
case PIPE_SHADER_CAP_MAX_SHADER_IMAGES:
return PIPE_MAX_SHADER_IMAGES;
-
- case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
- return 32;
}
/* if we get here, we missed a shader cap above (and should have seen
* a compiler warning.)
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 6942fb328b0..7d84088e528 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -88,6 +88,7 @@ static const nir_shader_compiler_options sp_compiler_options = {
.lower_rotate = true,
.lower_uniforms_to_ubo = true,
.lower_vector_cmp = true,
+ .max_unroll_iterations = 32,
.use_interpolated_input_intrinsics = true,
};