Module: Mesa
Branch: main
Commit: e27f84c56e1c0026edfc31aee9fe909763da81d9
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=e27f84c56e1c0026edfc31aee9fe909763da81d9

Author: Emma Anholt <[email protected]>
Date:   Wed Feb  1 15:20:14 2023 -0800

tu: Mark tiling impossible if we couldn't lay out gmem in the first place.

We were leaving the field undefined, which tripped me up later.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21004>

---

 src/freedreno/vulkan/tu_cmd_buffer.c | 3 +--
 src/freedreno/vulkan/tu_util.c       | 4 +++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c 
b/src/freedreno/vulkan/tu_cmd_buffer.c
index cd19e2a52af..711fbd368bd 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -686,8 +686,7 @@ use_sysmem_rendering(struct tu_cmd_buffer *cmd,
       return true;
 
    /* can't fit attachments into gmem */
-   if (!cmd->state.pass->gmem_pixels[cmd->state.gmem_layout] ||
-       !cmd->state.tiling->possible)
+   if (!cmd->state.tiling->possible)
       return true;
 
    if (cmd->state.framebuffer->layers > 1)
diff --git a/src/freedreno/vulkan/tu_util.c b/src/freedreno/vulkan/tu_util.c
index 07a9df29d4f..46880f20fb1 100644
--- a/src/freedreno/vulkan/tu_util.c
+++ b/src/freedreno/vulkan/tu_util.c
@@ -174,8 +174,10 @@ tu_tiling_config_update_tile_layout(struct tu_framebuffer 
*fb,
    /* will force to sysmem, don't bother trying to have a valid tile config
     * TODO: just skip all GMEM stuff when sysmem is forced?
     */
-   if (!pass->gmem_pixels[gmem_layout])
+   if (!pass->gmem_pixels[gmem_layout]) {
+      tiling->possible = false;
       return;
+   }
 
    if (TU_DEBUG(FORCEBIN)) {
       /* start with 2x2 tiles */

Reply via email to