Skip to content

Commit 0a37ae9

Browse files
GraphicsEngineD3D11: don't use auto where unnecessary
1 parent aec5216 commit 0a37ae9

15 files changed

+212
-212
lines changed

Graphics/GraphicsEngineD3D11/src/BufferD3D11Impl.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2023 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -119,13 +119,13 @@ BufferD3D11Impl::BufferD3D11Impl(IReferenceCounters* pRefCounters,
119119
InitData.SysMemPitch = 0;
120120
InitData.SysMemSlicePitch = 0;
121121

122-
auto* pDeviceD3D11 = pRenderDeviceD3D11->GetD3D11Device();
122+
ID3D11Device* pDeviceD3D11 = pRenderDeviceD3D11->GetD3D11Device();
123123
CHECK_D3D_RESULT_THROW(pDeviceD3D11->CreateBuffer(&D3D11BuffDesc, InitData.pSysMem ? &InitData : nullptr, &m_pd3d11Buffer),
124124
"Failed to create the Direct3D11 buffer");
125125

126126
if (*m_Desc.Name != 0)
127127
{
128-
auto hr = m_pd3d11Buffer->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
128+
HRESULT hr = m_pd3d11Buffer->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
129129
DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set buffer name");
130130
}
131131

@@ -145,15 +145,15 @@ static BufferDesc BuffDescFromD3D11Buffer(ID3D11Buffer* pd3d11Buffer, BufferDesc
145145
") does not match the d3d11 buffer size (", D3D11BuffDesc.ByteWidth, ")");
146146
BuffDesc.Size = Uint32{D3D11BuffDesc.ByteWidth};
147147

148-
auto BindFlags = D3D11BindFlagsToBindFlags(D3D11BuffDesc.BindFlags);
148+
BIND_FLAGS BindFlags = D3D11BindFlagsToBindFlags(D3D11BuffDesc.BindFlags);
149149
if (D3D11BuffDesc.MiscFlags & D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS)
150150
BindFlags |= BIND_INDIRECT_DRAW_ARGS;
151151
VERIFY(BuffDesc.BindFlags == 0 || BuffDesc.BindFlags == BindFlags,
152152
"Bind flags specified by the BufferDesc (", GetBindFlagsString(BuffDesc.BindFlags),
153153
") do not match the bind flags recovered from d3d11 buffer desc (", GetBindFlagsString(BindFlags), ")");
154154
BuffDesc.BindFlags = BindFlags;
155155

156-
auto Usage = D3D11UsageToUsage(D3D11BuffDesc.Usage);
156+
USAGE Usage = D3D11UsageToUsage(D3D11BuffDesc.Usage);
157157
if (D3D11BuffDesc.MiscFlags & D3D11_RESOURCE_MISC_TILED)
158158
{
159159
VERIFY_EXPR(Usage == USAGE_DEFAULT);
@@ -167,7 +167,7 @@ static BufferDesc BuffDescFromD3D11Buffer(ID3D11Buffer* pd3d11Buffer, BufferDesc
167167
") does not match the buffer usage recovered from d3d11 buffer desc (", GetUsageString(Usage), ")");
168168
BuffDesc.Usage = Usage;
169169

170-
auto CPUAccessFlags = D3D11CPUAccessFlagsToCPUAccessFlags(D3D11BuffDesc.CPUAccessFlags);
170+
CPU_ACCESS_FLAGS CPUAccessFlags = D3D11CPUAccessFlagsToCPUAccessFlags(D3D11BuffDesc.CPUAccessFlags);
171171
VERIFY(BuffDesc.CPUAccessFlags == 0 || BuffDesc.CPUAccessFlags == CPUAccessFlags,
172172
"CPU access flags specified by the BufferDesc (", GetCPUAccessFlagsString(BuffDesc.CPUAccessFlags),
173173
") do not match CPU access flags recovered from d3d11 buffer desc (", GetCPUAccessFlagsString(CPUAccessFlags), ")");
@@ -250,8 +250,8 @@ void BufferD3D11Impl::CreateViewInternal(const BufferViewDesc& OrigViewDesc, IBu
250250

251251
try
252252
{
253-
auto* pDeviceD3D11Impl = GetDevice();
254-
auto& BuffViewAllocator = pDeviceD3D11Impl->GetBuffViewObjAllocator();
253+
RenderDeviceD3D11Impl* pDeviceD3D11Impl = GetDevice();
254+
FixedBlockMemoryAllocator& BuffViewAllocator = pDeviceD3D11Impl->GetBuffViewObjAllocator();
255255
VERIFY(&BuffViewAllocator == &m_dbgBuffViewAllocator, "Buff view allocator does not match allocator provided at buffer initialization");
256256

257257
BufferViewDesc ViewDesc = OrigViewDesc;
@@ -273,7 +273,7 @@ void BufferD3D11Impl::CreateViewInternal(const BufferViewDesc& OrigViewDesc, IBu
273273
}
274274
catch (const std::runtime_error&)
275275
{
276-
const auto* ViewTypeName = GetBufferViewTypeLiteralName(OrigViewDesc.ViewType);
276+
const char* ViewTypeName = GetBufferViewTypeLiteralName(OrigViewDesc.ViewType);
277277
LOG_ERROR("Failed to create view \"", OrigViewDesc.Name ? OrigViewDesc.Name : "", "\" (", ViewTypeName, ") for buffer \"", m_Desc.Name, "\"");
278278
}
279279
}
@@ -285,7 +285,7 @@ void BufferD3D11Impl::CreateUAV(BufferViewDesc& UAVDesc, ID3D11UnorderedAccessVi
285285
D3D11_UNORDERED_ACCESS_VIEW_DESC D3D11_UAVDesc;
286286
BufferViewDesc_to_D3D11_UAV_DESC(m_Desc, UAVDesc, D3D11_UAVDesc);
287287

288-
auto* pd3d11Device = GetDevice()->GetD3D11Device();
288+
ID3D11Device* pd3d11Device = GetDevice()->GetD3D11Device();
289289
CHECK_D3D_RESULT_THROW(pd3d11Device->CreateUnorderedAccessView(m_pd3d11Buffer, &D3D11_UAVDesc, ppD3D11UAV),
290290
"Failed to create D3D11 unordered access view");
291291
}
@@ -297,7 +297,7 @@ void BufferD3D11Impl::CreateSRV(struct BufferViewDesc& SRVDesc, ID3D11ShaderReso
297297
D3D11_SHADER_RESOURCE_VIEW_DESC D3D11_SRVDesc;
298298
BufferViewDesc_to_D3D11_SRV_DESC(m_Desc, SRVDesc, D3D11_SRVDesc);
299299

300-
auto* pd3d11Device = GetDevice()->GetD3D11Device();
300+
ID3D11Device* pd3d11Device = GetDevice()->GetD3D11Device();
301301
CHECK_D3D_RESULT_THROW(pd3d11Device->CreateShaderResourceView(m_pd3d11Buffer, &D3D11_SRVDesc, ppD3D11SRV),
302302
"Failed to create D3D11 shader resource view");
303303
}
@@ -307,7 +307,7 @@ SparseBufferProperties BufferD3D11Impl::GetSparseProperties() const
307307
DEV_CHECK_ERR(m_Desc.Usage == USAGE_SPARSE,
308308
"IBuffer::GetSparseProperties() should only be used for sparse buffer");
309309

310-
auto* pd3d11Device2 = m_pDevice->GetD3D11Device2();
310+
ID3D11Device2* pd3d11Device2 = m_pDevice->GetD3D11Device2();
311311

312312
UINT NumTilesForEntireResource = 0;
313313
D3D11_TILE_SHAPE StandardTileShapeForNonPackedMips{};

Graphics/GraphicsEngineD3D11/src/BufferViewD3D11Impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -53,7 +53,7 @@ BufferViewD3D11Impl::BufferViewD3D11Impl(IReferenceCounters* pRefCounters,
5353
{
5454
if (*m_Desc.Name != 0)
5555
{
56-
auto hr = m_pD3D11View->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
56+
HRESULT hr = m_pD3D11View->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name);
5757
DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set buffer view name");
5858
}
5959
}

Graphics/GraphicsEngineD3D11/src/D3D11TypeConversions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -72,7 +72,7 @@ void BlendStateDesc_To_D3D11_BLEND_DESC(const BlendStateDesc& BSDesc,
7272

7373
for (int i = 0; i < 8; ++i)
7474
{
75-
const auto& SrcRTDesc = BSDesc.RenderTargets[i];
75+
const RenderTargetBlendDesc& SrcRTDesc = BSDesc.RenderTargets[i];
7676
if (SrcRTDesc.LogicOperationEnable)
7777
{
7878
LOG_ERROR("Logical operations on render targets are not supported by D3D11 device");

Graphics/GraphicsEngineD3D11/src/DeviceMemoryD3D11Impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -48,7 +48,7 @@ DeviceMemoryD3D11Impl::DeviceMemoryD3D11Impl(IReferenceCounters* pRefC
4848
D3D11BuffDesc.MiscFlags = D3D11_RESOURCE_MISC_TILE_POOL;
4949
D3D11BuffDesc.Usage = D3D11_USAGE_DEFAULT;
5050

51-
auto* pDeviceD3D11 = m_pDevice->GetD3D11Device();
51+
ID3D11Device* pDeviceD3D11 = m_pDevice->GetD3D11Device();
5252
CHECK_D3D_RESULT_THROW(pDeviceD3D11->CreateBuffer(&D3D11BuffDesc, nullptr, &m_pd3d11Buffer),
5353
"Failed to create Direct3D11 tile pool");
5454
}
@@ -69,7 +69,7 @@ Bool DeviceMemoryD3D11Impl::Resize(Uint64 NewSize)
6969

7070
DvpVerifyResize(NewSize);
7171

72-
auto pImmediateCtx = m_pDevice->GetImmediateContext(0);
72+
RefCntAutoPtr<DeviceContextD3D11Impl> pImmediateCtx = m_pDevice->GetImmediateContext(0);
7373
VERIFY(pImmediateCtx, "Immediate context has been released");
7474

7575
return pImmediateCtx->ResizeTilePool(m_pd3d11Buffer, StaticCast<UINT>(NewSize));

Graphics/GraphicsEngineD3D11/src/FenceD3D11Impl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,9 +55,9 @@ Uint64 FenceD3D11Impl::GetCompletedValue()
5555
{
5656
while (!m_PendingQueries.empty())
5757
{
58-
auto& QueryData = m_PendingQueries.front();
59-
BOOL Data;
60-
auto res = QueryData.pd3d11Ctx->GetData(QueryData.pd3d11Query, &Data, sizeof(Data), D3D11_ASYNC_GETDATA_DONOTFLUSH);
58+
PendingFenceData& QueryData = m_PendingQueries.front();
59+
BOOL Data = FALSE;
60+
HRESULT res = QueryData.pd3d11Ctx->GetData(QueryData.pd3d11Query, &Data, sizeof(Data), D3D11_ASYNC_GETDATA_DONOTFLUSH);
6161
if (res == S_OK)
6262
{
6363
VERIFY_EXPR(Data == TRUE);
@@ -82,7 +82,7 @@ void FenceD3D11Impl::Wait(Uint64 Value, bool FlushCommands)
8282
{
8383
while (!m_PendingQueries.empty())
8484
{
85-
auto& QueryData = m_PendingQueries.front();
85+
PendingFenceData& QueryData = m_PendingQueries.front();
8686
if (QueryData.Value > Value)
8787
break;
8888

Graphics/GraphicsEngineD3D11/src/PipelineResourceSignatureD3D11Impl.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ void ValidatePipelineResourceSignatureDescD3D11(const PipelineResourceSignatureD
4444
{
4545
for (Uint32 i = 0; i < Desc.NumResources; ++i)
4646
{
47-
const auto& ResDesc = Desc.Resources[i];
48-
const auto Range = PipelineResourceSignatureD3D11Impl::ShaderResourceTypeToRange(ResDesc.ResourceType);
47+
const PipelineResourceDesc& ResDesc = Desc.Resources[i];
48+
const D3D11_RESOURCE_RANGE Range = PipelineResourceSignatureD3D11Impl::ShaderResourceTypeToRange(ResDesc.ResourceType);
4949

5050
constexpr SHADER_TYPE UAVStages = SHADER_TYPE_PIXEL | SHADER_TYPE_COMPUTE;
5151
if (Range == D3D11_RESOURCE_RANGE_UAV && (ResDesc.ShaderStages & ~UAVStages) != 0)
@@ -359,7 +359,7 @@ void PipelineResourceSignatureD3D11Impl::InitSRBResourceCache(ShaderResourceCach
359359
// Copy immutable samplers.
360360
for (Uint32 i = 0; i < m_Desc.NumImmutableSamplers; ++i)
361361
{
362-
const auto& ImtblSampAttr = GetImmutableSamplerAttribs(i);
362+
const ImmutableSamplerAttribsD3D11& ImtblSampAttr = GetImmutableSamplerAttribs(i);
363363
VERIFY_EXPR(ImtblSampAttr.IsAllocated());
364364
VERIFY_EXPR(m_pImmutableSamplers != nullptr && m_pImmutableSamplers[i]);
365365
VERIFY_EXPR(ImtblSampAttr.ArraySize > 0);
@@ -375,13 +375,13 @@ void PipelineResourceSignatureD3D11Impl::UpdateShaderResourceBindingMap(Resource
375375
const D3D11ShaderResourceCounters& BaseBindings) const
376376
{
377377
VERIFY(ShaderStage != SHADER_TYPE_UNKNOWN && IsPowerOfTwo(ShaderStage), "Only single shader stage must be provided.");
378-
const auto ShaderInd = GetShaderTypeIndex(ShaderStage);
378+
const Int32 ShaderInd = GetShaderTypeIndex(ShaderStage);
379379

380380
for (Uint32 r = 0, ResCount = GetTotalResourceCount(); r < ResCount; ++r)
381381
{
382-
const auto& ResDesc = GetResourceDesc(r);
383-
const auto& ResAttr = GetResourceAttribs(r);
384-
const auto Range = ShaderResourceTypeToRange(ResDesc.ResourceType);
382+
const PipelineResourceDesc& ResDesc = GetResourceDesc(r);
383+
const PipelineResourceAttribsD3D11& ResAttr = GetResourceAttribs(r);
384+
const D3D11_RESOURCE_RANGE Range = ShaderResourceTypeToRange(ResDesc.ResourceType);
385385

386386
if ((ResDesc.ShaderStages & ShaderStage) != 0)
387387
{
@@ -393,7 +393,7 @@ void PipelineResourceSignatureD3D11Impl::UpdateShaderResourceBindingMap(Resource
393393
ResDesc.ArraySize,
394394
ResDesc.ResourceType //
395395
};
396-
auto IsUnique = ResourceMap.emplace(HashMapStringKey{ResDesc.Name}, BindInfo).second;
396+
bool IsUnique = ResourceMap.emplace(HashMapStringKey{ResDesc.Name}, BindInfo).second;
397397
VERIFY(IsUnique, "Shader resource '", ResDesc.Name,
398398
"' already present in the binding map. Every shader resource in PSO must be unambiguously defined by "
399399
"only one resource signature. This error should've been caught by ValidatePipelineResourceSignatures().");
@@ -407,9 +407,9 @@ void PipelineResourceSignatureD3D11Impl::UpdateShaderResourceBindingMap(Resource
407407
//
408408
for (Uint32 samp = 0, SampCount = GetImmutableSamplerCount(); samp < SampCount; ++samp)
409409
{
410-
const auto& ImtblSam = GetImmutableSamplerDesc(samp);
411-
const auto& SampAttr = GetImmutableSamplerAttribs(samp);
412-
const auto Range = D3D11_RESOURCE_RANGE_SAMPLER;
410+
const ImmutableSamplerDesc& ImtblSam = GetImmutableSamplerDesc(samp);
411+
const ImmutableSamplerAttribsD3D11& SampAttr = GetImmutableSamplerAttribs(samp);
412+
const D3D11_RESOURCE_RANGE Range = D3D11_RESOURCE_RANGE_SAMPLER;
413413

414414
VERIFY_EXPR(SampAttr.IsAllocated());
415415
if ((ImtblSam.ShaderStages & ShaderStage) != 0)
@@ -432,7 +432,7 @@ void PipelineResourceSignatureD3D11Impl::UpdateShaderResourceBindingMap(Resource
432432
#ifdef DILIGENT_DEBUG
433433
if (!it_inserted.second)
434434
{
435-
const auto& ExistingBindInfo = it_inserted.first->second;
435+
const ResourceBinding::BindInfo& ExistingBindInfo = it_inserted.first->second;
436436
VERIFY(ExistingBindInfo.BindPoint == BindInfo.BindPoint,
437437
"Bind point defined by the immutable sampler attribs is inconsistent with the bind point defined by the sampler resource. "
438438
"This may be a bug in CreateLayout().");
@@ -453,8 +453,8 @@ bool PipelineResourceSignatureD3D11Impl::DvpValidateCommittedResource(const D3DS
453453
const char* PSOName) const
454454
{
455455
VERIFY_EXPR(ResIndex < m_Desc.NumResources);
456-
const auto& ResDesc = m_Desc.Resources[ResIndex];
457-
const auto& ResAttr = m_pResourceAttribs[ResIndex];
456+
const PipelineResourceDesc& ResDesc = m_Desc.Resources[ResIndex];
457+
const PipelineResourceAttribsD3D11& ResAttr = m_pResourceAttribs[ResIndex];
458458
VERIFY(strcmp(ResDesc.Name, D3DAttribs.Name) == 0, "Inconsistent resource names");
459459

460460
VERIFY_EXPR(D3DAttribs.BindCount <= ResDesc.ArraySize);
@@ -497,7 +497,7 @@ bool PipelineResourceSignatureD3D11Impl::DvpValidateCommittedResource(const D3DS
497497
continue;
498498
}
499499

500-
const auto& SRV = ResourceCache.GetResource<D3D11_RESOURCE_RANGE_SRV>(ResAttr.BindPoints + ArrInd);
500+
const ShaderResourceCacheD3D11::CachedResource& SRV = ResourceCache.GetResource<D3D11_RESOURCE_RANGE_SRV>(ResAttr.BindPoints + ArrInd);
501501
if (SRV.pTexture)
502502
{
503503
if (!ValidateResourceViewDimension(D3DAttribs.Name, D3DAttribs.BindCount, ArrInd, SRV.pView.RawPtr<TextureViewD3D11Impl>(),
@@ -523,7 +523,7 @@ bool PipelineResourceSignatureD3D11Impl::DvpValidateCommittedResource(const D3DS
523523
BindingsOK = false;
524524
continue;
525525
}
526-
const auto& UAV = ResourceCache.GetResource<D3D11_RESOURCE_RANGE_UAV>(ResAttr.BindPoints + ArrInd);
526+
const ShaderResourceCacheD3D11::CachedResource& UAV = ResourceCache.GetResource<D3D11_RESOURCE_RANGE_UAV>(ResAttr.BindPoints + ArrInd);
527527
if (UAV.pTexture)
528528
{
529529
if (!ValidateResourceViewDimension(D3DAttribs.Name, D3DAttribs.BindCount, ArrInd, UAV.pView.RawPtr<TextureViewD3D11Impl>(),

Graphics/GraphicsEngineD3D11/src/QueryD3D11Impl.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2022 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -65,11 +65,11 @@ QueryD3D11Impl::QueryD3D11Impl(IReferenceCounters* pRefCounters,
6565
default:
6666
UNEXPECTED("Unexpected query type");
6767
}
68-
auto* pd3d11Device = pDevice->GetD3D11Device();
68+
ID3D11Device* pd3d11Device = pDevice->GetD3D11Device();
6969

7070
for (Uint32 i = 0; i < (Desc.Type == QUERY_TYPE_DURATION ? Uint32{2} : Uint32{1}); ++i)
7171
{
72-
auto hr = pd3d11Device->CreateQuery(&d3d11QueryDesc, &m_pd3d11Query[i]);
72+
HRESULT hr = pd3d11Device->CreateQuery(&d3d11QueryDesc, &m_pd3d11Query[i]);
7373
CHECK_D3D_RESULT_THROW(hr, "Failed to create D3D11 query object");
7474
VERIFY_EXPR(m_pd3d11Query[i] != nullptr);
7575
}
@@ -92,7 +92,7 @@ bool QueryD3D11Impl::GetData(void* pData, Uint32 DataSize, bool AutoInvalidate)
9292
}
9393
else
9494
{
95-
auto pImmediateCtx = m_pDevice->GetImmediateContext(0);
95+
RefCntAutoPtr<DeviceContextD3D11Impl> pImmediateCtx = m_pDevice->GetImmediateContext(0);
9696
VERIFY(pImmediateCtx, "Immediate context has been released");
9797
pd3d11Ctx = pImmediateCtx->GetD3D11DeviceContext();
9898
}
@@ -106,8 +106,8 @@ bool QueryD3D11Impl::GetData(void* pData, Uint32 DataSize, bool AutoInvalidate)
106106
DataReady = pd3d11Ctx->GetData(m_pd3d11Query[0], &NumSamples, sizeof(NumSamples), 0) == S_OK;
107107
if (DataReady && pData != nullptr)
108108
{
109-
auto& QueryData = *reinterpret_cast<QueryDataOcclusion*>(pData);
110-
QueryData.NumSamples = NumSamples;
109+
QueryDataOcclusion& QueryData = *reinterpret_cast<QueryDataOcclusion*>(pData);
110+
QueryData.NumSamples = NumSamples;
111111
}
112112
}
113113
break;
@@ -118,8 +118,8 @@ bool QueryD3D11Impl::GetData(void* pData, Uint32 DataSize, bool AutoInvalidate)
118118
DataReady = pd3d11Ctx->GetData(m_pd3d11Query[0], &AnySamplePassed, sizeof(AnySamplePassed), 0) == S_OK;
119119
if (DataReady && pData != nullptr)
120120
{
121-
auto& QueryData = *reinterpret_cast<QueryDataBinaryOcclusion*>(pData);
122-
QueryData.AnySamplePassed = AnySamplePassed != FALSE;
121+
QueryDataBinaryOcclusion& QueryData = *reinterpret_cast<QueryDataBinaryOcclusion*>(pData);
122+
QueryData.AnySamplePassed = AnySamplePassed != FALSE;
123123
}
124124
}
125125
break;
@@ -146,8 +146,8 @@ bool QueryD3D11Impl::GetData(void* pData, Uint32 DataSize, bool AutoInvalidate)
146146

147147
if (DataReady)
148148
{
149-
auto& QueryData = *reinterpret_cast<QueryDataTimestamp*>(pData);
150-
QueryData.Counter = Counter;
149+
QueryDataTimestamp& QueryData = *reinterpret_cast<QueryDataTimestamp*>(pData);
150+
QueryData.Counter = Counter;
151151
// The timestamp returned by ID3D11DeviceContext::GetData for a timestamp query is only reliable if Disjoint is FALSE.
152152
QueryData.Frequency = DisjointQueryData.Disjoint ? 0 : DisjointQueryData.Frequency;
153153
}
@@ -162,7 +162,7 @@ bool QueryD3D11Impl::GetData(void* pData, Uint32 DataSize, bool AutoInvalidate)
162162
DataReady = pd3d11Ctx->GetData(m_pd3d11Query[0], &d3d11QueryData, sizeof(d3d11QueryData), 0) == S_OK;
163163
if (DataReady && pData != nullptr)
164164
{
165-
auto& QueryData = *reinterpret_cast<QueryDataPipelineStatistics*>(pData);
165+
QueryDataPipelineStatistics& QueryData = *reinterpret_cast<QueryDataPipelineStatistics*>(pData);
166166

167167
QueryData.InputVertices = d3d11QueryData.IAVertices;
168168
QueryData.InputPrimitives = d3d11QueryData.IAPrimitives;
@@ -206,7 +206,7 @@ bool QueryD3D11Impl::GetData(void* pData, Uint32 DataSize, bool AutoInvalidate)
206206

207207
if (DataReady)
208208
{
209-
auto& QueryData = *reinterpret_cast<QueryDataDuration*>(pData);
209+
QueryDataDuration& QueryData = *reinterpret_cast<QueryDataDuration*>(pData);
210210
VERIFY_EXPR(EndCounter >= StartCounter);
211211
QueryData.Duration = EndCounter - StartCounter;
212212
// The timestamp returned by ID3D11DeviceContext::GetData for a timestamp query is only reliable if Disjoint is FALSE.

0 commit comments

Comments
 (0)