turnip: Ensure that there is no renderpass rotation in binning
authorDanylo Piliaiev <dpiliaiev@igalia.com>
Mon, 6 Feb 2023 19:38:41 +0000 (20:38 +0100)
committerMarge Bot <emma+marge@anholt.net>
Fri, 10 Feb 2023 20:29:40 +0000 (20:29 +0000)
It appears that A6XX_GRAS_SC_CNTL::rotation applies to the binning,
so we should ensure there is no unexpected rotations and apply with
A6XX_GRAS_SC_CNTL during the binning pass.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>

src/freedreno/vulkan/tu_cmd_buffer.c

index 6a551ab..b35c690 100644 (file)
@@ -555,9 +555,15 @@ tu_cs_emit_draw_state(struct tu_cs *cs, uint32_t id, struct tu_draw_state state)
       enable_mask = CP_SET_DRAW_STATE__0_GMEM;
       break;
    case TU_DRAW_STATE_INPUT_ATTACHMENTS_SYSMEM:
-   case TU_DRAW_STATE_PRIM_MODE_SYSMEM:
       enable_mask = CP_SET_DRAW_STATE__0_SYSMEM;
       break;
+   case TU_DRAW_STATE_PRIM_MODE_SYSMEM:
+      /* By also applying the state during binning we ensure that there
+       * is no rotation applied, by previous A6XX_GRAS_SC_CNTL::rotation.
+       */
+      enable_mask =
+         CP_SET_DRAW_STATE__0_SYSMEM | CP_SET_DRAW_STATE__0_BINNING;
+      break;
    default:
       enable_mask = CP_SET_DRAW_STATE__0_GMEM |
                     CP_SET_DRAW_STATE__0_SYSMEM |