diff options
author | Gert Wollny <gert.wollny@collabora.com> | 2022-09-09 09:22:18 +0200 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2022-09-10 15:23:57 +0000 |
commit | 95cea62a9b7b4b2caa3835e4f5e04d83df1de0a3 (patch) | |
tree | cc169d302165c3e90c99c848f99e35098987ba95 /src/gallium/drivers/virgl/virgl_screen.c | |
parent | d5394296becfc97bc992c82d6f5d013b35b5275a (diff) |
virgl: Report CONSTANT_BUFFER_SIZE according to GL_MAX_UNIFORM_BLOCK_SIZE
GL_MAX_FRAGMENT_UNIFORM_COMPONENTS may not report a size that
is useful to calculate the supported UBO size. Use the value
GL_MAX_UNIFORM_BLOCK_SIZE instead when the host supports this.
Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/286
Fixes: 5b683ba19ac77d6c7dfd8de478678d0b90ba764f
virgl: Only progagate the uniform numbers if the numbers are actually right
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18512>
Diffstat (limited to 'src/gallium/drivers/virgl/virgl_screen.c')
-rw-r--r-- | src/gallium/drivers/virgl/virgl_screen.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/drivers/virgl/virgl_screen.c b/src/gallium/drivers/virgl/virgl_screen.c index 597521a4f42..af24d65015f 100644 --- a/src/gallium/drivers/virgl/virgl_screen.c +++ b/src/gallium/drivers/virgl/virgl_screen.c @@ -356,6 +356,10 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param) return vscreen->caps.caps.v2.capability_bits_v2 & VIRGL_CAP_V2_IMPLICIT_MSAA; case PIPE_CAP_IMAGE_STORE_FORMATTED: return 1; + case PIPE_CAP_MAX_CONSTANT_BUFFER_SIZE_UINT: + if (vscreen->caps.caps.v2.host_feature_check_version >= 13) + return vscreen->caps.caps.v2.max_uniform_block_size; + FALLTHROUGH; default: return u_pipe_screen_get_param_defaults(screen, param); } |