Commit dbd6135b authored by Paul Berry's avatar Paul Berry

mesa: Rename API_OPENGL to API_OPENGL_COMPAT.

This should help avoid confusion now that we're using the gl_api enum
to distinguishing between core and compatibility API's.  The
corresponding enum value for core API's is API_OPENGL_CORE.
Acked-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Acked-by: Matt Turner's avatarMatt Turner <mattst88@gmail.com>
Acked-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
parent 3e163a13
......@@ -81,10 +81,10 @@ dri_create_context(gl_api api, const struct gl_config * visual,
case API_OPENGLES2:
attribs.profile = ST_PROFILE_OPENGL_ES2;
break;
case API_OPENGL:
case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
attribs.profile = api == API_OPENGL ? ST_PROFILE_DEFAULT
: ST_PROFILE_OPENGL_CORE;
attribs.profile = api == API_OPENGL_COMPAT ? ST_PROFILE_DEFAULT
: ST_PROFILE_OPENGL_CORE;
attribs.major = major_version;
attribs.minor = minor_version;
......
......@@ -173,7 +173,7 @@ gl_shader *
read_builtins(GLenum target, const char *protos, const char **functions, unsigned count)
{
struct gl_context fakeCtx;
fakeCtx.API = API_OPENGL;
fakeCtx.API = API_OPENGL_COMPAT;
fakeCtx.Const.GLSLVersion = 140;
fakeCtx.Extensions.ARB_ES2_compatibility = true;
fakeCtx.Const.ForceGLSLExtensionsWarn = false;
......
......@@ -111,7 +111,7 @@ main (int argc, char *argv[])
if (shader == NULL)
return 1;
ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL);
ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL_COMPAT);
printf("%s", shader);
fprintf(stderr, "%s", info_log);
......
......@@ -223,7 +223,7 @@ main(int argc, char **argv)
if (argc <= optind)
usage_fail(argv[0]);
initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL);
initialize_context(ctx, (glsl_es) ? API_OPENGLES2 : API_OPENGL_COMPAT);
struct gl_shader_program *whole_program;
......
......@@ -197,7 +197,7 @@ int test_optpass(int argc, char **argv)
struct gl_context local_ctx;
struct gl_context *ctx = &local_ctx;
initialize_context_to_defaults(ctx, API_OPENGL);
initialize_context_to_defaults(ctx, API_OPENGL_COMPAT);
ctx->Driver.NewShader = _mesa_new_shader;
......
......@@ -166,7 +166,7 @@ class PrintCode(gl_XML.gl_print_base):
condition_parts = []
if f.desktop:
if f.deprecated:
condition_parts.append('ctx->API == API_OPENGL')
condition_parts.append('ctx->API == API_OPENGL_COMPAT')
else:
condition_parts.append('_mesa_is_desktop_gl(ctx)')
if 'es1' in f.api_map:
......
......@@ -567,7 +567,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
save->PolygonCull = ctx->Polygon.CullFlag;
_mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL);
_mesa_set_enable(ctx, GL_POLYGON_OFFSET_FILL, GL_FALSE);
if (ctx->API == API_OPENGL) {
if (ctx->API == API_OPENGL_COMPAT) {
_mesa_set_enable(ctx, GL_POLYGON_SMOOTH, GL_FALSE);
_mesa_set_enable(ctx, GL_POLYGON_STIPPLE, GL_FALSE);
}
......@@ -580,14 +580,14 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
}
if (state & MESA_META_SHADER) {
if (ctx->API == API_OPENGL && ctx->Extensions.ARB_vertex_program) {
if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) {
save->VertexProgramEnabled = ctx->VertexProgram.Enabled;
_mesa_reference_vertprog(ctx, &save->VertexProgram,
ctx->VertexProgram.Current);
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB, GL_FALSE);
}
if (ctx->API == API_OPENGL && ctx->Extensions.ARB_fragment_program) {
if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_fragment_program) {
save->FragmentProgramEnabled = ctx->FragmentProgram.Enabled;
_mesa_reference_fragprog(ctx, &save->FragmentProgram,
ctx->FragmentProgram.Current);
......@@ -623,7 +623,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
save->EnvMode = ctx->Texture.Unit[0].EnvMode;
/* Disable all texture units */
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
save->TexEnabled[u] = ctx->Texture.Unit[u].Enabled;
save->TexGenEnabled[u] = ctx->Texture.Unit[u].TexGenEnabled;
......@@ -636,7 +636,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
if (ctx->Extensions.OES_EGL_image_external)
_mesa_set_enable(ctx, GL_TEXTURE_EXTERNAL_OES, GL_FALSE);
if (ctx->API == API_OPENGL) {
if (ctx->API == API_OPENGL_COMPAT) {
_mesa_set_enable(ctx, GL_TEXTURE_1D, GL_FALSE);
_mesa_set_enable(ctx, GL_TEXTURE_3D, GL_FALSE);
if (ctx->Extensions.NV_texture_rectangle)
......@@ -661,7 +661,7 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
/* set defaults for unit[0] */
_mesa_ActiveTexture(GL_TEXTURE0);
_mesa_ClientActiveTexture(GL_TEXTURE0);
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
}
}
......@@ -885,7 +885,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_PolygonMode(GL_FRONT, save->FrontPolygonMode);
_mesa_PolygonMode(GL_BACK, save->BackPolygonMode);
}
if (ctx->API == API_OPENGL) {
if (ctx->API == API_OPENGL_COMPAT) {
_mesa_set_enable(ctx, GL_POLYGON_STIPPLE, save->PolygonStipple);
_mesa_set_enable(ctx, GL_POLYGON_SMOOTH, save->PolygonSmooth);
}
......@@ -900,7 +900,7 @@ _mesa_meta_end(struct gl_context *ctx)
}
if (state & MESA_META_SHADER) {
if (ctx->API == API_OPENGL && ctx->Extensions.ARB_vertex_program) {
if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_vertex_program) {
_mesa_set_enable(ctx, GL_VERTEX_PROGRAM_ARB,
save->VertexProgramEnabled);
_mesa_reference_vertprog(ctx, &ctx->VertexProgram.Current,
......@@ -908,7 +908,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_reference_vertprog(ctx, &save->VertexProgram, NULL);
}
if (ctx->API == API_OPENGL && ctx->Extensions.ARB_fragment_program) {
if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_fragment_program) {
_mesa_set_enable(ctx, GL_FRAGMENT_PROGRAM_ARB,
save->FragmentProgramEnabled);
_mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current,
......@@ -941,7 +941,7 @@ _mesa_meta_end(struct gl_context *ctx)
_mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled);
_mesa_ClearStencil(stencil->Clear);
if (ctx->API == API_OPENGL && ctx->Extensions.EXT_stencil_two_side) {
if (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_stencil_two_side) {
_mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT,
stencil->TestTwoSide);
_mesa_ActiveStencilFaceEXT(stencil->ActiveFace
......@@ -973,7 +973,7 @@ _mesa_meta_end(struct gl_context *ctx)
ASSERT(ctx->Texture.CurrentUnit == 0);
/* restore texenv for unit[0] */
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
_mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, save->EnvMode);
}
......@@ -988,7 +988,7 @@ _mesa_meta_end(struct gl_context *ctx)
}
/* Restore fixed function texture enables, texgen */
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES) {
if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES) {
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u].Enabled != save->TexEnabled[u]) {
FLUSH_VERTICES(ctx, _NEW_TEXTURE);
......@@ -3268,7 +3268,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
_mesa_BindFramebuffer(GL_FRAMEBUFFER_EXT, mipmap->FBO);
if (ctx->API == API_OPENGL || ctx->API == API_OPENGLES)
if (ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGLES)
_mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE);
else
assert(!genMipmapSave);
......
......@@ -183,7 +183,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
switch (api) {
case __DRI_API_OPENGL:
mesa_api = API_OPENGL;
mesa_api = API_OPENGL_COMPAT;
break;
case __DRI_API_GLES:
mesa_api = API_OPENGLES;
......@@ -221,13 +221,13 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
}
/* Mesa does not support the GL_ARB_compatibilty extension or the
* compatibility profile. This means that we treat a API_OPENGL 3.1 as
* API_OPENGL_CORE and reject API_OPENGL 3.2+.
* compatibility profile. This means that we treat a API_OPENGL_COMPAT 3.1 as
* API_OPENGL_CORE and reject API_OPENGL_COMPAT 3.2+.
*/
if (mesa_api == API_OPENGL && major_version == 3 && minor_version == 1)
if (mesa_api == API_OPENGL_COMPAT && major_version == 3 && minor_version == 1)
mesa_api = API_OPENGL_CORE;
if (mesa_api == API_OPENGL
if (mesa_api == API_OPENGL_COMPAT
&& ((major_version > 3)
|| (major_version == 3 && minor_version >= 2))) {
*error = __DRI_CTX_ERROR_BAD_API;
......@@ -244,7 +244,7 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api,
* anything specific about this case. However, none of the known flags
* have any meaning in an ES context, so this seems safe.
*/
if (mesa_api != API_OPENGL
if (mesa_api != API_OPENGL_COMPAT
&& mesa_api != API_OPENGL_CORE
&& flags != 0) {
*error = __DRI_CTX_ERROR_BAD_FLAG;
......
......@@ -117,7 +117,7 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
switch (api) {
case __DRI_API_OPENGL:
mesa_api = API_OPENGL;
mesa_api = API_OPENGL_COMPAT;
break;
case __DRI_API_GLES:
mesa_api = API_OPENGLES;
......
......@@ -175,7 +175,7 @@ i915CreateContext(int api,
* and version.
*/
switch (api) {
case API_OPENGL: {
case API_OPENGL_COMPAT: {
const unsigned max_version =
(ctx->Extensions.ARB_fragment_shader &&
ctx->Extensions.ARB_occlusion_query) ? 20 : 15;
......
......@@ -101,7 +101,7 @@ brwCreateContext(int api,
/* Determine max_supported_version. */
switch (api) {
case API_OPENGL:
case API_OPENGL_COMPAT:
max_supported_version = supports_gl30 ? 30 : 21;
break;
case API_OPENGLES:
......
......@@ -797,7 +797,7 @@ intelCreateContext(gl_api api,
sharedContextPrivate);
} else {
switch (api) {
case API_OPENGL:
case API_OPENGL_COMPAT:
if (major_version > 1 || minor_version > 3) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
success = false;
......
......@@ -60,7 +60,7 @@ nouveau_context_create(gl_api api,
struct gl_context *ctx;
switch (api) {
case API_OPENGL:
case API_OPENGL_COMPAT:
/* Do after-the-fact version checking (below).
*/
break;
......@@ -133,7 +133,7 @@ nouveau_context_init(struct gl_context *ctx, struct nouveau_screen *screen,
nouveau_fbo_functions_init(&functions);
/* Initialize the mesa context. */
_mesa_initialize_context(ctx, API_OPENGL, visual,
_mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual,
share_ctx, &functions);
nouveau_state_init(ctx);
......
......@@ -213,7 +213,7 @@ GLboolean r200CreateContext( gl_api api,
int tcl_mode;
switch (api) {
case API_OPENGL:
case API_OPENGL_COMPAT:
if (major_version > 1 || minor_version > 3) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
return GL_FALSE;
......
......@@ -147,7 +147,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
else
shareCtx = NULL;
if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL,
if (!_mesa_initialize_context(&radeon->glCtx, API_OPENGL_COMPAT,
glVisual, shareCtx,
functions))
return GL_FALSE;
......
......@@ -179,7 +179,7 @@ r100CreateContext( gl_api api,
int tcl_mode, fthrottle_mode;
switch (api) {
case API_OPENGL:
case API_OPENGL_COMPAT:
if (major_version > 1 || minor_version > 3) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
return GL_FALSE;
......
......@@ -706,7 +706,7 @@ dri_create_context(gl_api api,
(void) flags;
switch (api) {
case API_OPENGL:
case API_OPENGL_COMPAT:
if (major_version > 2
|| (major_version == 2 && minor_version > 1)) {
*error = __DRI_CTX_ERROR_BAD_VERSION;
......@@ -768,7 +768,7 @@ dri_create_context(gl_api api,
switch (api) {
case API_OPENGL_CORE:
/* XXX fix me, fall-through for now */
case API_OPENGL:
case API_OPENGL_COMPAT:
_mesa_enable_1_3_extensions(mesaCtx);
_mesa_enable_1_4_extensions(mesaCtx);
_mesa_enable_1_5_extensions(mesaCtx);
......
......@@ -709,7 +709,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
functions.GetBufferSize = NULL;
if (!_mesa_initialize_context(&osmesa->mesa,
API_OPENGL,
API_OPENGL_COMPAT,
osmesa->gl_visual,
sharelist ? &sharelist->mesa
: (struct gl_context *) NULL,
......
......@@ -610,7 +610,7 @@ WMesaContext WMesaCreateContext(HDC hDC,
/* initialize the Mesa context data */
ctx = &c->gl_ctx;
_mesa_initialize_context(ctx, API_OPENGL, visual,
_mesa_initialize_context(ctx, API_OPENGL_COMPAT, visual,
NULL, &functions);
/* visual no longer needed - it was copied by _mesa_initialize_context() */
......
......@@ -900,7 +900,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list )
/* initialize with default driver functions, then plug in XMesa funcs */
_mesa_init_driver_functions(&functions);
xmesa_init_driver_functions(v, &functions);
if (!_mesa_initialize_context(mesaCtx, API_OPENGL, &v->mesa_visual,
if (!_mesa_initialize_context(mesaCtx, API_OPENGL_COMPAT, &v->mesa_visual,
share_list ? &(share_list->mesa) : (struct gl_context *) NULL,
&functions)) {
free(c);
......
......@@ -1507,7 +1507,7 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
SET_Color4ub(dest, _mesa_Color4ub);
SET_Materialf(dest, _mesa_Materialf);
}
if (ctx->API == API_OPENGL) {
if (ctx->API == API_OPENGL_COMPAT) {
SET_Color3b(dest, _mesa_Color3b);
SET_Color3d(dest, _mesa_Color3d);
SET_Color3i(dest, _mesa_Color3i);
......@@ -1654,7 +1654,7 @@ _mesa_loopback_init_api_table(const struct gl_context *ctx,
SET_FogCoorddv(dest, _mesa_FogCoorddv);
}
if (ctx->API == API_OPENGL) {
if (ctx->API == API_OPENGL_COMPAT) {
SET_VertexAttrib1sNV(dest, _mesa_VertexAttrib1sNV);
SET_VertexAttrib1dNV(dest, _mesa_VertexAttrib1dNV);
SET_VertexAttrib2sNV(dest, _mesa_VertexAttrib2sNV);
......
......@@ -124,7 +124,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
return GL_FALSE;
break;
case API_OPENGL:
case API_OPENGL_COMPAT:
case API_OPENGL_CORE:
{
const struct gl_shader_program *vsProg =
......@@ -219,7 +219,7 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
case GL_QUADS:
case GL_QUAD_STRIP:
case GL_POLYGON:
valid_enum = (ctx->API == API_OPENGL);
valid_enum = (ctx->API == API_OPENGL_COMPAT);
break;
case GL_LINES_ADJACENCY:
case GL_LINE_STRIP_ADJACENCY:
......
......@@ -1150,7 +1150,7 @@ _mesa_PopAttrib(void)
_mesa_PointParameteri(GL_POINT_SPRITE_R_MODE_NV,
ctx->Point.SpriteRMode);
if ((ctx->API == API_OPENGL && ctx->Version >= 20)
if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20)
|| ctx->API == API_OPENGL_CORE)
_mesa_PointParameterf(GL_POINT_SPRITE_COORD_ORIGIN,
(GLfloat)ctx->Point.SpriteOrigin);
......
......@@ -353,7 +353,7 @@ updated_drawbuffers(struct gl_context *ctx)
{
FLUSH_VERTICES(ctx, _NEW_BUFFERS);
if (ctx->API == API_OPENGL && !ctx->Extensions.ARB_ES2_compatibility) {
if (ctx->API == API_OPENGL_COMPAT && !ctx->Extensions.ARB_ES2_compatibility) {
struct gl_framebuffer *fb = ctx->DrawBuffer;
/* Flag the FBO as requiring validation. */
......
......@@ -963,7 +963,7 @@ _mesa_initialize_context(struct gl_context *ctx,
sizeof(ctx->TextureFormatSupported));
switch (ctx->API) {
case API_OPENGL:
case API_OPENGL_COMPAT:
ctx->Save = _mesa_create_save_table(ctx);
if (!ctx->Save) {
_mesa_reference_shared_state(ctx, &ctx->Shared, NULL);
......
......@@ -296,7 +296,7 @@ do { \
static inline GLboolean
_mesa_is_desktop_gl(const struct gl_context *ctx)
{
return ctx->API == API_OPENGL || ctx->API == API_OPENGL_CORE;
return ctx->API == API_OPENGL_COMPAT || ctx->API == API_OPENGL_CORE;
}
......
This diff is collapsed.
......@@ -41,9 +41,9 @@
enum {
DISABLE = 0,
GLL = 1 << API_OPENGL, /* GL Legacy / Compatibility */
GLL = 1 << API_OPENGL_COMPAT, /* GL Legacy / Compatibility */
GLC = 1 << API_OPENGL_CORE, /* GL Core */
GL = (1 << API_OPENGL) | (1 << API_OPENGL_CORE),
GL = (1 << API_OPENGL_COMPAT) | (1 << API_OPENGL_CORE),
ES1 = 1 << API_OPENGLES,
ES2 = 1 << API_OPENGLES2,
};
......
......@@ -1072,14 +1072,14 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_ALPHA8:
case GL_ALPHA12:
case GL_ALPHA16:
return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_ALPHA : 0;
case GL_LUMINANCE:
case GL_LUMINANCE4:
case GL_LUMINANCE8:
case GL_LUMINANCE12:
case GL_LUMINANCE16:
return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA:
case GL_LUMINANCE4_ALPHA4:
......@@ -1088,14 +1088,14 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_LUMINANCE12_ALPHA4:
case GL_LUMINANCE12_ALPHA12:
case GL_LUMINANCE16_ALPHA16:
return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_LUMINANCE_ALPHA : 0;
case GL_INTENSITY:
case GL_INTENSITY4:
case GL_INTENSITY8:
case GL_INTENSITY12:
case GL_INTENSITY16:
return ctx->API == API_OPENGL && ctx->Extensions.ARB_framebuffer_object
return ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_framebuffer_object
? GL_INTENSITY : 0;
case GL_RGB8:
return GL_RGB;
......@@ -1146,11 +1146,11 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
? GL_DEPTH_STENCIL_EXT : 0;
case GL_DEPTH_COMPONENT32F:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_buffer_float)
|| (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float)
? GL_DEPTH_COMPONENT : 0;
case GL_DEPTH32F_STENCIL8:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL && ctx->Extensions.ARB_depth_buffer_float)
|| (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.ARB_depth_buffer_float)
? GL_DEPTH_STENCIL : 0;
case GL_RED:
case GL_R16:
......@@ -1169,7 +1169,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
/* signed normalized texture formats */
case GL_R8_SNORM:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
|| (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RED : 0;
case GL_RED_SNORM:
case GL_R16_SNORM:
......@@ -1177,7 +1177,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
? GL_RED : 0;
case GL_RG8_SNORM:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
|| (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RG : 0;
case GL_RG_SNORM:
case GL_RG16_SNORM:
......@@ -1185,7 +1185,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
? GL_RG : 0;
case GL_RGB8_SNORM:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
|| (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RGB : 0;
case GL_RGB_SNORM:
case GL_RGB16_SNORM:
......@@ -1193,7 +1193,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
? GL_RGB : 0;
case GL_RGBA8_SNORM:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL && ctx->Extensions.EXT_texture_snorm)
|| (ctx->API == API_OPENGL_COMPAT && ctx->Extensions.EXT_texture_snorm)
? GL_RGBA : 0;
case GL_RGBA_SNORM:
case GL_RGBA16_SNORM:
......@@ -1202,37 +1202,37 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_ALPHA_SNORM:
case GL_ALPHA8_SNORM:
case GL_ALPHA16_SNORM:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
case GL_LUMINANCE_SNORM:
case GL_LUMINANCE8_SNORM:
case GL_LUMINANCE16_SNORM:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA_SNORM:
case GL_LUMINANCE8_ALPHA8_SNORM:
case GL_LUMINANCE16_ALPHA16_SNORM:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
case GL_INTENSITY_SNORM:
case GL_INTENSITY8_SNORM:
case GL_INTENSITY16_SNORM:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_snorm &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
case GL_R16F:
case GL_R32F:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL &&
|| (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_rg &&
ctx->Extensions.ARB_texture_float) ? GL_RED : 0;
case GL_RG16F:
case GL_RG32F:
return ctx->Version >= 30
|| (ctx->API == API_OPENGL &&
|| (ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_rg &&
ctx->Extensions.ARB_texture_float) ? GL_RG : 0;
case GL_RGB16F:
......@@ -1247,22 +1247,22 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
? GL_RGBA : 0;
case GL_ALPHA16F_ARB:
case GL_ALPHA32F_ARB:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
case GL_LUMINANCE16F_ARB:
case GL_LUMINANCE32F_ARB:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
case GL_LUMINANCE_ALPHA16F_ARB:
case GL_LUMINANCE_ALPHA32F_ARB:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
case GL_INTENSITY16F_ARB:
case GL_INTENSITY32F_ARB:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.ARB_texture_float &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
case GL_RGB9_E5:
......@@ -1321,7 +1321,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_INTENSITY16UI_EXT:
case GL_INTENSITY32I_EXT:
case GL_INTENSITY32UI_EXT:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0;
......@@ -1331,7 +1331,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_LUMINANCE16UI_EXT:
case GL_LUMINANCE32I_EXT:
case GL_LUMINANCE32UI_EXT:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE : 0;
......@@ -1341,7 +1341,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_LUMINANCE_ALPHA16UI_EXT:
case GL_LUMINANCE_ALPHA32I_EXT:
case GL_LUMINANCE_ALPHA32UI_EXT:
return ctx->API == API_OPENGL &&
return ctx->API == API_OPENGL_COMPAT &&
ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
......@@ -1351,7 +1351,7 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_ALPHA16UI_EXT:
case GL_ALPHA32I_EXT:
case GL_ALPHA32UI_EXT:
return ctx->API == API_OPENGL &&
return