mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 12:42:34 +01:00
D3D12: Added DXIL support. (#3558)
* Added DXIL support. * Fixed Linux build. * Fixed mingw build. * Fixed build.
This commit is contained in:
committed by
GitHub
parent
9ca7782405
commit
33541e4bab
@@ -34,6 +34,8 @@ vs_%.bin.h : vs_%.sc
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p s_5_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(VS_FLAGS) --platform windows -p s_6_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dxil
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(VS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@)
|
||||
@@ -51,6 +53,8 @@ fs_%.bin.h : fs_%.sc
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p s_5_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(FS_FLAGS) --platform windows -p s_6_0 -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dxil
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(FS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@)
|
||||
@@ -68,6 +72,10 @@ cs_%.bin.h : cs_%.sc
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(CS_FLAGS) --platform windows -p s_5_0 -O 1 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dx11
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(CS_FLAGS) --platform windows -p s_6_0 -O 1 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_dxil
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-$(SILENT) $(SHADERC) $(CS_FLAGS) --platform ios -p metal -O 3 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_mtl
|
||||
-@cat "$(SHADER_TMP)" >> $(@)
|
||||
-@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@)
|
||||
-@printf "extern const uint32_t $(basename $(<))_pssl_size;\n" | tr -d '\015' >> $(@)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ ifndef TARGET
|
||||
.PHONY: all
|
||||
all:
|
||||
@echo Usage: make TARGET=# [clean, all, rebuild]
|
||||
@echo " TARGET=0 (hlsl - d3d11 / Windows only!)"
|
||||
@echo " TARGET=0 (dxil - d3d12)"
|
||||
@echo " TARGET=1 (hlsl - d3d11 / Windows only!)"
|
||||
@echo " TARGET=3 (essl - android)"
|
||||
@echo " TARGET=4 (glsl)"
|
||||
@@ -53,7 +53,13 @@ else
|
||||
|
||||
ADDITIONAL_INCLUDES?=
|
||||
|
||||
ifeq ($(TARGET), $(filter $(TARGET), 0 1))
|
||||
ifeq ($(TARGET), $(filter $(TARGET), 0))
|
||||
VS_FLAGS=--platform windows -p s_6_0 -O 3
|
||||
FS_FLAGS=--platform windows -p s_6_0 -O 3
|
||||
CS_FLAGS=--platform windows -p s_6_0 -O 3
|
||||
SHADER_PATH=shaders/dxil
|
||||
else
|
||||
ifeq ($(TARGET), $(filter $(TARGET), 1))
|
||||
VS_FLAGS=--platform windows -p s_5_0 -O 3
|
||||
FS_FLAGS=--platform windows -p s_5_0 -O 3
|
||||
CS_FLAGS=--platform windows -p s_5_0 -O 1
|
||||
@@ -101,6 +107,7 @@ endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
THISDIR := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
VS_FLAGS+=-i $(THISDIR)../src/ $(ADDITIONAL_INCLUDES)
|
||||
|
||||
@@ -687,7 +687,7 @@ project "shaderc"
|
||||
path.join(BIMG_DIR, "include"),
|
||||
path.join(BGFX_DIR, "include"),
|
||||
|
||||
path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
|
||||
path.join(BGFX_DIR, "3rdparty/directx-headers/include/directx"),
|
||||
|
||||
FCPP_DIR,
|
||||
|
||||
@@ -749,6 +749,12 @@ project "shaderc"
|
||||
"pthread",
|
||||
}
|
||||
|
||||
configuration { "linux-*" }
|
||||
includedirs {
|
||||
path.join(BGFX_DIR, "3rdparty/directx-headers/include"),
|
||||
path.join(BGFX_DIR, "3rdparty/directx-headers/include/wsl/stubs"),
|
||||
}
|
||||
|
||||
configuration {}
|
||||
|
||||
if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-gnm"), {
|
||||
|
||||
Reference in New Issue
Block a user