summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2010-09-17 20:56:48 +0200
committerFrancisco Jerez <[email protected]>2010-09-21 03:03:39 +0200
commit98add55fffc29e0c40859fd5e9cec47fa1e352f5 (patch)
treeda2385d5cb0f0126b4f6cc7da0f9aee93f7a371d
parent22c83ac47a50ed1fdab59476886a7e56910a653a (diff)
dri/nv10-nv20: Fix texturing in some cases after a base level change.
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_texture.c17
-rw-r--r--src/mesa/drivers/dri/nouveau/nv10_state_tex.c2
-rw-r--r--src/mesa/drivers/dri/nouveau/nv20_state_tex.c2
3 files changed, 10 insertions, 11 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
index d86f78b4371..b2f6faf1e12 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
@@ -178,7 +178,7 @@ nouveau_choose_tex_format(GLcontext *ctx, GLint internalFormat,
}
static GLboolean
-teximage_fits(GLcontext *ctx, struct gl_texture_object *t, int level)
+teximage_fits(struct gl_texture_object *t, int level)
{
struct nouveau_surface *s = &to_nouveau_texture(t)->surfaces[level];
struct gl_texture_image *ti = t->Image[0][level];
@@ -186,8 +186,7 @@ teximage_fits(GLcontext *ctx, struct gl_texture_object *t, int level)
if (!ti || !to_nouveau_teximage(ti)->surface.bo)
return GL_FALSE;
- if (context_chipset(ctx) < 0x10 &&
- level == t->BaseLevel && (s->offset & 0x7f))
+ if (level == t->BaseLevel && (s->offset & 0x7f))
return GL_FALSE;
return t->Target == GL_TEXTURE_RECTANGLE ||
@@ -202,7 +201,7 @@ validate_teximage(GLcontext *ctx, struct gl_texture_object *t,
{
struct gl_texture_image *ti = t->Image[0][level];
- if (teximage_fits(ctx, t, level)) {
+ if (teximage_fits(t, level)) {
struct nouveau_surface *ss = to_nouveau_texture(t)->surfaces;
struct nouveau_surface *s = &to_nouveau_teximage(ti)->surface;
@@ -290,8 +289,8 @@ nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t)
struct nouveau_texture *nt = to_nouveau_texture(t);
int i, last = get_last_level(t);
- if (!teximage_fits(ctx, t, t->BaseLevel) ||
- !teximage_fits(ctx, t, last))
+ if (!teximage_fits(t, t->BaseLevel) ||
+ !teximage_fits(t, last))
return GL_FALSE;
if (nt->dirty) {
@@ -314,8 +313,8 @@ nouveau_texture_validate(GLcontext *ctx, struct gl_texture_object *t)
void
nouveau_texture_reallocate(GLcontext *ctx, struct gl_texture_object *t)
{
- if (!teximage_fits(ctx, t, t->BaseLevel) ||
- !teximage_fits(ctx, t, get_last_level(t))) {
+ if (!teximage_fits(t, t->BaseLevel) ||
+ !teximage_fits(t, get_last_level(t))) {
texture_dirty(t);
relayout_texture(ctx, t);
nouveau_texture_validate(ctx, t);
@@ -377,7 +376,7 @@ nouveau_teximage(GLcontext *ctx, GLint dims, GLenum target, GLint level,
}
if (level == t->BaseLevel) {
- if (!teximage_fits(ctx, t, level))
+ if (!teximage_fits(t, level))
relayout_texture(ctx, t);
nouveau_texture_validate(ctx, t);
}
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
index 6dedb18c72b..6961ccbb450 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_tex.c
@@ -225,7 +225,7 @@ nv10_emit_tex_obj(GLcontext *ctx, int emit)
bo_flags | NOUVEAU_BO_OR);
nouveau_bo_markl(bctx, celsius, NV10TCL_TX_OFFSET(i),
- s->bo, 0, bo_flags);
+ s->bo, s->offset, bo_flags);
BEGIN_RING(chan, celsius, NV10TCL_TX_FILTER(i), 1);
OUT_RING(chan, tx_filter);
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
index 2d45513bb4c..ea6b9b96db3 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_tex.c
@@ -236,7 +236,7 @@ nv20_emit_tex_obj(GLcontext *ctx, int emit)
bo_flags | NOUVEAU_BO_OR);
nouveau_bo_markl(bctx, kelvin, NV20TCL_TX_OFFSET(i),
- s->bo, 0, bo_flags);
+ s->bo, s->offset, bo_flags);
BEGIN_RING(chan, kelvin, NV20TCL_TX_WRAP(i), 1);
OUT_RING(chan, tx_wrap);