aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGert Wollny <[email protected]>2019-12-16 21:48:09 +0100
committerMarge Bot <[email protected]>2019-12-17 08:07:51 +0000
commitcffa7bb99084eb9e5988c2be4427f6b188cc7bbe (patch)
tree2a361dec2ab9883d41f2ffd2966e4a926bf7fe66
parent2da68c8649b6061c38e303da962e236985d76fc5 (diff)
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 <[email protected]> Reviewed-by: Gurchetan Singh <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3121> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3121>
-rw-r--r--src/gallium/drivers/virgl/virgl_encode.c5
1 files 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;