turnip: estimate render pass costs

They will be used by autotuner.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16733>
This commit is contained in:
Chia-I Wu
2022-05-26 09:22:40 -07:00
committed by Marge Bot
parent fe9a2374e6
commit ce118a7002
2 changed files with 27 additions and 0 deletions

View File

@@ -885,6 +885,28 @@ tu_CreateRenderPass2(VkDevice _device,
tu_render_pass_gmem_config(pass, device->physical_device);
}
for (uint32_t i = 0; i < pass->attachment_count; i++) {
const struct tu_render_pass_attachment *att = &pass->attachments[i];
/* approximate tu_load_gmem_attachment */
if (att->load)
pass->gmem_bandwidth_per_pixel += att->cpp;
/* approximate tu_store_gmem_attachment */
if (att->store)
pass->gmem_bandwidth_per_pixel += att->cpp;
/* approximate tu_clear_sysmem_attachment */
if (att->clear_mask)
pass->sysmem_bandwidth_per_pixel += att->cpp;
/* approximate tu6_emit_sysmem_resolves */
if (att->will_be_resolved) {
pass->sysmem_bandwidth_per_pixel +=
att->cpp + att->cpp / att->samples;
}
}
for (unsigned i = 0; i < pCreateInfo->dependencyCount; ++i) {
tu_render_pass_add_subpass_dep(pass, &pCreateInfo->pDependencies[i]);
}

View File

@@ -1912,6 +1912,11 @@ struct tu_render_pass
uint32_t subpass_count;
uint32_t gmem_pixels;
uint32_t tile_align_w;
/* memory bandwidth costs (in bytes) for gmem / sysmem rendering */
uint32_t gmem_bandwidth_per_pixel;
uint32_t sysmem_bandwidth_per_pixel;
struct tu_subpass_attachment *subpass_attachments;
struct tu_render_pass_attachment *attachments;
struct tu_subpass_barrier end_barrier;