mesa: fixup r600 DRI driver for sampler object changes
authorBrian Paul <brianp@vmware.com>
Mon, 11 Apr 2011 19:26:42 +0000 (13:26 -0600)
committerBrian Paul <brianp@vmware.com>
Mon, 11 Apr 2011 19:26:42 +0000 (13:26 -0600)
src/mesa/drivers/dri/r600/evergreen_tex.c
src/mesa/drivers/dri/r600/r600_tex.c
src/mesa/drivers/dri/r600/r600_texstate.c
src/mesa/drivers/dri/r600/r700_chip.c

index 5fdb91a63d12a2ffce4086a9a46a2eb0097bfef7..810f0e8b523fbce73686ba208ddcce0a714eee44 100644 (file)
@@ -581,7 +581,7 @@ static GLboolean evergreenGetTexFormat(struct gl_texture_object *tObj, gl_format
                default:
                        break;
                };
-               switch (tObj->DepthMode) {
+               switch (tObj->Sampler.DepthMode) {
                case GL_LUMINANCE:  /* X, X, X, ONE */
                        SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                                 SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
@@ -901,7 +901,7 @@ static void evergreenSetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, G
        }
 }
 
-static void evergreenSetTexSampler.BorderColor(radeonTexObjPtr t, const GLfloat color[4])
+static void evergreenSetTexBorderColor(radeonTexObjPtr t, const GLfloat color[4])
 {
        t->TD_PS_SAMPLER0_BORDER_ALPHA = *((uint32_t*)&(color[3]));
        t->TD_PS_SAMPLER0_BORDER_RED = *((uint32_t*)&(color[2]));
@@ -1022,21 +1022,21 @@ static GLboolean evergreen_setup_hardware_state(struct gl_context * ctx, struct
        SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask);
     
        SETfield(t->SQ_TEX_SAMPLER1,
-                    EG_S_FIXED(CLAMP(t->base.MinLod - t->minLod, 0, 15), 8),
+                    EG_S_FIXED(CLAMP(t->base.Sampler.MinLod - t->minLod, 0, 15), 8),
                     EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_shift, 
              EG_SQ_TEX_SAMPLER_WORD1_0__MIN_LOD_mask);
        SETfield(t->SQ_TEX_SAMPLER1,
-                    EG_S_FIXED(CLAMP(t->base.MaxLod - t->minLod, 0, 15), 8),
+                    EG_S_FIXED(CLAMP(t->base.Sampler.MaxLod - t->minLod, 0, 15), 8),
                     EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_shift, 
              EG_SQ_TEX_SAMPLER_WORD1_0__MAX_LOD_mask);
        SETfield(t->SQ_TEX_SAMPLER2,
-                    EG_S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.LodBias, -16, 16), 8),
+                    EG_S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.Sampler.LodBias, -16, 16), 8),
                     EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_shift, 
              EG_SQ_TEX_SAMPLER_WORD2_0__LOD_BIAS_mask);
 
-       if(texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB)
+       if(texObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB)
        {
-               SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_shadow_func(texObj->CompareFunc), 
+               SETfield(t->SQ_TEX_SAMPLER0, evergreen_translate_shadow_func(texObj->Sampler.CompareFunc), 
                  EG_SQ_TEX_SAMPLER_WORD0_0__DCF_shift, 
                  EG_SQ_TEX_SAMPLER_WORD0_0__DCF_mask);
        }
@@ -1420,12 +1420,12 @@ static struct gl_texture_object *evergreenNewTextureObject(struct gl_context * c
                        t, _mesa_lookup_enum_by_nr(target));
 
        _mesa_initialize_texture_object(&t->base, name, target);
-       t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
+       t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
     
        evergreenSetTexDefaultState(t);
        evergreenUpdateTexWrap(t);
-       evergreenSetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter, t->base.MaxAnisotropy);
-       evergreenSetTexSampler.BorderColor(t, t->base.Sampler.BorderColor.f);
+       evergreenSetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter, t->base.Sampler.MaxAnisotropy);
+       evergreenSetTexBorderColor(t, t->base.Sampler.BorderColor.f);
 
        return &t->base;
 }
@@ -1475,7 +1475,7 @@ static void evergreenTexParameter(struct gl_context * ctx, GLenum target,
        case GL_TEXTURE_MIN_FILTER:
        case GL_TEXTURE_MAG_FILTER:
        case GL_TEXTURE_MAX_ANISOTROPY_EXT:
-               evergreenSetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->MaxAnisotropy);
+               evergreenSetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->Sampler.MaxAnisotropy);
                break;
 
        case GL_TEXTURE_WRAP_S:
@@ -1485,7 +1485,7 @@ static void evergreenTexParameter(struct gl_context * ctx, GLenum target,
                break;
 
        case GL_TEXTURE_BORDER_COLOR:
-               evergreenSetTexSampler.BorderColor(t, texObj->Sampler.BorderColor.f);
+               evergreenSetTexBorderColor(t, texObj->Sampler.BorderColor.f);
                break;
 
        case GL_TEXTURE_BASE_LEVEL:
index 07f6de7ad4976d1eda54bc21437258c049d2f0a5..eb7ed30c7a369fa974c3e49152e81de5d582b3eb 100644 (file)
@@ -262,7 +262,7 @@ static void r600SetTexFilter(radeonTexObjPtr t, GLenum minf, GLenum magf, GLfloa
        }
 }
 
-static void r600SetTexSampler.BorderColor(radeonTexObjPtr t, const GLfloat color[4])
+static void r600SetTexBorderColor(radeonTexObjPtr t, const GLfloat color[4])
 {
        t->TD_PS_SAMPLER0_BORDER_ALPHA = *((uint32_t*)&(color[3]));
        t->TD_PS_SAMPLER0_BORDER_BLUE = *((uint32_t*)&(color[2]));
@@ -292,7 +292,7 @@ static void r600TexParameter(struct gl_context * ctx, GLenum target,
        case GL_TEXTURE_MIN_FILTER:
        case GL_TEXTURE_MAG_FILTER:
        case GL_TEXTURE_MAX_ANISOTROPY_EXT:
-               r600SetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->MaxAnisotropy);
+               r600SetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->Sampler.MaxAnisotropy);
                break;
 
        case GL_TEXTURE_WRAP_S:
@@ -302,7 +302,7 @@ static void r600TexParameter(struct gl_context * ctx, GLenum target,
                break;
 
        case GL_TEXTURE_BORDER_COLOR:
-               r600SetTexSampler.BorderColor(t, texObj->Sampler.BorderColor.f);
+               r600SetTexBorderColor(t, texObj->Sampler.BorderColor.f);
                break;
 
        case GL_TEXTURE_BASE_LEVEL:
@@ -382,13 +382,13 @@ static struct gl_texture_object *r600NewTextureObject(struct gl_context * ctx,
                        t, _mesa_lookup_enum_by_nr(target));
 
        _mesa_initialize_texture_object(&t->base, name, target);
-       t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
+       t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
 
        /* Initialize hardware state */
        r600SetTexDefaultState(t);
        r600UpdateTexWrap(t);
-       r600SetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter, t->base.MaxAnisotropy);
-       r600SetTexSampler.BorderColor(t, t->base.Sampler.BorderColor.f);
+       r600SetTexFilter(t, t->base.Sampler.MinFilter, t->base.Sampler.MagFilter, t->base.Sampler.MaxAnisotropy);
+       r600SetTexBorderColor(t, t->base.Sampler.BorderColor.f);
 
        return &t->base;
 }
index aafa6875774b124d90f85f355e8941a345b082df..3568a5515beeaa8031efc819011f26011bf8f0cf 100644 (file)
@@ -571,7 +571,7 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
                default:
                        break;
                };
-               switch (tObj->DepthMode) {
+               switch (tObj->Sampler.DepthMode) {
                case GL_LUMINANCE:  /* X, X, X, ONE */
                        SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                                 SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
@@ -777,18 +777,18 @@ static GLboolean setup_hardware_state(struct gl_context * ctx, struct gl_texture
        SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask);
 
        SETfield(t->SQ_TEX_SAMPLER1,
-               S_FIXED(CLAMP(t->base.MinLod - t->minLod, 0, 15), 6),
+               S_FIXED(CLAMP(t->base.Sampler.MinLod - t->minLod, 0, 15), 6),
                MIN_LOD_shift, MIN_LOD_mask);
        SETfield(t->SQ_TEX_SAMPLER1,
-               S_FIXED(CLAMP(t->base.MaxLod - t->minLod, 0, 15), 6),
+               S_FIXED(CLAMP(t->base.Sampler.MaxLod - t->minLod, 0, 15), 6),
                MAX_LOD_shift, MAX_LOD_mask);
        SETfield(t->SQ_TEX_SAMPLER1,
-               S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.LodBias, -16, 16), 6),
+               S_FIXED(CLAMP(ctx->Texture.Unit[unit].LodBias + t->base.Sampler.LodBias, -16, 16), 6),
                SQ_TEX_SAMPLER_WORD1_0__LOD_BIAS_shift, SQ_TEX_SAMPLER_WORD1_0__LOD_BIAS_mask);
 
-       if(texObj->CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB)
+       if(texObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB)
        {
-               SETfield(t->SQ_TEX_SAMPLER0, r600_translate_shadow_func(texObj->CompareFunc), DEPTH_COMPARE_FUNCTION_shift, DEPTH_COMPARE_FUNCTION_mask);
+               SETfield(t->SQ_TEX_SAMPLER0, r600_translate_shadow_func(texObj->Sampler.CompareFunc), DEPTH_COMPARE_FUNCTION_shift, DEPTH_COMPARE_FUNCTION_mask);
        }
        else
        {
index ff456c67e2eab92bf7d3975cd84384f0748340fb..4ec2845ab443a7fc53aa81d20985b929fab0da48 100644 (file)
@@ -141,7 +141,7 @@ static void r700SendTexSamplerState(struct gl_context *ctx, struct radeon_state_
        }
 }
 
-static void r700SendTexSampler.BorderColorState(struct gl_context *ctx, struct radeon_state_atom *atom)
+static void r700SendTexBorderColorState(struct gl_context *ctx, struct radeon_state_atom *atom)
 {
        context_t         *context = R700_CONTEXT(ctx);
        R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
@@ -1640,7 +1640,7 @@ void r600InitAtoms(context_t *context)
     ALLOC_STATE(vtx, vtx, (VERT_ATTRIB_MAX * 18), r700SendVTXState);
     ALLOC_STATE(tx, tx, (R700_TEXTURE_NUMBERUNITS * 20), r700SendTexState);
     ALLOC_STATE(tx_smplr, tx, (R700_TEXTURE_NUMBERUNITS * 5), r700SendTexSamplerState);
-    ALLOC_STATE(tx_brdr_clr, tx, (R700_TEXTURE_NUMBERUNITS * 6), r700SendTexSampler.BorderColorState);
+    ALLOC_STATE(tx_brdr_clr, tx, (R700_TEXTURE_NUMBERUNITS * 6), r700SendTexBorderColorState);
     r600_init_query_stateobj(&context->radeon, 6 * 2);
 
     context->radeon.hw.is_dirty = GL_TRUE;