Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HansKristian-Work/vkd3d-proton.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Kristian Arntzen <post@arntzen-software.no>2022-09-19 17:42:46 +0300
committerHans-Kristian Arntzen <post@arntzen-software.no>2022-09-21 16:31:32 +0300
commit8681971e4a6951b2dde412dd3f2cdfafcf42362c (patch)
treed2810f8db633fd1375488098b6061a200561f0d5
parentc7c10c0f555f83daf1676de29bad75f2689b9b80 (diff)
vkd3d: Add some logging for descriptor heap allocations.
Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
-rw-r--r--libs/vkd3d/resource.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c
index af4669ee..f017ce6a 100644
--- a/libs/vkd3d/resource.c
+++ b/libs/vkd3d/resource.c
@@ -5992,6 +5992,26 @@ static void d3d12_descriptor_heap_init_descriptors(struct d3d12_descriptor_heap
}
}
+#ifndef VKD3D_NO_TRACE_MESSAGES
+static void d3d12_descriptor_heap_report_allocation(const D3D12_DESCRIPTOR_HEAP_DESC *desc)
+{
+ if (desc->Type == D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV)
+ {
+ if (desc->Flags & D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE)
+ TRACE(" %u GPU visible CBV_SRV_UAV descriptors.\n", desc->NumDescriptors);
+ else
+ TRACE(" %u host visible CBV_SRV_UAV descriptors.\n", desc->NumDescriptors);
+ }
+ else if (desc->Type == D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER)
+ {
+ if (desc->Flags & D3D12_DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE)
+ TRACE(" %u GPU visible sampler descriptors.\n", desc->NumDescriptors);
+ else
+ TRACE(" %u host visible sampler descriptors.\n", desc->NumDescriptors);
+ }
+}
+#endif
+
HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device,
const D3D12_DESCRIPTOR_HEAP_DESC *desc, struct d3d12_descriptor_heap **descriptor_heap)
{
@@ -6003,6 +6023,15 @@ HRESULT d3d12_descriptor_heap_create(struct d3d12_device *device,
size_t alignment;
HRESULT hr;
+#ifndef VKD3D_NO_TRACE_MESSAGES
+ if (desc->Type == D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV ||
+ desc->Type == D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER)
+ {
+ TRACE("Allocating descriptor heap:\n");
+ d3d12_descriptor_heap_report_allocation(desc);
+ }
+#endif
+
if (!(descriptor_size = d3d12_device_get_descriptor_handle_increment_size(desc->Type)))
{
WARN("No descriptor size for descriptor type %#x.\n", desc->Type);
@@ -6098,6 +6127,15 @@ void d3d12_descriptor_heap_cleanup(struct d3d12_descriptor_heap *descriptor_heap
const struct vkd3d_vk_device_procs *vk_procs = &descriptor_heap->device->vk_procs;
struct d3d12_device *device = descriptor_heap->device;
+#ifndef VKD3D_NO_TRACE_MESSAGES
+ if (descriptor_heap->desc.Type == D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV ||
+ descriptor_heap->desc.Type == D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER)
+ {
+ TRACE("Freeing descriptor heap:\n");
+ d3d12_descriptor_heap_report_allocation(&descriptor_heap->desc);
+ }
+#endif
+
if (!descriptor_heap->device_allocation.vk_memory)
vkd3d_free(descriptor_heap->host_memory);