summaryrefslogtreecommitdiffstats
path: root/tools/gfx/d3d12/d3d12-device.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/d3d12/d3d12-device.cpp')
-rw-r--r--tools/gfx/d3d12/d3d12-device.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/gfx/d3d12/d3d12-device.cpp b/tools/gfx/d3d12/d3d12-device.cpp
index 983f93bce..eb9e597bf 100644
--- a/tools/gfx/d3d12/d3d12-device.cpp
+++ b/tools/gfx/d3d12/d3d12-device.cpp
@@ -1665,9 +1665,11 @@ Result DeviceImpl::createBufferView(
{
auto resourceImpl = (BufferResourceImpl*)buffer;
auto resourceDesc = *resourceImpl->getDesc();
+ const auto counterResourceImpl = static_cast<BufferResourceImpl*>(counterBuffer);
RefPtr<ResourceViewImpl> viewImpl = new ResourceViewImpl();
viewImpl->m_resource = resourceImpl;
+ viewImpl->m_counterResource = counterResourceImpl;
viewImpl->m_desc = desc;
switch (desc.type)
@@ -1722,7 +1724,6 @@ Result DeviceImpl::createBufferView(
}
else
{
- auto counterResourceImpl = static_cast<BufferResourceImpl*>(counterBuffer);
SLANG_RETURN_ON_FAIL(m_cpuViewHeap->allocate(&viewImpl->m_descriptor));
viewImpl->m_allocator = m_cpuViewHeap;
m_device->CreateUnorderedAccessView(