From 3bb266bfc21f635b46fec4effdecbd305c87e7b1 Mon Sep 17 00:00:00 2001 From: assiduous Date: Fri, 17 Jul 2020 14:47:09 -0700 Subject: Vk backend: disabled warning about missing SPV_GOOGLE_hlsl_functionality1 extension when SPIRV is not compiled from HLSL plus few improvements to handling SPIRV created from HLSL --- Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp index 523a5108..8b3cf728 100644 --- a/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/ShaderVkImpl.cpp @@ -102,13 +102,22 @@ ShaderVkImpl::ShaderVkImpl(IReferenceCounters* pRefCounters, // pipeline state is created // Load shader resources - auto& Allocator = GetRawAllocator(); - auto* pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", SPIRVShaderResources, 1); - bool IsHLSLVertexShader = CreationAttribs.SourceLanguage == SHADER_SOURCE_LANGUAGE_HLSL && m_Desc.ShaderType == SHADER_TYPE_VERTEX; - auto* pResources = new (pRawMem) SPIRVShaderResources(Allocator, pRenderDeviceVk, m_SPIRV, m_Desc, CreationAttribs.UseCombinedTextureSamplers ? CreationAttribs.CombinedSamplerSuffix : nullptr, IsHLSLVertexShader, m_EntryPoint); + auto& Allocator = GetRawAllocator(); + auto* pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", SPIRVShaderResources, 1); + auto LoadShaderInputs = m_Desc.ShaderType == SHADER_TYPE_VERTEX; + auto* pResources = new (pRawMem) SPIRVShaderResources // + { + Allocator, + pRenderDeviceVk, + m_SPIRV, + m_Desc, + CreationAttribs.UseCombinedTextureSamplers ? CreationAttribs.CombinedSamplerSuffix : nullptr, + LoadShaderInputs, + m_EntryPoint // + }; m_pShaderResources.reset(pResources, STDDeleterRawMem(Allocator)); - if (IsHLSLVertexShader) + if (LoadShaderInputs && m_pShaderResources->IsHLSLSource()) { MapHLSLVertexShaderInputs(); } -- cgit v1.2.3