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: 5b683ba19a
  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>
This commit is contained in:
Gert Wollny
2022-09-09 09:22:18 +02:00
committed by Marge Bot
parent d5394296be
commit 95cea62a9b
2 changed files with 5 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -641,6 +641,7 @@ struct virgl_caps_v2 {
uint32_t max_const_buffer_size[6]; // PIPE_SHADER_TYPES
uint32_t num_video_caps;
struct virgl_video_caps video_caps[32];
uint32_t max_uniform_block_size;
};
union virgl_caps {