switch (pname) {
case GL_PACK_SWAP_BYTES:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
if (param == (GLint)ctx->Pack.SwapBytes)
return;
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE;
break;
case GL_PACK_LSB_FIRST:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
if (param == (GLint)ctx->Pack.LsbFirst)
return;
FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
ctx->Pack.LsbFirst = param ? GL_TRUE : GL_FALSE;
break;
case GL_PACK_ROW_LENGTH:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Pack.RowLength = param;
break;
case GL_PACK_IMAGE_HEIGHT:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Pack.ImageHeight = param;
break;
case GL_PACK_SKIP_PIXELS:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Pack.SkipPixels = param;
break;
case GL_PACK_SKIP_ROWS:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Pack.SkipRows = param;
break;
case GL_PACK_SKIP_IMAGES:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Pack.Alignment = param;
break;
case GL_PACK_INVERT_MESA:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
if (!ctx->Extensions.MESA_pack_invert) {
_mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" );
return;
break;
case GL_UNPACK_SWAP_BYTES:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
if (param == (GLint)ctx->Unpack.SwapBytes)
return;
if ((GLint)ctx->Unpack.SwapBytes == param)
ctx->Unpack.SwapBytes = param ? GL_TRUE : GL_FALSE;
break;
case GL_UNPACK_LSB_FIRST:
+ if (!_mesa_is_desktop_gl(ctx))
+ goto invalid_enum_error;
if (param == (GLint)ctx->Unpack.LsbFirst)
return;
if ((GLint)ctx->Unpack.LsbFirst == param)
ctx->Unpack.LsbFirst = param ? GL_TRUE : GL_FALSE;
break;
case GL_UNPACK_ROW_LENGTH:
+ if (ctx->API == API_OPENGLES)
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Unpack.RowLength = param;
break;
case GL_UNPACK_IMAGE_HEIGHT:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Unpack.ImageHeight = param;
break;
case GL_UNPACK_SKIP_PIXELS:
+ if (ctx->API == API_OPENGLES)
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Unpack.SkipPixels = param;
break;
case GL_UNPACK_SKIP_ROWS:
+ if (ctx->API == API_OPENGLES)
+ goto invalid_enum_error;
if (param<0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Unpack.SkipRows = param;
break;
case GL_UNPACK_SKIP_IMAGES:
+ if (!_mesa_is_desktop_gl(ctx) && !_mesa_is_gles3(ctx))
+ goto invalid_enum_error;
if (param < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glPixelStore(param)" );
return;
ctx->Unpack.Alignment = param;
break;
default:
- _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" );
- return;
+ goto invalid_enum_error;
}
+
+ return;
+
+invalid_enum_error:
+ _mesa_error( ctx, GL_INVALID_ENUM, "glPixelStore" );
+ return;
}