summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-29 10:36:10 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-29 10:36:10 -0600
commitebe1642d7a65acd5e41632b3b23655f67de85cfc (patch)
tree2879a8e42adace0875853130c518c164566f3fb0 /src
parentb58b64f361bef38a76b199427a4e248b1fab9f65 (diff)
check for signed vs. unsigned in st_get_format_info() - fixes accum buffer failure
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_format.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index c0e1a79bad..bffc39be87 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -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;
}
}