aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErico Nunes <[email protected]>2019-12-19 22:51:07 +0100
committerErico Nunes <[email protected]>2019-12-20 20:59:15 +0100
commit8e9e94d084316e8723951bcf9595c45dfb735c2a (patch)
treef85a96003f47797f2722daa1ec79079f464b272a /src
parent4322656dee2d3db448faaf3bd01e2a7769c9e46a (diff)
lima: set shader caps to optimize control flow
With these new caps, nir is able to unroll loops and optimize conditionals much more efficiently in both gpit and ppir. panfrost and vc4 were used as reference for the values. Signed-off-by: Erico Nunes <[email protected]> Reviewed-by: Vasily Khoruzhick <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3176> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3176>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/lima/lima_screen.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/gallium/drivers/lima/lima_screen.c b/src/gallium/drivers/lima/lima_screen.c
index 4dc1fc652b8..9610018115d 100644
--- a/src/gallium/drivers/lima/lima_screen.c
+++ b/src/gallium/drivers/lima/lima_screen.c
@@ -178,6 +178,9 @@ get_vertex_shader_param(struct lima_screen *screen,
case PIPE_SHADER_CAP_MAX_TEX_INDIRECTIONS:
return 16384; /* need investigate */
+ case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
+ return 1024;
+
case PIPE_SHADER_CAP_MAX_INPUTS:
return 16; /* attributes */
@@ -185,7 +188,8 @@ get_vertex_shader_param(struct lima_screen *screen,
return LIMA_MAX_VARYING_NUM; /* varying */
case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
- return 4096; /* need investigate */
+ return 16 * 1024 * sizeof(float);
+
case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
return 1;
@@ -195,6 +199,9 @@ get_vertex_shader_param(struct lima_screen *screen,
case PIPE_SHADER_CAP_MAX_TEMPS:
return 256; /* need investigate */
+ case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
+ return 32;
+
default:
return 0;
}
@@ -214,8 +221,12 @@ get_fragment_shader_param(struct lima_screen *screen,
case PIPE_SHADER_CAP_MAX_INPUTS:
return LIMA_MAX_VARYING_NUM - 1; /* varying, minus gl_Position */
+ case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH:
+ return 1024;
+
case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
- return 4096; /* need investigate */
+ return 16 * 1024 * sizeof(float);
+
case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
return 1;
@@ -236,6 +247,9 @@ get_fragment_shader_param(struct lima_screen *screen,
case PIPE_SHADER_CAP_INDIRECT_OUTPUT_ADDR:
return 0;
+ case PIPE_SHADER_CAP_MAX_UNROLL_ITERATIONS_HINT:
+ return 32;
+
default:
return 0;
}