[Piglit] [PATCH 2/4] arb_texture_view: Constrain accessible mip levels correctly

Chris Forbes chrisf at ijw.co.nz
Sat Jan 11 16:39:01 PST 2014


The test expects us to be sampling from the smallest miplevel accessible
in the view, but the TEXTURE_MAX_LEVEL constraint was out of range,
and TEXTURE_BASE_LEVEL wasn't set at all.

This would have been masked previously because the test fell over due to
use of legacy features in the core profile.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 tests/spec/arb_texture_view/rendering_levels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_texture_view/rendering_levels.c b/tests/spec/arb_texture_view/rendering_levels.c
index 7f02613..ef29f78 100644
--- a/tests/spec/arb_texture_view/rendering_levels.c
+++ b/tests/spec/arb_texture_view/rendering_levels.c
@@ -94,7 +94,8 @@ test_render_levels(void)
 		glTextureView(new_tex, GL_TEXTURE_2D, tex,  GL_RGBA8, l,
 			      numLevels[l], 0, 1);
 		glBindTexture(GL_TEXTURE_2D, new_tex);
-		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, levels-1);
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, numLevels[l] - 1);
+		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, numLevels[l] - 1);
 
 		glClear(GL_COLOR_BUFFER_BIT);
 
-- 
1.8.5.2



More information about the Piglit mailing list