mesa/program: Take ARB_framebuffers_no_attachments into account in wpos correction
authorGert Wollny <gert.wollny@collabora.com>
Mon, 19 Aug 2019 15:41:46 +0000 (17:41 +0200)
committerGert Wollny <gert.wollny@collabora.com>
Tue, 20 Aug 2019 08:04:24 +0000 (10:04 +0200)
If a drawbuffer is an fbo without an attachment then its 'Height' will be zero,
and we have to take its 'DefaultGeometry.Height' into account.

Fixes on softpipe (with the exception of tests that use multisample):
  dEQP-GLES31.functional.fbo.no_attachments.*

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/program/prog_statevars.c

index 3bbe451399f5adea1adad9cc9162eabc4b7255e7..5178b61ec4ad0e00637ace8d1d1d9b578b3ad31f 100644 (file)
@@ -576,11 +576,11 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index16 state[],
             value[0] = 1.0F;
             value[1] = 0.0F;
             value[2] = -1.0F;
-            value[3] = (GLfloat) ctx->DrawBuffer->Height;
+            value[3] = _mesa_geometric_height(ctx->DrawBuffer);
          } else {
             /* Flipping Y upside down (XY) followed by identity (ZW). */
             value[0] = -1.0F;
-            value[1] = (GLfloat) ctx->DrawBuffer->Height;
+            value[1] = _mesa_geometric_height(ctx->DrawBuffer);
             value[2] = 1.0F;
             value[3] = 0.0F;
          }