mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-24 12:30:19 +01:00
mesa: do not require optional queries
The OpenGL specifications explicitly calls out these queries as allowing zero bits, so these features aren't actually required to bump the OpenGL version. While we could in theory also enable the corresponding extensions unconditionally, this risks breaking applications that assume that the presence of the extensions are sufficient to use meaningfully use them, like is the case with most other OpenGL extensions. However, blocking more recent GL versions due to this seems like a bit of an overreaction. So let's allow new OpenGL versions, but not the extensions themselves. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>
This commit is contained in:
parent
2906c468c1
commit
00a88f48fd
3 changed files with 27 additions and 9 deletions
|
|
@ -416,6 +416,29 @@ _mesa_hw_select_enabled(const struct gl_context *ctx)
|
|||
ctx->Const.HardwareAcceleratedSelect;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
_mesa_has_occlusion_query(const struct gl_context *ctx)
|
||||
{
|
||||
return _mesa_has_ARB_occlusion_query(ctx) ||
|
||||
_mesa_has_ARB_occlusion_query2(ctx) ||
|
||||
(_mesa_is_desktop_gl(ctx) && ctx->Version >= 15);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
_mesa_has_occlusion_query_boolean(const struct gl_context *ctx)
|
||||
{
|
||||
return _mesa_has_ARB_occlusion_query2(ctx) ||
|
||||
_mesa_has_EXT_occlusion_query_boolean(ctx) ||
|
||||
(_mesa_is_desktop_gl(ctx) && ctx->Version >= 33);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
_mesa_has_pipeline_statistics(const struct gl_context *ctx)
|
||||
{
|
||||
return _mesa_has_ARB_pipeline_statistics_query(ctx) ||
|
||||
(_mesa_is_desktop_gl(ctx) && ctx->Version >= 46);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ get_pipe_stats_binding_point(struct gl_context *ctx,
|
|||
const int which = target - GL_VERTICES_SUBMITTED;
|
||||
assert(which < MAX_PIPELINE_STATISTICS);
|
||||
|
||||
if (!_mesa_has_ARB_pipeline_statistics_query(ctx))
|
||||
if (!_mesa_has_pipeline_statistics(ctx))
|
||||
return NULL;
|
||||
|
||||
return &ctx->Query.pipeline_stats[which];
|
||||
|
|
@ -487,14 +487,12 @@ get_query_binding_point(struct gl_context *ctx, GLenum target, GLuint index)
|
|||
{
|
||||
switch (target) {
|
||||
case GL_SAMPLES_PASSED:
|
||||
if (_mesa_has_ARB_occlusion_query(ctx) ||
|
||||
_mesa_has_ARB_occlusion_query2(ctx))
|
||||
if (_mesa_has_occlusion_query(ctx))
|
||||
return &ctx->Query.CurrentOcclusionObject;
|
||||
else
|
||||
return NULL;
|
||||
case GL_ANY_SAMPLES_PASSED:
|
||||
if (_mesa_has_ARB_occlusion_query2(ctx) ||
|
||||
_mesa_has_EXT_occlusion_query_boolean(ctx))
|
||||
if (_mesa_has_occlusion_query_boolean(ctx))
|
||||
return &ctx->Query.CurrentOcclusionObject;
|
||||
else
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -252,8 +252,7 @@ compute_version(const struct gl_extensions *extensions,
|
|||
GLuint major, minor, version;
|
||||
|
||||
const bool ver_1_4 = (extensions->ARB_shadow);
|
||||
const bool ver_1_5 = (ver_1_4 &&
|
||||
extensions->ARB_occlusion_query);
|
||||
const bool ver_1_5 = ver_1_4;
|
||||
const bool ver_2_0 = (ver_1_5 &&
|
||||
extensions->ARB_vertex_shader &&
|
||||
extensions->ARB_fragment_shader &&
|
||||
|
|
@ -312,7 +311,6 @@ compute_version(const struct gl_extensions *extensions,
|
|||
extensions->ARB_blend_func_extended &&
|
||||
extensions->ARB_explicit_attrib_location &&
|
||||
extensions->ARB_instanced_arrays &&
|
||||
extensions->ARB_occlusion_query2 &&
|
||||
extensions->ARB_shader_bit_encoding &&
|
||||
extensions->ARB_texture_rgb10_a2ui &&
|
||||
extensions->ARB_timer_query &&
|
||||
|
|
@ -394,7 +392,6 @@ compute_version(const struct gl_extensions *extensions,
|
|||
extensions->ARB_gl_spirv &&
|
||||
extensions->ARB_spirv_extensions &&
|
||||
extensions->ARB_indirect_parameters &&
|
||||
extensions->ARB_pipeline_statistics_query &&
|
||||
extensions->ARB_polygon_offset_clamp &&
|
||||
extensions->ARB_shader_atomic_counter_ops &&
|
||||
extensions->ARB_shader_draw_parameters &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue