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:
@@ -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]);
|
||||
}
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user