aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-26 10:45:42 +0100
committermarha <marha@users.sourceforge.net>2012-01-26 10:45:42 +0100
commit40bdd8b27f5c730b8d0c9a189e89fb51a5400611 (patch)
tree23d7ead2d11ebc95c1d0a5e57cdb2ee5b358110b /mesalib/src/mesa/main
parentffbc36adb7ea5781a93731212226c47f1d49da5e (diff)
parenteb4c088eb71f93b9639f4ff651523d794f1433f7 (diff)
downloadvcxsrv-40bdd8b27f5c730b8d0c9a189e89fb51a5400611.tar.gz
vcxsrv-40bdd8b27f5c730b8d0c9a189e89fb51a5400611.tar.bz2
vcxsrv-40bdd8b27f5c730b8d0c9a189e89fb51a5400611.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/fbobject.c27
-rw-r--r--mesalib/src/mesa/main/framebuffer.c2
-rw-r--r--mesalib/src/mesa/main/image.c12
-rw-r--r--mesalib/src/mesa/main/mtypes.h3
-rw-r--r--mesalib/src/mesa/main/texformat.c10
-rw-r--r--mesalib/src/mesa/main/teximage.c14
-rw-r--r--mesalib/src/mesa/main/version.c2
7 files changed, 48 insertions, 22 deletions
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 2b3ac2e25..987d687b9 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -1225,7 +1225,8 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_RGBA8I_EXT:
case GL_RGBA16I_EXT:
case GL_RGBA32I_EXT:
- return ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
+ return ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer ? GL_RGBA : 0;
case GL_RGB8UI_EXT:
case GL_RGB16UI_EXT:
@@ -1233,7 +1234,8 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_RGB8I_EXT:
case GL_RGB16I_EXT:
case GL_RGB32I_EXT:
- return ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
+ return ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer ? GL_RGB : 0;
case GL_R8UI:
case GL_R8I:
@@ -1241,8 +1243,9 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_R16I:
case GL_R32UI:
case GL_R32I:
- return ctx->Extensions.ARB_texture_rg &&
- ctx->Extensions.EXT_texture_integer ? GL_RED : 0;
+ return ctx->VersionMajor >= 3 ||
+ (ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.EXT_texture_integer) ? GL_RED : 0;
case GL_RG8UI:
case GL_RG8I:
@@ -1250,8 +1253,9 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
case GL_RG16I:
case GL_RG32UI:
case GL_RG32I:
- return ctx->Extensions.ARB_texture_rg &&
- ctx->Extensions.EXT_texture_integer ? GL_RG : 0;
+ return ctx->VersionMajor >= 3 ||
+ (ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.EXT_texture_integer) ? GL_RG : 0;
case GL_INTENSITY8I_EXT:
case GL_INTENSITY8UI_EXT:
@@ -1280,6 +1284,15 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat)
return ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0;
+ case GL_ALPHA8I_EXT:
+ case GL_ALPHA8UI_EXT:
+ case GL_ALPHA16I_EXT:
+ case GL_ALPHA16UI_EXT:
+ case GL_ALPHA32I_EXT:
+ case GL_ALPHA32UI_EXT:
+ return ctx->Extensions.EXT_texture_integer &&
+ ctx->Extensions.ARB_framebuffer_object ? GL_ALPHA : 0;
+
case GL_RGB10_A2UI:
return ctx->Extensions.ARB_texture_rgb10_a2ui ? GL_RGBA : 0;
default:
@@ -2392,7 +2405,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment,
"glGetFramebufferAttachmentParameterivEXT(pname)");
}
else {
- if (ctx->Extensions.EXT_framebuffer_sRGB && ctx->Const.sRGBCapable) {
+ if (ctx->Extensions.EXT_framebuffer_sRGB) {
*params = _mesa_get_format_color_encoding(att->Renderbuffer->Format);
}
else {
diff --git a/mesalib/src/mesa/main/framebuffer.c b/mesalib/src/mesa/main/framebuffer.c
index 7c3c4e345..ea14148de 100644
--- a/mesalib/src/mesa/main/framebuffer.c
+++ b/mesalib/src/mesa/main/framebuffer.c
@@ -527,7 +527,7 @@ _mesa_update_framebuffer_visual(struct gl_context *ctx,
fb->Visual.samples = rb->NumSamples;
fb->Visual.sampleBuffers = rb->NumSamples > 0 ? 1 : 0;
if (_mesa_get_format_color_encoding(fmt) == GL_SRGB)
- fb->Visual.sRGBCapable = ctx->Const.sRGBCapable;
+ fb->Visual.sRGBCapable = ctx->Extensions.EXT_framebuffer_sRGB;
break;
}
}
diff --git a/mesalib/src/mesa/main/image.c b/mesalib/src/mesa/main/image.c
index 8b65cf0f0..3491704f8 100644
--- a/mesalib/src/mesa/main/image.c
+++ b/mesalib/src/mesa/main/image.c
@@ -536,7 +536,8 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
case GL_UNSIGNED_SHORT:
case GL_INT:
case GL_UNSIGNED_INT:
- return ctx->Extensions.EXT_texture_integer;
+ return ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer;
default:
return GL_FALSE;
}
@@ -549,7 +550,8 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
case GL_UNSIGNED_SHORT:
case GL_INT:
case GL_UNSIGNED_INT:
- return ctx->Extensions.EXT_texture_integer;
+ return ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer;
case GL_UNSIGNED_BYTE_3_3_2:
case GL_UNSIGNED_BYTE_2_3_3_REV:
case GL_UNSIGNED_SHORT_5_6_5:
@@ -568,7 +570,8 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
case GL_INT:
case GL_UNSIGNED_INT:
/* NOTE: no packed formats w/ BGR format */
- return ctx->Extensions.EXT_texture_integer;
+ return ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer;
default:
return GL_FALSE;
}
@@ -582,7 +585,8 @@ _mesa_is_legal_format_and_type(const struct gl_context *ctx,
case GL_UNSIGNED_SHORT:
case GL_INT:
case GL_UNSIGNED_INT:
- return ctx->Extensions.EXT_texture_integer;
+ return ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer;
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_4_4_4_4_REV:
case GL_UNSIGNED_SHORT_5_5_5_1:
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index 760113172..a2b01d05d 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -2808,9 +2808,6 @@ struct gl_constants
/** GL_EXT_gpu_shader4 */
GLint MinProgramTexelOffset, MaxProgramTexelOffset;
- /* GL_EXT_framebuffer_sRGB */
- GLboolean sRGBCapable; /* can enable sRGB blend/update on FBOs */
-
/* GL_ARB_robustness */
GLenum ResetStrategy;
diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c
index 259eb9044..5fdc2ab1f 100644
--- a/mesalib/src/mesa/main/texformat.c
+++ b/mesalib/src/mesa/main/texformat.c
@@ -706,6 +706,12 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
RETURN_IF_SUPPORTED(MESA_FORMAT_INTENSITY_INT32);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_INT32);
break;
+ }
+ }
+
+ if (ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer) {
+ switch (internalFormat) {
case GL_RGB8UI_EXT:
RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_UINT8);
RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_UINT8);
@@ -822,7 +828,9 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
}
}
- if (ctx->Extensions.ARB_texture_rg && ctx->Extensions.EXT_texture_integer) {
+ if (ctx->VersionMajor >= 3 ||
+ (ctx->Extensions.ARB_texture_rg &&
+ ctx->Extensions.EXT_texture_integer)) {
switch (internalFormat) {
case GL_R8UI:
RETURN_IF_SUPPORTED(MESA_FORMAT_R_UINT8);
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c
index c64b10b04..d11425d5e 100644
--- a/mesalib/src/mesa/main/teximage.c
+++ b/mesalib/src/mesa/main/teximage.c
@@ -323,7 +323,8 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
}
#endif /* FEATURE_EXT_texture_sRGB */
- if (ctx->Extensions.EXT_texture_integer) {
+ if (ctx->VersionMajor >= 3 ||
+ ctx->Extensions.EXT_texture_integer) {
switch (internalFormat) {
case GL_RGBA8UI_EXT:
case GL_RGBA16UI_EXT:
@@ -340,6 +341,11 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
case GL_RGB16I_EXT:
case GL_RGB32I_EXT:
return GL_RGB;
+ }
+ }
+
+ if (ctx->Extensions.EXT_texture_integer) {
+ switch (internalFormat) {
case GL_ALPHA8UI_EXT:
case GL_ALPHA16UI_EXT:
case GL_ALPHA32UI_EXT:
@@ -391,7 +397,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
case GL_R16UI:
case GL_R32I:
case GL_R32UI:
- if (!ctx->Extensions.EXT_texture_integer)
+ if (ctx->VersionMajor < 3 && !ctx->Extensions.EXT_texture_integer)
break;
/* FALLTHROUGH */
case GL_R8:
@@ -416,7 +422,7 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
case GL_RG16UI:
case GL_RG32I:
case GL_RG32UI:
- if (!ctx->Extensions.EXT_texture_integer)
+ if (ctx->VersionMajor < 3 && !ctx->Extensions.EXT_texture_integer)
break;
/* FALLTHROUGH */
case GL_RG:
@@ -1680,7 +1686,7 @@ texture_error_check( struct gl_context *ctx,
}
/* additional checks for integer textures */
- if (ctx->Extensions.EXT_texture_integer &&
+ if ((ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) &&
(_mesa_is_integer_format(format) !=
_mesa_is_integer_format(internalFormat))) {
if (!isProxy) {
diff --git a/mesalib/src/mesa/main/version.c b/mesalib/src/mesa/main/version.c
index 92ae9c659..5b8b65ddf 100644
--- a/mesalib/src/mesa/main/version.c
+++ b/mesalib/src/mesa/main/version.c
@@ -77,7 +77,6 @@ _mesa_override_glsl_version(struct gl_context *ctx)
/**
* Examine enabled GL extensions to determine GL version.
- * Return major and minor version numbers.
*/
static void
compute_version(struct gl_context *ctx)
@@ -140,7 +139,6 @@ compute_version(struct gl_context *ctx)
ctx->Extensions.EXT_framebuffer_sRGB &&
ctx->Extensions.EXT_packed_float &&
ctx->Extensions.EXT_texture_array &&
- ctx->Extensions.EXT_texture_integer &&
ctx->Extensions.EXT_texture_shared_exponent &&
ctx->Extensions.EXT_transform_feedback &&
ctx->Extensions.NV_conditional_render);