From 4c9c8a7a4d9b97fec6041a562638fbea521533ed Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 14 Apr 2023 17:08:18 +0800 Subject: 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 --- tools/gfx/render.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'tools/gfx/render.cpp') diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp index 048eb8224..2f10fa67c 100644 --- a/tools/gfx/render.cpp +++ b/tools/gfx/render.cpp @@ -256,13 +256,9 @@ extern "C" break; case DeviceType::OpenGl: return SLANG_E_NOT_IMPLEMENTED; - case DeviceType::Vulkan: - SLANG_RETURN_ON_FAIL(getVKAdapters(adapters)); - break; - case DeviceType::CUDA: - SLANG_RETURN_ON_FAIL(getCUDAAdapters(adapters)); - break; -#elif SLANG_LINUX_FAMILY && !defined(__CYGWIN__) +#endif +#if SLANG_WINDOWS_FAMILY || SLANG_LINUX_FAMILY + // Assume no Vulkan or CUDA on MacOS or Cygwin case DeviceType::Vulkan: SLANG_RETURN_ON_FAIL(getVKAdapters(adapters)); break; @@ -304,10 +300,6 @@ extern "C" { return createVKDevice(desc, outDevice); } - case DeviceType::CUDA: - { - return createCUDADevice(desc, outDevice); - } case DeviceType::Default: { IDevice::Desc newDesc = *desc; @@ -332,11 +324,11 @@ extern "C" { return createVKDevice(desc, outDevice); } +#endif case DeviceType::CUDA: { return createCUDADevice(desc, outDevice); } -#endif case DeviceType::CPU: { return createCPUDevice(desc, outDevice); -- cgit v1.2.3