From cffa7bb99084eb9e5988c2be4427f6b188cc7bbe Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Mon, 16 Dec 2019 21:48:09 +0100 Subject: [PATCH] virgl: Increase the shader transfer buffer by doubling the size With only linearly increasing the size of the shader transfer buffer the transfer of very large shaders may fail, so with each attempt double the size of the buffer. CTS: dEQP-GLES31.functional.ssbo.layout.random.all_shared_buffer.48 for VTK-GL-CTS b5dcfb9c5 and newer virglrenderer bug: https://gitlab.freedesktop.org/virgl/virglrenderer/issues/150 Fixes: a8987b88ff1db4ac00720a9b56c4bc3aeb666537 virgl: add driver for virtio-gpu 3D (v2) Signed-off-by: Gert Wollny Reviewed-by: Gurchetan Singh Tested-by: Marge Bot Part-of: --- src/gallium/drivers/virgl/virgl_encode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/virgl/virgl_encode.c b/src/gallium/drivers/virgl/virgl_encode.c index 9f90345722e..fa4e4c0d50e 100644 --- a/src/gallium/drivers/virgl/virgl_encode.c +++ b/src/gallium/drivers/virgl/virgl_encode.c @@ -492,12 +492,13 @@ int virgl_encode_shader_state(struct virgl_context *ctx, if (virgl_debug & VIRGL_DEBUG_VERBOSE) debug_printf("Failed to translate shader in available space - trying again\n"); old_size = str_total_size; - str_total_size = 65536 * ++retry_size; + str_total_size = 65536 * retry_size; + retry_size *= 2; str = REALLOC(str, old_size, str_total_size); if (!str) return -1; } - } while (bret == false && retry_size < 10); + } while (bret == false && retry_size < 1024); if (bret == false) return -1; -- 2.30.2