From d755dfa28cb520e157b78edf60fd79c0367a86d6 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 3 Nov 2021 14:57:02 +0100 Subject: [PATCH] vrend: Sync some constants with mesa and pass max_shader_samplers This is needed for modern games that require more than 16 samplers. Signed-off-by: Gert Wollny Reviewed-by: John Bates --- src/gallium/include/pipe/p_state.h | 4 ++-- src/virgl_hw.h | 1 + src/vrend_renderer.c | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index f0a7b55..48d5a26 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -57,10 +57,10 @@ extern "C" { #define PIPE_MAX_CLIP_PLANES 8 #define PIPE_MAX_COLOR_BUFS 8 #define PIPE_MAX_CONSTANT_BUFFERS 32 -#define PIPE_MAX_SAMPLERS 16 +#define PIPE_MAX_SAMPLERS 32 #define PIPE_MAX_SHADER_INPUTS 80 /* 32 GENERIC + 32 PATCH + 16 others */ #define PIPE_MAX_SHADER_OUTPUTS 80 /* 32 GENERIC + 32 PATCH + 16 others */ -#define PIPE_MAX_SHADER_SAMPLER_VIEWS 32 +#define PIPE_MAX_SHADER_SAMPLER_VIEWS 128 #define PIPE_MAX_SHADER_BUFFERS 32 #define PIPE_MAX_SHADER_IMAGES 32 #define PIPE_MAX_TEXTURE_LEVELS 16 diff --git a/src/virgl_hw.h b/src/virgl_hw.h index f9bf780..62c1095 100644 --- a/src/virgl_hw.h +++ b/src/virgl_hw.h @@ -597,6 +597,7 @@ struct virgl_caps_v2 { uint32_t max_video_memory; char renderer[64]; float max_anisotropy; + uint32_t max_texture_image_units; }; union virgl_caps { diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 346f245..855253f 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -10852,6 +10852,8 @@ static void vrend_renderer_fill_caps_v2(int gl_ver, int gles_ver, union virgl_c caps->v2.max_anisotropy = MIN2(max_aniso, 16.0); } + glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max); + caps->v2.max_texture_image_units = max; } void vrend_renderer_fill_caps(uint32_t set, uint32_t version,