From 24c0b018ea89626d86f096c4f9d67b3512d12d29 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 27 Nov 2019 12:06:25 +0000 Subject: [PATCH] Fix types used for non-uint types in GL_Texture_Zoo test --- util/test/demos/gl/gl_texture_zoo.cpp | 29 ++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/util/test/demos/gl/gl_texture_zoo.cpp b/util/test/demos/gl/gl_texture_zoo.cpp index 7c70e3e19..897ee1174 100644 --- a/util/test/demos/gl/gl_texture_zoo.cpp +++ b/util/test/demos/gl/gl_texture_zoo.cpp @@ -460,11 +460,30 @@ void main() glPixelStorei(GL_PACK_ALIGNMENT, 1); GLenum format = GL_RGBA; - GLenum type = GL_UNSIGNED_BYTE; - if(test.fmt.cfg.componentBytes == 2) - type = GL_UNSIGNED_SHORT; - else if(test.fmt.cfg.componentBytes == 2) - type = GL_UNSIGNED_INT; + GLenum type; + + if(test.fmt.cfg.data == DataType::UInt || test.fmt.cfg.data == DataType::UNorm) + { + type = GL_UNSIGNED_BYTE; + if(test.fmt.cfg.componentBytes == 2) + type = GL_UNSIGNED_SHORT; + else if(test.fmt.cfg.componentBytes == 4) + type = GL_UNSIGNED_INT; + } + else if(test.fmt.cfg.data == DataType::SInt || test.fmt.cfg.data == DataType::SNorm) + { + type = GL_BYTE; + if(test.fmt.cfg.componentBytes == 2) + type = GL_SHORT; + else if(test.fmt.cfg.componentBytes == 4) + type = GL_INT; + } + else + { + type = GL_FLOAT; + if(test.fmt.cfg.componentBytes == 2) + type = GL_HALF_FLOAT; + } bool isInt = (test.fmt.cfg.data == DataType::SInt || test.fmt.cfg.data == DataType::UInt); if(test.fmt.cfg.componentCount == 4)