From: Erico Nunes Date: Fri, 11 Dec 2020 18:58:07 +0000 (+0100) Subject: lima: adjust pp and gp max const buffer size X-Git-Tag: upstream/21.0.0~1358 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=001411774d203007850a157900c9cd9d0307a417;p=platform%2Fupstream%2Fmesa.git lima: adjust pp and gp max const buffer size According to the mali driver output, the Mali-400 GP provides space for 304 vec4 uniforms, globals and temporary variables. The Mali-PP supports a uniform table up to size 32768 total. However, indirect access to an uniform only supports indices up to 8192 (a 2048 vec4 array). Trying to access beyond that currently causes a pp job timeout with both lima and the mali driver. To prevent indices bigger than that in application uniforms, limit to 8192 for now. Signed-off-by: Erico Nunes Reviewed-by: Vasily Khoruzhick Part-of: --- diff --git a/src/gallium/drivers/lima/lima_screen.c b/src/gallium/drivers/lima/lima_screen.c index 0d65aa4..28a40e3 100644 --- a/src/gallium/drivers/lima/lima_screen.c +++ b/src/gallium/drivers/lima/lima_screen.c @@ -197,8 +197,10 @@ get_vertex_shader_param(struct lima_screen *screen, case PIPE_SHADER_CAP_MAX_OUTPUTS: return LIMA_MAX_VARYING_NUM; /* varying */ + /* Mali-400 GP provides space for 304 vec4 uniforms, globals and + * temporary variables. */ case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: - return 16 * 1024 * sizeof(float); + return 304 * 4 * sizeof(float); case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: return 1; @@ -234,8 +236,12 @@ get_fragment_shader_param(struct lima_screen *screen, case PIPE_SHADER_CAP_MAX_CONTROL_FLOW_DEPTH: return 1024; + /* The Mali-PP supports a uniform table up to size 32768 total. + * However, indirect access to an uniform only supports indices up + * to 8192 (a 2048 vec4 array). To prevent indices bigger than that, + * limit max const buffer size to 8192 for now. */ case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE: - return 16 * 1024 * sizeof(float); + return 2048 * 4 * sizeof(float); case PIPE_SHADER_CAP_MAX_CONST_BUFFERS: return 1;