From 5df7ada451a993efff2b80bb1af2d8c7579ba00b Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Sat, 29 Apr 2023 08:28:40 +0800 Subject: 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 --- source/compiler-core/slang-fxc-compiler.cpp | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'source') 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 # include - -# 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 } -- cgit v1.2.3