From 6dceeb2eb804d708639d68a13a924d65f366458a Mon Sep 17 00:00:00 2001 From: Robert Ellison Date: Wed, 11 Mar 2009 16:27:38 -0600 Subject: i965: fix polygon face orientation when rendering to FBO In the i965, the FBO coordinate system is inverted from the standard OpenGL/Mesa coordinate system; that means that the viewport and the polygon face orientation have to be inverted if rendering to a FBO. The viewport was already being handled correctly; but polygon face was not. This caused a conform failure when rendering to texture with two-sided lighting enabled. This fixes the problem in the i965 driver, and adds to the comment about the gl_framebuffer "Name" field so that this isn't a surprise to other driver writers. --- src/mesa/main/mtypes.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mesa/main') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f205864191..9080c83da4 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2236,7 +2236,15 @@ struct gl_renderbuffer_attachment struct gl_framebuffer { _glthread_Mutex Mutex; /**< for thread safety */ - GLuint Name; /**< if zero, this is a window system framebuffer */ + /** + * If zero, this is a window system framebuffer. If non-zero, this + * is a FBO framebuffer; note that for some devices (i.e. those with + * a natural pixel coordinate system for FBOs that differs from the + * OpenGL/Mesa coordinate system), this means that both the viewport + * and polygon face orientation will have to be inverted. + */ + GLuint Name; + GLint RefCount; GLboolean DeletePending; -- cgit v1.2.3