d3d12: Update hard-coded heap sizes and batch limit
authorGiancarlo Devich <giancarlodevich@live.com>
Mon, 9 Jan 2023 19:33:20 +0000 (11:33 -0800)
committerMarge Bot <emma+marge@anholt.net>
Tue, 10 Jan 2023 03:22:26 +0000 (03:22 +0000)
Increasing the heap sizes and active batch count reduces flushing
churn when rendering runs out of descriptors.

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

src/gallium/drivers/d3d12/d3d12_batch.cpp
src/gallium/drivers/d3d12/d3d12_context.h

index d61d0a3..3728df8 100644 (file)
@@ -61,18 +61,17 @@ d3d12_init_batch(struct d3d12_context *ctx, struct d3d12_batch *batch)
                                                   IID_PPV_ARGS(&batch->cmdalloc))))
       return false;
 
-
    batch->sampler_heap =
       d3d12_descriptor_heap_new(screen->dev,
                                 D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER,
                                 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE,
-                                128);
+                              1024);
 
    batch->view_heap =
       d3d12_descriptor_heap_new(screen->dev,
                                 D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV,
                                 D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE,
-                                1024);
+                                8096);
 
    if (!batch->sampler_heap && !batch->view_heap)
       return false;
index d3996ab..c28a778 100644 (file)
@@ -177,7 +177,7 @@ struct d3d12_context {
    struct hash_table *compute_transform_cache;
    struct hash_table_u64 *bo_state_table;
 
-   struct d3d12_batch batches[4];
+   struct d3d12_batch batches[8];
    unsigned current_batch_idx;
 
    struct util_dynarray recently_destroyed_bos;