mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
mesa: ctx->API != API_OPENGL_CORE --> !_mesa_is_desktop_gl_core(ctx)
replaces direct API checks with _mesa_is_...() checks Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8340 Signed-off-by: Volodymyr Obohzyn volodymyr.obozhyn@globallogic.com Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38981>
This commit is contained in:
parent
389d8b96a6
commit
ba4908e61f
6 changed files with 10 additions and 9 deletions
|
|
@ -34,7 +34,7 @@ header = """
|
|||
#include "bufferobj.h"
|
||||
#include "dispatch.h"
|
||||
|
||||
#define COMPAT (ctx->API != API_OPENGL_CORE)
|
||||
#define COMPAT (!_mesa_is_desktop_gl_core(ctx))
|
||||
|
||||
UNUSED static inline int safe_mul(int a, int b)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1185,7 +1185,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
* GLSL vertex shaders on desktop.
|
||||
*/
|
||||
if (!_mesa_has_ARB_vertex_program(ctx) &&
|
||||
ctx->API != API_OPENGL_CORE)
|
||||
!_mesa_is_desktop_gl_core(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->VertexProgram.PointSizeEnabled == state)
|
||||
return;
|
||||
|
|
@ -1970,7 +1970,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
* GLSL vertex shaders on desktop.
|
||||
*/
|
||||
if (!_mesa_has_ARB_vertex_program(ctx) &&
|
||||
ctx->API != API_OPENGL_CORE)
|
||||
!_mesa_is_desktop_gl_core(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->VertexProgram.PointSizeEnabled;
|
||||
case GL_VERTEX_PROGRAM_TWO_SIDE_ARB:
|
||||
|
|
|
|||
|
|
@ -5110,7 +5110,7 @@ get_framebuffer_attachment_parameter(struct gl_context *ctx,
|
|||
case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
|
||||
if ((!_mesa_is_desktop_gl_compat(ctx) ||
|
||||
!ctx->Extensions.ARB_framebuffer_object)
|
||||
&& ctx->API != API_OPENGL_CORE
|
||||
&& !_mesa_is_desktop_gl_core(ctx)
|
||||
&& !_mesa_is_gles3(ctx)) {
|
||||
goto invalid_pname_enum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ void _mesa_glthread_disable(struct gl_context *ctx)
|
|||
/* Unbind VBOs in all VAOs that glthread bound for non-VBO vertex uploads
|
||||
* to restore original states.
|
||||
*/
|
||||
if (ctx->API != API_OPENGL_CORE)
|
||||
if (!_mesa_is_desktop_gl_core(ctx))
|
||||
_mesa_glthread_unbind_uploaded_vbos(ctx);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include "main/hash.h"
|
||||
#include "dispatch.h"
|
||||
#include "main/varray.h"
|
||||
#include "main/context.h"
|
||||
|
||||
static unsigned
|
||||
element_size(union gl_vertex_format_user format)
|
||||
|
|
@ -746,7 +747,7 @@ unbind_uploaded_vbos(void *_vao, void *_ctx)
|
|||
struct gl_context *ctx = _ctx;
|
||||
struct gl_vertex_array_object *vao = _vao;
|
||||
|
||||
assert(ctx->API != API_OPENGL_CORE);
|
||||
assert(!_mesa_is_desktop_gl_core(ctx));
|
||||
|
||||
for (unsigned i = 0; i < ARRAY_SIZE(vao->BufferBinding); i++) {
|
||||
if (vao->BufferBinding[i].BufferObj &&
|
||||
|
|
@ -767,7 +768,7 @@ unbind_uploaded_vbos(void *_vao, void *_ctx)
|
|||
void
|
||||
_mesa_glthread_unbind_uploaded_vbos(struct gl_context *ctx)
|
||||
{
|
||||
assert(ctx->API != API_OPENGL_CORE);
|
||||
assert(!_mesa_is_desktop_gl_core(ctx));
|
||||
|
||||
/* Iterate over all VAOs. */
|
||||
_mesa_HashWalk(&ctx->Array.Objects, unbind_uploaded_vbos, ctx);
|
||||
|
|
|
|||
|
|
@ -2556,7 +2556,7 @@ get_tex_parameterfv(struct gl_context *ctx,
|
|||
break;
|
||||
|
||||
case GL_TEXTURE_TARGET:
|
||||
if (ctx->API != API_OPENGL_CORE)
|
||||
if (!_mesa_is_desktop_gl_core(ctx))
|
||||
goto invalid_pname;
|
||||
*params = ENUM_TO_FLOAT(obj->Target);
|
||||
break;
|
||||
|
|
@ -2849,7 +2849,7 @@ get_tex_parameteriv(struct gl_context *ctx,
|
|||
break;
|
||||
|
||||
case GL_TEXTURE_TARGET:
|
||||
if (ctx->API != API_OPENGL_CORE)
|
||||
if (!_mesa_is_desktop_gl_core(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLint) obj->Target;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue