[Piglit] [PATCH 2/4] util: Make an even simpler interface for building simple shaders.
Eric Anholt
eric at anholt.net
Tue May 14 10:54:32 PDT 2013
Eric Anholt <eric at anholt.net> writes:
> Brian Paul <brianp at vmware.com> writes:
>
>> On 05/08/2013 03:02 PM, Eric Anholt wrote:
>>> The previous piglit_link_simple_program() interface required you to
>>> compile your shaders up front, and tests routinely have issues with
>>> either not checking that the component shaders compiled, or not
>>> checking that the program linked, and then confusingly fail later in
>>> the test. This one enforces that the program actually compiled and
>>> linked before continuing, so you don't need to worry about error
>>> checking.
>>> ---
>>> tests/util/piglit-shader.c | 35 +++++++++++++++++++++++++++++++++++
>>> tests/util/piglit-shader.h | 1 +
>>> 2 files changed, 36 insertions(+)
>>>
>>> diff --git a/tests/util/piglit-shader.c b/tests/util/piglit-shader.c
>>> index ca48f41..d715bab 100644
>>> --- a/tests/util/piglit-shader.c
>>> +++ b/tests/util/piglit-shader.c
>>> @@ -263,3 +263,38 @@ GLint piglit_link_simple_program(GLint vs, GLint fs)
>>>
>>> return prog;
>>> }
>>> +
>>> +/**
>>> + * Builds and links a program from optional VS and FS sources,
>>> + * throwing PIGLIT_FAIL on error.
>>> + */
>>> +GLint
>>> +piglit_build_simple_program(const char *vs_source, const char *fs_source)
>>
>> How would you feel about adding a gs_source for geometry shaders too?
>>
>> Otherwise,
>> Reviewed-by: Brian Paul <brianp at vmware.com>
>
> As long as we don't add tes/tcs as well, because damned if I'm ever
> going to remember what order they all go in.
On further thought, I think this interface is better mirroring
piglit_link_simple_program and covering the 90% case of just a VS/FS. I
expect for GS-using tests, they will generally either be shader_runner
tests (don't use this interface), or link failure tests (don't use this
interface), or shader limits tests (usually have to manually link, to
conditionally do things for beyond-the-limits cases).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130514/eead2b03/attachment.pgp>
More information about the Piglit
mailing list