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;
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;
{
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;
}
__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 */
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;
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;
}
* \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 ||
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;
_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
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;
}