[Piglit] [PATCH 17/18] shader_runner: Fix texture rgbw on GLES.

Francisco Jerez currojerez at riseup.net
Tue Oct 18 23:36:43 UTC 2016


GLES2 (and potentially also GLES3 depending on the internal format)
doesn't allow the specification of a texture image with base format
GL_RGBA and type GL_FLOAT, as piglit_rgbw_texture() would attempt to
do when the specified basetype argument is GL_UNSIGNED_NORMALIZED.
GL_UNSIGNED_BYTE should be okay though according to table 3.4 of the
GLES2 specification.
---
 tests/shaders/shader_runner.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 7ae08ed..93dfd10 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3367,7 +3367,8 @@ piglit_display(void)
 			glActiveTexture(GL_TEXTURE0 + tex);
 			int handle = piglit_rgbw_texture(
 				int_fmt, w, h, GL_FALSE, GL_FALSE,
-				GL_UNSIGNED_NORMALIZED);
+				(piglit_is_gles() ? GL_UNSIGNED_BYTE :
+				 GL_UNSIGNED_NORMALIZED));
 			set_texture_binding(tex, handle, w, h, 1);
 
 			if (!piglit_is_core_profile &&
-- 
2.9.0



More information about the Piglit mailing list