mesa: Handle getting GL_MAX_VIEWS_OVR

Add support for GL_OVR_multiview's GL_MAX_VIEWS_OVR which can be
accessed with glGetIntegerv().

MaxViews is accessed via the hash table set up by get_hash_params.py as
a constant (MAX_VIEWS_OVR) using GL_MAX_VIEWS_OVR.

v2: Add this patch (thanks to Mike's guidance)
v3: Drop unnecessary enum size element in OVR_multiview.XML
v4: Switch to CONST(MAX_VIEWS_OVR) instead of gl_constants::MaxViews
    (Marek's suggestion)

Fixes: 328c29d600 ("mesa,glsl,gallium: add GL_OVR_multiview")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Signed-off-by: James Hogan <james@albanarts.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32992>
This commit is contained in:
James Hogan 2025-01-13 20:03:55 +00:00 committed by Marge Bot
parent a282a130fb
commit be106bd6c6
3 changed files with 6 additions and 0 deletions

View file

@ -21,6 +21,8 @@
<param name="baseviewindex" type="GLint"/>
<param name="numviews" type="GLsizei"/>
</function>
<enum name="MAX_VIEWS_OVR" count="1" value="0x9631"/>
</category>
</OpenGLAPI>

View file

@ -592,6 +592,7 @@ EXTRA_EXT(ARB_spirv_extensions);
EXTRA_EXT(NV_viewport_swizzle);
EXTRA_EXT(ARB_sparse_texture);
EXTRA_EXT(KHR_shader_subgroup);
EXTRA_EXT(OVR_multiview);
static const int extra_ARB_gl_spirv_or_es2_compat[] = {
EXT(ARB_gl_spirv),

View file

@ -498,6 +498,9 @@ descriptor=[
# GL_ARB_cull_distance, GL_EXT_clip_cull_distance
[ "MAX_CULL_DISTANCES", "CONTEXT_INT(Const.MaxClipPlanes), extra_ARB_cull_distance" ],
[ "MAX_COMBINED_CLIP_AND_CULL_DISTANCES", "CONTEXT_INT(Const.MaxClipPlanes), extra_ARB_cull_distance" ],
# OVR_multiview
[ "MAX_VIEWS_OVR", "CONST(MAX_VIEWS_OVR), extra_OVR_multiview" ],
]},
{ "apis": ["GLES", "GLES2"], "params": [