mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 03:10:09 +01:00
mesa: make more use of the new _mesa_is_gles1() helper
Signed-off-by: Eric Engestrom <eric@igalia.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21343>
This commit is contained in:
parent
6651f9808c
commit
7a7c1e6519
10 changed files with 33 additions and 33 deletions
|
|
@ -1402,7 +1402,7 @@ handle_first_current(struct gl_context *ctx)
|
|||
* that will erroneously allow this usage in a 3.0 forward-compatible
|
||||
* context too.
|
||||
*/
|
||||
ctx->_AttribZeroAliasesVertex = (ctx->API == API_OPENGLES
|
||||
ctx->_AttribZeroAliasesVertex = (_mesa_is_gles1(ctx)
|
||||
|| (_mesa_is_desktop_gl_compat(ctx)
|
||||
&& !is_forward_compatible_context));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ _mesa_set_multisample(struct gl_context *ctx, GLboolean state)
|
|||
/* GL compatibility needs Multisample.Enable to determine program state
|
||||
* constants.
|
||||
*/
|
||||
if (_mesa_is_desktop_gl_compat(ctx) || ctx->API == API_OPENGLES) {
|
||||
if (_mesa_is_desktop_gl_compat(ctx) || _mesa_is_gles1(ctx)) {
|
||||
FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
|
||||
} else {
|
||||
FLUSH_VERTICES(ctx, 0, GL_MULTISAMPLE_BIT | GL_ENABLE_BIT);
|
||||
|
|
@ -457,7 +457,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
/* The compatibility profile needs _NEW_TRANSFORM to transform
|
||||
* clip planes according to the projection matrix.
|
||||
*/
|
||||
if (_mesa_is_desktop_gl_compat(ctx) || ctx->API == API_OPENGLES) {
|
||||
if (_mesa_is_desktop_gl_compat(ctx) || _mesa_is_gles1(ctx)) {
|
||||
FLUSH_VERTICES(ctx, _NEW_TRANSFORM,
|
||||
GL_TRANSFORM_BIT | GL_ENABLE_BIT);
|
||||
} else {
|
||||
|
|
@ -470,7 +470,7 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
|
|||
|
||||
/* The projection matrix transforms the clip plane. */
|
||||
/* TODO: glEnable might not be the best place to do it. */
|
||||
if (_mesa_is_desktop_gl_compat(ctx) || ctx->API == API_OPENGLES) {
|
||||
if (_mesa_is_desktop_gl_compat(ctx) || _mesa_is_gles1(ctx)) {
|
||||
_mesa_update_clip_plane(ctx, p);
|
||||
ctx->NewDriverState |= ST_NEW_CLIP_STATE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ get_attachment(struct gl_context *ctx, struct gl_framebuffer *fb,
|
|||
*/
|
||||
i = attachment - GL_COLOR_ATTACHMENT0_EXT;
|
||||
if (i >= ctx->Const.MaxColorAttachments
|
||||
|| (i > 0 && ctx->API == API_OPENGLES)) {
|
||||
|| (i > 0 && _mesa_is_gles1(ctx))) {
|
||||
return NULL;
|
||||
}
|
||||
assert(BUFFER_COLOR0 + i < ARRAY_SIZE(fb->Attachment));
|
||||
|
|
@ -4745,7 +4745,7 @@ get_framebuffer_attachment_parameter(struct gl_context *ctx,
|
|||
}
|
||||
return;
|
||||
case GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT:
|
||||
if (ctx->API == API_OPENGLES) {
|
||||
if (_mesa_is_gles1(ctx)) {
|
||||
goto invalid_pname_enum;
|
||||
} else if (att->Type == GL_NONE) {
|
||||
_mesa_error(ctx, err, "%s(invalid pname %s)", caller,
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ _mesa_is_valid_generate_texture_mipmap_target(struct gl_context *ctx,
|
|||
error = false;
|
||||
break;
|
||||
case GL_TEXTURE_3D:
|
||||
error = ctx->API == API_OPENGLES;
|
||||
error = _mesa_is_gles1(ctx);
|
||||
break;
|
||||
case GL_TEXTURE_CUBE_MAP:
|
||||
error = false;
|
||||
|
|
|
|||
|
|
@ -1330,7 +1330,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
|
|||
case GL_PALETTE8_R5_G6_B5_OES:
|
||||
case GL_PALETTE8_RGBA4_OES:
|
||||
case GL_PALETTE8_RGB5_A1_OES:
|
||||
return ctx->API == API_OPENGLES;
|
||||
return _mesa_is_gles1(ctx);
|
||||
}
|
||||
|
||||
switch (_mesa_get_format_layout(m_format)) {
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ pixel_storei(GLenum pname, GLint param, bool no_error)
|
|||
ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
case GL_PACK_ROW_LENGTH:
|
||||
if (!no_error && ctx->API == API_OPENGLES)
|
||||
if (!no_error && _mesa_is_gles1(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!no_error && param<0)
|
||||
goto invalid_value_error;
|
||||
|
|
@ -69,14 +69,14 @@ pixel_storei(GLenum pname, GLint param, bool no_error)
|
|||
ctx->Pack.ImageHeight = param;
|
||||
break;
|
||||
case GL_PACK_SKIP_PIXELS:
|
||||
if (!no_error && ctx->API == API_OPENGLES)
|
||||
if (!no_error && _mesa_is_gles1(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!no_error && param<0)
|
||||
goto invalid_value_error;
|
||||
ctx->Pack.SkipPixels = param;
|
||||
break;
|
||||
case GL_PACK_SKIP_ROWS:
|
||||
if (!no_error && ctx->API == API_OPENGLES)
|
||||
if (!no_error && _mesa_is_gles1(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!no_error && param<0)
|
||||
goto invalid_value_error;
|
||||
|
|
@ -144,7 +144,7 @@ pixel_storei(GLenum pname, GLint param, bool no_error)
|
|||
ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE;
|
||||
break;
|
||||
case GL_UNPACK_ROW_LENGTH:
|
||||
if (!no_error && ctx->API == API_OPENGLES)
|
||||
if (!no_error && _mesa_is_gles1(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!no_error && param<0)
|
||||
goto invalid_value_error;
|
||||
|
|
@ -158,14 +158,14 @@ pixel_storei(GLenum pname, GLint param, bool no_error)
|
|||
ctx->Unpack.ImageHeight = param;
|
||||
break;
|
||||
case GL_UNPACK_SKIP_PIXELS:
|
||||
if (!no_error && ctx->API == API_OPENGLES)
|
||||
if (!no_error && _mesa_is_gles1(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!no_error && param<0)
|
||||
goto invalid_value_error;
|
||||
ctx->Unpack.SkipPixels = param;
|
||||
break;
|
||||
case GL_UNPACK_SKIP_ROWS:
|
||||
if (!no_error && ctx->API == API_OPENGLES)
|
||||
if (!no_error && _mesa_is_gles1(ctx))
|
||||
goto invalid_enum_error;
|
||||
if (!no_error && param<0)
|
||||
goto invalid_value_error;
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
|
|||
formats[n++] = GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
|
||||
}
|
||||
|
||||
if (ctx->API == API_OPENGLES) {
|
||||
if (_mesa_is_gles1(ctx)) {
|
||||
formats[n++] = GL_PALETTE4_RGB8_OES;
|
||||
formats[n++] = GL_PALETTE4_RGBA8_OES;
|
||||
formats[n++] = GL_PALETTE4_R5_G6_B5_OES;
|
||||
|
|
|
|||
|
|
@ -3146,7 +3146,7 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
|
|||
* call by decompressing the texture. If we really want to support cpal
|
||||
* textures in any driver this would have to be changed.
|
||||
*/
|
||||
if (ctx->API == API_OPENGLES && compressed && dims == 2) {
|
||||
if (_mesa_is_gles1(ctx) && compressed && dims == 2) {
|
||||
switch (internalFormat) {
|
||||
case GL_PALETTE4_RGB8_OES:
|
||||
case GL_PALETTE4_RGBA8_OES:
|
||||
|
|
|
|||
|
|
@ -848,7 +848,7 @@ set_tex_parameterf(struct gl_context *ctx,
|
|||
* OpenGL ES 2.0+, it only exists in when GL_OES_texture_border_clamp is
|
||||
* enabled. It is never available in OpenGL ES 1.x.
|
||||
*/
|
||||
if (ctx->API == API_OPENGLES)
|
||||
if (_mesa_is_gles1(ctx))
|
||||
goto invalid_pname;
|
||||
|
||||
if (!_mesa_target_allows_setting_sampler_parameters(texObj->Target))
|
||||
|
|
@ -2303,7 +2303,7 @@ get_tex_parameterfv(struct gl_context *ctx,
|
|||
*params = ENUM_TO_FLOAT(obj->Sampler.Attrib.WrapR);
|
||||
break;
|
||||
case GL_TEXTURE_BORDER_COLOR:
|
||||
if (ctx->API == API_OPENGLES)
|
||||
if (_mesa_is_gles1(ctx))
|
||||
goto invalid_pname;
|
||||
|
||||
if (_mesa_get_clamp_fragment_color(ctx, ctx->DrawBuffer)) {
|
||||
|
|
@ -2566,7 +2566,7 @@ get_tex_parameteriv(struct gl_context *ctx,
|
|||
*params = (GLint) obj->Sampler.Attrib.WrapR;
|
||||
break;
|
||||
case GL_TEXTURE_BORDER_COLOR:
|
||||
if (ctx->API == API_OPENGLES)
|
||||
if (_mesa_is_gles1(ctx))
|
||||
goto invalid_pname;
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1175,7 +1175,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (SHORT_BIT | INT_BIT | FLOAT_BIT |
|
||||
DOUBLE_BIT | HALF_BIT |
|
||||
|
|
@ -1202,7 +1202,7 @@ _mesa_VertexArrayVertexOffsetEXT(GLuint vaobj, GLuint buffer, GLint size,
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (SHORT_BIT | INT_BIT | FLOAT_BIT |
|
||||
DOUBLE_BIT | HALF_BIT |
|
||||
|
|
@ -1247,7 +1247,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (BYTE_BIT | SHORT_BIT | INT_BIT |
|
||||
HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
|
||||
|
|
@ -1274,7 +1274,7 @@ _mesa_VertexArrayNormalOffsetEXT(GLuint vaobj, GLuint buffer, GLenum type,
|
|||
GET_CURRENT_CONTEXT(ctx);
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (BYTE_BIT | SHORT_BIT | INT_BIT |
|
||||
HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
|
||||
|
|
@ -1319,10 +1319,10 @@ void GLAPIENTRY
|
|||
_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 4 : 3;
|
||||
const GLint sizeMin = _mesa_is_gles1(ctx) ? 4 : 3;
|
||||
|
||||
GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (UNSIGNED_BYTE_BIT | HALF_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (BYTE_BIT | UNSIGNED_BYTE_BIT |
|
||||
SHORT_BIT | UNSIGNED_SHORT_BIT |
|
||||
|
|
@ -1349,10 +1349,10 @@ _mesa_VertexArrayColorOffsetEXT(GLuint vaobj, GLuint buffer, GLint size,
|
|||
GLenum type, GLsizei stride, GLintptr offset)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 4 : 3;
|
||||
const GLint sizeMin = _mesa_is_gles1(ctx) ? 4 : 3;
|
||||
|
||||
GLenum format = get_array_format(ctx, BGRA_OR_4, &size);
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (UNSIGNED_BYTE_BIT | HALF_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (BYTE_BIT | UNSIGNED_BYTE_BIT |
|
||||
SHORT_BIT | UNSIGNED_SHORT_BIT |
|
||||
|
|
@ -1601,11 +1601,11 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
|
|||
const GLvoid *ptr)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 2 : 1;
|
||||
const GLint sizeMin = _mesa_is_gles1(ctx) ? 2 : 1;
|
||||
const GLuint unit = ctx->Array.ActiveTexture;
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (SHORT_BIT | INT_BIT |
|
||||
HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
|
||||
|
|
@ -1630,11 +1630,11 @@ _mesa_VertexArrayTexCoordOffsetEXT(GLuint vaobj, GLuint buffer, GLint size,
|
|||
GLenum type, GLsizei stride, GLintptr offset)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 2 : 1;
|
||||
const GLint sizeMin = _mesa_is_gles1(ctx) ? 2 : 1;
|
||||
const GLuint unit = ctx->Array.ActiveTexture;
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (SHORT_BIT | INT_BIT |
|
||||
HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
|
||||
|
|
@ -1668,11 +1668,11 @@ _mesa_VertexArrayMultiTexCoordOffsetEXT(GLuint vaobj, GLuint buffer, GLenum texu
|
|||
GLintptr offset)
|
||||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
const GLint sizeMin = (ctx->API == API_OPENGLES) ? 2 : 1;
|
||||
const GLint sizeMin = _mesa_is_gles1(ctx) ? 2 : 1;
|
||||
const GLuint unit = texunit - GL_TEXTURE0;
|
||||
|
||||
GLenum format = GL_RGBA;
|
||||
const GLbitfield legalTypes = (ctx->API == API_OPENGLES)
|
||||
const GLbitfield legalTypes = _mesa_is_gles1(ctx)
|
||||
? (BYTE_BIT | SHORT_BIT | FLOAT_BIT | FIXED_ES_BIT)
|
||||
: (SHORT_BIT | INT_BIT |
|
||||
HALF_BIT | FLOAT_BIT | DOUBLE_BIT |
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue