summaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2020-02-27 14:29:05 -0500
committerMarge Bot <[email protected]>2020-02-28 14:04:20 +0000
commitd195eef05d2eb063ab82d680950b40eb9127265e (patch)
treeeddbc5c95b0516c8cef5973f6d251cd4262ce4ff /src/freedreno
parentde3230e0a5d90911f8a4e376629e264278dffc00 (diff)
turnip: fall back to sysmem when attachments don't fit into gmem
Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3979>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/vulkan/tu_cmd_buffer.c10
-rw-r--r--src/freedreno/vulkan/tu_pass.c1
2 files changed, 10 insertions, 1 deletions
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index a3d5a93f3a3..9b4ee7637a6 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -219,6 +219,12 @@ tu_tiling_config_update_tile_layout(struct tu_tiling_config *tiling,
align(DIV_ROUND_UP(ra_width, tiling->tile_count.width), tile_align_w);
}
+ /* 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 (!pixels)
+ return;
+
/* do not exceed gmem size */
while (tiling->tile0.extent.width * tiling->tile0.extent.height > pixels) {
if (tiling->tile0.extent.width > MAX2(tile_align_w, tiling->tile0.extent.height)) {
@@ -767,6 +773,10 @@ use_sysmem_rendering(struct tu_cmd_buffer *cmd)
if (unlikely(cmd->device->physical_device->instance->debug_flags & TU_DEBUG_SYSMEM))
return true;
+ /* can't fit attachments into gmem */
+ if (!cmd->state.pass->gmem_pixels)
+ return true;
+
return cmd->state.tiling_config.force_sysmem;
}
diff --git a/src/freedreno/vulkan/tu_pass.c b/src/freedreno/vulkan/tu_pass.c
index eca129ba804..26ce2b4958f 100644
--- a/src/freedreno/vulkan/tu_pass.c
+++ b/src/freedreno/vulkan/tu_pass.c
@@ -81,7 +81,6 @@ compute_gmem_offsets(struct tu_render_pass *pass, uint32_t gmem_size)
}
pass->gmem_pixels = pixels;
- assert(pixels);
}
VkResult