Re: [Piglit] [PATCH 5/7] khr_texture_compression_astc: Add sRGB skip decode test
On Fri, Jul 22, 2016 at 02:01:35PM -0700, Anuj Phogat wrote: > This adds the testing of EXT_texture_sRGB_decode with ASTC > compressed textures. > > Cc: Nanley Chery > Signed-off-by: Anuj Phogat Patches 4 and 5 are, Reviewed-by: Nanley Chery > --- > tests/all.py | 2 +- > .../khr_compressed_astc-miptree.c | 26 > +++--- > 2 files changed, 24 insertions(+), 4 deletions(-) > > diff --git a/tests/all.py b/tests/all.py > index 6db24ad..e2998d0 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -4355,7 +4355,7 @@ with profile.group_manager( > g(['khr_compressed_astc-basic_gl'], 'basic-gl') > g(['khr_compressed_astc-basic_gles2'], 'basic-gles') > > -for subtest in ('hdr', 'ldr', 'srgb', "srgb-fp"): > +for subtest in ('hdr', 'ldr', 'srgb', "srgb-fp", "srgb-sd"): > g(['khr_compressed_astc-miptree_gl', '-subtest', subtest], > 'miptree-gl {}'.format(subtest)) > g(['khr_compressed_astc-miptree_gles2', '-subtest', subtest], > diff --git > a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c > b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c > index 61edc5f..da43cb8 100644 > --- a/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c > +++ b/tests/spec/khr_texture_compression_astc/khr_compressed_astc-miptree.c > @@ -60,6 +60,7 @@ enum test_type > TEST_TYPE_LDR, > TEST_TYPE_SRGB, > TEST_TYPE_SRGB_FP, > + TEST_TYPE_SRGB_SD, > }; > > enum piglit_result > @@ -69,6 +70,7 @@ static enum test_type ldr_test = TEST_TYPE_LDR; > static enum test_type hdr_test = TEST_TYPE_HDR; > static enum test_type srgb_test = TEST_TYPE_SRGB; > static enum test_type srgb_fp_test = TEST_TYPE_SRGB_FP; > +static enum test_type srgb_skip_test = TEST_TYPE_SRGB_SD; > static const struct piglit_subtest subtests[] = { > { > "LDR Profile", > @@ -94,6 +96,12 @@ static const struct piglit_subtest subtests[] = { > test_miptrees, > &srgb_fp_test, > }, > + { > + "sRGB skip decode", > + "srgb-sd", > + test_miptrees, > + &srgb_skip_test, > + }, > {NULL}, > }; > > @@ -159,7 +167,7 @@ load_texture(const char *dir1, const char *dir2, > } > > /** Compares the compressed texture against the decompressed texture */ > -bool draw_compare_levels(bool check_error, > +bool draw_compare_levels(bool check_error, bool srgb_skip_decode, > GLint level_pixel_size_loc, GLint pixel_offset_loc, > GLuint compressed_tex, GLuint decompressed_tex) > { > @@ -179,12 +187,20 @@ bool draw_compare_levels(bool check_error, > > /* Draw miplevel of compressed texture. */ > glBindTexture(GL_TEXTURE_2D, compressed_tex); > + if (srgb_skip_decode) > + glTexParameteri(GL_TEXTURE_2D, > + GL_TEXTURE_SRGB_DECODE_EXT, > + GL_SKIP_DECODE_EXT); > glUniform2f(pixel_offset_loc, x, y); > glDrawArrays(GL_TRIANGLE_FAN, 0, NUM_VERTICES); > > /* Draw miplevel of decompressed texture. */ > if (!check_error) { > glBindTexture(GL_TEXTURE_2D, decompressed_tex); > + if (srgb_skip_decode) > + glTexParameteri(GL_TEXTURE_2D, > + GL_TEXTURE_SRGB_DECODE_EXT, > + GL_SKIP_DECODE_EXT); > glUniform2f(pixel_offset_loc, LEVEL0_WIDTH + x, y); > glDrawArrays(GL_TRIANGLE_FAN, 0, NUM_VERTICES); > } > @@ -224,9 +240,10 @@ test_miptrees(void* input_type) > { > const enum test_type subtest = *(enum test_type*) input_type; > const bool is_srgb_test = subtest == TEST_TYPE_SRGB; > + const bool is_srgb_skip_decode_test = subtest == TEST_TYPE_SRGB_SD; > const bool is_hdr_test = subtest == TEST_TYPE_HDR; > > - static const char * tests[4] = {"hdr", "ldrl", "ldrs", "ldrs"}; > + static const char * tests[5] = {"hdr", "ldrl", "ldrs", "ldrs", "ldrs"}; > static const char * block_dim_str[14] = { > "4x4", > "5x4", > @@ -248,6 +265,9 @@ test_miptrees(void* input_type) > GLint level_pixel_size_loc = glGetUniformLocation(prog, > "level_pixel_size"); > > + if (is_srgb_skip_decode_test) > + piglit_require_extension("GL_EXT_texture_sRGB_decode"); > + > /* Check for error color if an LDR-only sys reading an HDR >* texture. No need to draw a reference mipmap in this case. >*/ > @@ -283,7 +303,7 @@ test_miptrees(void* input_type) > > /* Draw and compare each level of the two textures
Re: [Piglit] [PATCH 2/7] khr_texture_compression_astc: Run each subtest separately in all.py
On Fri, Jul 22, 2016 at 02:01:32PM -0700, Anuj Phogat wrote: > Cc: Nanley Chery > Signed-off-by: Anuj Phogat This patch is, Reviewed-by: Nanley Chery > --- > tests/all.py | 8 ++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/tests/all.py b/tests/all.py > index 96a3e46..dfad955 100644 > --- a/tests/all.py > +++ b/tests/all.py > @@ -4354,8 +4354,12 @@ with profile.group_manager( > g(['khr_compressed_astc-array_gles3'], 'array-gles') > g(['khr_compressed_astc-basic_gl'], 'basic-gl') > g(['khr_compressed_astc-basic_gles2'], 'basic-gles') > -g(['khr_compressed_astc-miptree_gl'], 'miptree-gl') > -g(['khr_compressed_astc-miptree_gles2'], 'miptree-gles') > + > +for subtest in ('hdr', 'ldr', 'srgb'): > +g(['khr_compressed_astc-miptree_gl', '-subtest', subtest], > + 'miptree-gl {}'.format(subtest)) > +g(['khr_compressed_astc-miptree_gles2', '-subtest', subtest], > + 'miptree-gles {}'.format(subtest)) > > with profile.group_manager( > PiglitGLTest, > -- > 2.5.5 > > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] arb_separate_shader_object: Check piglit_link_check_status result.
Reviewed-by: Tapani Pälli On 07/02/2016 01:38 AM, Vinson Lee wrote: Fix Coverity unchecked return value defect. CID: 1351103 Signed-off-by: Vinson Lee --- tests/spec/arb_separate_shader_objects/uniform-namespace.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/spec/arb_separate_shader_objects/uniform-namespace.c b/tests/spec/arb_separate_shader_objects/uniform-namespace.c index 2c8cd988de30..a62fdaa4f5d0 100644 --- a/tests/spec/arb_separate_shader_objects/uniform-namespace.c +++ b/tests/spec/arb_separate_shader_objects/uniform-namespace.c @@ -96,7 +96,9 @@ generate_program(const char *code_template, unsigned glsl_version, (const GLchar * const*) &code); free(code); - piglit_link_check_status(prog); + if (!piglit_link_check_status(prog)) { + piglit_report_result(PIGLIT_FAIL); + } *uniform_loc = glGetUniformLocation(prog, "a"); ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 1/6] shader_runner: Trivial whitespace fixes
Patches 1..5 (I sent small proposal to patch 5) Reviewed-by: Tapani Pälli On 07/21/2016 10:04 PM, Ian Romanick wrote: From: Ian Romanick Signed-off-by: Ian Romanick --- tests/shaders/shader_runner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c index 5834585..0d7b593 100644 --- a/tests/shaders/shader_runner.c +++ b/tests/shaders/shader_runner.c @@ -400,7 +400,7 @@ compile_glsl(GLenum target) char *shader_strings[2]; char version_string[100]; GLint shader_string_sizes[2]; - + /* Add a #version directive based on the GLSL requirement. */ sprintf(version_string, "#version %d", glsl_req_version.num); if (glsl_req_version.es && glsl_req_version.num != 100) { @@ -411,7 +411,7 @@ compile_glsl(GLenum target) shader_string_sizes[0] = strlen(version_string); shader_strings[1] = shader_string; shader_string_sizes[1] = shader_string_size; - + glShaderSource(shader, 2, (const GLchar **) shader_strings, shader_string_sizes); ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH 5/6] built-in-constants: Fix up tessellation shader #extension work-around for ES
On 07/21/2016 10:04 PM, Ian Romanick wrote: From: Ian Romanick Signed-off-by: Ian Romanick --- tests/shaders/built-in-constants.c | 19 ++- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/tests/shaders/built-in-constants.c b/tests/shaders/built-in-constants.c index be4eb64..16bba8a 100644 --- a/tests/shaders/built-in-constants.c +++ b/tests/shaders/built-in-constants.c @@ -463,11 +463,20 @@ piglit_init(int argc, char **argv) piglit_report_result(PIGLIT_SKIP); /* Tessellation shaders must use the #extension directive. */ - if (piglit_is_extension_supported("GL_ARB_tessellation_shader")) { - assert(num_required_extensions < ARRAY_SIZE(required_extensions)); - required_extensions[num_required_extensions] = - strdup("GL_ARB_tessellation_shader"); - num_required_extensions++; + if (!es_shader) { + if (piglit_is_extension_supported("GL_ARB_tessellation_shader")) { + assert(num_required_extensions < ARRAY_SIZE(required_extensions)); + required_extensions[num_required_extensions] = + strdup("GL_ARB_tessellation_shader"); + num_required_extensions++; + } + } else { + if (piglit_is_extension_supported("GL_OES_tessellation_shader")) { + assert(num_required_extensions < ARRAY_SIZE(required_extensions)); + required_extensions[num_required_extensions] = + strdup("GL_OES_tessellation_shader"); + num_required_extensions++; + } Maybe simpler/shorter would be to have: const char *const ext_name = es_shader ? "GL_OES_tessellation_shader" : "GL_ARB_tessellation_shader"; if (piglit_is_extension_supported(ext_name)) { ... in similar manner as patch 2 does when requiring extension? // Tapani ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] Add glsl-1.20/execution/vsfs-unused-array-member.shader_test
nitpick: did not spot anything requiring GLSL 1.20, 1.10 should be enough for these shaders; Reviewed-by: Tapani Pälli On 07/25/2016 07:05 PM, Nicolai Hähnle wrote: From: Nicolai Hähnle Currently fails due to an error in Gallium st_glsl_to_tgsi. Observed in the game Overlord. --- I'm also going to send out a candidate fix to mesa-dev in a moment. .../execution/vsfs-unused-array-member.shader_test | 41 ++ 1 file changed, 41 insertions(+) create mode 100644 tests/spec/glsl-1.20/execution/vsfs-unused-array-member.shader_test diff --git a/tests/spec/glsl-1.20/execution/vsfs-unused-array-member.shader_test b/tests/spec/glsl-1.20/execution/vsfs-unused-array-member.shader_test new file mode 100644 index 000..821c57a --- /dev/null +++ b/tests/spec/glsl-1.20/execution/vsfs-unused-array-member.shader_test @@ -0,0 +1,41 @@ +# This test verifies that varyings are assigned correctly when a fragment +# shader doesn't read from all elements of a varying array. +# +# This used to fail due to a bug in st/mesa that was visible in Overlord. + +[require] +GLSL >= 1.20 + +[vertex shader] +#version 120 + +uniform vec4 data; + +varying vec4 a[3]; +varying float b; + +void main() +{ + a[0] = data.; + a[1] = data.; + a[2] = data.; + b = data.w; + gl_Position = gl_Vertex; +} + +[fragment shader] +#version 120 + +varying vec4 a[3]; +varying float b; + +void main() +{ + gl_FragColor = vec4(a[0].x, a[2].x, b, 1.0); +} + +[test] +uniform vec4 data 0.2 0.4 0.6 0.8 + +draw rect -1 -1 2 2 +probe all rgba 0.2 0.6 0.8 1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] Add glsl-1.10/execution/fs-discard-deep-branch.shader_test
Reviewed-by: Tapani Pälli On 07/26/2016 11:12 AM, Nicolai Hähnle wrote: From: Nicolai Hähnle Extracted from a bug in the Mesa GLSL compiler that was triggered by Firewatch. I will also send out a patch for Mesa. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96762 --- .../execution/fs-discard-deep-branch.shader_test | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test diff --git a/tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test b/tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test new file mode 100644 index 000..63be51b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test @@ -0,0 +1,42 @@ +# This tests discard in nested if-statements. The additional code in the outer +# if-statement caused this to miscompile in Mesa. + +[require] +GLSL >= 1.10 +SIZE 20 20 + +[vertex shader passthrough] + +[fragment shader] +uniform bool use_discard; +uniform float boundary; +uniform vec4 color; + +void main() +{ + if (use_discard) { + float tmp; + tmp = boundary * 0.5; + if (gl_FragCoord.x < tmp) + discard; + } + + gl_FragColor = color; +} + +[test] +clear color 1.0 0.0 0.0 1.0 +clear + +uniform uint use_discard 1 +uniform float boundary 20.0 +uniform vec4 color 0.0 1.0 0.0 1.0 + +draw rect -1 -1 2 2 +probe rect rgba (0, 0, 10, 20) (1.0, 0.0, 0.0, 1.0) +probe rect rgba (10, 0, 10, 20) (0.0, 1.0, 0.0, 1.0) + +uniform uint use_discard 0 +uniform vec4 color 0.0 0.0 1.0 1.0 +draw rect -1 -1 2 2 +probe all rgba 0.0 0.0 1.0 1.0 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [Bug 97063] piglit_wfl_framework.c:287:4: error: void function 'parse_test_config' should not return a value [-Wreturn-type]
https://bugs.freedesktop.org/show_bug.cgi?id=97063 Emil Velikov changed: What|Removed |Added Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #2 from Emil Velikov --- Thanks Vinson. These should be fixed with the following commit 3cdff435cdbafefd557d542f1b96feab3047fbf6 Author: Emil Velikov Date: Mon Jul 25 11:41:59 2016 +0100 util/wfl: remove const qualifier from parse_test_config commit 5221c65d10e06252022dacd245b4836c15d341d2 Author: Emil Velikov Date: Mon Jul 25 11:36:26 2016 +0100 util/wfl: remove unused default case -- You are receiving this mail because: You are the assignee for the bug. You are the QA Contact for the bug.___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH] Add glsl-1.10/execution/fs-discard-deep-branch.shader_test
From: Nicolai Hähnle Extracted from a bug in the Mesa GLSL compiler that was triggered by Firewatch. I will also send out a patch for Mesa. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96762 --- .../execution/fs-discard-deep-branch.shader_test | 42 ++ 1 file changed, 42 insertions(+) create mode 100644 tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test diff --git a/tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test b/tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test new file mode 100644 index 000..63be51b --- /dev/null +++ b/tests/spec/glsl-1.10/execution/fs-discard-deep-branch.shader_test @@ -0,0 +1,42 @@ +# This tests discard in nested if-statements. The additional code in the outer +# if-statement caused this to miscompile in Mesa. + +[require] +GLSL >= 1.10 +SIZE 20 20 + +[vertex shader passthrough] + +[fragment shader] +uniform bool use_discard; +uniform float boundary; +uniform vec4 color; + +void main() +{ + if (use_discard) { + float tmp; + tmp = boundary * 0.5; + if (gl_FragCoord.x < tmp) + discard; + } + + gl_FragColor = color; +} + +[test] +clear color 1.0 0.0 0.0 1.0 +clear + +uniform uint use_discard 1 +uniform float boundary 20.0 +uniform vec4 color 0.0 1.0 0.0 1.0 + +draw rect -1 -1 2 2 +probe rect rgba (0, 0, 10, 20) (1.0, 0.0, 0.0, 1.0) +probe rect rgba (10, 0, 10, 20) (0.0, 1.0, 0.0, 1.0) + +uniform uint use_discard 0 +uniform vec4 color 0.0 0.0 1.0 1.0 +draw rect -1 -1 2 2 +probe all rgba 0.0 0.0 1.0 1.0 -- 2.7.4 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH] tex3d-maxsize: rewrite to be more robust and do more testing
On 26/07/16 01:39, Brian Paul wrote: > On 07/20/2016 02:45 AM, Alejandro Piñeiro wrote: >> On 13/07/16 23:47, Brian Paul wrote: >>> 1. It seems with NVIDIA's driver that using a proxy texture isn't a >>> sure fire way to know that a given texture format/size can actually be >>> created. Update the find_max_tex3d_size() function to actually try >>> creating a texture with glTexImage3D/glTexStorage3D and see if it >>> works. >>> >>> 2. Improve the speed of texture initialization by copying the first >>> 3D slice to the other slices with glCopyImageSubData(). >>> >>> 3. Use glTexStorage3D when GL_ARB_texture_storage is supported. >>> >>> 4. In addition to GL_RGBA8, test GL_INTENSITY8 and GL_RGBA32F formats. >>> >>> 5. Before testing the largest possible texture, try a couple smaller >>> sizes as a sanity check. >>> >>> 6. Loosen the piglit probe tolerance by one bit to account for >>> inaccuracy >>> caused by GL_NEAREST filtering. >>> >>> Tested with NVIDIA driver, VMware driver and llvmpipe. >> >> I just tested with intel i965 Haswell, and it also works fine. Looks >> good to me, but I have a small question below. >> >>> --- >>> tests/texturing/tex3d-maxsize.c | 285 >>> +--- >>> 1 file changed, 211 insertions(+), 74 deletions(-) >>> >>> diff --git a/tests/texturing/tex3d-maxsize.c >>> b/tests/texturing/tex3d-maxsize.c >>> index e168d14..60c9c63 100644 >>> --- a/tests/texturing/tex3d-maxsize.c >>> +++ b/tests/texturing/tex3d-maxsize.c >>> @@ -30,31 +30,88 @@ >>> >>> PIGLIT_GL_TEST_CONFIG_BEGIN >>> >>> -config.supports_gl_compat_version = 10; >>> +config.supports_gl_compat_version = 12; >>> >>> config.window_visual = PIGLIT_GL_VISUAL_RGBA | >>> PIGLIT_GL_VISUAL_DOUBLE; >>> >>> PIGLIT_GL_TEST_CONFIG_END >>> >>> -static const char *TestName = "tex3d-maxsize"; >>> + >>> +static GLint MaxSize; >>> + >>> + >>> + >>> +/** >>> + * Compute size (in megabytes) of a texture of the given dimensions >>> and >>> + * internal format. >>> + */ >>> +static unsigned >>> +tex_size(GLenum internalFormat, int width, int height, int depth) >>> +{ >>> +uint64_t sz; >>> + >>> +sz = (uint64_t) width * (uint64_t) height * (uint64_t) depth; >>> + >>> +switch (internalFormat) { >>> +case GL_INTENSITY8: >>> +sz *= 1; >>> +break; >>> +case GL_RGBA8: >>> +sz *= 4; >>> +break; >>> +case GL_RGBA32F: >>> +sz *= 16; >>> +break; >>> +default: >>> +assert(!"Unexpected internalFormat"); >>> +} >>> + >>> +return (unsigned) (sz / (uint64_t) (1024 * 1024)); >>> +} >>> + >>> + >>> +/** >>> + * Allocate a 1-level 3D texture. >>> + */ >>> +static void >>> +alloc_tex3d(GLenum target, GLenum internalFormat, >>> +GLsizei width, GLsizei height, GLsizei depth) >>> +{ >>> +if (target == GL_TEXTURE_3D) { >>> +glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); >>> +glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); >>> +} >>> + >>> +if (piglit_is_extension_supported("GL_ARB_texture_storage")) { >>> +glTexStorage3D(target, 1, internalFormat, >>> + width, height, depth); >>> +} >>> +else { >>> +glTexImage3D(target, 0, internalFormat, >>> + width, height, depth, 0, >>> + GL_RGBA, GL_UNSIGNED_BYTE, NULL); >>> +} >>> +} >>> >>> >>> /* >>>* Use proxy texture to find largest possible 3D texture size. >>>*/ >>> static void >>> -find_max_tex3d_size(GLint initSize, GLint *width, GLint *height, >>> GLint *depth) >>> +find_max_tex3d_size(GLenum internalFormat, >>> +GLint initSize, GLint *width, GLint *height, GLint *depth) >>> { >>> GLint dim = 0, w, h, d, pw, ph, pd; >>> >>> +piglit_check_gl_error(GL_NO_ERROR); >>> + >>> w = h = d = initSize; >>> >>> while (w >= 1 && h >= 1 && d >= 1) { >>> /* try proxy image */ >>> const int level = 0; >>> >>> -glTexImage3D(GL_PROXY_TEXTURE_3D, level, GL_RGBA8, >>> - w, h, d, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); >>> +alloc_tex3d(GL_PROXY_TEXTURE_3D, internalFormat, w, h, d); >>> >>> glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, level, >>>GL_TEXTURE_WIDTH, &pw); >>> @@ -63,12 +120,40 @@ find_max_tex3d_size(GLint initSize, GLint >>> *width, GLint *height, GLint *depth) >>> glGetTexLevelParameteriv(GL_PROXY_TEXTURE_3D, level, >>>GL_TEXTURE_DEPTH, &pd); >>> >>> +if (!piglit_check_gl_error(GL_NO_ERROR)) { >>> +printf("Unexpected error during texture proxy test.\n"); >>> +piglit_report_result(PIGLIT_FAIL); >>> +} >>> + >>> if (pw == w && ph == h && pd == d) { >>> -/* success! */ >>> -*width = w; >>> -*height = h; >>> -*depth = d; >>> -return; >>> +/* this size should be supported,