summaryrefslogtreecommitdiffstats
path: root/source/compiler-core
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-14 17:08:18 +0800
committerGitHub <noreply@github.com>2023-04-14 17:08:18 +0800
commit4c9c8a7a4d9b97fec6041a562638fbea521533ed (patch)
treebcbe353f9c3a64ce7e7e5419c4172a5fadac297b /source/compiler-core
parent5a629b3ccd801a1f0647e971d01481c55d3381c2 (diff)
Some small fixes with Windows/DX usage (#2797)
* Correct case of windows.h includes * Use Slang::SharedLibrary to load directx dlls * s/max/std::max/ * Factor common OS code in calcHasApi * Add DXIL test for compute/simple * s/false/FALSE for calls to WinAPI functions * Factor common OS code in gfxGetAdapters * 2 missing headers d3d12sdklayers for ID3DDebug climits for UINT_MAX * Define out unused function on Linux * Only try to load Vulkan and CUDA on Windows or Linux * simplify D3DUtil::getDxgiModule * Remove WIN32_LEAN_AND_MEAN &co from source files Add a global define * Set WIN32_LEAN_AND_MEAN &friends in headers Restore previous state also * regenerate vs projects
Diffstat (limited to 'source/compiler-core')
-rw-r--r--source/compiler-core/slang-dxc-compiler.cpp8
-rw-r--r--source/compiler-core/slang-fxc-compiler.cpp6
-rw-r--r--source/compiler-core/windows/slang-win-visual-studio-util.cpp7
3 files changed, 4 insertions, 17 deletions
diff --git a/source/compiler-core/slang-dxc-compiler.cpp b/source/compiler-core/slang-dxc-compiler.cpp
index a275143f8..832c5809c 100644
--- a/source/compiler-core/slang-dxc-compiler.cpp
+++ b/source/compiler-core/slang-dxc-compiler.cpp
@@ -34,13 +34,9 @@
#if SLANG_ENABLE_DXIL_SUPPORT
# ifdef _WIN32
-# define WIN32_LEAN_AND_MEAN
-# define NOMINMAX
-# include <Windows.h>
-# include <Unknwn.h>
+# include <windows.h>
+# include <unknwn.h>
# include "../../external/dxc/dxcapi.h"
-# undef WIN32_LEAN_AND_MEAN
-# undef NOMINMAX
# else
# include "../../external/dxc/dxcapi.h"
diff --git a/source/compiler-core/slang-fxc-compiler.cpp b/source/compiler-core/slang-fxc-compiler.cpp
index de6f5d2bc..9d547e673 100644
--- a/source/compiler-core/slang-fxc-compiler.cpp
+++ b/source/compiler-core/slang-fxc-compiler.cpp
@@ -26,11 +26,7 @@
// Enable calling through to `fxc` or `dxc` to
// generate code on Windows.
#ifdef _WIN32
-# define WIN32_LEAN_AND_MEAN
-# define NOMINMAX
-# include <Windows.h>
-# undef WIN32_LEAN_AND_MEAN
-# undef NOMINMAX
+# include <windows.h>
# include <d3dcompiler.h>
# ifndef SLANG_ENABLE_DXBC_SUPPORT
diff --git a/source/compiler-core/windows/slang-win-visual-studio-util.cpp b/source/compiler-core/windows/slang-win-visual-studio-util.cpp
index d4c72e100..cb784b426 100644
--- a/source/compiler-core/windows/slang-win-visual-studio-util.cpp
+++ b/source/compiler-core/windows/slang-win-visual-studio-util.cpp
@@ -10,12 +10,7 @@
#include "../slang-visual-studio-compiler-util.h"
#ifdef _WIN32
-# define WIN32_LEAN_AND_MEAN
-# define NOMINMAX
-# include <Windows.h>
-# undef WIN32_LEAN_AND_MEAN
-# undef NOMINMAX
-
+# include <windows.h>
# include <Shlobj.h>
#pragma comment(lib, "advapi32")
#pragma comment(lib, "Shell32")