From 5adecbe837d27cf4e0a554ae13a0338743a8cb4b Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Sat, 29 Apr 2023 11:32:53 +0800 Subject: vkd3d and dxvk integration (#2823) * Add d3d sources for linux builds * Return NOT_IMPLEMENTED for shared handle support on Linux * Enable DirectX api on Linux * Do not report DX11 support without FXC * Initial version of SynchAPI emulation * Neaten dx library name handling * Neaten and use posix-synchapi * Add premake option for DirectX on Vulkan * s/SLANG_ENABLE_VKD3D_PROTON/SLANG_ENABLE_VKD3D * Skip failing tests on vkd3d * Regenerate vs projects * Silence unused var warning --- premake5.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'premake5.lua') diff --git a/premake5.lua b/premake5.lua index 7226d18ad..06da86754 100644 --- a/premake5.lua +++ b/premake5.lua @@ -212,6 +212,14 @@ newoption { allowed = { { "true", "True"}, { "false", "False" } } } +newoption { + trigger = "dx-on-vk", + description = "(Optional) If true will use dxvk and vkd3d-proton for DirectX support", + value = "bool", + default = "false", + allowed = { { "true", "True"}, { "false", "False" } } +} + buildLocation = _OPTIONS["build-location"] executeBinary = (_OPTIONS["execute-binary"] == "true") buildGlslang = (_OPTIONS["build-glslang"] == "true") @@ -227,6 +235,7 @@ deployLLVM = (_OPTIONS["deploy-slang-llvm"] == "true") deployGLSLang = (_OPTIONS["deploy-slang-glslang"] == "true") fullDebugValidation = (_OPTIONS["full-debug-validation"] == "true") enableAsan = (_OPTIONS["enable-asan"] == "true") +dxOnVk = (_OPTIONS["dx-on-vk"] == "true") -- If stdlib embedding is enabled, disable stdlib source embedding by default disableStdlibSource = enableEmbedStdLib @@ -396,6 +405,10 @@ workspace "slang" -- files which may be included by another project defines { "WIN32_LEAN_AND_MEAN", "VC_EXTRALEAN", "NOMINMAX" } + if dxOnVk then + defines { "SLANG_CONFIG_DX_ON_VK" } + end + function dump(o) if type(o) == 'table' then local s = '{ ' @@ -1028,6 +1041,11 @@ tool "gfx" else -- Linux like addSourceDir "tools/gfx/vulkan" + if dxOnVk then + addSourceDir "tools/gfx/d3d" + addSourceDir "tools/gfx/d3d11" + addSourceDir "tools/gfx/d3d12" + end --addSourceDir "tools/gfx/open-gl" end -- cgit v1.2.3