summaryrefslogtreecommitdiffstats
path: root/tools/gfx/render.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2023-04-20 20:06:37 +0800
committerGitHub <noreply@github.com>2023-04-20 20:06:37 +0800
commit4d24f55226870055c8dcbb3409efc5355da134d7 (patch)
tree479c4341e38dcea2f1b9a831cf6ce0dea20234ac /tools/gfx/render.cpp
parent588991f6df3d6813378721166a7260990835817e (diff)
Changes for vkd3d proton (#2813)
* Add some caches to .gitignore * Remove appendWideChars Use String::toWString instead * s/Sleep/sleepCurrentThread * formatting * Expand set of shared libraries which have buggy dlclose Work around https://github.com/microsoft/DirectXShaderCompiler/issues/5119 and https://github.com/doitsujin/dxvk/issues/3330 libdxcompiler.so invokes UB on dlclose, the dxvk libs break GDB when closed * Add assert for specialization failure on DX11 As a band aid for https://github.com/shader-slang/slang/issues/2805 * More fine grained selection of directx features
Diffstat (limited to 'tools/gfx/render.cpp')
-rw-r--r--tools/gfx/render.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/gfx/render.cpp b/tools/gfx/render.cpp
index 2f10fa67c..11aacc741 100644
--- a/tools/gfx/render.cpp
+++ b/tools/gfx/render.cpp
@@ -247,13 +247,15 @@ extern "C"
switch (type)
{
-#if SLANG_WINDOWS_FAMILY
+#if SLANG_ENABLE_DIRECTX
case DeviceType::DirectX11:
SLANG_RETURN_ON_FAIL(getD3D11Adapters(adapters));
break;
case DeviceType::DirectX12:
SLANG_RETURN_ON_FAIL(getD3D12Adapters(adapters));
break;
+#endif
+#if SLANG_WINDOWS_FAMILY
case DeviceType::OpenGl:
return SLANG_E_NOT_IMPLEMENTED;
#endif
@@ -283,7 +285,7 @@ extern "C"
{
switch (desc->deviceType)
{
-#if SLANG_WINDOWS_FAMILY
+#if SLANG_ENABLE_DIRECTX
case DeviceType::DirectX11:
{
return createD3D11Device(desc, outDevice);
@@ -292,6 +294,8 @@ extern "C"
{
return createD3D12Device(desc, outDevice);
}
+#endif
+#if SLANG_WINDOWS_FAMILY
case DeviceType::OpenGl:
{
return createGLDevice(desc, outDevice);
@@ -326,9 +330,9 @@ extern "C"
}
#endif
case DeviceType::CUDA:
- {
- return createCUDADevice(desc, outDevice);
- }
+ {
+ return createCUDADevice(desc, outDevice);
+ }
case DeviceType::CPU:
{
return createCPUDevice(desc, outDevice);
@@ -361,7 +365,7 @@ extern "C"
SLANG_GFX_API SlangResult SLANG_MCALL
gfxReportLiveObjects()
{
-#if SLANG_WINDOWS_FAMILY
+#if SLANG_ENABLE_DIRECTX
SLANG_RETURN_ON_FAIL(reportD3DLiveObjects());
#endif
return SLANG_OK;