summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_program.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-10-02 22:14:03 -0700
committerEric Anholt <[email protected]>2014-10-19 08:42:33 +0100
commit572fba95e4cd85aebdde9bd757c17f719af2af04 (patch)
tree9a8e72c55c67b4a9190e9812ab3e38fc98d5a462 /src/gallium/drivers/vc4/vc4_program.c
parent15eb4c59f6504473989e6a064fda11d6c009ed8f (diff)
vc4: Add support for rebasing texture levels so firstlevel == 0.
GLES2 doesn't have GL_TEXTURE_BASE_LEVEL, so the hardware doesn't. Fixes piglit levelclamp, tex-miplevel-selection, and texture-storage/2D mipmap rendering.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_program.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c
index 66dff974a71..7a2a9756a59 100644
--- a/src/gallium/drivers/vc4/vc4_program.c
+++ b/src/gallium/drivers/vc4/vc4_program.c
@@ -2265,7 +2265,8 @@ write_texture_p0(struct vc4_context *vc4,
cl_reloc(vc4, &vc4->uniforms, rsc->bo,
VC4_SET_FIELD(rsc->slices[0].offset >> 12, VC4_TEX_P0_OFFSET) |
- VC4_SET_FIELD(texture->u.tex.last_level, VC4_TEX_P0_MIPLVLS) |
+ VC4_SET_FIELD(texture->u.tex.last_level -
+ texture->u.tex.first_level, VC4_TEX_P0_MIPLVLS) |
VC4_SET_FIELD(texture->target == PIPE_TEXTURE_CUBE,
VC4_TEX_P0_CMMODE) |
VC4_SET_FIELD(rsc->vc4_format & 7, VC4_TEX_P0_TYPE));