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");
@@ -68,7 +68,7 @@ static constexpr char VulkanDefine[] =
6868std::vector<uint32_t > CompileShaderDXC (const ShaderCreateInfo& ShaderCI,
6969 const ShaderVkImpl::CreateInfo& VkShaderCI)
7070{
71- auto * pDXCompiler = VkShaderCI.pDXCompiler ;
71+ IDXCompiler * pDXCompiler = VkShaderCI.pDXCompiler ;
7272 VERIFY_EXPR (pDXCompiler != nullptr && pDXCompiler->IsLoaded ());
7373 std::vector<uint32_t > SPIRV;
7474 pDXCompiler->Compile (ShaderCI, ShaderCI.HLSLVersion , VulkanDefine, nullptr , &SPIRV, VkShaderCI.ppCompilerOutput );
@@ -78,7 +78,7 @@ std::vector<uint32_t> CompileShaderDXC(const ShaderCreateInfo& ShaderCI,
7878 {
7979 // SPIR-V bytecode generated from HLSL must be legalized to
8080 // turn it into a valid vulkan SPIR-V shader.
81- auto LegalizedSPIRV = OptimizeSPIRV (SPIRV, SPV_ENV_MAX, SPIRV_OPTIMIZATION_FLAG_LEGALIZATION);
81+ std::vector< uint32_t > LegalizedSPIRV = OptimizeSPIRV (SPIRV, SPV_ENV_MAX, SPIRV_OPTIMIZATION_FLAG_LEGALIZATION);
8282 if (!LegalizedSPIRV.empty ())
8383 SPIRV = std::move (LegalizedSPIRV);
8484 else
@@ -168,10 +168,10 @@ void ShaderVkImpl::Initialize(const ShaderCreateInfo& ShaderCI,
168168 {
169169 DEV_CHECK_ERR (ShaderCI.ByteCode == nullptr , " 'ByteCode' must be null when shader is created from source code or a file" );
170170
171- auto ShaderCompiler = ShaderCI.ShaderCompiler ;
171+ SHADER_COMPILER ShaderCompiler = ShaderCI.ShaderCompiler ;
172172 if (ShaderCompiler == SHADER_COMPILER_DXC)
173173 {
174- auto * pDXCompiler = VkShaderCI.pDXCompiler ;
174+ IDXCompiler * pDXCompiler = VkShaderCI.pDXCompiler ;
175175 if (pDXCompiler == nullptr || !pDXCompiler->IsLoaded ())
176176 {
177177 LOG_WARNING_MESSAGE (" DX Compiler is not loaded. Using default shader compiler" );
@@ -219,13 +219,13 @@ void ShaderVkImpl::Initialize(const ShaderCreateInfo& ShaderCI,
219219 {
220220 if ((ShaderCI.CompileFlags & SHADER_COMPILE_FLAG_SKIP_REFLECTION) == 0 )
221221 {
222- auto & Allocator = GetRawAllocator ();
222+ IMemoryAllocator & Allocator = GetRawAllocator ();
223223
224224 std::unique_ptr<void , STDDeleterRawMem<void >> pRawMem{
225225 ALLOCATE (Allocator, " Memory for SPIRVShaderResources" , SPIRVShaderResources, 1 ),
226226 STDDeleterRawMem<void >(Allocator),
227227 };
228- auto LoadShaderInputs = m_Desc.ShaderType == SHADER_TYPE_VERTEX;
228+ const bool LoadShaderInputs = m_Desc.ShaderType == SHADER_TYPE_VERTEX;
229229 new (pRawMem.get ()) SPIRVShaderResources // May throw
230230 {
231231 Allocator,
@@ -322,20 +322,20 @@ void ShaderVkImpl::GetResourceDesc(Uint32 Index, ShaderResourceDesc& ResourceDes
322322{
323323 DEV_CHECK_ERR (!IsCompiling (), " Shader resources are not available until the shader is compiled. Use GetStatus() to check the shader status." );
324324
325- auto ResCount = GetResourceCount ();
325+ const Uint32 ResCount = GetResourceCount ();
326326 DEV_CHECK_ERR (Index < ResCount, " Resource index (" , Index, " ) is out of range" );
327327 if (Index < ResCount)
328328 {
329- const auto & SPIRVResource = m_pShaderResources->GetResource (Index);
330- ResourceDesc = SPIRVResource.GetResourceDesc ();
329+ const SPIRVShaderResourceAttribs & SPIRVResource = m_pShaderResources->GetResource (Index);
330+ ResourceDesc = SPIRVResource.GetResourceDesc ();
331331 }
332332}
333333
334334const ShaderCodeBufferDesc* ShaderVkImpl::GetConstantBufferDesc (Uint32 Index) const
335335{
336336 DEV_CHECK_ERR (!IsCompiling (), " Shader resources are not available until the shader is compiled. Use GetStatus() to check the shader status." );
337337
338- auto ResCount = GetResourceCount ();
338+ const Uint32 ResCount = GetResourceCount ();
339339 if (Index >= ResCount)
340340 {
341341 UNEXPECTED (" Resource index (" , Index, " ) is out of range" );
0 commit comments