[Piglit] [PATCH 23/23] glsl: Fix Normalscale test.

Fabian Bieler fabianbieler at fastmail.fm
Thu Nov 23 20:46:15 UTC 2017


gl_Normalscale is supposed to be 1/sqrt(m_31^2+m_32^2+m_33^2) with m_ij
being the components of the inverse modelview matrix.
After a call to glScale(1, 1, 2) the _inverse_ modelview matrix is a
diagnoal matrix with the elements 1, 1, 0.5, 1. gl_Normalscale should thus
be 2 rather than 0.5 as presumed in the test.

Because of color clamping alter the glScale call rather than the expected
result.
---
 tests/shaders/glsl-vs-normalscale.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shaders/glsl-vs-normalscale.c b/tests/shaders/glsl-vs-normalscale.c
index 5e5627c..da6aac3 100644
--- a/tests/shaders/glsl-vs-normalscale.c
+++ b/tests/shaders/glsl-vs-normalscale.c
@@ -56,7 +56,7 @@ piglit_display(void)
 
 	/* Tweak the modelview and draw over it with another matrix. */
 	glMatrixMode(GL_MODELVIEW);
-	glScalef(1.0, 1.0, 2.0);
+	glScalef(1.0, 1.0, 0.5);
 	piglit_draw_rect(0, 0, 1, 1);
 
 	pass = piglit_probe_rect_rgba(0, 0, piglit_width, piglit_height,
-- 
2.7.4



More information about the Piglit mailing list