Skip to content

Commit 78a2c7b

Browse files
Code refactoring: don't use auto where unnecessary
1 parent 2d65ec4 commit 78a2c7b

File tree

11 files changed

+429
-177
lines changed

11 files changed

+429
-177
lines changed

Components/src/GBuffer.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 Diligent Graphics LLC
2+
* Copyright 2023-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.
@@ -38,13 +38,13 @@ static std::vector<GBuffer::ElementDesc> GetGBufferElementDescs(const GBuffer::E
3838
size_t NumElements)
3939
{
4040
std::vector<GBuffer::ElementDesc> Elems{Elements, Elements + NumElements};
41-
for (auto& ElemDesc : Elems)
41+
for (GBuffer::ElementDesc& ElemDesc : Elems)
4242
{
4343
DEV_CHECK_ERR(ElemDesc.Format != TEX_FORMAT_UNKNOWN, "GBuffer element format is not specified");
4444

4545
if (ElemDesc.BindFlags == BIND_NONE)
4646
{
47-
const auto& FmtAttribs = GetTextureFormatAttribs(ElemDesc.Format);
47+
const TextureFormatAttribs& FmtAttribs = GetTextureFormatAttribs(ElemDesc.Format);
4848
if (FmtAttribs.ComponentType == COMPONENT_TYPE_DEPTH || FmtAttribs.ComponentType == COMPONENT_TYPE_DEPTH_STENCIL)
4949
{
5050
ElemDesc.BindFlags = BIND_DEPTH_STENCIL | BIND_SHADER_RESOURCE;
@@ -97,7 +97,7 @@ void GBuffer::Resize(IRenderDevice* pDevice, Uint32 Width, Uint32 Height)
9797
TexDesc.Usage = USAGE_DEFAULT;
9898
TexDesc.Type = RESOURCE_DIM_TEX_2D;
9999

100-
for (const auto& ElemDesc : m_ElemDesc)
100+
for (const ElementDesc& ElemDesc : m_ElemDesc)
101101
{
102102
TexDesc.Format = ElemDesc.Format;
103103
TexDesc.BindFlags = ElemDesc.BindFlags;
@@ -134,8 +134,8 @@ void GBuffer::Bind(IDeviceContext* pContext,
134134
if ((BuffersMask & BufferBit) == 0)
135135
continue;
136136

137-
const auto& ElemDesc = GetElementDesc(i);
138-
const auto& BindFlags = ElemDesc.BindFlags;
137+
const ElementDesc& ElemDesc = GetElementDesc(i);
138+
const BIND_FLAGS& BindFlags = ElemDesc.BindFlags;
139139
if (BindFlags & BIND_RENDER_TARGET)
140140
{
141141
const Uint32 RTIdx = RTIndex != nullptr ? *(RTIndex++) : i;

Components/src/ShadowMapManager.cpp

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2024 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");
@@ -139,9 +139,9 @@ void ShadowMapManager::DistributeCascades(const DistributeCascadeInfo& Info,
139139
VERIFY(Info.pLightDir, "Light direction must not be null");
140140
VERIFY(m_pDevice, "Shadow map manager is not initialized");
141141

142-
const auto& DevInfo = m_pDevice->GetDeviceInfo();
143-
const auto IsGL = DevInfo.IsGLDevice();
144-
const auto& SMDesc = m_pShadowMapSRV->GetTexture()->GetDesc();
142+
const RenderDeviceInfo& DevInfo = m_pDevice->GetDeviceInfo();
143+
const bool IsGL = DevInfo.IsGLDevice();
144+
const TextureDesc& SMDesc = m_pShadowMapSRV->GetTexture()->GetDesc();
145145

146146
float2 f2ShadowMapSize = float2(static_cast<float>(SMDesc.Width), static_cast<float>(SMDesc.Height));
147147

@@ -153,8 +153,8 @@ void ShadowMapManager::DistributeCascades(const DistributeCascadeInfo& Info,
153153
if (m_ShadowMode == SHADOW_MODE_VSM || m_ShadowMode == SHADOW_MODE_EVSM2 || m_ShadowMode == SHADOW_MODE_EVSM4)
154154
{
155155
VERIFY_EXPR(m_pFilterableShadowMapSRV);
156-
const auto& FilterableSMDesc = m_pFilterableShadowMapSRV->GetTexture()->GetDesc();
157-
ShadowAttribs.bIs32BitEVSM = FilterableSMDesc.Format == TEX_FORMAT_RGBA32_FLOAT || FilterableSMDesc.Format == TEX_FORMAT_RG32_FLOAT;
156+
const TextureDesc& FilterableSMDesc = m_pFilterableShadowMapSRV->GetTexture()->GetDesc();
157+
ShadowAttribs.bIs32BitEVSM = FilterableSMDesc.Format == TEX_FORMAT_RGBA32_FLOAT || FilterableSMDesc.Format == TEX_FORMAT_RG32_FLOAT;
158158
}
159159

160160
float3 LightSpaceX, LightSpaceY, LightSpaceZ;
@@ -165,7 +165,7 @@ void ShadowMapManager::DistributeCascades(const DistributeCascadeInfo& Info,
165165

166166
WriteShaderMatrix(&ShadowAttribs.mWorldToLightView, WorldToLightViewSpaceMatr, !Info.PackMatrixRowMajor);
167167

168-
const auto& CameraWorld = Info.pCameraWorld != nullptr ? *Info.pCameraWorld : Info.pCameraView->Inverse();
168+
const float4x4& CameraWorld = Info.pCameraWorld != nullptr ? *Info.pCameraWorld : Info.pCameraView->Inverse();
169169
//const float3 f3CameraPos = {CameraWorld._41, CameraWorld._42, CameraWorld._43};
170170
//const float3 f3CameraPosInLightSpace = f3CameraPos * WorldToLightViewSpaceMatr;
171171

@@ -186,7 +186,8 @@ void ShadowMapManager::DistributeCascades(const DistributeCascadeInfo& Info,
186186
m_CascadeTransforms.resize(iNumCascades);
187187
for (int iCascade = 0; iCascade < iNumCascades; ++iCascade)
188188
{
189-
auto& CurrCascade = ShadowAttribs.Cascades[iCascade];
189+
CascadeAttribs& CurrCascade = ShadowAttribs.Cascades[iCascade];
190+
190191
float fCascadeNearZ = (iCascade == 0) ? fMainCamNearPlane : ShadowAttribs.fCascadeCamSpaceZEnd[iCascade - 1];
191192
float& fCascadeFarZ = ShadowAttribs.fCascadeCamSpaceZEnd[iCascade];
192193
if (iCascade < iNumCascades - 1)
@@ -224,9 +225,10 @@ void ShadowMapManager::DistributeCascades(const DistributeCascadeInfo& Info,
224225
float3 f3MinimalSphereCenter;
225226
float fMinimalSphereRadius;
226227
GetFrustumMinimumBoundingSphere(Info.pCameraProj->_11, Info.pCameraProj->_22, fCascadeNearZ, fCascadeFarZ, f3MinimalSphereCenter, fMinimalSphereRadius);
227-
auto f3CenterLightSpace = f3MinimalSphereCenter * CameraWorld * WorldToLightViewSpaceMatr;
228-
f3MinXYZ = f3CenterLightSpace - float3(fMinimalSphereRadius, fMinimalSphereRadius, fMinimalSphereRadius);
229-
f3MaxXYZ = f3CenterLightSpace + float3(fMinimalSphereRadius, fMinimalSphereRadius, fMinimalSphereRadius);
228+
float3 f3CenterLightSpace = f3MinimalSphereCenter * CameraWorld * WorldToLightViewSpaceMatr;
229+
230+
f3MinXYZ = f3CenterLightSpace - float3(fMinimalSphereRadius, fMinimalSphereRadius, fMinimalSphereRadius);
231+
f3MaxXYZ = f3CenterLightSpace + float3(fMinimalSphereRadius, fMinimalSphereRadius, fMinimalSphereRadius);
230232
}
231233
else
232234
{
@@ -383,9 +385,10 @@ void ShadowMapManager::DistributeCascades(const DistributeCascadeInfo& Info,
383385
float4x4& WorldToLightProjSpaceMatr = m_CascadeTransforms[iCascade].WorldToLightProjSpace;
384386
WorldToLightProjSpaceMatr = WorldToLightViewSpaceMatr * CascadeProjMatr;
385387

386-
const auto& NDCAttribs = DevInfo.GetNDCAttribs();
387-
float4x4 ProjToUVScale = float4x4::Scale(0.5f, NDCAttribs.YtoVScale, NDCAttribs.ZtoDepthScale);
388-
float4x4 ProjToUVBias = float4x4::Translation(0.5f, 0.5f, NDCAttribs.GetZtoDepthBias());
388+
const NDCAttribs& NDC = DevInfo.GetNDCAttribs();
389+
390+
float4x4 ProjToUVScale = float4x4::Scale(0.5f, NDC.YtoVScale, NDC.ZtoDepthScale);
391+
float4x4 ProjToUVBias = float4x4::Translation(0.5f, 0.5f, NDC.GetZtoDepthBias());
389392

390393
float4x4 WorldToShadowMapUVDepthMatr = WorldToLightProjSpaceMatr * ProjToUVScale * ProjToUVBias;
391394
WriteShaderMatrix(ShadowAttribs.mWorldToShadowMapUVDepth + iCascade, WorldToShadowMapUVDepthMatr, !Info.PackMatrixRowMajor);
@@ -404,7 +407,7 @@ void ShadowMapManager::InitializeConversionTechniques(TEXTURE_FORMAT FilterableS
404407
RefCntAutoPtr<IShader> pScreenSizeTriVS;
405408
for (int mode = SHADOW_MODE_VSM; mode <= SHADOW_MODE_EVSM4; ++mode)
406409
{
407-
auto& Tech = m_ConversionTech[mode];
410+
ShadowConversionTechnique& Tech = m_ConversionTech[mode];
408411
if (mode == SHADOW_MODE_EVSM4)
409412
{
410413
Tech = m_ConversionTech[SHADOW_MODE_EVSM2];
@@ -454,7 +457,7 @@ void ShadowMapManager::InitializeConversionTechniques(TEXTURE_FORMAT FilterableS
454457
{
455458
UNEXPECTED("Unexpected shadow mode");
456459
}
457-
auto pVSMHorzPS = DeviceWithCache.CreateShader(ShaderCI);
460+
RefCntAutoPtr<IShader> pVSMHorzPS = DeviceWithCache.CreateShader(ShaderCI);
458461

459462
ShaderResourceVariableDesc Variables[] =
460463
{
@@ -476,8 +479,7 @@ void ShadowMapManager::InitializeConversionTechniques(TEXTURE_FORMAT FilterableS
476479
PSODesc.ResourceLayout.Variables = Variables;
477480
PSODesc.ResourceLayout.NumVariables = _countof(Variables);
478481

479-
auto& GraphicsPipeline = PSOCreateInfo.GraphicsPipeline;
480-
482+
GraphicsPipelineDesc& GraphicsPipeline{PSOCreateInfo.GraphicsPipeline};
481483
GraphicsPipeline.RasterizerDesc.FillMode = FILL_MODE_SOLID;
482484
GraphicsPipeline.RasterizerDesc.CullMode = CULL_MODE_NONE;
483485
GraphicsPipeline.DepthStencilDesc.DepthEnable = False;
@@ -499,7 +501,8 @@ void ShadowMapManager::InitializeConversionTechniques(TEXTURE_FORMAT FilterableS
499501
ShaderCI.Desc.Name = "Vertical blur pass PS";
500502
PSODesc.Name = "Vertical blur pass PSO";
501503

502-
auto pVertBlurPS = DeviceWithCache.CreateShader(ShaderCI);
504+
RefCntAutoPtr<IShader> pVertBlurPS = DeviceWithCache.CreateShader(ShaderCI);
505+
503506
PSOCreateInfo.pPS = pVertBlurPS;
504507
m_BlurVertTech.PSO = DeviceWithCache.CreateGraphicsPipelineState(PSOCreateInfo);
505508
m_BlurVertTech.PSO->GetStaticVariableByName(SHADER_TYPE_PIXEL, "cbConversionAttribs")->Set(m_pConversionAttribsBuffer);
@@ -511,7 +514,7 @@ void ShadowMapManager::InitializeResourceBindings()
511514
{
512515
for (int mode = SHADOW_MODE_VSM; mode <= SHADOW_MODE_EVSM4; ++mode)
513516
{
514-
auto& Tech = m_ConversionTech[mode];
517+
ShadowConversionTechnique& Tech = m_ConversionTech[mode];
515518
if (mode == SHADOW_MODE_EVSM4)
516519
{
517520
Tech.SRB = m_ConversionTech[SHADOW_MODE_EVSM2].SRB;
@@ -531,10 +534,10 @@ void ShadowMapManager::ConvertToFilterable(IDeviceContext* pCtx, const ShadowMap
531534
{
532535
if (m_ShadowMode == SHADOW_MODE_VSM || m_ShadowMode == SHADOW_MODE_EVSM2 || m_ShadowMode == SHADOW_MODE_EVSM4)
533536
{
534-
auto& Tech = m_ConversionTech[m_ShadowMode];
535-
const auto& ShadowMapDesc = m_pShadowMapSRV->GetTexture()->GetDesc();
537+
ShadowConversionTechnique& Tech = m_ConversionTech[m_ShadowMode];
538+
const TextureDesc& ShadowMapDesc = m_pShadowMapSRV->GetTexture()->GetDesc();
536539
VERIFY(static_cast<int>(ShadowMapDesc.ArraySize) == ShadowAttribs.iNumCascades, "Inconsistent number of cascades");
537-
const auto& FilterableSMDesc = m_pFilterableShadowMapSRV->GetTexture()->GetDesc();
540+
const TextureDesc& FilterableSMDesc = m_pFilterableShadowMapSRV->GetTexture()->GetDesc();
538541
VERIFY(ShadowAttribs.bIs32BitEVSM == (FilterableSMDesc.Format == TEX_FORMAT_RGBA32_FLOAT || FilterableSMDesc.Format == TEX_FORMAT_RG32_FLOAT),
539542
"Incorrect 32-bit VSM flag");
540543
(void)FilterableSMDesc;
@@ -566,10 +569,11 @@ void ShadowMapManager::ConvertToFilterable(IDeviceContext* pCtx, const ShadowMap
566569
}
567570
else
568571
{
569-
const auto& Cascade = ShadowAttribs.Cascades[i];
570-
float fNDCtoUVScale = 0.5f;
571-
float fFilterWidth = ShadowAttribs.fFilterWorldSize * Cascade.f4LightSpaceScale.x * fNDCtoUVScale;
572-
float fFilterHeight = ShadowAttribs.fFilterWorldSize * Cascade.f4LightSpaceScale.y * fNDCtoUVScale;
572+
const CascadeAttribs& Cascade = ShadowAttribs.Cascades[i];
573+
574+
float fNDCtoUVScale = 0.5f;
575+
float fFilterWidth = ShadowAttribs.fFilterWorldSize * Cascade.f4LightSpaceScale.x * fNDCtoUVScale;
576+
float fFilterHeight = ShadowAttribs.fFilterWorldSize * Cascade.f4LightSpaceScale.y * fNDCtoUVScale;
573577
pAttribs->fHorzFilterRadius = fFilterWidth / 2.f * static_cast<float>(ShadowMapDesc.Width);
574578
pAttribs->fVertFilterRadius = fFilterHeight / 2.f * static_cast<float>(ShadowMapDesc.Height);
575579
}

Components/src/VectorFieldRenderer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2023-2024 Diligent Graphics LLC
2+
* Copyright 2023-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.
@@ -153,13 +153,13 @@ IPipelineState* VectorFieldRenderer::GetPSO(const PSOKey& Key)
153153
.SetPrimitiveTopology(PRIMITIVE_TOPOLOGY_LINE_LIST)
154154
.SetDepthFormat(m_DSVFormat)
155155
.SetDepthStencilDesc(DSS_DisableDepth);
156-
for (auto RTVFormat : m_RTVFormats)
156+
for (TEXTURE_FORMAT RTVFormat : m_RTVFormats)
157157
PsoCI.AddRenderTarget(RTVFormat);
158158

159159
if (m_AsyncShaders)
160160
PsoCI.Flags |= PSO_CREATE_FLAG_ASYNCHRONOUS;
161161

162-
auto PSO = Device.CreateGraphicsPipelineState(PsoCI);
162+
RefCntAutoPtr<IPipelineState> PSO = Device.CreateGraphicsPipelineState(PsoCI);
163163
if (!PSO)
164164
{
165165
UNEXPECTED("Failed to create vector field PSO");
@@ -187,7 +187,7 @@ void VectorFieldRenderer::Render(const RenderAttribs& Attribs)
187187
return;
188188
}
189189

190-
auto* pPSO = GetPSO({Attribs.ConvertOutputToSRGB});
190+
IPipelineState* pPSO = GetPSO({Attribs.ConvertOutputToSRGB});
191191
if (pPSO == nullptr)
192192
{
193193
UNEXPECTED("Failed to get PSO");

PostProcess/Bloom/src/Bloom.cpp

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2024 Diligent Graphics LLC
2+
* Copyright 2024-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.
@@ -75,8 +75,8 @@ void Bloom::PrepareResources(IRenderDevice* pDevice, IDeviceContext* pDeviceCont
7575
DEV_CHECK_ERR(pDevice != nullptr, "pDevice must not be null");
7676
DEV_CHECK_ERR(pPostFXContext != nullptr, "pPostFXContext must not be null");
7777

78-
const auto& FrameDesc = pPostFXContext->GetFrameDesc();
79-
const auto& SupportedFeatures = pPostFXContext->GetSupportedFeatures();
78+
const PostFXContext::FrameDesc& FrameDesc = pPostFXContext->GetFrameDesc();
79+
const PostFXContext::SupportedDeviceFeatures& SupportedFeatures = pPostFXContext->GetSupportedFeatures();
8080

8181
m_CurrentFrameIdx = FrameDesc.Index;
8282

@@ -159,11 +159,18 @@ bool Bloom::PrepareShadersAndPSO(const RenderAttributes& RenderAttribs, FEATURE_
159159
const PSO_CREATE_FLAGS PSOFlags = m_Settings.EnableAsyncCreation ? PSO_CREATE_FLAG_ASYNCHRONOUS : PSO_CREATE_FLAG_NONE;
160160

161161
{
162-
auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_PREFILTERED_TEXTURE, FeatureFlags);
162+
RenderTechnique& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_PREFILTERED_TEXTURE, FeatureFlags);
163163
if (!RenderTech.IsInitializedPSO())
164164
{
165-
const auto VS = PostFXRenderTechnique::CreateShader(RenderAttribs.pDevice, RenderAttribs.pStateCache, "FullScreenTriangleVS.fx", "FullScreenTriangleVS", SHADER_TYPE_VERTEX, {}, ShaderFlags);
166-
const auto PS = PostFXRenderTechnique::CreateShader(RenderAttribs.pDevice, RenderAttribs.pStateCache, "Bloom_ComputePrefilteredTexture.fx", "ComputePrefilteredTexturePS", SHADER_TYPE_PIXEL, {}, ShaderFlags);
165+
RefCntAutoPtr<IShader> VS = PostFXRenderTechnique::CreateShader(
166+
RenderAttribs.pDevice, RenderAttribs.pStateCache,
167+
"FullScreenTriangleVS.fx", "FullScreenTriangleVS",
168+
SHADER_TYPE_VERTEX, {}, ShaderFlags);
169+
170+
RefCntAutoPtr<IShader> PS = PostFXRenderTechnique::CreateShader(
171+
RenderAttribs.pDevice, RenderAttribs.pStateCache,
172+
"Bloom_ComputePrefilteredTexture.fx", "ComputePrefilteredTexturePS",
173+
SHADER_TYPE_PIXEL, {}, ShaderFlags);
167174

168175
const bool BorderSamplingModeSupported = RenderAttribs.pDevice->GetAdapterInfo().Sampler.BorderSamplingModeSupported;
169176

@@ -187,11 +194,18 @@ bool Bloom::PrepareShadersAndPSO(const RenderAttributes& RenderAttribs, FEATURE_
187194
}
188195

189196
{
190-
auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_DOWNSAMPLED_TEXTURE, FeatureFlags);
197+
RenderTechnique& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_DOWNSAMPLED_TEXTURE, FeatureFlags);
191198
if (!RenderTech.IsInitializedPSO())
192199
{
193-
const auto VS = PostFXRenderTechnique::CreateShader(RenderAttribs.pDevice, RenderAttribs.pStateCache, "FullScreenTriangleVS.fx", "FullScreenTriangleVS", SHADER_TYPE_VERTEX, {}, ShaderFlags);
194-
const auto PS = PostFXRenderTechnique::CreateShader(RenderAttribs.pDevice, RenderAttribs.pStateCache, "Bloom_ComputeDownsampledTexture.fx", "ComputeDownsampledTexturePS", SHADER_TYPE_PIXEL, {}, ShaderFlags);
200+
RefCntAutoPtr<IShader> VS = PostFXRenderTechnique::CreateShader(
201+
RenderAttribs.pDevice, RenderAttribs.pStateCache,
202+
"FullScreenTriangleVS.fx", "FullScreenTriangleVS",
203+
SHADER_TYPE_VERTEX, {}, ShaderFlags);
204+
205+
RefCntAutoPtr<IShader> PS = PostFXRenderTechnique::CreateShader(
206+
RenderAttribs.pDevice, RenderAttribs.pStateCache,
207+
"Bloom_ComputeDownsampledTexture.fx", "ComputeDownsampledTexturePS",
208+
SHADER_TYPE_PIXEL, {}, ShaderFlags);
195209

196210
const bool BorderSamplingModeSupported = RenderAttribs.pDevice->GetAdapterInfo().Sampler.BorderSamplingModeSupported;
197211

@@ -214,11 +228,18 @@ bool Bloom::PrepareShadersAndPSO(const RenderAttributes& RenderAttribs, FEATURE_
214228
}
215229

216230
{
217-
auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_UPSAMPLED_TEXTURE, FeatureFlags);
231+
RenderTechnique& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_UPSAMPLED_TEXTURE, FeatureFlags);
218232
if (!RenderTech.IsInitializedPSO())
219233
{
220-
const auto VS = PostFXRenderTechnique::CreateShader(RenderAttribs.pDevice, RenderAttribs.pStateCache, "FullScreenTriangleVS.fx", "FullScreenTriangleVS", SHADER_TYPE_VERTEX, {}, ShaderFlags);
221-
const auto PS = PostFXRenderTechnique::CreateShader(RenderAttribs.pDevice, RenderAttribs.pStateCache, "Bloom_ComputeUpsampledTexture.fx", "ComputeUpsampledTexturePS", SHADER_TYPE_PIXEL, {}, ShaderFlags);
234+
RefCntAutoPtr<IShader> VS = PostFXRenderTechnique::CreateShader(
235+
RenderAttribs.pDevice, RenderAttribs.pStateCache,
236+
"FullScreenTriangleVS.fx", "FullScreenTriangleVS",
237+
SHADER_TYPE_VERTEX, {}, ShaderFlags);
238+
239+
RefCntAutoPtr<IShader> PS = PostFXRenderTechnique::CreateShader(
240+
RenderAttribs.pDevice, RenderAttribs.pStateCache,
241+
"Bloom_ComputeUpsampledTexture.fx", "ComputeUpsampledTexturePS",
242+
SHADER_TYPE_PIXEL, {}, ShaderFlags);
222243

223244
PipelineResourceLayoutDescX ResourceLayout;
224245
ResourceLayout
@@ -262,7 +283,7 @@ void Bloom::UpdateConstantBuffer(const RenderAttributes& RenderAttribs, bool Res
262283

263284
void Bloom::ComputePrefilteredTexture(const RenderAttributes& RenderAttribs)
264285
{
265-
auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_PREFILTERED_TEXTURE, m_FeatureFlags);
286+
RenderTechnique& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_PREFILTERED_TEXTURE, m_FeatureFlags);
266287

267288
if (!RenderTech.IsInitializedSRB())
268289
{
@@ -287,7 +308,7 @@ void Bloom::ComputePrefilteredTexture(const RenderAttributes& RenderAttribs)
287308

288309
void Bloom::ComputeDownsampledTextures(const RenderAttributes& RenderAttribs)
289310
{
290-
auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_DOWNSAMPLED_TEXTURE, m_FeatureFlags);
311+
RenderTechnique& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_DOWNSAMPLED_TEXTURE, m_FeatureFlags);
291312

292313
if (!RenderTech.IsInitializedSRB())
293314
RenderTech.InitializeSRB(false);
@@ -313,7 +334,7 @@ void Bloom::ComputeDownsampledTextures(const RenderAttributes& RenderAttribs)
313334

314335
void Bloom::ComputeUpsampledTextures(const RenderAttributes& RenderAttribs)
315336
{
316-
auto& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_UPSAMPLED_TEXTURE, m_FeatureFlags);
337+
RenderTechnique& RenderTech = GetRenderTechnique(RENDER_TECH_COMPUTE_UPSAMPLED_TEXTURE, m_FeatureFlags);
317338

318339
if (!RenderTech.IsInitializedSRB())
319340
{

0 commit comments

Comments
 (0)