summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/unichrome
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-04-10 12:44:46 -0600
committerBrian Paul <[email protected]>2011-04-10 13:12:49 -0600
commitecfaab88b2577bd0395bc05d75a036126806a9c4 (patch)
tree5abb78f767f546778d551a57f7f2cfe20c479f50 /src/mesa/drivers/dri/unichrome
parent1cbd3a1cc734df16610a59dc49cdb42c70dc3270 (diff)
mesa: move sampler state into new gl_sampler_object type
gl_texture_object contains an instance of this type for the regular texture object sampling state. glGenSamplers() generates new instances of gl_sampler_object which can override that state with glBindSampler().
Diffstat (limited to 'src/mesa/drivers/dri/unichrome')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c32
-rw-r--r--src/mesa/drivers/dri/unichrome/via_tex.c6
2 files changed, 19 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c
index 774f439bfb6..3b270e02a97 100644
--- a/src/mesa/drivers/dri/unichrome/via_state.c
+++ b/src/mesa/drivers/dri/unichrome/via_state.c
@@ -877,21 +877,21 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx)
if (texUnit0->_ReallyEnabled) {
struct gl_texture_object *texObj = texUnit0->_Current;
- vmesa->regHTXnTB[0] = get_minmag_filter( texObj->MinFilter,
- texObj->MagFilter );
+ vmesa->regHTXnTB[0] = get_minmag_filter( texObj->Sampler.MinFilter,
+ texObj->Sampler.MagFilter );
vmesa->regHTXnMPMD[0] &= ~(HC_HTXnMPMD_SMASK | HC_HTXnMPMD_TMASK);
- vmesa->regHTXnMPMD[0] |= get_wrap_mode( texObj->WrapS,
- texObj->WrapT );
+ vmesa->regHTXnMPMD[0] |= get_wrap_mode( texObj->Sampler.WrapS,
+ texObj->Sampler.WrapT );
vmesa->regHTXnTB[0] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
if (texObj->Image[0][texObj->BaseLevel]->Border > 0) {
vmesa->regHTXnTB[0] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
vmesa->regHTXnTBC[0] =
- PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]),
- FLOAT_TO_UBYTE(texObj->BorderColor.f[1]),
- FLOAT_TO_UBYTE(texObj->BorderColor.f[2]));
- vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->BorderColor.f[3]);
+ PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[0]),
+ FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[1]),
+ FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[2]));
+ vmesa->regHTXnTRAH[0] = FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[3]);
}
if (texUnit0->LodBias != 0.0f) {
@@ -911,20 +911,20 @@ static GLboolean viaChooseTextureState(struct gl_context *ctx)
if (texUnit1->_ReallyEnabled) {
struct gl_texture_object *texObj = texUnit1->_Current;
- vmesa->regHTXnTB[1] = get_minmag_filter( texObj->MinFilter,
- texObj->MagFilter );
+ vmesa->regHTXnTB[1] = get_minmag_filter( texObj->Sampler.MinFilter,
+ texObj->Sampler.MagFilter );
vmesa->regHTXnMPMD[1] &= ~(HC_HTXnMPMD_SMASK | HC_HTXnMPMD_TMASK);
- vmesa->regHTXnMPMD[1] |= get_wrap_mode( texObj->WrapS,
- texObj->WrapT );
+ vmesa->regHTXnMPMD[1] |= get_wrap_mode( texObj->Sampler.WrapS,
+ texObj->Sampler.WrapT );
vmesa->regHTXnTB[1] &= ~(HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
if (texObj->Image[0][texObj->BaseLevel]->Border > 0) {
vmesa->regHTXnTB[1] |= (HC_HTXnTB_TBC_S | HC_HTXnTB_TBC_T);
vmesa->regHTXnTBC[1] =
- PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->BorderColor.f[0]),
- FLOAT_TO_UBYTE(texObj->BorderColor.f[1]),
- FLOAT_TO_UBYTE(texObj->BorderColor.f[2]));
- vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->BorderColor.f[3]);
+ PACK_COLOR_888(FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[0]),
+ FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[1]),
+ FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[2]));
+ vmesa->regHTXnTRAH[1] = FLOAT_TO_UBYTE(texObj->Sampler.BorderColor.f[3]);
}
diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c
index a2fb010e142..1a0d1eaf070 100644
--- a/src/mesa/drivers/dri/unichrome/via_tex.c
+++ b/src/mesa/drivers/dri/unichrome/via_tex.c
@@ -495,13 +495,13 @@ static GLboolean viaSetTexImages(struct gl_context *ctx,
* GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL.
* Yes, this looks overly complicated, but it's all needed.
*/
- if (texObj->MinFilter == GL_LINEAR || texObj->MinFilter == GL_NEAREST) {
+ if (texObj->Sampler.MinFilter == GL_LINEAR || texObj->Sampler.MinFilter == GL_NEAREST) {
firstLevel = lastLevel = texObj->BaseLevel;
}
else {
- firstLevel = texObj->BaseLevel + (GLint)(texObj->MinLod + 0.5);
+ firstLevel = texObj->BaseLevel + (GLint)(texObj->Sampler.MinLod + 0.5);
firstLevel = MAX2(firstLevel, texObj->BaseLevel);
- lastLevel = texObj->BaseLevel + (GLint)(texObj->MaxLod + 0.5);
+ lastLevel = texObj->BaseLevel + (GLint)(texObj->Sampler.MaxLod + 0.5);
lastLevel = MAX2(lastLevel, texObj->BaseLevel);
lastLevel = MIN2(lastLevel, texObj->BaseLevel + baseImage->image.MaxLog2);
lastLevel = MIN2(lastLevel, texObj->MaxLevel);