summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_tex.c
diff options
context:
space:
mode:
authorPauli Nieminen <pauli.nieminen@linux.intel.com>2012-06-12 21:38:52 +0300
committerEric Anholt <eric@anholt.net>2012-08-01 15:31:16 -0700
commit6f6bd8aedcf2b2f0e1ca9a1fa7ded1cb1f5a88ed (patch)
treec58ab2a0d102202d55daf280c09141bb74198f6c /src/mesa/drivers/dri/radeon/radeon_tex.c
parent10169e7adc40b445776453fcc6d3227d7dda5879 (diff)
downloadexternal_mesa3d-6f6bd8aedcf2b2f0e1ca9a1fa7ded1cb1f5a88ed.zip
external_mesa3d-6f6bd8aedcf2b2f0e1ca9a1fa7ded1cb1f5a88ed.tar.gz
external_mesa3d-6f6bd8aedcf2b2f0e1ca9a1fa7ded1cb1f5a88ed.tar.bz2
radeon&r200: Add support for ARB_sampler_objects
Preparation for the mandatory support of ARB_sampler_objects. I have tested this patch with rv280 only. Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com> Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_tex.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_tex.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c
index 71bd464..fcd9a76 100644
--- a/src/mesa/drivers/dri/radeon/radeon_tex.c
+++ b/src/mesa/drivers/dri/radeon/radeon_tex.c
@@ -312,6 +312,17 @@ static void radeonTexEnv( struct gl_context *ctx, GLenum target,
}
}
+void radeonTexUpdateParameters(struct gl_context *ctx, GLuint unit)
+{
+ struct gl_sampler_object *samp = _mesa_get_samplerobj(ctx, unit);
+ radeonTexObj* t = radeon_tex_obj(ctx->Texture.Unit[unit]._Current);
+
+ radeonSetTexMaxAnisotropy(t , samp->MaxAnisotropy);
+ radeonSetTexFilter(t, samp->MinFilter, samp->MagFilter);
+ radeonSetTexWrap(t, samp->WrapS, samp->WrapT);
+ radeonSetTexBorderColor(t, samp->BorderColor.f);
+}
+
/**
* Changes variables and flags for a state update, which will happen at the
@@ -328,22 +339,6 @@ static void radeonTexParameter( struct gl_context *ctx, GLenum target,
_mesa_lookup_enum_by_nr( pname ) );
switch ( pname ) {
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- radeonSetTexMaxAnisotropy( t, texObj->Sampler.MaxAnisotropy );
- radeonSetTexFilter( t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter );
- break;
-
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- radeonSetTexWrap( t, texObj->Sampler.WrapS, texObj->Sampler.WrapT );
- break;
-
- case GL_TEXTURE_BORDER_COLOR:
- radeonSetTexBorderColor( t, texObj->Sampler.BorderColor.f );
- break;
-
case GL_TEXTURE_BASE_LEVEL:
case GL_TEXTURE_MAX_LEVEL:
case GL_TEXTURE_MIN_LOD:
@@ -433,6 +428,16 @@ radeonNewTextureObject( struct gl_context *ctx, GLuint name, GLenum target )
}
+static struct gl_sampler_object *
+radeonNewSamplerObject(struct gl_context *ctx, GLuint name)
+{
+ r100ContextPtr rmesa = R100_CONTEXT(ctx);
+ struct gl_sampler_object *samp = _mesa_new_sampler_object(ctx, name);
+ if (samp)
+ samp->MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
+ return samp;
+}
+
void radeonInitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *functions )
{
@@ -445,4 +450,5 @@ void radeonInitTextureFuncs( radeonContextPtr radeon, struct dd_function_table *
functions->TexEnv = radeonTexEnv;
functions->TexParameter = radeonTexParameter;
functions->TexGen = radeonTexGen;
+ functions->NewSamplerObject = radeonNewSamplerObject;
}