[Piglit] [PATCH 1/2] util: Add piglit_set_default_fbo to restore system FBO

Eric Anholt eric at anholt.net
Thu Jan 19 10:44:29 PST 2012


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.

> 
> 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.
-------------- 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/20120119/cde71db7/attachment.pgp>


More information about the Piglit mailing list