summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorChristian König <[email protected]>2011-01-21 21:51:24 +0100
committerChristian König <[email protected]>2011-01-21 21:51:24 +0100
commit86e5b79a274ad4ed5c169aa5626106331273311c (patch)
tree31bc98df0e79c453c5ff143ac8e6ddaa846799c1 /src/mesa/main/context.c
parent78faf8d0e9c276a0ff1465e501d58fb3d66de2f7 (diff)
parent8af583f6e844ef2d173eb3c5c2e378cd1da018a8 (diff)
Merge remote branch 'origin/master' into pipe-video
Conflicts: src/gallium/drivers/r600/r600_texture.c
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index fe370fa369b..e017939a45c 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -534,8 +534,17 @@ init_program_limits(GLenum type, struct gl_program_constants *prog)
prog->MediumFloat.RangeMax = 127;
prog->MediumFloat.Precision = 23;
prog->LowFloat = prog->HighFloat = prog->MediumFloat;
- /* assume ints are stored as floats for now */
- prog->LowInt = prog->MediumInt = prog->HighInt = prog->MediumFloat;
+
+ /* Assume ints are stored as floats for now, since this is the least-common
+ * denominator. The OpenGL ES spec implies (page 132) that the precision
+ * of integer types should be 0. Practically speaking, IEEE
+ * single-precision floating point values can only store integers in the
+ * range [-0x01000000, 0x01000000] without loss of precision.
+ */
+ prog->MediumInt.RangeMin = 24;
+ prog->MediumInt.RangeMax = 24;
+ prog->MediumInt.Precision = 0;
+ prog->LowInt = prog->HighInt = prog->MediumInt;
}