[Piglit] [PATCH] ARB_texture_view: Add format test case for formats not in VIEW_CLASS table
Brian Paul
brianp at vmware.com
Wed Dec 4 06:24:50 PST 2013
Looks OK to me. Tested on NVIDIA (fails some cases due to apparent
driver bug). Pushed with minor whitespace change.
-Brian
On 12/02/2013 10:15 AM, Jon Ashburn wrote:
> Can anyone review this patch from a week ago?
>
> Thanks,
> Jon Ashburn
> On 11/25/13, 5:43 PM, Jon Ashburn wrote:
>> Add test case for this sentence in the extension registry spec for
>> ARB_texture_view, that involves identical formats:
>> "The two textures' internal formats must be compatible according to Table
>> 3.X.2 ... the internal formats must be identical if not in
>> that table, or else an INVALID_OPERATION error is generated"
>>
>> Both identical and non-identical format cases are tested.
>>
>> Can someone upload this to origin/master branch for me?
>> ---
>> tests/spec/arb_texture_view/formats.c | 13 ++++++++++++-
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/tests/spec/arb_texture_view/formats.c
>> b/tests/spec/arb_texture_view/formats.c
>> index c6fbb80..1b67f70 100644
>> --- a/tests/spec/arb_texture_view/formats.c
>> +++ b/tests/spec/arb_texture_view/formats.c
>> @@ -50,6 +50,7 @@ PIGLIT_GL_TEST_CONFIG_END
>> static const char *TestName = "arb_texture_view-formats";
>> #define MAX_ILLEGAL_FORMATS 17
>> +#define VIEW_CLASS_NOT_IN_TABLE 0xfffffff
>> /**
>> * Iterate through array of texture formats and check if call to
>> TextureView
>> @@ -75,6 +76,7 @@ check_format_array(const GLenum err, const unsigned
>> int numFormats,
>> layers);
>> glDeleteTextures(1, &newTex);
>> if (!piglit_check_gl_error(err)) {
>> + printf("failing texView
>> format=%s\n",piglit_get_gl_enum_name(format));
>> pass = false;
>> break;
>> }
>> @@ -178,6 +180,8 @@ test_format_errors(GLenum format_class)
>> GL_COMPRESSED_SRGB_ALPHA,
>> GL_COMPRESSED_SLUMINANCE,
>> GL_COMPRESSED_SLUMINANCE_ALPHA,
>> + /* format that is legal for TexStorage but not in table */
>> + GL_RGB12
>> };
>> glGenTextures(1, &tex); /* orig tex */
>> @@ -243,8 +247,14 @@ test_format_errors(GLenum format_class)
>> ARRAY_SIZE(illegalFormats),
>> GL_R8UI, GL_R8I, GL_R8, GL_R8_SNORM, 0);
>> break;
>> + case VIEW_CLASS_NOT_IN_TABLE:
>> + glTexStorage2D(target, levels, GL_RGB12, width, height);
>> + numFormats = update_valid_arrays(legalFormats, illegalFormats,
>> + ARRAY_SIZE(illegalFormats),
>> + GL_RGB12, 0);
>> + break;
>> default:
>> - assert(0);
>> + assert(!"Invalid format_class\n");
>> }
>> if (!piglit_check_gl_error(GL_NO_ERROR)) {
>> @@ -304,6 +314,7 @@ piglit_init(int argc, char **argv)
>> X(test_format_errors(GL_VIEW_CLASS_24_BITS), "Format 24 bits
>> validity");
>> X(test_format_errors(GL_VIEW_CLASS_16_BITS), "Format 16 bits
>> validity");
>> X(test_format_errors(GL_VIEW_CLASS_8_BITS), "Format 8 bits
>> validity");
>> + X(test_format_errors(VIEW_CLASS_NOT_IN_TABLE), "Format misc
>> validity");
>> #undef X
>> pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
>> piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> https://urldefense.proofpoint.com/v1/url?u=http://lists.freedesktop.org/mailman/listinfo/piglit&k=oIvRg1%2BdGAgOoM1BIlLLqw%3D%3D%0A&r=lGQMzzTgII0I7jefp2FHq7WtZ%2BTLs8wadB%2BiIj9xpBY%3D%0A&m=OOUUZzwYEKWKpMxph3GLwRMuVpKCZUDw8pqVFIMKeoM%3D%0A&s=ced1884f93de9b05537463e142b1360b922907c3ff67f26378bf593d595be4fc
>
>
More information about the Piglit
mailing list