Skip to content

Commit 701d3cc

Browse files
Removed a few unneeded autos
1 parent 4915eac commit 701d3cc

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

Graphics/GraphicsEngineD3D11/src/DeviceContextD3D11Impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,7 +1715,7 @@ void DeviceContextD3D11Impl::BeginSubpass()
17151715
const Uint32 RTAttachmentIdx = AttachmentRef.AttachmentIndex;
17161716
if (RTAttachmentIdx != ATTACHMENT_UNUSED)
17171717
{
1718-
const auto AttachmentFirstUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(RTAttachmentIdx).first;
1718+
const Uint32 AttachmentFirstUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(RTAttachmentIdx).first;
17191719
if (AttachmentFirstUse == m_SubpassIndex && RPDesc.pAttachments[RTAttachmentIdx].LoadOp == ATTACHMENT_LOAD_OP_CLEAR)
17201720
{
17211721
if (ITextureView* pTexView = FBDesc.ppAttachments[RTAttachmentIdx])
@@ -1734,7 +1734,7 @@ void DeviceContextD3D11Impl::BeginSubpass()
17341734
Uint32 DSAttachmentIdx = Subpass.pDepthStencilAttachment->AttachmentIndex;
17351735
if (DSAttachmentIdx != ATTACHMENT_UNUSED)
17361736
{
1737-
const auto AttachmentFirstUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(DSAttachmentIdx).first;
1737+
const Uint32 AttachmentFirstUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(DSAttachmentIdx).first;
17381738
if (AttachmentFirstUse == m_SubpassIndex && RPDesc.pAttachments[DSAttachmentIdx].LoadOp == ATTACHMENT_LOAD_OP_CLEAR)
17391739
{
17401740
if (ITextureView* pTexView = FBDesc.ppAttachments[DSAttachmentIdx])
@@ -2557,7 +2557,7 @@ void DeviceContextD3D11Impl::DvpVerifyCommittedResources(TD3D11ResourceType
25572557
(m_pd3d11DeviceContext->*GetResMethod)(0, _countof(pctxResources), pctxResources);
25582558
}
25592559
const auto* CommittedResources = CommittedD3D11ResourcesArr[ShaderInd];
2560-
const auto NumCommittedResources = NumCommittedResourcesArr[ShaderInd];
2560+
const Uint8 NumCommittedResources = NumCommittedResourcesArr[ShaderInd];
25612561
for (Uint32 Slot = 0; Slot < _countof(pctxResources); ++Slot)
25622562
{
25632563
if (Slot < NumCommittedResources)

Graphics/GraphicsEngineD3D12/src/DeviceContextD3D12Impl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2565,7 +2565,7 @@ void DeviceContextD3D12Impl::TransitionResourceStates(Uint32 BarrierCount, const
25652565
#ifdef DILIGENT_DEVELOPMENT
25662566
DvpVerifyStateTransitionDesc(pResourceBarriers[i]);
25672567
#endif
2568-
const auto& Barrier = pResourceBarriers[i];
2568+
const StateTransitionDesc& Barrier = pResourceBarriers[i];
25692569
if (Barrier.Flags & STATE_TRANSITION_FLAG_ALIASING)
25702570
{
25712571
AliasingBarrier(CmdCtx, Barrier.pResourceBefore, Barrier.pResource);
@@ -2703,7 +2703,7 @@ void DeviceContextD3D12Impl::ResolveTextureSubresource(ITexture*
27032703
TEXTURE_FORMAT Format = ResolveAttribs.Format;
27042704
if (Format == TEX_FORMAT_UNKNOWN)
27052705
{
2706-
const auto& SrcFmtAttribs = GetTextureFormatAttribs(SrcTexDesc.Format);
2706+
const TextureFormatAttribs& SrcFmtAttribs = GetTextureFormatAttribs(SrcTexDesc.Format);
27072707
if (!SrcFmtAttribs.IsTypeless)
27082708
{
27092709
Format = SrcTexDesc.Format;

Graphics/GraphicsEngineOpenGL/src/DeviceContextGLImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ void DeviceContextGLImpl::EndSubpass()
606606
const Uint32 RTAttachmentIdx = SubpassDesc.pRenderTargetAttachments[rt].AttachmentIndex;
607607
if (RTAttachmentIdx != ATTACHMENT_UNUSED)
608608
{
609-
auto AttachmentLastUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(RTAttachmentIdx).second;
609+
Uint32 AttachmentLastUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(RTAttachmentIdx).second;
610610
if (AttachmentLastUse == m_SubpassIndex && RPDesc.pAttachments[RTAttachmentIdx].StoreOp == ATTACHMENT_STORE_OP_DISCARD)
611611
{
612612
if (SubpassFBOs.RenderTarget == 0)
@@ -627,7 +627,7 @@ void DeviceContextGLImpl::EndSubpass()
627627
const Uint32 DSAttachmentIdx = SubpassDesc.pDepthStencilAttachment->AttachmentIndex;
628628
if (DSAttachmentIdx != ATTACHMENT_UNUSED)
629629
{
630-
auto AttachmentLastUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(DSAttachmentIdx).second;
630+
Uint32 AttachmentLastUse = m_pActiveRenderPass->GetAttachmentFirstLastUse(DSAttachmentIdx).second;
631631
if (AttachmentLastUse == m_SubpassIndex && RPDesc.pAttachments[DSAttachmentIdx].StoreOp == ATTACHMENT_STORE_OP_DISCARD)
632632
{
633633
const TextureFormatAttribs& FmtAttribs = GetTextureFormatAttribs(RPDesc.pAttachments[DSAttachmentIdx].Format);

Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4008,7 +4008,7 @@ void DeviceContextVkImpl::SetShadingRate(SHADING_RATE BaseRate, SHADING_RATE_COM
40084008
{
40094009
TDeviceContextBase::SetShadingRate(BaseRate, PrimitiveCombiner, TextureCombiner, 0);
40104010

4011-
const auto& ExtFeatures = m_pDevice->GetLogicalDevice().GetEnabledExtFeatures();
4011+
const VulkanUtilities::LogicalDevice::ExtensionFeatures& ExtFeatures = m_pDevice->GetLogicalDevice().GetEnabledExtFeatures();
40124012
if (ExtFeatures.ShadingRate.attachmentFragmentShadingRate != VK_FALSE)
40134013
{
40144014
const VkFragmentShadingRateCombinerOpKHR CombinerOps[2] =
@@ -4136,7 +4136,7 @@ void DeviceContextVkImpl::BindSparseResourceMemory(const BindSparseResourceMemor
41364136
DEV_CHECK_ERR((SrcRange.pMemory != nullptr) == (pMemVk != nullptr),
41374137
"Failed to query IDeviceMemoryVk interface from non-null memory object");
41384138

4139-
const auto MemRangeVk = pMemVk ? pMemVk->GetRange(SrcRange.MemoryOffset, SrcRange.MemorySize) : DeviceMemoryRangeVk{};
4139+
const DeviceMemoryRangeVk MemRangeVk = pMemVk ? pMemVk->GetRange(SrcRange.MemoryOffset, SrcRange.MemorySize) : DeviceMemoryRangeVk{};
41404140
DEV_CHECK_ERR((MemRangeVk.Offset % TexSparseProps.BlockSize) == 0,
41414141
"MemoryOffset must be a multiple of the SparseTextureProperties::BlockSize");
41424142

Tests/DiligentCoreAPITest/src/CopyTextureTest.cpp

Lines changed: 19 additions & 19 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");
@@ -75,17 +75,17 @@ TEXTURE_FORMAT TestFormats[] =
7575

7676
TEST(CopyTexture, Texture2D)
7777
{
78-
auto* pEnv = GPUTestingEnvironment::GetInstance();
79-
auto* pDevice = pEnv->GetDevice();
80-
auto* pContext = pEnv->GetDeviceContext();
78+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
79+
IRenderDevice* pDevice = pEnv->GetDevice();
80+
IDeviceContext* pContext = pEnv->GetDeviceContext();
8181

8282
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
8383

8484
for (size_t f = 0; f < _countof(TestFormats); ++f)
8585
{
8686
GPUTestingEnvironment::ScopedReleaseResources AutoReleaseResources;
8787

88-
auto Format = TestFormats[f];
88+
TEXTURE_FORMAT Format = TestFormats[f];
8989

9090
TextureDesc TexDesc;
9191
TexDesc.Type = RESOURCE_DIM_TEX_2D;
@@ -98,8 +98,8 @@ TEST(CopyTexture, Texture2D)
9898

9999
Diligent::RefCntAutoPtr<ITexture> pSrcTex, pDstTex;
100100

101-
auto FmtAttribs = pDevice->GetTextureFormatInfo(Format);
102-
auto TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
101+
TextureFormatInfo FmtAttribs = pDevice->GetTextureFormatInfo(Format);
102+
Uint32 TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
103103
std::vector<uint8_t> DummyData(size_t{TexDesc.Width} * size_t{TexDesc.Height} * size_t{TexelSize});
104104
TextureData InitData;
105105
InitData.NumSubresources = TexDesc.MipLevels;
@@ -139,17 +139,17 @@ TEST(CopyTexture, Texture2D)
139139

140140
TEST(CopyTexture, Texture2DArray)
141141
{
142-
auto* pEnv = GPUTestingEnvironment::GetInstance();
143-
auto* pDevice = pEnv->GetDevice();
144-
auto* pContext = pEnv->GetDeviceContext();
142+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
143+
IRenderDevice* pDevice = pEnv->GetDevice();
144+
IDeviceContext* pContext = pEnv->GetDeviceContext();
145145

146146
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
147147

148148
for (size_t f = 0; f < _countof(TestFormats); ++f)
149149
{
150150
GPUTestingEnvironment::ScopedReleaseResources AutoReleaseResources;
151151

152-
auto Format = TestFormats[f];
152+
TEXTURE_FORMAT Format = TestFormats[f];
153153

154154
TextureDesc TexDesc;
155155
TexDesc.Type = RESOURCE_DIM_TEX_2D_ARRAY;
@@ -162,8 +162,8 @@ TEST(CopyTexture, Texture2DArray)
162162
TexDesc.Usage = USAGE_DEFAULT;
163163

164164
Diligent::RefCntAutoPtr<ITexture> pSrcTex, pDstTex;
165-
auto FmtAttribs = pDevice->GetTextureFormatInfo(Format);
166-
auto TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
165+
TextureFormatInfo FmtAttribs = pDevice->GetTextureFormatInfo(Format);
166+
Uint32 TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
167167
std::vector<uint8_t> DummyData(size_t{TexDesc.Width} * size_t{TexDesc.Height} * size_t{TexelSize});
168168
TextureData InitData;
169169
InitData.NumSubresources = TexDesc.MipLevels * TexDesc.ArraySize;
@@ -212,17 +212,17 @@ TEST(CopyTexture, Texture2DArray)
212212

213213
TEST(CopyTexture, Texture3D)
214214
{
215-
auto* pEnv = GPUTestingEnvironment::GetInstance();
216-
auto* pDevice = pEnv->GetDevice();
217-
auto* pContext = pEnv->GetDeviceContext();
215+
GPUTestingEnvironment* pEnv = GPUTestingEnvironment::GetInstance();
216+
IRenderDevice* pDevice = pEnv->GetDevice();
217+
IDeviceContext* pContext = pEnv->GetDeviceContext();
218218

219219
GPUTestingEnvironment::ScopedReset EnvironmentAutoReset;
220220

221221
for (size_t f = 0; f < _countof(TestFormats); ++f)
222222
{
223223
GPUTestingEnvironment::ScopedReleaseResources AutoReleaseResources;
224224

225-
auto Format = TestFormats[f];
225+
TEXTURE_FORMAT Format = TestFormats[f];
226226

227227
TextureDesc TexDesc;
228228
TexDesc.Type = RESOURCE_DIM_TEX_3D;
@@ -236,8 +236,8 @@ TEST(CopyTexture, Texture3D)
236236

237237
Diligent::RefCntAutoPtr<ITexture> pSrcTex, pDstTex;
238238

239-
auto FmtAttribs = pDevice->GetTextureFormatInfo(Format);
240-
auto TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
239+
TextureFormatInfo FmtAttribs = pDevice->GetTextureFormatInfo(Format);
240+
Uint32 TexelSize = Uint32{FmtAttribs.ComponentSize} * Uint32{FmtAttribs.NumComponents};
241241
std::vector<uint8_t> DummyData(size_t{TexDesc.Width} * size_t{TexDesc.Height} * size_t{TexDesc.Depth} * size_t{TexelSize});
242242
TextureData InitData;
243243
InitData.NumSubresources = TexDesc.MipLevels;

0 commit comments

Comments
 (0)