diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2023-04-29 08:28:40 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-29 08:28:40 +0800 |
| commit | 5df7ada451a993efff2b80bb1af2d8c7579ba00b (patch) | |
| tree | d28dc6704e4f12ec68a1e9a32f6a1ee439888387 /source | |
| parent | 2492ec59fb52c15d1658ab32f473521b40664168 (diff) | |
Minor tidyings around d3d usage (#2854)
* Remove unused COM annotation
* Move SLANG_ENABLE_DXBC_SUPPORT to slang.h
* Add DX11 simple compute test
* Remove unnecessary COM parameter annotation
* Run compute smoke test for DX12
* Ignore d3d11 tests when we do not have fxc
* Do not try to find NVAPI on Linux
* Add some logs to .gitignore
* Minor cleanups in d3d12 headers
* Fix tautological comparison (due to integer overflow)
* Limit OutputDebugStringA to Windows
Diffstat (limited to 'source')
| -rw-r--r-- | source/compiler-core/slang-fxc-compiler.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/source/compiler-core/slang-fxc-compiler.cpp b/source/compiler-core/slang-fxc-compiler.cpp index 9d547e673..4153585d3 100644 --- a/source/compiler-core/slang-fxc-compiler.cpp +++ b/source/compiler-core/slang-fxc-compiler.cpp @@ -1,6 +1,8 @@ // slang-fxc-compiler.cpp #include "slang-fxc-compiler.h" +#if SLANG_ENABLE_DXBC_SUPPORT + #include "../core/slang-common.h" #include "../../slang-com-helper.h" @@ -28,28 +30,20 @@ #ifdef _WIN32 # include <windows.h> # include <d3dcompiler.h> - -# ifndef SLANG_ENABLE_DXBC_SUPPORT -# define SLANG_ENABLE_DXBC_SUPPORT 1 -# endif #endif -#ifndef SLANG_ENABLE_DXBC_SUPPORT -# define SLANG_ENABLE_DXBC_SUPPORT 0 +// Some of the `D3DCOMPILE_*` constants aren't available in all +// versions of `d3dcompiler.h`, so we define them here just in case +#ifndef D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES +# define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20) #endif -#if SLANG_ENABLE_DXBC_SUPPORT - // Some of the `D3DCOMPILE_*` constants aren't available in all - // versions of `d3dcompiler.h`, so we define them here just in case -# ifndef D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES -# define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20) -# endif - -# ifndef D3DCOMPILE_ALL_RESOURCES_BOUND -# define D3DCOMPILE_ALL_RESOURCES_BOUND (1 << 21) -# endif +#ifndef D3DCOMPILE_ALL_RESOURCES_BOUND +# define D3DCOMPILE_ALL_RESOURCES_BOUND (1 << 21) #endif +#endif // SLANG_ENABLE_DXBC_SUPPORT + namespace Slang { @@ -396,6 +390,6 @@ SlangResult FXCDownstreamCompiler::convert(IArtifact* from, const ArtifactDesc& return SLANG_E_NOT_AVAILABLE; } -#endif // SLANG_ENABLE_DXBC_SUPPORT +#endif // else SLANG_ENABLE_DXBC_SUPPORT } |
