summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineD3DBase
diff options
context:
space:
mode:
authorassiduous <assiduous@diligentgraphics.com>2021-03-02 04:41:41 +0000
committerassiduous <assiduous@diligentgraphics.com>2021-03-19 00:38:13 +0000
commit17062f3e3e96412ef8b1a5b68b993767806d6615 (patch)
tree2a61084cfc1a07c9d52cb163c128401deebad022 /Graphics/GraphicsEngineD3DBase
parentAdded resource signature creation failure test; fxied validation of resource ... (diff)
downloadDiligentCore-17062f3e3e96412ef8b1a5b68b993767806d6615.tar.gz
DiligentCore-17062f3e3e96412ef8b1a5b68b993767806d6615.zip
Fixed few issues with run-time sized arrays in D3D12; enabled test.
Diffstat (limited to 'Graphics/GraphicsEngineD3DBase')
-rw-r--r--Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
index 345eb9cf..49566626 100644
--- a/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
+++ b/Graphics/GraphicsEngineD3DBase/src/ShaderD3DBase.cpp
@@ -29,6 +29,9 @@
#include <vector>
#include <memory>
+#ifndef NOMINMAX
+# define NOMINMAX
+#endif
#include <D3Dcompiler.h>
#include <atlcomcli.h>
@@ -40,6 +43,7 @@
#include "ShaderD3DBase.hpp"
#include "DXCompiler.hpp"
#include "HLSLUtils.hpp"
+#include "BasicMath.hpp"
namespace Diligent
{
@@ -105,6 +109,21 @@ static HRESULT CompileShader(const char* Source,
// dwShaderFlags |= D3D10_SHADER_OPTIMIZATION_LEVEL3;
#endif
+ for (auto CompileFlags = ShaderCI.CompileFlags; CompileFlags != SHADER_COMPILE_FLAG_NONE;)
+ {
+ auto Flag = ExtractLSB(CompileFlags);
+ static_assert(SHADER_COMPILE_FLAG_LAST == 1, "Please updated the switch below to handle the new shader flag");
+ switch (Flag)
+ {
+ case SHADER_COMPILE_FLAG_ENABLE_UNBOUNDED_ARRAYS:
+ dwShaderFlags |= D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES;
+ break;
+
+ default:
+ UNEXPECTED("Unexpected shader compile flag");
+ }
+ }
+
D3DIncludeImpl IncludeImpl{ShaderCI.pShaderSourceStreamFactory};
return D3DCompile(Source, SourceLength, NULL, nullptr, &IncludeImpl, ShaderCI.EntryPoint, profile, dwShaderFlags, 0, ppBlobOut, ppCompilerOutput);
}