[Piglit] [PATCH 1/2] util: Add piglit_set_default_fbo to restore system FBO
Ian Romanick
idr at freedesktop.org
Thu Jan 19 18:33:12 PST 2012
On 01/19/2012 10:44 AM, Eric Anholt wrote:
> On Thu, 19 Jan 2012 08:42:44 -0800, "Ian Romanick"<idr at freedesktop.org> wrote:
>> From: Ian Romanick<ian.d.romanick at intel.com>
>>
>> When running framework tests with the -fbo option, this restores the
>> default non-window FBO instead.
>
> Hmm, I was thinking of just exposing the integer, and only the GLX code
> would override it from its default of 0. Then you get to write
> glBindFramebuffer(piglit_winsys_fbo) in testcases.
Duh.
>> Signed-off-by: Ian Romanick<ian.d.romanick at intel.com>
>> ---
>> tests/util/piglit-framework.c | 12 ++++++++++++
>> tests/util/piglit-framework.h | 1 +
>> 2 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/tests/util/piglit-framework.c b/tests/util/piglit-framework.c
>> index 262d1e8..0517273 100644
>> --- a/tests/util/piglit-framework.c
>> +++ b/tests/util/piglit-framework.c
>> @@ -112,6 +112,18 @@ piglit_framework_glut_init(int argc, char *argv[])
>> #endif
>> }
>>
>> +/**
>> + * Use either the window system FBO or the default off-screen render target
>> + */
>> +void
>> +piglit_set_default_fbo(unsigned int target)
>> +{
>> +#ifdef USE_GLX
>> + glBindFramebuffer((GLenum) target,
>> + (piglit_use_fbo) ? piglit_fbo : 0);
>> +#endif
>> +}
>
> Looks like for non-GLX you aren't rebinding to the window system FBO.
I originally didn't have the #ifdef, but piglit-framework.c would fail
to compile for EGL. Having the #ifdef is, obviously, broken.
More information about the Piglit
mailing list