mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 10:20:09 +01:00
mesa/main: add _mesa_has_texture_multisample-helper
This reduces the number of places we need to keep track of what extensions enables this functionality. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35097>
This commit is contained in:
parent
214fd4e40d
commit
8d97f5d77e
3 changed files with 10 additions and 3 deletions
|
|
@ -490,6 +490,13 @@ _mesa_has_texture_view(const struct gl_context *ctx)
|
|||
_mesa_has_OES_texture_view(ctx);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
_mesa_has_texture_multisample(const struct gl_context *ctx)
|
||||
{
|
||||
return _mesa_has_ARB_texture_multisample(ctx) ||
|
||||
_mesa_is_gles31(ctx);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
_mesa_hw_select_enabled(const struct gl_context *ctx)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1295,7 +1295,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
|
||||
/* ARB_texture_multisample */
|
||||
case GL_SAMPLE_MASK:
|
||||
if (!_mesa_has_ARB_texture_multisample(ctx) && !_mesa_is_gles31(ctx))
|
||||
if (!_mesa_has_texture_multisample(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Multisample.SampleMask == state)
|
||||
return;
|
||||
|
|
@ -1959,7 +1959,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
|
||||
/* ARB_texture_multisample */
|
||||
case GL_SAMPLE_MASK:
|
||||
if (!_mesa_has_ARB_texture_multisample(ctx) && !_mesa_is_gles31(ctx))
|
||||
if (!_mesa_has_texture_multisample(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Multisample.SampleMask;
|
||||
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ _legal_parameters(struct gl_context *ctx, GLenum target, GLenum internalformat,
|
|||
* ARB_internalformat_query implementation like an error.
|
||||
*/
|
||||
if (!query2 &&
|
||||
!(_mesa_has_ARB_texture_multisample(ctx) || _mesa_is_gles31(ctx))) {
|
||||
!_mesa_has_texture_multisample(ctx)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM,
|
||||
"glGetInternalformativ(target=%s)",
|
||||
_mesa_enum_to_string(target));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue