Skip to content

Commit

Permalink
Add RD_ENABLED when VULKAN_ENABLED or D3D12_ENABLED is added
Browse files Browse the repository at this point in the history
  • Loading branch information
jsjtxietian committed Dec 25, 2023
1 parent 9d1cbab commit 078bfae
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
2 changes: 0 additions & 2 deletions drivers/d3d12/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ from pathlib import Path

Import("env")

env.Append(CPPDEFINES=["RD_ENABLED"])

env_d3d12_rdd = env.Clone()

thirdparty_obj = []
Expand Down
2 changes: 0 additions & 2 deletions drivers/vulkan/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

Import("env")

env.Append(CPPDEFINES=["RD_ENABLED"])

thirdparty_obj = []
thirdparty_dir = "#thirdparty/vulkan"
thirdparty_volk_dir = "#thirdparty/volk"
Expand Down
2 changes: 1 addition & 1 deletion platform/android/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def configure(env: "Environment"):
env.Append(LIBS=["OpenSLES", "EGL", "android", "log", "z", "dl"])

if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
if not env["use_volk"]:
env.Append(LIBS=["vulkan"])

Expand Down
2 changes: 1 addition & 1 deletion platform/ios/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def configure(env: "Environment"):
env.Append(CPPDEFINES=["IOS_ENABLED", "UNIX_ENABLED", "COREAUDIO_ENABLED"])

if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])

if env["opengl3"]:
env.Append(CPPDEFINES=["GLES3_ENABLED", "GLES_SILENCE_DEPRECATION"])
Expand Down
2 changes: 1 addition & 1 deletion platform/linuxbsd/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def configure(env: "Environment"):
env.Append(CPPDEFINES=["X11_ENABLED"])

if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
if not env["use_volk"]:
env.ParseConfig("pkg-config vulkan --cflags --libs")
if not env["builtin_glslang"]:
Expand Down
2 changes: 1 addition & 1 deletion platform/macos/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def configure(env: "Environment"):
env.Append(LINKFLAGS=["-rpath", "@executable_path/../Frameworks", "-rpath", "@executable_path"])

if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
env.Append(LINKFLAGS=["-framework", "Metal", "-framework", "IOSurface"])
if not env["use_volk"]:
env.Append(LINKFLAGS=["-lMoltenVK"])
Expand Down
8 changes: 4 additions & 4 deletions platform/windows/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def configure_msvc(env, vcvars_msvc_config):
LIBS += ["psapi", "dbghelp"]

if env["vulkan"]:
env.AppendUnique(CPPDEFINES=["VULKAN_ENABLED"])
env.AppendUnique(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
if not env["use_volk"]:
LIBS += ["vulkan"]

Expand All @@ -445,7 +445,7 @@ def configure_msvc(env, vcvars_msvc_config):
print("The Direct3D 12 rendering driver requires dxc_path to be set.")
sys.exit(255)

env.AppendUnique(CPPDEFINES=["D3D12_ENABLED"])
env.AppendUnique(CPPDEFINES=["D3D12_ENABLED", "RD_ENABLED"])
LIBS += ["d3d12", "dxgi", "dxguid"]
LIBS += ["version"] # Mesa dependency.

Expand Down Expand Up @@ -657,12 +657,12 @@ def configure_mingw(env):
env.Append(LIBS=["psapi", "dbghelp"])

if env["vulkan"]:
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
if not env["use_volk"]:
env.Append(LIBS=["vulkan"])

if env["d3d12"]:
env.AppendUnique(CPPDEFINES=["D3D12_ENABLED"])
env.AppendUnique(CPPDEFINES=["D3D12_ENABLED", "RD_ENABLED"])
env.Append(LIBS=["d3d12", "dxgi", "dxguid"])

arch_subdir = "arm64" if env["arch"] == "arm64" else "x64"
Expand Down

0 comments on commit 078bfae

Please sign in to comment.