aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300
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/r300
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/r300')
-rw-r--r--src/mesa/drivers/dri/r300/r300_fragprog_common.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_state.c4
-rw-r--r--src/mesa/drivers/dri/r300/r300_tex.c18
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c2
4 files changed, 15 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
index 50cf8d6f9db..f0d960dca54 100644
--- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c
+++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c
@@ -77,8 +77,8 @@ static void build_state(
if (fp->Base.ShadowSamplers & (1 << unit)) {
struct gl_texture_object* tex = r300->radeon.glCtx->Texture.Unit[unit]._Current;
- state->unit[unit].texture_swizzle = build_dts(tex->DepthMode);
- state->unit[unit].texture_compare_func = build_func(tex->CompareFunc);
+ state->unit[unit].texture_swizzle = build_dts(tex->Sampler.DepthMode);
+ state->unit[unit].texture_compare_func = build_func(tex->Sampler.CompareFunc);
}
}
}
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c
index 51989c6b224..da6c8b602e1 100644
--- a/src/mesa/drivers/dri/r300/r300_state.c
+++ b/src/mesa/drivers/dri/r300/r300_state.c
@@ -1343,7 +1343,7 @@ static void r300SetupTextures(struct gl_context * ctx)
*/
r300->hw.tex.filter_1.cmd[R300_TEX_VALUE_0 + hw_tmu] =
t->pp_txfilter_1 |
- translate_lod_bias(ctx->Texture.Unit[i].LodBias + t->base.LodBias);
+ translate_lod_bias(ctx->Texture.Unit[i].LodBias + t->base.Sampler.LodBias);
r300->hw.tex.size.cmd[R300_TEX_VALUE_0 + hw_tmu] =
t->pp_txsize;
r300->hw.tex.format.cmd[R300_TEX_VALUE_0 +
@@ -2014,7 +2014,7 @@ static const GLfloat *get_fragmentprogram_constant(struct gl_context *ctx, GLuin
buffer[0] =
buffer[1] =
buffer[2] =
- buffer[3] = texObj->CompareFailValue;
+ buffer[3] = texObj->Sampler.CompareFailValue;
}
return buffer;
}
diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c
index f930b4d06bf..590d9afe14a 100644
--- a/src/mesa/drivers/dri/r300/r300_tex.c
+++ b/src/mesa/drivers/dri/r300/r300_tex.c
@@ -81,13 +81,13 @@ static void r300UpdateTexWrap(radeonTexObjPtr t)
t->pp_txfilter &=
~(R300_TX_WRAP_S_MASK | R300_TX_WRAP_T_MASK | R300_TX_WRAP_R_MASK);
- t->pp_txfilter |= translate_wrap_mode(tObj->WrapS) << R300_TX_WRAP_S_SHIFT;
+ t->pp_txfilter |= translate_wrap_mode(tObj->Sampler.WrapS) << R300_TX_WRAP_S_SHIFT;
if (tObj->Target != GL_TEXTURE_1D) {
- t->pp_txfilter |= translate_wrap_mode(tObj->WrapT) << R300_TX_WRAP_T_SHIFT;
+ t->pp_txfilter |= translate_wrap_mode(tObj->Sampler.WrapT) << R300_TX_WRAP_T_SHIFT;
if (tObj->Target == GL_TEXTURE_3D)
- t->pp_txfilter |= translate_wrap_mode(tObj->WrapR) << R300_TX_WRAP_R_SHIFT;
+ t->pp_txfilter |= translate_wrap_mode(tObj->Sampler.WrapR) << R300_TX_WRAP_R_SHIFT;
}
}
@@ -202,7 +202,7 @@ static void r300TexParameter(struct gl_context * ctx, GLenum target,
case GL_TEXTURE_MIN_FILTER:
case GL_TEXTURE_MAG_FILTER:
case GL_TEXTURE_MAX_ANISOTROPY_EXT:
- r300SetTexFilter(t, texObj->MinFilter, texObj->MagFilter, texObj->MaxAnisotropy);
+ r300SetTexFilter(t, texObj->Sampler.MinFilter, texObj->Sampler.MagFilter, texObj->Sampler.MaxAnisotropy);
break;
case GL_TEXTURE_WRAP_S:
@@ -212,7 +212,7 @@ static void r300TexParameter(struct gl_context * ctx, GLenum target,
break;
case GL_TEXTURE_BORDER_COLOR:
- r300SetTexBorderColor(t, texObj->BorderColor.f);
+ r300SetTexBorderColor(t, texObj->Sampler.BorderColor.f);
break;
case GL_TEXTURE_BASE_LEVEL:
@@ -299,12 +299,14 @@ static struct gl_texture_object *r300NewTextureObject(struct gl_context * ctx,
}
_mesa_initialize_texture_object(&t->base, name, target);
- t->base.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
+ t->base.Sampler.MaxAnisotropy = rmesa->radeon.initialMaxAnisotropy;
/* Initialize hardware state */
r300UpdateTexWrap(t);
- r300SetTexFilter(t, t->base.MinFilter, t->base.MagFilter, t->base.MaxAnisotropy);
- r300SetTexBorderColor(t, t->base.BorderColor.f);
+ r300SetTexFilter(t, t->base.Sampler.MinFilter,
+ t->base.Sampler.MagFilter,
+ t->base.Sampler.MaxAnisotropy);
+ r300SetTexBorderColor(t, t->base.Sampler.BorderColor.f);
return &t->base;
}
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index ed9955b05d8..e24ad6f088d 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -216,7 +216,7 @@ void r300SetDepthTexMode(struct gl_texture_object *tObj)
return;
}
- switch (tObj->DepthMode) {
+ switch (tObj->Sampler.DepthMode) {
case GL_LUMINANCE:
t->pp_txformat = format[0];
break;