mesa: default DEPTH_TEXTURE_MODE should be RED in the core profile
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 Jul 2013 20:29:08 +0000 (22:29 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 30 Jul 2013 20:36:21 +0000 (22:36 +0200)
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i915/intel_tex.c
src/mesa/drivers/dri/i965/intel_tex.c
src/mesa/drivers/dri/nouveau/nouveau_texture.c
src/mesa/drivers/dri/r200/r200_tex.c
src/mesa/drivers/dri/radeon/radeon_tex.c
src/mesa/main/texobj.c
src/mesa/main/texobj.h
src/mesa/state_tracker/st_cb_texture.c

index 6ac5a09b042c92254a68d11763948c58d555bd6d..ce17395778edcaeba09fc3c6b31dcc4a85145f40 100644 (file)
@@ -39,7 +39,7 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
    if (obj == NULL)
       return NULL;
 
-   _mesa_initialize_texture_object(&obj->base, name, target);
+   _mesa_initialize_texture_object(ctx, &obj->base, name, target);
 
    obj->needs_validate = true;
 
index 175387d54bdab78705e2033de8d2a550d19ca71b..eecffc970bb2cac3a66392c1a3256fe208e0d97e 100644 (file)
@@ -39,7 +39,7 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
    if (obj == NULL)
       return NULL;
 
-   _mesa_initialize_texture_object(&obj->base, name, target);
+   _mesa_initialize_texture_object(ctx, &obj->base, name, target);
 
    obj->needs_validate = true;
 
index 0889b5a54d1cf8e3654915d69ffb859d706c8e32..da74e8f4207a6463c72e3f6921b5721552cedd67 100644 (file)
@@ -46,7 +46,7 @@ nouveau_texture_new(struct gl_context *ctx, GLuint name, GLenum target)
 {
        struct nouveau_texture *nt = CALLOC_STRUCT(nouveau_texture);
 
-       _mesa_initialize_texture_object(&nt->base, name, target);
+       _mesa_initialize_texture_object(ctx, &nt->base, name, target);
 
        return &nt->base;
 }
index 31a65c86748b362273ca204df19068b70efd9f19..57e96dec97b6d46a74baa84271e3a494548535c4 100644 (file)
@@ -476,7 +476,7 @@ static struct gl_texture_object *r200NewTextureObject(struct gl_context * ctx,
           __FUNCTION__, ctx,
           _mesa_lookup_enum_by_nr(target), t);
 
-   _mesa_initialize_texture_object(&t->base, name, target);
+   _mesa_initialize_texture_object(ctx, &t->base, name, target);
    t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
 
    /* Initialize hardware state */
index 301949db2467bbbe9ebe4cbe46ba556e3fc5f8de..fe8d8ed02f112e00ad7fad64769cea9270f42878 100644 (file)
@@ -410,7 +410,7 @@ radeonNewTextureObject( struct gl_context *ctx, GLuint name, GLenum target )
    r100ContextPtr rmesa = R100_CONTEXT(ctx);
    radeonTexObj* t = CALLOC_STRUCT(radeon_tex_obj);
 
-   _mesa_initialize_texture_object(&t->base, name, target);
+   _mesa_initialize_texture_object(ctx, &t->base, name, target);
    t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
 
    t->border_fallback = GL_FALSE;
index 2168bffb1a378fa61b3c3c466e2fa776f47cb20f..a2b112c8f86d1c55852709e93bacf28f32f471f7 100644 (file)
@@ -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;
index a99f45bfa292dff37600790e1e6c3c7ccb6302b4..0df088ce42483473fe53ba95f2e570060ac561df 100644 (file)
@@ -50,7 +50,8 @@ extern struct gl_texture_object *
 _mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target );
 
 extern 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 );
 
 extern void
index c167744f4dde16eb8dded1c2d08e59187dba5f30..faa9ee3f6c7686a48d9e31675226f2d52c03a219 100644 (file)
@@ -141,7 +141,7 @@ st_NewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
    struct st_texture_object *obj = ST_CALLOC_STRUCT(st_texture_object);
 
    DBG("%s\n", __FUNCTION__);
-   _mesa_initialize_texture_object(&obj->base, name, target);
+   _mesa_initialize_texture_object(ctx, &obj->base, name, target);
 
    return &obj->base;
 }