summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-07-30 22:29:08 +0200
committerMarek Olšák <[email protected]>2013-07-30 22:36:21 +0200
commita6b1a7c0d269256ffbaf2300710601cde8ac872c (patch)
treefb78573248919c368150df857ddf7c8cc3402ec6 /src/mesa/main/texobj.c
parent63569dbeb0b33776043b141571700123b7cf6bf5 (diff)
mesa: default DEPTH_TEXTURE_MODE should be RED in the core profile
Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 2168bffb1a3..a2b112c8f86 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -83,7 +83,7 @@ _mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target )
struct gl_texture_object *obj;
(void) ctx;
obj = MALLOC_STRUCT(gl_texture_object);
- _mesa_initialize_texture_object(obj, name, target);
+ _mesa_initialize_texture_object(ctx, obj, name, target);
return obj;
}
@@ -95,7 +95,8 @@ _mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target )
* \param target the texture target
*/
void
-_mesa_initialize_texture_object( struct gl_texture_object *obj,
+_mesa_initialize_texture_object( struct gl_context *ctx,
+ struct gl_texture_object *obj,
GLuint name, GLenum target )
{
ASSERT(target == 0 ||
@@ -146,7 +147,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj,
obj->Sampler.MaxAnisotropy = 1.0;
obj->Sampler.CompareMode = GL_NONE; /* ARB_shadow */
obj->Sampler.CompareFunc = GL_LEQUAL; /* ARB_shadow */
- obj->DepthMode = GL_LUMINANCE;
+ obj->DepthMode = ctx->API == API_OPENGL_CORE ? GL_RED : GL_LUMINANCE;
obj->Sampler.CubeMapSeamless = GL_FALSE;
obj->Swizzle[0] = GL_RED;
obj->Swizzle[1] = GL_GREEN;