summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3D12
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-10-20 01:54:45 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-10-20 01:54:45 +0000
commit7d27dcd7dc3d6a990a106e95e254009176e7ee53 (patch)
tree39e2df8b4f0a25a0c4b3238de6672cf769db2818 /Graphics/GraphicsEngineD3D12
parentD3D backends: properly handling the issue with static sampler arrays in shade... (diff)
downloadDiligentCore-7d27dcd7dc3d6a990a106e95e254009176e7ee53.tar.gz
DiligentCore-7d27dcd7dc3d6a990a106e95e254009176e7ee53.zip
Added HLSLVersion, GLSLVersion and GLESSLVersion to ShaderCreateInfo struct (API Version 240035)
Diffstat (limited to 'Graphics/GraphicsEngineD3D12')
-rw-r--r--Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
index f6dfb74d..42325bf5 100644
--- a/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
+++ b/Graphics/GraphicsEngineD3D12/src/ShaderD3D12Impl.cpp
@@ -32,13 +32,20 @@
namespace Diligent
{
-static const char* GetD3D12ShaderModel(RenderDeviceD3D12Impl* /*pDevice*/)
+static const std::string GetD3D12ShaderModel(RenderDeviceD3D12Impl* /*pDevice*/, const ShaderCreateInfo::ShaderVersion& HLSLVersion)
{
- //auto d3dDeviceFeatureLevel = pDevice->GetD3DFeatureLevel();
+ if (HLSLVersion.Major == 0 && HLSLVersion.Minor == 0)
+ {
+ //auto d3dDeviceFeatureLevel = pDevice->GetD3DFeatureLevel();
- // Direct3D12 supports shader model 5.1 on all feature levels.
- // https://docs.microsoft.com/en-us/windows/win32/direct3d12/hardware-feature-levels#feature-level-support
- return "5_1";
+ // Direct3D12 supports shader model 5.1 on all feature levels.
+ // https://docs.microsoft.com/en-us/windows/win32/direct3d12/hardware-feature-levels#feature-level-support
+ return "5_1";
+ }
+ else
+ {
+ return std::to_string(Uint32{HLSLVersion.Major}) + '_' + std::to_string(Uint32{HLSLVersion.Minor});
+ }
}
ShaderD3D12Impl::ShaderD3D12Impl(IReferenceCounters* pRefCounters,
@@ -50,7 +57,7 @@ ShaderD3D12Impl::ShaderD3D12Impl(IReferenceCounters* pRefCounters,
pRenderDeviceD3D12,
ShaderCI.Desc
},
- ShaderD3DBase{ShaderCI, GetD3D12ShaderModel(pRenderDeviceD3D12)}
+ ShaderD3DBase{ShaderCI, GetD3D12ShaderModel(pRenderDeviceD3D12, ShaderCI.HLSLVersion).c_str()}
{
// Load shader resources
auto& Allocator = GetRawAllocator();