mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
mesa: ctx->API != API_OPENGL_COMPAT --> !_mesa_is_desktop_gl_compat(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
aee14878cc
commit
401c62af8c
14 changed files with 122 additions and 122 deletions
|
|
@ -633,7 +633,7 @@ valid_draw_indirect(struct gl_context *ctx,
|
|||
* structure, be in buffer objects, and may not be called when
|
||||
* the default vertex array object is bound."
|
||||
*/
|
||||
if (ctx->API != API_OPENGL_COMPAT &&
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) &&
|
||||
ctx->Array.VAO == ctx->Array.DefaultVAO)
|
||||
return GL_INVALID_OPERATION;
|
||||
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
|
||||
switch (cap) {
|
||||
case GL_ALPHA_TEST:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Color.AlphaEnabled == state)
|
||||
return;
|
||||
|
|
@ -502,7 +502,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Color.AlphaEnabled = state;
|
||||
break;
|
||||
case GL_AUTO_NORMAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.AutoNormal == state)
|
||||
return;
|
||||
|
|
@ -569,7 +569,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
}
|
||||
break;
|
||||
case GL_COLOR_MATERIAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Light.ColorMaterialEnabled == state)
|
||||
return;
|
||||
|
|
@ -614,7 +614,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Color.DitherFlag = state;
|
||||
break;
|
||||
case GL_FOG:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Fog.Enabled == state)
|
||||
return;
|
||||
|
|
@ -631,7 +631,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
case GL_LIGHT5:
|
||||
case GL_LIGHT6:
|
||||
case GL_LIGHT7:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Light.Light[cap-GL_LIGHT0].Enabled == state)
|
||||
return;
|
||||
|
|
@ -646,7 +646,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
}
|
||||
break;
|
||||
case GL_LIGHTING:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Light.Enabled == state)
|
||||
return;
|
||||
|
|
@ -666,7 +666,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Line.SmoothFlag = state;
|
||||
break;
|
||||
case GL_LINE_STIPPLE:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Line.StippleFlag == state)
|
||||
return;
|
||||
|
|
@ -676,7 +676,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Line.StippleFlag = state;
|
||||
break;
|
||||
case GL_INDEX_LOGIC_OP:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Color.IndexLogicOpEnabled == state)
|
||||
return;
|
||||
|
|
@ -725,7 +725,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
_mesa_update_allow_draw_out_of_order(ctx);
|
||||
break;
|
||||
case GL_MAP1_COLOR_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Color4 == state)
|
||||
return;
|
||||
|
|
@ -734,7 +734,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1Color4 = state;
|
||||
break;
|
||||
case GL_MAP1_INDEX:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Index == state)
|
||||
return;
|
||||
|
|
@ -743,7 +743,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1Index = state;
|
||||
break;
|
||||
case GL_MAP1_NORMAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Normal == state)
|
||||
return;
|
||||
|
|
@ -752,7 +752,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1Normal = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_1:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord1 == state)
|
||||
return;
|
||||
|
|
@ -761,7 +761,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1TextureCoord1 = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_2:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord2 == state)
|
||||
return;
|
||||
|
|
@ -770,7 +770,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1TextureCoord2 = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord3 == state)
|
||||
return;
|
||||
|
|
@ -779,7 +779,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1TextureCoord3 = state;
|
||||
break;
|
||||
case GL_MAP1_TEXTURE_COORD_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1TextureCoord4 == state)
|
||||
return;
|
||||
|
|
@ -788,7 +788,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1TextureCoord4 = state;
|
||||
break;
|
||||
case GL_MAP1_VERTEX_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Vertex3 == state)
|
||||
return;
|
||||
|
|
@ -797,7 +797,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1Vertex3 = state;
|
||||
break;
|
||||
case GL_MAP1_VERTEX_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map1Vertex4 == state)
|
||||
return;
|
||||
|
|
@ -806,7 +806,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map1Vertex4 = state;
|
||||
break;
|
||||
case GL_MAP2_COLOR_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Color4 == state)
|
||||
return;
|
||||
|
|
@ -815,7 +815,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2Color4 = state;
|
||||
break;
|
||||
case GL_MAP2_INDEX:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Index == state)
|
||||
return;
|
||||
|
|
@ -824,7 +824,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2Index = state;
|
||||
break;
|
||||
case GL_MAP2_NORMAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Normal == state)
|
||||
return;
|
||||
|
|
@ -833,7 +833,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2Normal = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_1:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord1 == state)
|
||||
return;
|
||||
|
|
@ -842,7 +842,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2TextureCoord1 = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_2:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord2 == state)
|
||||
return;
|
||||
|
|
@ -851,7 +851,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2TextureCoord2 = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord3 == state)
|
||||
return;
|
||||
|
|
@ -860,7 +860,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2TextureCoord3 = state;
|
||||
break;
|
||||
case GL_MAP2_TEXTURE_COORD_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2TextureCoord4 == state)
|
||||
return;
|
||||
|
|
@ -869,7 +869,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2TextureCoord4 = state;
|
||||
break;
|
||||
case GL_MAP2_VERTEX_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Vertex3 == state)
|
||||
return;
|
||||
|
|
@ -878,7 +878,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2Vertex3 = state;
|
||||
break;
|
||||
case GL_MAP2_VERTEX_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Eval.Map2Vertex4 == state)
|
||||
return;
|
||||
|
|
@ -887,7 +887,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Eval.Map2Vertex4 = state;
|
||||
break;
|
||||
case GL_NORMALIZE:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Transform.Normalize == state)
|
||||
return;
|
||||
|
|
@ -896,7 +896,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Transform.Normalize = state;
|
||||
break;
|
||||
case GL_POINT_SMOOTH:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Point.SmoothFlag == state)
|
||||
return;
|
||||
|
|
@ -914,7 +914,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Polygon.SmoothFlag = state;
|
||||
break;
|
||||
case GL_POLYGON_STIPPLE:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Polygon.StippleFlag == state)
|
||||
return;
|
||||
|
|
@ -952,7 +952,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
ctx->Polygon.OffsetFill = state;
|
||||
break;
|
||||
case GL_RESCALE_NORMAL_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Transform.RescaleNormals == state)
|
||||
return;
|
||||
|
|
@ -983,21 +983,21 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
_mesa_update_allow_draw_out_of_order(ctx);
|
||||
break;
|
||||
case GL_TEXTURE_1D:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!enable_texture(ctx, state, TEXTURE_1D_BIT)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_2D:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (!enable_texture(ctx, state, TEXTURE_2D_BIT)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (!enable_texture(ctx, state, TEXTURE_3D_BIT)) {
|
||||
return;
|
||||
|
|
@ -1010,7 +1010,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
{
|
||||
struct gl_fixedfunc_texture_unit *texUnit = get_texcoord_unit(ctx);
|
||||
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
|
||||
if (texUnit) {
|
||||
|
|
@ -1055,7 +1055,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
case GL_NORMAL_ARRAY:
|
||||
case GL_COLOR_ARRAY:
|
||||
case GL_TEXTURE_COORD_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
client_state( ctx, ctx->Array.VAO, cap, state );
|
||||
return;
|
||||
|
|
@ -1063,7 +1063,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
case GL_EDGE_FLAG_ARRAY:
|
||||
case GL_FOG_COORDINATE_ARRAY_EXT:
|
||||
case GL_SECONDARY_COLOR_ARRAY_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
client_state( ctx, ctx->Array.VAO, cap, state );
|
||||
return;
|
||||
|
|
@ -1075,7 +1075,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
|
||||
/* GL_ARB_texture_cube_map */
|
||||
case GL_TEXTURE_CUBE_MAP:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
if (!enable_texture(ctx, state, TEXTURE_CUBE_BIT)) {
|
||||
return;
|
||||
|
|
@ -1084,7 +1084,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
|
||||
/* GL_EXT_secondary_color */
|
||||
case GL_COLOR_SUM_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Fog.ColorSumEnabled == state)
|
||||
return;
|
||||
|
|
@ -1149,7 +1149,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
|
||||
/* GL_IBM_rasterpos_clip */
|
||||
case GL_RASTER_POSITION_UNCLIPPED_IBM:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (ctx->Transform.RasterPositionUnclipped == state)
|
||||
return;
|
||||
|
|
@ -1655,11 +1655,11 @@ _mesa_IsEnabled( GLenum cap )
|
|||
|
||||
switch (cap) {
|
||||
case GL_ALPHA_TEST:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Color.AlphaEnabled;
|
||||
case GL_AUTO_NORMAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.AutoNormal;
|
||||
case GL_BLEND:
|
||||
|
|
@ -1680,7 +1680,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
return (ctx->Transform.ClipPlanesEnabled >> p) & 1;
|
||||
}
|
||||
case GL_COLOR_MATERIAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Light.ColorMaterialEnabled;
|
||||
case GL_CULL_FACE:
|
||||
|
|
@ -1693,11 +1693,11 @@ _mesa_IsEnabled( GLenum cap )
|
|||
case GL_DITHER:
|
||||
return ctx->Color.DitherFlag;
|
||||
case GL_FOG:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Fog.Enabled;
|
||||
case GL_LIGHTING:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Light.Enabled;
|
||||
case GL_LIGHT0:
|
||||
|
|
@ -1708,7 +1708,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
case GL_LIGHT5:
|
||||
case GL_LIGHT6:
|
||||
case GL_LIGHT7:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Light.Light[cap-GL_LIGHT0].Enabled;
|
||||
case GL_LINE_SMOOTH:
|
||||
|
|
@ -1716,11 +1716,11 @@ _mesa_IsEnabled( GLenum cap )
|
|||
goto invalid_enum_error;
|
||||
return ctx->Line.SmoothFlag;
|
||||
case GL_LINE_STIPPLE:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Line.StippleFlag;
|
||||
case GL_INDEX_LOGIC_OP:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Color.IndexLogicOpEnabled;
|
||||
case GL_COLOR_LOGIC_OP:
|
||||
|
|
@ -1728,83 +1728,83 @@ _mesa_IsEnabled( GLenum cap )
|
|||
goto invalid_enum_error;
|
||||
return ctx->Color.ColorLogicOpEnabled;
|
||||
case GL_MAP1_COLOR_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1Color4;
|
||||
case GL_MAP1_INDEX:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1Index;
|
||||
case GL_MAP1_NORMAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1Normal;
|
||||
case GL_MAP1_TEXTURE_COORD_1:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1TextureCoord1;
|
||||
case GL_MAP1_TEXTURE_COORD_2:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1TextureCoord2;
|
||||
case GL_MAP1_TEXTURE_COORD_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1TextureCoord3;
|
||||
case GL_MAP1_TEXTURE_COORD_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1TextureCoord4;
|
||||
case GL_MAP1_VERTEX_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1Vertex3;
|
||||
case GL_MAP1_VERTEX_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map1Vertex4;
|
||||
case GL_MAP2_COLOR_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2Color4;
|
||||
case GL_MAP2_INDEX:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2Index;
|
||||
case GL_MAP2_NORMAL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2Normal;
|
||||
case GL_MAP2_TEXTURE_COORD_1:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2TextureCoord1;
|
||||
case GL_MAP2_TEXTURE_COORD_2:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2TextureCoord2;
|
||||
case GL_MAP2_TEXTURE_COORD_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2TextureCoord3;
|
||||
case GL_MAP2_TEXTURE_COORD_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2TextureCoord4;
|
||||
case GL_MAP2_VERTEX_3:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2Vertex3;
|
||||
case GL_MAP2_VERTEX_4:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Eval.Map2Vertex4;
|
||||
case GL_NORMALIZE:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Transform.Normalize;
|
||||
case GL_POINT_SMOOTH:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Point.SmoothFlag;
|
||||
case GL_POLYGON_SMOOTH:
|
||||
|
|
@ -1812,7 +1812,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
goto invalid_enum_error;
|
||||
return ctx->Polygon.SmoothFlag;
|
||||
case GL_POLYGON_STIPPLE:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Polygon.StippleFlag;
|
||||
case GL_POLYGON_OFFSET_POINT:
|
||||
|
|
@ -1826,7 +1826,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
case GL_POLYGON_OFFSET_FILL:
|
||||
return ctx->Polygon.OffsetFill;
|
||||
case GL_RESCALE_NORMAL_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return ctx->Transform.RescaleNormals;
|
||||
case GL_SCISSOR_TEST:
|
||||
|
|
@ -1834,15 +1834,15 @@ _mesa_IsEnabled( GLenum cap )
|
|||
case GL_STENCIL_TEST:
|
||||
return ctx->Stencil.Enabled;
|
||||
case GL_TEXTURE_1D:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return is_texture_enabled(ctx, TEXTURE_1D_BIT);
|
||||
case GL_TEXTURE_2D:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return is_texture_enabled(ctx, TEXTURE_2D_BIT);
|
||||
case GL_TEXTURE_3D:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return is_texture_enabled(ctx, TEXTURE_3D_BIT);
|
||||
case GL_TEXTURE_GEN_S:
|
||||
|
|
@ -1853,7 +1853,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
const struct gl_fixedfunc_texture_unit *texUnit =
|
||||
get_texcoord_unit(ctx);
|
||||
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
|
||||
if (texUnit) {
|
||||
|
|
@ -1880,36 +1880,36 @@ _mesa_IsEnabled( GLenum cap )
|
|||
|
||||
/* client-side state */
|
||||
case GL_VERTEX_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_POS);
|
||||
case GL_NORMAL_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_NORMAL);
|
||||
case GL_COLOR_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_COLOR0);
|
||||
case GL_INDEX_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_COLOR_INDEX);
|
||||
case GL_TEXTURE_COORD_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled &
|
||||
VERT_BIT_TEX(ctx->Array.ActiveTexture));
|
||||
case GL_EDGE_FLAG_ARRAY:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_EDGEFLAG);
|
||||
case GL_FOG_COORDINATE_ARRAY_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_FOG);
|
||||
case GL_SECONDARY_COLOR_ARRAY_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return !!(ctx->Array.VAO->Enabled & VERT_BIT_COLOR1);
|
||||
case GL_POINT_SIZE_ARRAY_OES:
|
||||
|
|
@ -1919,13 +1919,13 @@ _mesa_IsEnabled( GLenum cap )
|
|||
|
||||
/* GL_ARB_texture_cube_map */
|
||||
case GL_TEXTURE_CUBE_MAP:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_enum_error;
|
||||
return is_texture_enabled(ctx, TEXTURE_CUBE_BIT);
|
||||
|
||||
/* GL_EXT_secondary_color */
|
||||
case GL_COLOR_SUM_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Fog.ColorSumEnabled;
|
||||
|
||||
|
|
@ -1949,7 +1949,7 @@ _mesa_IsEnabled( GLenum cap )
|
|||
|
||||
/* GL_IBM_rasterpos_clip */
|
||||
case GL_RASTER_POSITION_UNCLIPPED_IBM:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum_error;
|
||||
return ctx->Transform.RasterPositionUnclipped;
|
||||
|
||||
|
|
|
|||
|
|
@ -5108,7 +5108,7 @@ get_framebuffer_attachment_parameter(struct gl_context *ctx,
|
|||
}
|
||||
return;
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
|
||||
if ((ctx->API != API_OPENGL_COMPAT ||
|
||||
if ((!_mesa_is_desktop_gl_compat(ctx) ||
|
||||
!ctx->Extensions.ARB_framebuffer_object)
|
||||
&& ctx->API != API_OPENGL_CORE
|
||||
&& !_mesa_is_gles3(ctx)) {
|
||||
|
|
@ -5561,7 +5561,7 @@ invalidate_framebuffer_storage(struct gl_context *ctx,
|
|||
/* Accumulation buffers and auxilary buffers were removed in
|
||||
* OpenGL 3.1, and they never existed in OpenGL ES.
|
||||
*/
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_enum;
|
||||
break;
|
||||
case GL_COLOR:
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
|
|||
ctx->Fog.End = *params;
|
||||
break;
|
||||
case GL_FOG_INDEX:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
if (ctx->Fog.Index == *params)
|
||||
return;
|
||||
|
|
@ -156,7 +156,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
|
|||
break;
|
||||
case GL_FOG_COORDINATE_SOURCE_EXT: {
|
||||
GLenum p = (GLenum) (GLint) *params;
|
||||
if (ctx->API != API_OPENGL_COMPAT ||
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) ||
|
||||
(p != GL_FOG_COORDINATE_EXT && p != GL_FRAGMENT_DEPTH_EXT)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glFog");
|
||||
return;
|
||||
|
|
@ -169,7 +169,7 @@ _mesa_Fogfv( GLenum pname, const GLfloat *params )
|
|||
}
|
||||
case GL_FOG_DISTANCE_MODE_NV: {
|
||||
GLenum p = (GLenum) (GLint) *params;
|
||||
if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_fog_distance ||
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) || !ctx->Extensions.NV_fog_distance ||
|
||||
(p != GL_EYE_RADIAL_NV && p != GL_EYE_PLANE && p != GL_EYE_PLANE_ABSOLUTE_NV)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glFog");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -254,52 +254,52 @@ _get_vao_pointerv(GLenum pname, struct gl_vertex_array_object* vao,
|
|||
|
||||
switch (pname) {
|
||||
case GL_VERTEX_ARRAY_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_POS].Ptr;
|
||||
break;
|
||||
case GL_NORMAL_ARRAY_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_NORMAL].Ptr;
|
||||
break;
|
||||
case GL_COLOR_ARRAY_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_COLOR0].Ptr;
|
||||
break;
|
||||
case GL_SECONDARY_COLOR_ARRAY_POINTER_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_COLOR1].Ptr;
|
||||
break;
|
||||
case GL_FOG_COORDINATE_ARRAY_POINTER_EXT:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_FOG].Ptr;
|
||||
break;
|
||||
case GL_INDEX_ARRAY_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr;
|
||||
break;
|
||||
case GL_TEXTURE_COORD_ARRAY_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_TEX(clientUnit)].Ptr;
|
||||
break;
|
||||
case GL_EDGE_FLAG_ARRAY_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
*params = (GLvoid *) vao->VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr;
|
||||
break;
|
||||
case GL_FEEDBACK_BUFFER_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
*params = ctx->Feedback.Buffer;
|
||||
break;
|
||||
case GL_SELECTION_BUFFER_POINTER:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
*params = ctx->Select.Buffer;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1399,7 +1399,7 @@ lower_draw_elements_indirect(struct gl_context *ctx, GLenum mode, GLenum type,
|
|||
static inline bool
|
||||
draw_indirect_async_allowed(struct gl_context *ctx, unsigned user_buffer_mask)
|
||||
{
|
||||
return ctx->API != API_OPENGL_COMPAT ||
|
||||
return !_mesa_is_desktop_gl_compat(ctx) ||
|
||||
/* This will just generate GL_INVALID_OPERATION, as it should. */
|
||||
ctx->GLThread.inside_begin_end ||
|
||||
ctx->GLThread.ListMode ||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ _mesa_Hint( GLenum target, GLenum mode )
|
|||
|
||||
switch (target) {
|
||||
case GL_FOG_HINT:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_target;
|
||||
if (ctx->Hint.Fog == mode)
|
||||
return;
|
||||
|
|
@ -67,7 +67,7 @@ _mesa_Hint( GLenum target, GLenum mode )
|
|||
ctx->Hint.LineSmooth = mode;
|
||||
break;
|
||||
case GL_PERSPECTIVE_CORRECTION_HINT:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_target;
|
||||
if (ctx->Hint.PerspectiveCorrection == mode)
|
||||
return;
|
||||
|
|
@ -75,7 +75,7 @@ _mesa_Hint( GLenum target, GLenum mode )
|
|||
ctx->Hint.PerspectiveCorrection = mode;
|
||||
break;
|
||||
case GL_POINT_SMOOTH_HINT:
|
||||
if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx) && ctx->API != API_OPENGLES)
|
||||
goto invalid_target;
|
||||
if (ctx->Hint.PointSmooth == mode)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
|
|||
COPY_4V( ctx->Light.Model.Ambient, params );
|
||||
break;
|
||||
case GL_LIGHT_MODEL_LOCAL_VIEWER:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
newbool = (params[0] != 0.0F);
|
||||
if (ctx->Light.Model.LocalViewer == newbool)
|
||||
|
|
@ -524,7 +524,7 @@ _mesa_LightModelfv( GLenum pname, const GLfloat *params )
|
|||
ctx->Light.Model.TwoSide = newbool;
|
||||
break;
|
||||
case GL_LIGHT_MODEL_COLOR_CONTROL:
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
goto invalid_pname;
|
||||
if (params[0] == (GLfloat) GL_SINGLE_COLOR)
|
||||
newenum = GL_SINGLE_COLOR;
|
||||
|
|
@ -856,7 +856,7 @@ _mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params )
|
|||
*params = mat[MAT_ATTRIB_SHININESS(f)][0];
|
||||
break;
|
||||
case GL_COLOR_INDEXES:
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glGetMaterialfv(pname)" );
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -781,7 +781,7 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
|
|||
|
||||
q = _mesa_lookup_query_object(ctx, id);
|
||||
if (!q) {
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error(ctx, GL_INVALID_OPERATION,
|
||||
"glBeginQuery{Indexed}(non-gen name)");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ set_combiner_source(struct gl_context *ctx,
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((term == 3) && (ctx->API != API_OPENGL_COMPAT
|
||||
if ((term == 3) && (!_mesa_is_desktop_gl_compat(ctx)
|
||||
|| !ctx->Extensions.NV_texture_env_combine4)) {
|
||||
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
|
||||
return false;
|
||||
|
|
@ -290,7 +290,7 @@ set_combiner_operand(struct gl_context *ctx,
|
|||
return false;
|
||||
}
|
||||
|
||||
if ((term == 3) && (ctx->API != API_OPENGL_COMPAT
|
||||
if ((term == 3) && (!_mesa_is_desktop_gl_compat(ctx)
|
||||
|| !ctx->Extensions.NV_texture_env_combine4)) {
|
||||
TE_ERROR(GL_INVALID_ENUM, "glTexEnv(pname=%s)", pname);
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ texgenfv( GLuint texunitIndex, GLenum coord, GLenum pname,
|
|||
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
|
||||
return;
|
||||
}
|
||||
if (ctx->API != API_OPENGL_COMPAT
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)
|
||||
&& (bit & (TEXGEN_REFLECTION_MAP_NV | TEXGEN_NORMAL_MAP_NV)) == 0) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
|
||||
return;
|
||||
|
|
@ -140,7 +140,7 @@ texgenfv( GLuint texunitIndex, GLenum coord, GLenum pname,
|
|||
|
||||
case GL_OBJECT_PLANE:
|
||||
{
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
|
||||
return;
|
||||
}
|
||||
|
|
@ -155,7 +155,7 @@ texgenfv( GLuint texunitIndex, GLenum coord, GLenum pname,
|
|||
{
|
||||
GLfloat tmp[4];
|
||||
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glTexGenfv(param)" );
|
||||
return;
|
||||
}
|
||||
|
|
@ -235,14 +235,14 @@ gettexgenfv( GLenum texunitIndex, GLenum coord, GLenum pname,
|
|||
params[0] = ENUM_TO_FLOAT(texgen->Mode);
|
||||
break;
|
||||
case GL_OBJECT_PLANE:
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "%s(param)", caller );
|
||||
return;
|
||||
}
|
||||
COPY_4V(params, unit->ObjectPlane[index]);
|
||||
break;
|
||||
case GL_EYE_PLANE:
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "%s(param)", caller );
|
||||
return;
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ gettexgeniv( GLenum texunitIndex, GLenum coord, GLenum pname,
|
|||
params[0] = texgen->Mode;
|
||||
break;
|
||||
case GL_OBJECT_PLANE:
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "%s(param)" , caller);
|
||||
return;
|
||||
}
|
||||
|
|
@ -286,7 +286,7 @@ gettexgeniv( GLenum texunitIndex, GLenum coord, GLenum pname,
|
|||
params[3] = (GLint) unit->ObjectPlane[index][3];
|
||||
break;
|
||||
case GL_EYE_PLANE:
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "%s(param)" , caller);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1916,7 +1916,7 @@ texture_error_check( struct gl_context *ctx,
|
|||
|
||||
/* Check border */
|
||||
if (border < 0 || border > 1 ||
|
||||
((ctx->API != API_OPENGL_COMPAT ||
|
||||
((!_mesa_is_desktop_gl_compat(ctx) ||
|
||||
target == GL_TEXTURE_RECTANGLE_NV ||
|
||||
target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
|
|
@ -2391,7 +2391,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
|
|||
|
||||
/* Check border */
|
||||
if (border < 0 || border > 1 ||
|
||||
((ctx->API != API_OPENGL_COMPAT ||
|
||||
((!_mesa_is_desktop_gl_compat(ctx) ||
|
||||
target == GL_TEXTURE_RECTANGLE_NV ||
|
||||
target == GL_PROXY_TEXTURE_RECTANGLE_NV) && border != 0)) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ update_attribute_map_mode(const struct gl_context *ctx,
|
|||
* There is no need to change the mapping away from the
|
||||
* identity mapping if we are not in compat mode.
|
||||
*/
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
return;
|
||||
/* The generic0 attribute superseeds the position attribute */
|
||||
const GLbitfield enabled = vao->Enabled;
|
||||
|
|
@ -2093,7 +2093,7 @@ void
|
|||
_mesa_update_edgeflag_state_explicit(struct gl_context *ctx,
|
||||
bool per_vertex_enable)
|
||||
{
|
||||
if (ctx->API != API_OPENGL_COMPAT)
|
||||
if (!_mesa_is_desktop_gl_compat(ctx))
|
||||
return;
|
||||
|
||||
/* Edge flags take effect only if the polygon mode is not FILL on the side
|
||||
|
|
|
|||
|
|
@ -648,7 +648,7 @@ _mesa_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
|
|||
MAT_ATTR(VBO_ATTRIB_MAT_BACK_SHININESS, 1, params);
|
||||
break;
|
||||
case GL_COLOR_INDEXES:
|
||||
if (ctx->API != API_OPENGL_COMPAT) {
|
||||
if (!_mesa_is_desktop_gl_compat(ctx)) {
|
||||
_mesa_error(ctx, GL_INVALID_ENUM, "glMaterialfv(pname)");
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue