[Piglit] [PATCH 10/15] shader_runner: Add GLES workarounds (v2)

Chad Versace chad.versace at linux.intel.com
Tue Dec 11 15:46:59 PST 2012


On 12/11/2012 04:00 PM, Eric Anholt wrote:
> Chad Versace <chad.versace at linux.intel.com> writes:
>> diff --git a/tests/shaders/shader_runner_gles_workarounds.h b/tests/shaders/shader_runner_gles_workarounds.h
>> new file mode 100644
>> index 0000000..9a33d21
>> --- /dev/null
>> +++ b/tests/shaders/shader_runner_gles_workarounds.h
>> @@ -0,0 +1,136 @@
> 
>> +static void __attribute__((unused))
>> +unsupported_function(const char *name)
>> +{
>> +	printf("Function \"%s\" not supported on this implementation\n", name);
>> +	piglit_report_result(PIGLIT_SKIP);
>> +}
> 
> doesn't unsupported_function() get reported as an unused static function
> in the non-es3 build?

__attribute__((unused)) suppresses that warning.

>> +#if defined(PIGLIT_USE_OPENGL_ES3)
> 
>> +#define glBindProgramARB(a, b) \
>> +	/* Custom definition to suppress unused-variable warnings. */ \
>> +	({ \
>> +	 	(void) a; \
>> +	 	(void) b; \
>> +		unsupported_function("glBindProgramARB"); \
>> +	 })
>> +
>> +#define glVertexPointer(a, b, c, d) \
>> +	/* Custom definition to suppress unused-variable warnings. */ \
>> +	({ \
>> +	 	(void) a; \
>> +	 	(void) b; \
>> +	 	(void) c; \
>> +	 	(void) d; \
>> +		unsupported_function("glVertexPointer"); \
>> +	 })
> 
> Wouldn't actual functions avoid the need for this silliness?

Right. Real functions here would have been a better choice. I was
spewing forth macros so quickly in this header that I failed to consider
real functions.

Having only received only a few comments from Ian after posting v1 of the
series on Dec 3, 8 days ago; and no comments on v2 after posting it on
Dec 7, I honestly didn't think anyone was going to review this. So I went
ahead and pushed this afternoon... shortly before I received your comments.
Perhaps I was too hasty.

If you find bugs or serious design problems, let me know and I'll quickly clean
them up. I just posted a patch, with you CC'd, that applies that replaces
the silly macros with real functions.


More information about the Piglit mailing list