Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
mesa: Additional FlipY applications
Browse files Browse the repository at this point in the history
Instances where direction was determined based on
winsys or user fbo and should be determined based on
FlipY.

Key STATE_FB_WPOS_Y_TRANSFORM for of FlipY instead of
_mesa_is_user_fbo.  This corrects gl_FragCoord usage
when applying GL_MESA_framebuffer_flip_y.

Fixes: ab05dd1 ("i965: implement GL_MESA_framebuffer_flip_y [v3]")
Reviewed-by: Brian Paul <brianp@vmware.com>
  • Loading branch information
fritzk authored and Kristian H. Kristensen committed Sep 17, 2018
1 parent d17443a commit ba6cc32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mesa/main/multisample.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ _mesa_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)

ctx->Driver.GetSamplePosition(ctx, ctx->DrawBuffer, index, val);

/* winsys FBOs are upside down */
if (_mesa_is_winsys_fbo(ctx->DrawBuffer))
/* FBOs can be upside down (winsys always are)*/
if (ctx->DrawBuffer->FlipY)
val[1] = 1.0f - val[1];

return;
Expand Down
2 changes: 1 addition & 1 deletion src/mesa/program/prog_statevars.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
case STATE_FB_WPOS_Y_TRANSFORM:
/* A driver may negate this conditional by using ZW swizzle
* instead of XY (based on e.g. some other state). */
if (_mesa_is_user_fbo(ctx->DrawBuffer)) {
if (!ctx->DrawBuffer->FlipY) {
/* Identity (XY) followed by flipping Y upside down (ZW). */
value[0] = 1.0F;
value[1] = 0.0F;
Expand Down

0 comments on commit ba6cc32

Please sign in to comment.