summaryrefslogtreecommitdiff
path: root/tools/gfx/d3d12/d3d12-query.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/d3d12/d3d12-query.cpp')
-rw-r--r--tools/gfx/d3d12/d3d12-query.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/gfx/d3d12/d3d12-query.cpp b/tools/gfx/d3d12/d3d12-query.cpp
index 6b2e92980..d0191e349 100644
--- a/tools/gfx/d3d12/d3d12-query.cpp
+++ b/tools/gfx/d3d12/d3d12-query.cpp
@@ -2,7 +2,6 @@
#include "d3d12-query.h"
#include "d3d12-command-queue.h"
-
#include "d3d12-helper-functions.h"
namespace gfx
@@ -26,8 +25,7 @@ Result QueryPoolImpl::init(const IQueryPool::Desc& desc, DeviceImpl* device)
heapDesc.Type = D3D12_QUERY_HEAP_TYPE_TIMESTAMP;
m_queryType = D3D12_QUERY_TYPE_TIMESTAMP;
break;
- default:
- return SLANG_E_INVALID_ARG;
+ default: return SLANG_E_INVALID_ARG;
}
// Create query heap.
@@ -54,7 +52,8 @@ Result QueryPoolImpl::init(const IQueryPool::Desc& desc, DeviceImpl* device)
// Create command allocator.
SLANG_RETURN_ON_FAIL(d3dDevice->CreateCommandAllocator(
- D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS(m_commandAllocator.writeRef())));
+ D3D12_COMMAND_LIST_TYPE_DIRECT,
+ IID_PPV_ARGS(m_commandAllocator.writeRef())));
// Create command list.
SLANG_RETURN_ON_FAIL(d3dDevice->CreateCommandList(
@@ -99,7 +98,8 @@ Result QueryPoolImpl::getResult(GfxIndex queryIndex, GfxCount count, uint64_t* d
int8_t* mappedData = nullptr;
D3D12_RANGE readRange = {
- sizeof(uint64_t) * queryIndex, sizeof(uint64_t) * (queryIndex + count) };
+ sizeof(uint64_t) * queryIndex,
+ sizeof(uint64_t) * (queryIndex + count)};
m_readBackBuffer.getResource()->Map(0, &readRange, (void**)&mappedData);
memcpy(data, mappedData + sizeof(uint64_t) * queryIndex, sizeof(uint64_t) * count);
m_readBackBuffer.getResource()->Unmap(0, nullptr);
@@ -119,7 +119,9 @@ IQueryPool* PlainBufferProxyQueryPoolImpl::getInterface(const Guid& guid)
}
Result PlainBufferProxyQueryPoolImpl::init(
- const IQueryPool::Desc& desc, DeviceImpl* device, uint32_t stride)
+ const IQueryPool::Desc& desc,
+ DeviceImpl* device,
+ uint32_t stride)
{
ComPtr<IBufferResource> bufferResource;
IBufferResource::Desc bufferDesc = {};
@@ -187,8 +189,8 @@ Result PlainBufferProxyQueryPoolImpl::getResult(GfxIndex queryIndex, GfxCount co
D3D12_RESOURCE_STATE_COPY_DEST,
nullptr));
- encodeInfo.d3dCommandList->CopyBufferRegion(
- stageBuf, 0, m_bufferResource->m_resource.getResource(), 0, size);
+ encodeInfo.d3dCommandList
+ ->CopyBufferRegion(stageBuf, 0, m_bufferResource->m_resource.getResource(), 0, size);
m_device->submitResourceCommandsAndWait(encodeInfo);
void* ptr = nullptr;
stageBuf.getResource()->Map(0, nullptr, &ptr);