You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Merge pull request #70315 from RandomShaper/d3d12_mesa
Direct3D 12 Rendering Driver (Mesa NIR approach)
This commit is contained in:
@@ -187,6 +187,12 @@ def get_opts():
|
||||
BoolVariable("debug_crt", "Compile with MSVC's debug CRT (/MDd)", False),
|
||||
BoolVariable("incremental_link", "Use MSVC incremental linking. May increase or decrease build times.", False),
|
||||
("angle_libs", "Path to the ANGLE static libraries", ""),
|
||||
# Direct3D 12 support.
|
||||
("mesa_libs", "Path to the MESA/NIR static libraries (required for D3D12)", ""),
|
||||
("dxc_path", "Path to the DirectX Shader Compiler distribution (required for D3D12)", ""),
|
||||
("agility_sdk_path", "Path to the Agility SDK distribution (optional for D3D12)", ""),
|
||||
("agility_sdk_multiarch", "Whether the Agility SDK DLLs will be stored in arch-specific subdirectories", False),
|
||||
("pix_path", "Path to the PIX runtime distribution (optional for D3D12)", ""),
|
||||
]
|
||||
|
||||
|
||||
@@ -430,6 +436,34 @@ def configure_msvc(env, vcvars_msvc_config):
|
||||
if not env["use_volk"]:
|
||||
LIBS += ["vulkan"]
|
||||
|
||||
if env["d3d12"]:
|
||||
if env["dxc_path"] == "":
|
||||
print("The Direct3D 12 rendering driver requires dxc_path to be set.")
|
||||
sys.exit(255)
|
||||
|
||||
env.AppendUnique(CPPDEFINES=["D3D12_ENABLED"])
|
||||
LIBS += ["d3d12", "dxgi", "dxguid"]
|
||||
LIBS += ["version"] # Mesa dependency.
|
||||
|
||||
# Needed for avoiding C1128.
|
||||
if env["target"] == "release_debug":
|
||||
env.Append(CXXFLAGS=["/bigobj"])
|
||||
|
||||
arch_subdir = "arm64" if env["arch"] == "arm64" else "x64"
|
||||
|
||||
# PIX
|
||||
if env["pix_path"] != "":
|
||||
env.Append(LIBPATH=[env["pix_path"] + "/bin/" + arch_subdir])
|
||||
LIBS += ["WinPixEventRuntime"]
|
||||
|
||||
# Mesa
|
||||
if env["mesa_libs"] == "":
|
||||
print("The Direct3D 12 rendering driver requires mesa_libs to be set.")
|
||||
sys.exit(255)
|
||||
|
||||
env.Append(LIBPATH=[env["mesa_libs"] + "/bin"])
|
||||
LIBS += ["libNIR.windows." + env["arch"]]
|
||||
|
||||
if env["opengl3"]:
|
||||
env.AppendUnique(CPPDEFINES=["GLES3_ENABLED"])
|
||||
if env["angle_libs"] != "":
|
||||
@@ -623,6 +657,26 @@ def configure_mingw(env):
|
||||
if not env["use_volk"]:
|
||||
env.Append(LIBS=["vulkan"])
|
||||
|
||||
if env["d3d12"]:
|
||||
env.AppendUnique(CPPDEFINES=["D3D12_ENABLED"])
|
||||
env.Append(LIBS=["d3d12", "dxgi", "dxguid"])
|
||||
env.Append(LIBS=["version"]) # Mesa dependency.
|
||||
|
||||
arch_subdir = "arm64" if env["arch"] == "arm64" else "x64"
|
||||
|
||||
# PIX
|
||||
if env["pix_path"] != "":
|
||||
print("PIX runtime is not supported with MinGW.")
|
||||
sys.exit(255)
|
||||
|
||||
# Mesa
|
||||
if env["mesa_libs"] == "":
|
||||
print("The Direct3D 12 rendering driver requires mesa_libs to be set.")
|
||||
sys.exit(255)
|
||||
|
||||
env.Append(LIBPATH=[env["mesa_libs"] + "/bin"])
|
||||
env.Append(LIBS=["libNIR.windows." + env["arch"]])
|
||||
|
||||
if env["opengl3"]:
|
||||
env.Append(CPPDEFINES=["GLES3_ENABLED"])
|
||||
if env["angle_libs"] != "":
|
||||
|
||||
Reference in New Issue
Block a user