[Piglit] [PATCH] gl-3.0: Fix required-sized-texture-formats for depth formats
Chia-I Wu
olvaffe at gmail.com
Wed Feb 19 20:58:33 PST 2014
When a sized internal depth format is requested, implementations are allowed
to choose a format as closely as possible (whose definition is up to the
implementations) on GL 3.0.
Thanks to Kenneth Graunke for pointing this out.
Signed-off-by: Chia-I Wu <olv at lunarg.com>
---
tests/spec/gl-3.0/required-sized-texture-formats.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/tests/spec/gl-3.0/required-sized-texture-formats.c b/tests/spec/gl-3.0/required-sized-texture-formats.c
index 79ea5b1..ed94470 100644
--- a/tests/spec/gl-3.0/required-sized-texture-formats.c
+++ b/tests/spec/gl-3.0/required-sized-texture-formats.c
@@ -36,6 +36,9 @@
* the internal component sizes and types shown for that format
* in tables 3.16- 3.17:"
*
+ * Note that table 3.18, sized internal depth and stencil formats, is
+ * excluded.
+ *
* In GL 3.1 this is changed to allow increased precision for the
* required sized formats. From page 118 of the GL 3.1 core spec PDF
* (20090528):
@@ -194,7 +197,14 @@ piglit_init(int argc, char **argv)
format_pass = false;
} else if (target_version == 30) {
if (sizes[c] != get_channel_size(f, c)) {
- format_pass = false;
+ if ((c == D || c == S) &&
+ get_channel_size(f, c) > 0) {
+ /* any non-zero size will do */
+ if (sizes[c] <= 0)
+ format_pass = false;
+ } else {
+ format_pass = false;
+ }
}
} else {
if (sizes[c] < get_channel_size(f, c)) {
--
1.8.3.1
More information about the Piglit
mailing list