check for signed vs. unsigned in st_get_format_info() - fixes accum buffer failure
authorBrian <brian.paul@tungstengraphics.com>
Mon, 29 Oct 2007 16:36:10 +0000 (10:36 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Mon, 29 Oct 2007 16:36:10 +0000 (10:36 -0600)
src/mesa/state_tracker/st_format.c

index c0e1a79bad0e4eaae3adac93f756879597f291d2..bffc39be87bef2a20227b19fe7e7fd32ab550e3a 100644 (file)
@@ -204,19 +204,25 @@ st_get_format_info(
       else {
          GLuint size;
 
-         assert( info.type == PIPE_FORMAT_TYPE_UNORM );
-
          size = format_max_bits( info );
          if (size == 8) {
-            pinfo->datatype = GL_UNSIGNED_BYTE;
+            if (info.type == PIPE_FORMAT_TYPE_UNORM)
+               pinfo->datatype = GL_UNSIGNED_BYTE;
+            else
+               pinfo->datatype = GL_BYTE;
          }
          else if (size == 16) {
-            pinfo->datatype = GL_UNSIGNED_SHORT;
+            if (info.type == PIPE_FORMAT_TYPE_UNORM)
+               pinfo->datatype = GL_UNSIGNED_SHORT;
+            else
+               pinfo->datatype = GL_SHORT;
          }
          else {
             assert( size <= 32 );
-
-            pinfo->datatype = GL_UNSIGNED_INT;
+            if (info.type == PIPE_FORMAT_TYPE_UNORM)
+               pinfo->datatype = GL_UNSIGNED_INT;
+            else
+               pinfo->datatype = GL_INT;
          }
       }