mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
Merge branch 'master' of https://github.com/libretro/RetroArch
This commit is contained in:
commit
d3d4c5740c
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,6 +7,7 @@
|
||||
*.elf
|
||||
*.dol
|
||||
*.map
|
||||
*.swp
|
||||
.tmp
|
||||
.tmp.c
|
||||
.tmp.cxx
|
||||
@ -139,3 +140,6 @@ retroarch.js
|
||||
retroarch.js.mem
|
||||
*.bc
|
||||
*.wasm
|
||||
|
||||
# only ignore .js files in the repo root
|
||||
/*.js
|
||||
|
14
CHANGES.md
14
CHANGES.md
@ -10,8 +10,12 @@
|
||||
- COMMON: Bugfix for issue related to 'Windows mouse pointer visible when running MESS or MAME cores'.
|
||||
- COMMON: Fix bug 'Last item in a Playlist is ignored'.
|
||||
- COMMON: New LED API. Driver implemented for Raspberry Pi, proof of concept implemented for core MAME 2003.
|
||||
- COMMON: Add quick menu option to watch shader files for changes and recompile them automatically (Linux only for now).
|
||||
- D3D8: Direct3D 8 can now work on systems that have Direct3D 8 installed.
|
||||
- D3D9: Add menu support for MaterialUI/XMB.
|
||||
- D3D10: Initial video driver implementation.
|
||||
- D3D11: Initial video driver implementation.
|
||||
- D3D12: Initial video driver implementation.
|
||||
- DINPUT: don't reinitialize input driver on network events / media insertion / network drive connection
|
||||
- INPUT: show friendly names when available under input binds and system information
|
||||
- INPUT: show the config name when available under system information
|
||||
@ -19,23 +23,29 @@
|
||||
- GUI: Menu visibility options for RGUI and MaterialUI.
|
||||
- GUI/XMB: Add Monochrome Inverted icon theme.
|
||||
- GUI/XMB: Allow changing menu scale to 200%.
|
||||
- HAIKU: Restored port.
|
||||
- KEYMAPPER: prevent a condition that caused input_menu_toggle to stop working when a RETRO_DEVICE_KEYBOARD type device is enabled
|
||||
- GL: ignore hard gpu sync when fast-forwarding
|
||||
- IOS10/11: Handle hardware keyboards and iCade controllers
|
||||
- LOCALIZATION: Update Italian translation.
|
||||
- LOCALIZATION: Update Japanese translation.
|
||||
- LOCALIZATION: Update Spanish translation.
|
||||
- NSW: Initial Nintendo Switch port, based on libtransistor SDK.
|
||||
- OSX: Modify HID buttons detection algorithm.
|
||||
- SOLARIS: Initial port.
|
||||
- SWITCH: Initial Nintendo Switch port, based on libtransistor SDK.
|
||||
- PS3: Enable Cheevos.
|
||||
- PSP: Enable threading support through pthreads.
|
||||
- SHIELD ATV: Allow the remote / gamepad takeover hack to work with the 2017 gamepad
|
||||
- VULKAN: Fix swapchain recreation bug on Nvidia GPUs with Windows 10 through workaround (will be properly resolved in a future driver version).
|
||||
- WINDOWS: Improved Unicode support (for cores/directory creation and 7zip archives).
|
||||
- WINDOWS: Show progress meter on taskbar for downloads (Windows 7 and up).
|
||||
- WINDOWS: WS_EX_LAYERED drastically decreases performance, so only set it when needed (transparency in windowed mode).
|
||||
- WIIU: Overlay support.
|
||||
- WIIU: Transparency support in menu + overlays.
|
||||
- WIIU: New HID pad support.
|
||||
- WIIU: Increased stability during core switching.
|
||||
- WIIU: Shader support.
|
||||
- WIIU: Menu shader effects added (shaders).
|
||||
- XBOX OG: Restored port.
|
||||
|
||||
# 1.7.0
|
||||
- CHEEVOS: Add badges for achievements, shows thumbnail images of achievements.
|
||||
|
7
Makefile
7
Makefile
@ -16,7 +16,11 @@ include config.mk
|
||||
|
||||
TARGET = retroarch
|
||||
|
||||
OBJDIR := obj-unix
|
||||
ifeq ($(DEBUG), 1)
|
||||
OBJDIR := obj-unix/debug
|
||||
else
|
||||
OBJDIR := obj-unix/release
|
||||
endif
|
||||
|
||||
OBJ :=
|
||||
LIBS :=
|
||||
@ -71,6 +75,7 @@ endif
|
||||
|
||||
ifeq ($(DEBUG), 1)
|
||||
OPTIMIZE_FLAG = -O0 -g
|
||||
DEFINES += -DDEBUG -D_DEBUG
|
||||
else
|
||||
OPTIMIZE_FLAG = -O3 -ffast-math
|
||||
endif
|
||||
|
@ -115,6 +115,13 @@ else
|
||||
OSX := 0
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Haiku,$(OS)),)
|
||||
LIBS += -lroot -lnetwork
|
||||
HAVE_UNIX = 1
|
||||
else
|
||||
LIBS += -lm
|
||||
endif
|
||||
|
||||
ifneq ($(findstring Linux,$(OS)),)
|
||||
LIBS += -lrt
|
||||
OBJ += input/drivers/linuxraw_input.o \
|
||||
@ -131,12 +138,6 @@ ifeq ($(TARGET), retroarch_3ds)
|
||||
OBJ += frontend/drivers/platform_ctr.o
|
||||
endif
|
||||
|
||||
ifeq ($(findstring Haiku,$(OS)),)
|
||||
LIBS += -lm
|
||||
else
|
||||
LIBS += -lroot -lnetwork
|
||||
endif
|
||||
|
||||
# Git
|
||||
|
||||
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||
@ -1108,7 +1109,8 @@ endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_EGL), 1)
|
||||
DEFINES += -DHAVE_EGL
|
||||
DEFINES += -DHAVE_EGL $(EGL_CFLAGS)
|
||||
LIBS += $(EGL_LIBS)
|
||||
OBJ += gfx/common/egl_common.o
|
||||
endif
|
||||
|
||||
@ -1184,8 +1186,7 @@ ifeq ($(HAVE_VULKAN), 1)
|
||||
-I$(DEPS_DIR)/glslang \
|
||||
-I$(DEPS_DIR)/SPIRV-Cross
|
||||
|
||||
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses -Igfx/include
|
||||
CFLAGS += -Igfx/include
|
||||
CXXFLAGS += -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses
|
||||
|
||||
GLSLANG_OBJ := $(GLSLANG_SOURCES:.cpp=.o)
|
||||
SPIRV_CROSS_OBJ := $(SPIRV_CROSS_SOURCES:.cpp=.o)
|
||||
@ -1211,6 +1212,14 @@ ifeq ($(HAVE_VULKAN), 1)
|
||||
DEFINES += -DHAVE_SLANG
|
||||
endif
|
||||
|
||||
ifeq ($(findstring 1, $(HAVE_VULKAN) $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),1)
|
||||
INCLUDE_DIRS += -Igfx/include
|
||||
endif
|
||||
|
||||
ifeq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),1)
|
||||
INCLUDE_DIRS += -Igfx/include/dxsdk
|
||||
endif
|
||||
|
||||
ifeq ($(WANT_WGL), 1)
|
||||
OBJ += gfx/drivers_context/wgl_ctx.o
|
||||
LIBS += -lcomctl32
|
||||
@ -1287,6 +1296,28 @@ endif
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D10), 1)
|
||||
OBJ += gfx/drivers/d3d10.o gfx/common/d3d10_common.o
|
||||
DEFINES += -DHAVE_D3D10
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D11), 1)
|
||||
OBJ += gfx/drivers/d3d11.o gfx/common/d3d11_common.o \
|
||||
gfx/drivers_font/d3d11_font.o menu/drivers_display/menu_display_d3d11.o
|
||||
DEFINES += -DHAVE_D3D11
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D12), 1)
|
||||
OBJ += gfx/drivers/d3d12.o gfx/common/d3d12_common.o
|
||||
DEFINES += -DHAVE_D3D12
|
||||
endif
|
||||
|
||||
ifneq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),)
|
||||
OBJ += gfx/common/d3dcompiler_common.o
|
||||
OBJ += gfx/common/dxgi_common.o
|
||||
CFLAGS += -Wno-unknown-pragmas
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D8), 1)
|
||||
HAVE_D3D_COMMON = 1
|
||||
HAVE_DX_COMMON = 1
|
||||
@ -1297,17 +1328,25 @@ ifeq ($(HAVE_D3DX), 1)
|
||||
LIBS += -ld3dx8
|
||||
endif
|
||||
endif
|
||||
|
||||
OBJ += gfx/drivers_renderchain/d3d8_renderchain.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_DX_COMMON), 1)
|
||||
LIBS += -ldxguid
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D8), 1)
|
||||
DEFINES += -DHAVE_D3D8
|
||||
OBJ += gfx/drivers/d3d9.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D9), 1)
|
||||
DEFINES += -DHAVE_D3D9
|
||||
OBJ += gfx/drivers/d3d9.o
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_D3D_COMMON), 1)
|
||||
DEFINES += -DHAVE_D3D
|
||||
OBJ += gfx/drivers/d3d.o \
|
||||
OBJ += \
|
||||
gfx/common/d3d_common.o \
|
||||
gfx/drivers_context/d3d_ctx.o
|
||||
|
||||
@ -1511,6 +1550,7 @@ ifeq ($(HAVE_NETWORKING), 1)
|
||||
network/netplay/netplay_handshake.o \
|
||||
network/netplay/netplay_init.o \
|
||||
network/netplay/netplay_io.o \
|
||||
network/netplay/netplay_keyboard.o \
|
||||
network/netplay/netplay_sync.o \
|
||||
network/netplay/netplay_discovery.o \
|
||||
network/netplay/netplay_buf.o \
|
||||
|
268
Makefile.msvc
Normal file
268
Makefile.msvc
Normal file
@ -0,0 +1,268 @@
|
||||
TARGET := retroarch.exe
|
||||
DEBUG = 0
|
||||
GRIFFIN_BUILD = 0
|
||||
OS = Win32
|
||||
ARCH = amd64
|
||||
#TARGET_ARCH = x86
|
||||
BUILD_DIR = objs/msvc
|
||||
|
||||
|
||||
WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
|
||||
WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
|
||||
VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)
|
||||
|
||||
HAVE_D3DX := 1
|
||||
HAVE_D3D8 := 0
|
||||
HAVE_D3D9 := 1
|
||||
HAVE_D3D10 := 1
|
||||
HAVE_D3D11 := 1
|
||||
HAVE_D3D12 := 1
|
||||
HAVE_CG := 1
|
||||
HAVE_OPENGL := 1
|
||||
HAVE_VULKAN := 1
|
||||
|
||||
HAVE_RPNG := 1
|
||||
HAVE_ZLIB := 1
|
||||
WANT_ZLIB := 1
|
||||
HAVE_RGUI := 1
|
||||
HAVE_XMB := 1
|
||||
HAVE_MATERIALUI := 1
|
||||
HAVE_STB_FONT := 1
|
||||
HAVE_THREADS := 1
|
||||
HAVE_LIBRETRODB := 1
|
||||
HAVE_COMMAND := 1
|
||||
HAVE_STDIN_CMD := 1
|
||||
HAVE_CMD := 1
|
||||
HAVE_DYLIB := 1
|
||||
HAVE_DYNAMIC := 1
|
||||
HAVE_DINPUT := 1
|
||||
HAVE_MENU_COMMON := 1
|
||||
HAVE_BUILTINZLIB := 1
|
||||
|
||||
HAVE_RJPEG := 1
|
||||
HAVE_RBMP := 1
|
||||
HAVE_RTGA := 1
|
||||
HAVE_7ZIP := 1
|
||||
HAVE_NETWORKING := 1
|
||||
HAVE_NETWORK_CMD := 1
|
||||
HAVE_OVERLAY := 1
|
||||
HAVE_LANGEXTRA := 1
|
||||
HAVE_CHEEVOS := 1
|
||||
HAVE_KEYMAPPER := 1
|
||||
HAVE_SHADERPIPELINE := 1
|
||||
|
||||
include Makefile.common
|
||||
CFLAGS := $(filter-out -Wno-unknown-pragmas,$(CFLAGS))
|
||||
CXXFLAGS := $(filter-out -fpermissive -Wno-switch -Wno-sign-compare -fno-strict-aliasing -Wno-maybe-uninitialized -Wno-reorder -Wno-parentheses,$(CXXFLAGS))
|
||||
CXXFLAGS += $(CFLAGS)
|
||||
LIBS := $(filter-out -lstdc++,$(LIBS))
|
||||
ifeq ($(HAVE_VULKAN),1)
|
||||
DEFINES += -DHAVE_VULKAN
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x64)
|
||||
ARCH := amd64
|
||||
endif
|
||||
|
||||
ARCH2 := $(ARCH)
|
||||
ifeq ($(ARCH),amd64)
|
||||
ARCH2 := x64
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),)
|
||||
TARGET_ARCH = $(ARCH)
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),x64)
|
||||
TARGET_ARCH = amd64
|
||||
endif
|
||||
|
||||
TARGET_ARCH2 = $(TARGET_ARCH)
|
||||
ifeq ($(TARGET_ARCH2),amd64)
|
||||
TARGET_ARCH2 = x64
|
||||
endif
|
||||
|
||||
CROSS = $(ARCH)
|
||||
ifeq ($(ARCH),x86)
|
||||
CROSS =
|
||||
endif
|
||||
|
||||
|
||||
INCLUDE := $(VCINSTALLDIR)include;$(VCINSTALLDIR)atlmfc\include;$(WindowsSdkDir)include\$(WindowsSDKVersion)ucrt;$(WindowsSdkDir)include\$(WindowsSDKVersion)shared;$(WindowsSdkDir)include\$(WindowsSDKVersion)um;
|
||||
LIB := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);$(WindowsSdkDir)lib\$(WindowsSDKVersion)ucrt\$(TARGET_ARCH2);$(WindowsSdkDir)lib\$(WindowsSDKVersion)um\$(TARGET_ARCH2);C:\Program Files (x86)\NVIDIA Corporation\Cg\lib.$(TARGET_ARCH2);C:\Program Files (x86)\Microsoft DirectX SDK (February 2010)\Lib\$(TARGET_ARCH2);
|
||||
LIBPATH := $(VCINSTALLDIR)LIB\$(CROSS);$(VCINSTALLDIR)atlmfc\lib\$(CROSS);
|
||||
|
||||
PATH := $(shell IFS=$$'\n'; cygpath "$(VCINSTALLDIR)bin\\$(CROSS)"):$(shell IFS=$$'\n'; cygpath "$(WindowsSdkDir)\bin\\$(ARCH2)"):$(PATH)
|
||||
|
||||
|
||||
export INCLUDE := $(INCLUDE)
|
||||
export LIB := $(LIB)
|
||||
export LIBPATH := $(LIBPATH)
|
||||
export PATH := $(PATH)
|
||||
|
||||
#$(info WindowsSdkDir : $(WindowsSdkDir))
|
||||
#$(info WindowsSDKVersion : $(WindowsSDKVersion))
|
||||
#$(info VCINSTALLDIR : $(VCINSTALLDIR))
|
||||
#$(info INCLUDE : $(INCLUDE))
|
||||
#$(info LIB : $(LIB))
|
||||
#$(info LIBPATH : $(LIBPATH))
|
||||
#$(info PATH : $(PATH))
|
||||
#$(error end)
|
||||
|
||||
DEFINES += -D__SSE__ -D__SSE2__
|
||||
ifeq ($(TARGET_ARCH2),x64)
|
||||
DEFINES += -D__x86_64__
|
||||
else
|
||||
#DEFINES += -D__i686__
|
||||
endif
|
||||
|
||||
FLAGS += -nologo -MP
|
||||
FLAGS += -Gm- -Zc:inline -fp:precise -Zc:forScope -GR- -Gd -Oi -volatile:iso
|
||||
#FLAGS += -Zc:wchar_t -Zp16 -Z7
|
||||
#FLAGS += -utf-8
|
||||
#FLAGS += -source-charset:utf-8
|
||||
|
||||
|
||||
CFLAGS += -TC
|
||||
CXXFLAGS += -TP -EHsc
|
||||
WARNINGS += -WX -W3
|
||||
WARNINGS += -wd4101 -wd4996 -wd4244 -wd4267 -wd4090 -wd4305 -wd4146 -wd4334 -wd4018
|
||||
|
||||
CC = cl.exe
|
||||
CXX = cl.exe
|
||||
LD = link.exe
|
||||
RC = rc.exe
|
||||
|
||||
LIBS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib
|
||||
LDFLAGS += -nologo -wx -nxcompat -machine:$(TARGET_ARCH2)
|
||||
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
FLAGS += -GS -Gy -Od -RTC1 -D_SECURE_SCL=1 -Zi
|
||||
FLAGS += -MDd
|
||||
LDFLAGS += -DEBUG
|
||||
DEFINES += -DDEBUG -D_DEBUG
|
||||
else
|
||||
FLAGS += -GS- -Gy- -O2 -Ob2 -GF -GT -Oy -Ot -D_SECURE_SCL=0
|
||||
FLAGS += -MD
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
BUILD_DIR := $(BUILD_DIR)-debug
|
||||
endif
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD),1)
|
||||
BUILD_DIR := $(BUILD_DIR)-griffin
|
||||
endif
|
||||
|
||||
BUILD_DIR := $(BUILD_DIR)-$(TARGET_ARCH2)
|
||||
|
||||
ifneq ($(V), 1)
|
||||
Q := @
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(GRIFFIN_BUILD), 1)
|
||||
OBJ := griffin/griffin.o griffin/griffin_cpp.o
|
||||
DEFINES += -DHAVE_GRIFFIN -DUSE_MATH_DEFINES
|
||||
else
|
||||
DEFINES += -DWANT_GLSLANG
|
||||
BLACKLIST :=
|
||||
OBJ := $(filter-out $(BLACKLIST),$(OBJ))
|
||||
endif
|
||||
|
||||
DEFINES += -DRARCH_INTERNAL -DHAVE_DYNAMIC -DJSON_STATIC
|
||||
INCLUDE_DIRS += -I. -Igfx/include
|
||||
|
||||
#OBJ := version_git.o
|
||||
|
||||
OBJ := $(patsubst %rarch.o,%rarch.res,$(OBJ))
|
||||
OBJ := $(addprefix $(BUILD_DIR)/,$(OBJ))
|
||||
OBJ := $(OBJ:.o=.obj)
|
||||
|
||||
|
||||
|
||||
|
||||
LDFLAGS += -WX -SUBSYSTEM:WINDOWS -ENTRY:mainCRTStartup
|
||||
|
||||
DEFINES := $(patsubst -f%,,$(DEFINES))
|
||||
LDFLAGS := $(patsubst -l%,%.lib,$(LDFLAGS))
|
||||
LIBS := $(filter-out -lm,$(LIBS))
|
||||
LIBS := $(patsubst -l%,%.lib,$(LIBS))
|
||||
|
||||
|
||||
#$(info INCLUDE_DIRS : $(INCLUDE_DIRS))
|
||||
#$(info DEFINES : $(DEFINES))
|
||||
#$(info CFLAGS : $(CFLAGS))
|
||||
#$(info CXXFLAGS : $(CXXFLAGS))
|
||||
#$(info LDFLAGS : $(LDFLAGS))
|
||||
#$(info LIBS : $(LIBS))
|
||||
#$(info OBJ : $(OBJ))
|
||||
#$(info target : $(TARGET))
|
||||
#$(info flags : $(FLAGS))
|
||||
#$(info INCLUDE : $(INCLUDE))
|
||||
#$(info LIB : $(LIB))
|
||||
#$(info LIBPATH : $(LIBPATH))
|
||||
#$(error end)
|
||||
|
||||
$(info os : $(OS))
|
||||
$(info host : $(ARCH))
|
||||
$(info target : $(TARGET_ARCH))
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
%: $(BUILD_DIR)/%
|
||||
cp $< $@
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
%.exe: $(BUILD_DIR)/%.exe
|
||||
cp $< $@
|
||||
cp $(BUILD_DIR)/$*.pdb $*.pbd
|
||||
endif
|
||||
|
||||
SHELL:=$(SHELL) -o pipefail
|
||||
|
||||
DEPFLAGS = -showIncludes | tee $(BUILD_DIR)/$*.dtemp | sed /'Note: including file:'/d
|
||||
MAKEDEPS = echo $@: $< \\ > $(BUILD_DIR)/$*.depend && \
|
||||
grep 'Note: including file:' $(BUILD_DIR)/$*.dtemp \
|
||||
| sed '/$(subst \,\\,$(WindowsSdkDir))/Id; /$(subst \,\\,$(VCINSTALLDIR))/Id; s/Note: including file:[ ]*//g; s/\\/\//g; s/ /\\ /g; s/.*/ & \\/g' \
|
||||
>> $(BUILD_DIR)/$*.depend && \
|
||||
rm -f $(BUILD_DIR)/$*.dtemp
|
||||
|
||||
#DEPFLAGS :=
|
||||
#MAKEDEPS :=
|
||||
|
||||
$(BUILD_DIR)/%.obj: %.cpp
|
||||
@mkdir -p $(dir $@)
|
||||
$(Q)$(CXX) -c -Fo:$@ $< $(FLAGS) $(CXXFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) $(DEPFLAGS)
|
||||
@$(MAKEDEPS)
|
||||
|
||||
$(BUILD_DIR)/%.obj: %.c
|
||||
@mkdir -p $(dir $@)
|
||||
$(Q)$(CC) -c -Fo:$@ $< $(FLAGS) $(CFLAGS) $(DEFINES) $(INCLUDE_DIRS) $(WARNINGS) $(DEPFLAGS)
|
||||
@$(MAKEDEPS)
|
||||
|
||||
$(BUILD_DIR)/%.res: %.rc
|
||||
@mkdir -p $(dir $@)
|
||||
$(Q)$(RC) $<
|
||||
$(Q)mv $*.res $@
|
||||
|
||||
$(BUILD_DIR)/$(TARGET): $(OBJ) .$(TARGET).last
|
||||
@touch .$(TARGET).last
|
||||
$(Q)$(LD) $(OBJ) $(LDFLAGS) $(LIBS) -out:$(BUILD_DIR)/$(TARGET)
|
||||
|
||||
%.depend: ;
|
||||
%.last: ;
|
||||
%.h : ;
|
||||
|
||||
clean:
|
||||
rm -f $(OBJ) $(TARGET)
|
||||
rm -f $(BUILD_DIR)/$(TARGET)
|
||||
rm -f .$(TARGET).last
|
||||
rm -f $(OBJ:.obj=.depend)
|
||||
|
||||
.PHONY: clean all
|
||||
.PRECIOUS: %.depend %.last
|
||||
|
||||
-include $(patsubst %.obj,%.depend,$(filter %.obj,$(OBJ)))
|
@ -7,6 +7,7 @@ GRIFFIN_BUILD = 0
|
||||
SALAMANDER_BUILD = 0
|
||||
WHOLE_ARCHIVE_LINK = 0
|
||||
WIIU_HID = 0
|
||||
WIIU_LOG_RPX = 0
|
||||
BUILD_DIR = objs/wiiu
|
||||
PC_DEVELOPMENT_IP_ADDRESS ?=
|
||||
PC_DEVELOPMENT_TCP_PORT ?=
|
||||
@ -38,10 +39,24 @@ OBJ += wiiu/hbl.o
|
||||
|
||||
DEFINES :=
|
||||
|
||||
ifeq ($(WIIU_LOG_RPX),1)
|
||||
defines += -DWIIU_LOG_RPX
|
||||
endif
|
||||
|
||||
ifeq ($(WIIU_HID),1)
|
||||
DEFINES += -DWIIU_HID
|
||||
OBJ += wiiu/input/hidpad_driver.o
|
||||
OBJ += wiiu/input/wiiu_hid.o
|
||||
OBJ += input/connect/joypad_connection.o \
|
||||
input/connect/connect_ps2adapter.o \
|
||||
input/connect/connect_psxadapter.o \
|
||||
input/connect/connect_ps3.o \
|
||||
input/connect/connect_ps4.o \
|
||||
input/connect/connect_wii.o \
|
||||
input/connect/connect_nesusb.o \
|
||||
input/connect/connect_snesusb.o \
|
||||
input/connect/connect_wiiupro.o \
|
||||
input/connect/connect_wiiugca.o
|
||||
endif
|
||||
|
||||
ifeq ($(SALAMANDER_BUILD),1)
|
||||
@ -95,7 +110,6 @@ else
|
||||
# DEFINES += -DWANT_IFADDRS
|
||||
# DEFINES += -DHAVE_FREETYPE
|
||||
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
|
||||
# DEFINES += -DHAVE_HID
|
||||
else
|
||||
HAVE_MENU_COMMON = 1
|
||||
HAVE_RTGA = 1
|
||||
@ -121,7 +135,6 @@ else
|
||||
HAVE_OVERLAY = 1
|
||||
HAVE_STATIC_VIDEO_FILTERS = 1
|
||||
HAVE_STATIC_AUDIO_FILTERS = 1
|
||||
# HAVE_HID = 1
|
||||
WANT_LIBFAT = 1
|
||||
WANT_IOSUHAX = 1
|
||||
|
||||
|
@ -71,6 +71,7 @@ RetroArch has been ported to the following platforms:
|
||||
- NetBSD
|
||||
- OpenBSD
|
||||
- Haiku
|
||||
- Solaris
|
||||
- MacOS X
|
||||
- PlayStation 3
|
||||
- PlayStation Portable
|
||||
|
@ -573,7 +573,10 @@ static void audio_driver_flush(const int16_t *data, size_t samples)
|
||||
runloop_get_status(&is_paused, &is_idle, &is_slowmotion,
|
||||
&is_perfcnt_enable);
|
||||
|
||||
if (is_paused || !audio_driver_active || !audio_driver_input_data)
|
||||
if ( is_paused ||
|
||||
!audio_driver_active ||
|
||||
!audio_driver_input_data ||
|
||||
!audio_driver_output_samples_buf)
|
||||
return;
|
||||
|
||||
convert_s16_to_float(audio_driver_input_data, data, samples,
|
||||
|
@ -23,11 +23,11 @@
|
||||
|
||||
#include <windows.h>
|
||||
#include <winerror.h>
|
||||
#include <propidl.h>
|
||||
#include <initguid.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <mmreg.h>
|
||||
#include <audioclient.h>
|
||||
#include <propidl.h>
|
||||
|
||||
#include <lists/string_list.h>
|
||||
#include <queues/fifo_queue.h>
|
||||
|
@ -24,11 +24,9 @@ void set_badge_menu_texture(badges_ctx_t * badges, int i)
|
||||
{
|
||||
char badge_file[16];
|
||||
char fullpath[PATH_MAX_LENGTH];
|
||||
const char * locked_suffix = (badges->badge_locked[i] == true)
|
||||
? "_lock.png" : ".png";
|
||||
|
||||
snprintf(badge_file, sizeof(badge_file), "%s", badges->badge_id_list[i]);
|
||||
strcat(badge_file, locked_suffix);
|
||||
snprintf(badge_file, sizeof(badge_file), "%s%s", badges->badge_id_list[i],
|
||||
badges->badge_locked[i] ? "_lock.png" : ".png");
|
||||
|
||||
fill_pathname_application_special(fullpath,
|
||||
PATH_MAX_LENGTH * sizeof(char),
|
||||
@ -54,7 +52,7 @@ void set_badge_info (badges_ctx_t *badge_struct, int id,
|
||||
menu_texture_item get_badge_texture(int id)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
if (!settings->bools.cheevos_badges_enable)
|
||||
if (!settings || !settings->bools.cheevos_badges_enable)
|
||||
return (menu_texture_item)NULL;
|
||||
|
||||
return badges_ctx.menu_texture_list[id];
|
||||
|
@ -159,7 +159,6 @@ static const struct cmd_map map[] = {
|
||||
{ "SCREENSHOT", RARCH_SCREENSHOT },
|
||||
{ "MUTE", RARCH_MUTE },
|
||||
{ "OSK", RARCH_OSK },
|
||||
{ "NETPLAY_FLIP", RARCH_NETPLAY_FLIP },
|
||||
{ "NETPLAY_GAME_WATCH", RARCH_NETPLAY_GAME_WATCH },
|
||||
{ "SLOWMOTION", RARCH_SLOWMOTION },
|
||||
{ "VOLUME_UP", RARCH_VOLUME_UP },
|
||||
@ -2559,9 +2558,6 @@ TODO: Add a setting for these tweaks */
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case CMD_EVENT_NETPLAY_FLIP_PLAYERS:
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_FLIP_PLAYERS, NULL);
|
||||
break;
|
||||
case CMD_EVENT_NETPLAY_GAME_WATCH:
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_GAME_WATCH, NULL);
|
||||
break;
|
||||
@ -2572,7 +2568,6 @@ TODO: Add a setting for these tweaks */
|
||||
case CMD_EVENT_NETPLAY_INIT:
|
||||
case CMD_EVENT_NETPLAY_INIT_DIRECT:
|
||||
case CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED:
|
||||
case CMD_EVENT_NETPLAY_FLIP_PLAYERS:
|
||||
case CMD_EVENT_NETPLAY_GAME_WATCH:
|
||||
return false;
|
||||
#endif
|
||||
|
@ -179,8 +179,6 @@ enum event_command
|
||||
CMD_EVENT_NETPLAY_INIT_DIRECT_DEFERRED,
|
||||
/* Deinitializes netplay system. */
|
||||
CMD_EVENT_NETPLAY_DEINIT,
|
||||
/* Flip netplay players. */
|
||||
CMD_EVENT_NETPLAY_FLIP_PLAYERS,
|
||||
/* Switch between netplay gaming and watching. */
|
||||
CMD_EVENT_NETPLAY_GAME_WATCH,
|
||||
/* Initializes BSV movie. */
|
||||
|
19
config.def.h
19
config.def.h
@ -27,6 +27,10 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
#include "network/netplay/netplay.h"
|
||||
#endif
|
||||
|
||||
#if defined(HW_RVL)
|
||||
#define MAX_GAMMA_SETTING 30
|
||||
#elif defined(GEKKO)
|
||||
@ -170,7 +174,7 @@ static unsigned swap_interval = 1;
|
||||
static const bool video_threaded = false;
|
||||
|
||||
#if defined(HAVE_THREADS)
|
||||
#if defined(GEKKO) || defined(PSP) || defined(_3DS) || defined(_XBOX1)
|
||||
#if defined(GEKKO) || defined(PSP) || defined(_3DS)
|
||||
/* For single-core consoles right now it's better to have this be disabled. */
|
||||
static const bool threaded_data_runloop_enable = false;
|
||||
#else
|
||||
@ -400,6 +404,9 @@ static const bool post_filter_record = false;
|
||||
/* Screenshots post-shaded GPU output if available. */
|
||||
static const bool gpu_screenshot = true;
|
||||
|
||||
/* Watch shader files for changes and auto-apply as necessary. */
|
||||
static const bool video_shader_watch_files = false;
|
||||
|
||||
/* Screenshots named automatically. */
|
||||
static const bool auto_screenshot_filename = true;
|
||||
|
||||
@ -544,6 +551,12 @@ static const int netplay_check_frames = 600;
|
||||
|
||||
static const bool netplay_use_mitm_server = false;
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
static const unsigned netplay_share_digital = RARCH_NETPLAY_SHARE_DIGITAL_NO_PREFERENCE;
|
||||
|
||||
static const unsigned netplay_share_analog = RARCH_NETPLAY_SHARE_ANALOG_NO_PREFERENCE;
|
||||
#endif
|
||||
|
||||
/* On save state load, block SRAM from being overwritten.
|
||||
* This could potentially lead to buggy games. */
|
||||
static const bool block_sram_overwrite = false;
|
||||
@ -670,7 +683,7 @@ static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/apple/
|
||||
#endif
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
#if _MSC_VER == 1600
|
||||
#if defined(__x86_64__)
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2010/x86_64/latest/";
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2010/x86/latest/";
|
||||
@ -680,7 +693,7 @@ static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/window
|
||||
#elif _MSC_VER == 1310
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows-msvc2003/x86/latest/";
|
||||
#else
|
||||
#if defined(__x86_64__)
|
||||
#if defined(__x86_64__) || defined(_M_X64)
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows/x86_64/latest/";
|
||||
#elif defined(__i386__) || defined(__i486__) || defined(__i686__) || defined(_M_IX86) || defined(_M_IA64)
|
||||
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/windows/x86/latest/";
|
||||
|
@ -85,7 +85,6 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
@ -160,7 +159,6 @@ static const struct retro_keybind retro_keybinds_1[] = {
|
||||
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_F8, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_F9, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_F12, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_FLIP, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_FLIP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_SLOWMOTION, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
|
||||
|
@ -126,12 +126,15 @@ enum video_driver_enum
|
||||
VIDEO_WII,
|
||||
VIDEO_WIIU,
|
||||
VIDEO_XENON360,
|
||||
VIDEO_XDK_D3D,
|
||||
VIDEO_PSP1,
|
||||
VIDEO_VITA2D,
|
||||
VIDEO_CTR,
|
||||
VIDEO_SWITCH,
|
||||
VIDEO_D3D8,
|
||||
VIDEO_D3D9,
|
||||
VIDEO_D3D10,
|
||||
VIDEO_D3D11,
|
||||
VIDEO_D3D12,
|
||||
VIDEO_VG,
|
||||
VIDEO_OMAP,
|
||||
VIDEO_EXYNOS,
|
||||
@ -225,6 +228,7 @@ enum joypad_driver_enum
|
||||
JOYPAD_HID,
|
||||
JOYPAD_QNX,
|
||||
JOYPAD_RWEBPAD,
|
||||
JOYPAD_MFI,
|
||||
JOYPAD_NULL
|
||||
};
|
||||
|
||||
@ -281,10 +285,10 @@ static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WII;
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WIIU;
|
||||
#elif defined(XENON)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_XENON360;
|
||||
#elif (defined(_XBOX1) || defined(_XBOX360)) && (defined(HAVE_D3D8) || defined(HAVE_D3D9))
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_XDK_D3D;
|
||||
#elif defined(HAVE_D3D9)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D9;
|
||||
#elif defined(HAVE_D3D8)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_D3D8;
|
||||
#elif defined(HAVE_VG)
|
||||
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_VG;
|
||||
#elif defined(HAVE_VITA2D)
|
||||
@ -457,6 +461,8 @@ static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_HID;
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_QNX;
|
||||
#elif defined(EMSCRIPTEN)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_RWEBPAD;
|
||||
#elif defined(IOS)
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_MFI;
|
||||
#else
|
||||
static enum joypad_driver_enum JOYPAD_DEFAULT_DRIVER = JOYPAD_NULL;
|
||||
#endif
|
||||
@ -491,7 +497,7 @@ static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XUI;
|
||||
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_MATERIALUI;
|
||||
#elif defined(HAVE_XMB)
|
||||
#elif defined(HAVE_XMB) && !defined(_XBOX)
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XMB;
|
||||
#elif defined(HAVE_RGUI)
|
||||
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_RGUI;
|
||||
@ -692,9 +698,16 @@ const char *config_get_default_video(void)
|
||||
return "gx2";
|
||||
case VIDEO_XENON360:
|
||||
return "xenon360";
|
||||
case VIDEO_XDK_D3D:
|
||||
case VIDEO_D3D8:
|
||||
return "d3d8";
|
||||
case VIDEO_D3D9:
|
||||
return "d3d";
|
||||
return "d3d9";
|
||||
case VIDEO_D3D10:
|
||||
return "d3d10";
|
||||
case VIDEO_D3D11:
|
||||
return "d3d11";
|
||||
case VIDEO_D3D12:
|
||||
return "d3d12";
|
||||
case VIDEO_PSP1:
|
||||
return "psp1";
|
||||
case VIDEO_VITA2D:
|
||||
@ -853,6 +866,8 @@ const char *config_get_default_joypad(void)
|
||||
return "rwebpad";
|
||||
case JOYPAD_DOS:
|
||||
return "dos";
|
||||
case JOYPAD_MFI:
|
||||
return "mfi";
|
||||
case JOYPAD_NULL:
|
||||
break;
|
||||
}
|
||||
@ -1151,7 +1166,6 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
{
|
||||
struct config_bool_setting *tmp = (struct config_bool_setting*)malloc((*size + 1) * sizeof(struct config_bool_setting));
|
||||
unsigned count = 0;
|
||||
global_t *global = global_get_ptr();
|
||||
|
||||
SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, automatically_add_content_to_playlist, false);
|
||||
SETTING_BOOL("ui_companion_start_on_boot", &settings->bools.ui_companion_start_on_boot, true, ui_companion_start_on_boot, false);
|
||||
@ -1166,8 +1180,23 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("netplay_allow_slaves", &settings->bools.netplay_allow_slaves, true, netplay_allow_slaves, false);
|
||||
SETTING_BOOL("netplay_require_slaves", &settings->bools.netplay_require_slaves, true, netplay_require_slaves, false);
|
||||
SETTING_BOOL("netplay_stateless_mode", &settings->bools.netplay_stateless_mode, true, netplay_stateless_mode, false);
|
||||
SETTING_BOOL("netplay_client_swap_input", &settings->bools.netplay_swap_input, true, netplay_client_swap_input, false);
|
||||
SETTING_BOOL("netplay_use_mitm_server", &settings->bools.netplay_use_mitm_server, true, netplay_use_mitm_server, false);
|
||||
SETTING_BOOL("netplay_request_device_p1", &settings->bools.netplay_request_devices[0], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p2", &settings->bools.netplay_request_devices[1], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p3", &settings->bools.netplay_request_devices[2], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p4", &settings->bools.netplay_request_devices[3], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p5", &settings->bools.netplay_request_devices[4], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p6", &settings->bools.netplay_request_devices[5], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p7", &settings->bools.netplay_request_devices[6], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p8", &settings->bools.netplay_request_devices[7], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p9", &settings->bools.netplay_request_devices[8], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p10", &settings->bools.netplay_request_devices[9], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p11", &settings->bools.netplay_request_devices[10], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p12", &settings->bools.netplay_request_devices[11], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p13", &settings->bools.netplay_request_devices[12], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p14", &settings->bools.netplay_request_devices[13], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p15", &settings->bools.netplay_request_devices[14], true, false, false);
|
||||
SETTING_BOOL("netplay_request_device_p16", &settings->bools.netplay_request_devices[15], true, false, false);
|
||||
#endif
|
||||
SETTING_BOOL("input_descriptor_label_show", &settings->bools.input_descriptor_label_show, true, input_descriptor_label_show, false);
|
||||
SETTING_BOOL("input_descriptor_hide_unbound", &settings->bools.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false);
|
||||
@ -1182,6 +1211,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
SETTING_BOOL("rewind_enable", &settings->bools.rewind_enable, true, rewind_enable, false);
|
||||
SETTING_BOOL("audio_sync", &settings->bools.audio_sync, true, audio_sync, false);
|
||||
SETTING_BOOL("video_shader_enable", &settings->bools.video_shader_enable, true, shader_enable, false);
|
||||
SETTING_BOOL("video_shader_watch_files", &settings->bools.video_shader_watch_files, true, video_shader_watch_files, false);
|
||||
|
||||
/* Let implementation decide if automatic, or 1:1 PAR. */
|
||||
SETTING_BOOL("video_aspect_ratio_auto", &settings->bools.video_aspect_ratio_auto, true, aspect_ratio_auto, false);
|
||||
@ -1349,11 +1379,6 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
|
||||
|
||||
SETTING_BOOL("video_msg_bgcolor_enable", &settings->bools.video_msg_bgcolor_enable, true, message_bgcolor_enable, false);
|
||||
|
||||
if (global)
|
||||
{
|
||||
SETTING_BOOL("custom_bgm_enable", &global->console.sound.system_bgm_enable, true, false, false);
|
||||
}
|
||||
|
||||
*size = count;
|
||||
|
||||
return tmp;
|
||||
@ -1461,6 +1486,8 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
|
||||
SETTING_UINT("netplay_ip_port", &settings->uints.netplay_port, true, RARCH_DEFAULT_PORT, false);
|
||||
SETTING_UINT("netplay_input_latency_frames_min",&settings->uints.netplay_input_latency_frames_min, true, 0, false);
|
||||
SETTING_UINT("netplay_input_latency_frames_range",&settings->uints.netplay_input_latency_frames_range, true, 0, false);
|
||||
SETTING_UINT("netplay_share_digital", &settings->uints.netplay_share_digital, true, netplay_share_digital, false);
|
||||
SETTING_UINT("netplay_share_analog", &settings->uints.netplay_share_analog, true, netplay_share_analog, false);
|
||||
#endif
|
||||
#ifdef HAVE_LANGEXTRA
|
||||
SETTING_UINT("user_language", msg_hash_get_uint(MSG_HASH_USER_LANGUAGE), true, RETRO_LANGUAGE_ENGLISH, false);
|
||||
@ -2238,15 +2265,17 @@ static bool check_shader_compatibility(enum file_path_enum enum_idx)
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (string_is_equal(settings->arrays.video_driver, "vulkan"))
|
||||
if (string_is_equal(settings->arrays.video_driver, "vulkan") ||
|
||||
string_is_equal(settings->arrays.video_driver, "gx2"))
|
||||
{
|
||||
if (enum_idx != FILE_PATH_SLANGP_EXTENSION)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (string_is_equal(settings->arrays.video_driver, "gl") ||
|
||||
string_is_equal(settings->arrays.video_driver, "d3d")
|
||||
if (string_is_equal(settings->arrays.video_driver, "gl") ||
|
||||
string_is_equal(settings->arrays.video_driver, "d3d8") ||
|
||||
string_is_equal(settings->arrays.video_driver, "d3d9")
|
||||
)
|
||||
{
|
||||
if (enum_idx == FILE_PATH_SLANGP_EXTENSION)
|
||||
|
@ -81,6 +81,7 @@ typedef struct settings
|
||||
bool video_aspect_ratio_auto;
|
||||
bool video_scale_integer;
|
||||
bool video_shader_enable;
|
||||
bool video_shader_watch_files;
|
||||
bool video_threaded;
|
||||
bool video_font_enable;
|
||||
bool video_disable_composition;
|
||||
@ -174,9 +175,9 @@ typedef struct settings
|
||||
bool netplay_allow_slaves;
|
||||
bool netplay_require_slaves;
|
||||
bool netplay_stateless_mode;
|
||||
bool netplay_swap_input;
|
||||
bool netplay_nat_traversal;
|
||||
bool netplay_use_mitm_server;
|
||||
bool netplay_request_devices[MAX_USERS];
|
||||
|
||||
/* Network */
|
||||
bool network_buildbot_auto_extract_archive;
|
||||
@ -315,6 +316,8 @@ typedef struct settings
|
||||
unsigned netplay_port;
|
||||
unsigned netplay_input_latency_frames_min;
|
||||
unsigned netplay_input_latency_frames_range;
|
||||
unsigned netplay_share_digital;
|
||||
unsigned netplay_share_analog;
|
||||
unsigned bundle_assets_extract_version_current;
|
||||
unsigned bundle_assets_extract_last_version;
|
||||
unsigned content_history_size;
|
||||
|
@ -15,6 +15,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@ -64,6 +65,84 @@ static void fallback_log(enum retro_log_level level, const char *fmt, ...)
|
||||
va_end(va);
|
||||
}
|
||||
|
||||
static void print_mpv_logs(void)
|
||||
{
|
||||
/* Print out mpv logs */
|
||||
if(event_waiting > 0)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
mpv_event *mp_event = mpv_wait_event(mpv, 0);
|
||||
if(mp_event->event_id == MPV_EVENT_NONE)
|
||||
break;
|
||||
|
||||
if(mp_event->event_id == MPV_EVENT_LOG_MESSAGE)
|
||||
{
|
||||
struct mpv_event_log_message *msg =
|
||||
(struct mpv_event_log_message *)mp_event->data;
|
||||
log_cb(RETRO_LOG_INFO, "mpv: [%s] %s: %s",
|
||||
msg->prefix, msg->level, msg->text);
|
||||
}
|
||||
else if(mp_event->event_id == MPV_EVENT_END_FILE)
|
||||
{
|
||||
struct mpv_event_end_file *eof =
|
||||
(struct mpv_event_end_file *)mp_event->data;
|
||||
|
||||
if(eof->reason == MPV_END_FILE_REASON_EOF)
|
||||
environ_cb(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
|
||||
#if 0
|
||||
/* The following could be done instead if the file was not
|
||||
* closed once the end was reached - allowing the user to seek
|
||||
* back without reopening the file.
|
||||
*/
|
||||
struct retro_message ra_msg = {
|
||||
"Finished playing file", 60 * 5, /* 5 seconds */
|
||||
};
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, &ra_msg);RETRO_ENVIRONMENT_SHUTDOWN
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
log_cb(RETRO_LOG_INFO, "mpv: %s\n",
|
||||
mpv_event_name(mp_event->event_id));
|
||||
}
|
||||
}
|
||||
|
||||
event_waiting = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void *get_proc_address_mpv(void *fn_ctx, const char *name)
|
||||
{
|
||||
/* The "ISO C forbids conversion of function pointer to object pointer
|
||||
* type" warning is suppressed.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
void *proc_addr = (void *) hw_render.get_proc_address(name);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
// EGL 1.4 (supported by the RPI firmware) does not necessarily return
|
||||
// function pointers for core functions.
|
||||
if (!proc_addr) {
|
||||
void *h = dlopen("/opt/vc/lib/libGLESv2.so", RTLD_LAZY);
|
||||
|
||||
if (!h)
|
||||
h = dlopen("/usr/lib/libGLESv2.so", RTLD_LAZY);
|
||||
|
||||
if (h) {
|
||||
proc_addr = dlsym(h, name);
|
||||
dlclose(h);
|
||||
}
|
||||
}
|
||||
|
||||
if(proc_addr == NULL)
|
||||
log_cb(RETRO_LOG_ERROR, "Failure obtaining %s proc address\n", name);
|
||||
|
||||
return proc_addr;
|
||||
}
|
||||
|
||||
static void on_mpv_events(void *mpv)
|
||||
{
|
||||
event_waiting++;
|
||||
@ -128,6 +207,9 @@ void retro_get_system_av_info(struct retro_system_av_info *info)
|
||||
.sample_rate = sampling_rate,
|
||||
};
|
||||
|
||||
/* We don't know the dimensions of the video yet, so we set some good
|
||||
* defaults in the meantime.
|
||||
*/
|
||||
info->geometry = (struct retro_game_geometry) {
|
||||
.base_width = 256,
|
||||
.base_height = 144,
|
||||
@ -157,22 +239,6 @@ void retro_set_environment(retro_environment_t cb)
|
||||
log_cb = fallback_log;
|
||||
}
|
||||
|
||||
static void *get_proc_address_mpv(void *fn_ctx, const char *name)
|
||||
{
|
||||
/* The "ISO C forbids conversion of function pointer to object pointer
|
||||
* type" warning is suppressed.
|
||||
*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
void *proc_addr = (void *) hw_render.get_proc_address(name);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
if(proc_addr == NULL)
|
||||
log_cb(RETRO_LOG_ERROR, "Failure obtaining %s proc address\n", name);
|
||||
|
||||
return proc_addr;
|
||||
}
|
||||
|
||||
static void context_reset(void)
|
||||
{
|
||||
const char *cmd[] = {"loadfile", filepath, NULL};
|
||||
@ -183,7 +249,7 @@ static void context_reset(void)
|
||||
|
||||
mpv = mpv_create();
|
||||
|
||||
if(!mpv)
|
||||
if(mpv == NULL)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "failed creating context\n");
|
||||
exit(EXIT_FAILURE);
|
||||
@ -198,7 +264,7 @@ static void context_reset(void)
|
||||
/* When normal mpv events are available. */
|
||||
mpv_set_wakeup_callback(mpv, on_mpv_events, NULL);
|
||||
|
||||
if(mpv_request_log_messages(mpv, "info") < 0)
|
||||
if(mpv_request_log_messages(mpv, "v") < 0)
|
||||
log_cb(RETRO_LOG_ERROR, "mpv logging failed\n");
|
||||
|
||||
/* The OpenGL API is somewhat separate from the normal mpv API. This only
|
||||
@ -206,16 +272,16 @@ static void context_reset(void)
|
||||
*/
|
||||
mpv_gl = mpv_get_sub_api(mpv, MPV_SUB_API_OPENGL_CB);
|
||||
|
||||
if(!mpv_gl)
|
||||
if(mpv_gl == NULL)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "failed to create mpv GL API handle\n");
|
||||
exit(EXIT_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if(mpv_opengl_cb_init_gl(mpv_gl, NULL, get_proc_address_mpv, NULL) < 0)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "failed to initialize mpv GL context\n");
|
||||
exit(EXIT_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Actually using the opengl_cb state has to be explicitly requested.
|
||||
@ -224,7 +290,7 @@ static void context_reset(void)
|
||||
if(mpv_set_option_string(mpv, "vo", "opengl-cb") < 0)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "failed to set video output to OpenGL\n");
|
||||
exit(EXIT_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
if(mpv_set_option_string(mpv, "hwdec", "auto") < 0)
|
||||
@ -232,10 +298,11 @@ static void context_reset(void)
|
||||
|
||||
if(mpv_command(mpv, cmd) != 0)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "failed to issue mpv_command\n");
|
||||
exit(EXIT_FAILURE);
|
||||
log_cb(RETRO_LOG_ERROR, "failed to issue mpv_command to load file\n");
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
||||
/* Keep trying until mpv accepts the property. This is done to seek to the
|
||||
* point in the file after the previous context was destroyed. If no
|
||||
* context was destroyed previously, the file seeks to 0.
|
||||
@ -244,9 +311,19 @@ static void context_reset(void)
|
||||
*/
|
||||
while(mpv_set_property(mpv,
|
||||
"playback-time", MPV_FORMAT_INT64, &playback_time) < 0)
|
||||
{}
|
||||
{
|
||||
/* Garbage fix to overflowing log */
|
||||
usleep(10);
|
||||
}
|
||||
|
||||
log_cb(RETRO_LOG_INFO, "Context reset.\n");
|
||||
|
||||
return;
|
||||
|
||||
err:
|
||||
/* Print mpv logs to see why mpv failed. */
|
||||
print_mpv_logs();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
static void context_destroy(void)
|
||||
@ -257,30 +334,13 @@ static void context_destroy(void)
|
||||
log_cb(RETRO_LOG_INFO, "Context destroyed.\n");
|
||||
}
|
||||
|
||||
#ifdef HAVE_OPENGLES
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
#if defined(HAVE_OPENGLES_3_1)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES_VERSION;
|
||||
hw_render.version_major = 3;
|
||||
hw_render.version_minor = 1;
|
||||
#elif defined(HAVE_OPENGLES3)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES3;
|
||||
#else
|
||||
#if defined(HAVE_OPENGLES)
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGLES2;
|
||||
#endif
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
|
||||
if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
static bool retro_init_hw_context(void)
|
||||
{
|
||||
hw_render.context_type = RETRO_HW_CONTEXT_OPENGL;
|
||||
#endif
|
||||
hw_render.context_reset = context_reset;
|
||||
hw_render.context_destroy = context_destroy;
|
||||
|
||||
@ -289,7 +349,6 @@ static bool retro_init_hw_context(void)
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
void retro_set_audio_sample(retro_audio_sample_t cb)
|
||||
{
|
||||
@ -418,6 +477,11 @@ void retro_run(void)
|
||||
mpv_get_property(mpv, "dwidth", MPV_FORMAT_INT64, &width);
|
||||
mpv_get_property(mpv, "dheight", MPV_FORMAT_INT64, &height);
|
||||
|
||||
/* We don't know the dimensions of the video when
|
||||
* retro_get_system_av_info is called, so we have to set it here for
|
||||
* the correct aspect ratio.
|
||||
* This is not a temporary change
|
||||
*/
|
||||
struct retro_game_geometry geometry = {
|
||||
.base_width = width,
|
||||
.base_height = height,
|
||||
@ -428,33 +492,11 @@ void retro_run(void)
|
||||
.aspect_ratio = -1,
|
||||
};
|
||||
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &geometry);
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &geometry);
|
||||
updated_video_dimensions = true;
|
||||
}
|
||||
|
||||
/* Print out mpv logs */
|
||||
if(event_waiting > 0)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
mpv_event *mp_event = mpv_wait_event(mpv, 0);
|
||||
if(mp_event->event_id == MPV_EVENT_NONE)
|
||||
break;
|
||||
|
||||
log_cb(RETRO_LOG_INFO, "mpv: ");
|
||||
if(mp_event->event_id == MPV_EVENT_LOG_MESSAGE)
|
||||
{
|
||||
struct mpv_event_log_message *msg =
|
||||
(struct mpv_event_log_message *)mp_event->data;
|
||||
log_cb(RETRO_LOG_INFO, "[%s] %s: %s",
|
||||
msg->prefix, msg->level, msg->text);
|
||||
}
|
||||
else
|
||||
log_cb(RETRO_LOG_INFO, "%s\n", mpv_event_name(mp_event->event_id));
|
||||
}
|
||||
|
||||
event_waiting = 0;
|
||||
}
|
||||
print_mpv_logs();
|
||||
|
||||
retropad_update_input();
|
||||
/* TODO #2: Implement an audio callback feature in to libmpv */
|
||||
@ -506,7 +548,7 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc);
|
||||
|
||||
/* Not bothered if this fails. Assuming the default is selected anyway. */
|
||||
if(!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
|
||||
if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt) == false)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "XRGB8888 is not supported.\n");
|
||||
|
||||
@ -515,7 +557,7 @@ bool retro_load_game(const struct retro_game_info *info)
|
||||
environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt);
|
||||
}
|
||||
|
||||
if(!retro_init_hw_context())
|
||||
if(retro_init_hw_context() == false)
|
||||
{
|
||||
log_cb(RETRO_LOG_ERROR, "HW Context could not be initialized\n");
|
||||
return false;
|
||||
|
@ -23,10 +23,11 @@
|
||||
|
||||
#if defined(HAVE_D3D9)
|
||||
/* Direct3D 9 */
|
||||
#if 0
|
||||
#include <d3d9.h>
|
||||
#endif
|
||||
|
||||
#define ID3DSURFACE IDirect3DSurface9
|
||||
|
||||
#if 0
|
||||
#define LPDIRECT3D LPDIRECT3D9
|
||||
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
|
||||
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
|
||||
@ -40,21 +41,23 @@
|
||||
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE9
|
||||
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
|
||||
#define D3DVIEWPORT D3DVIEWPORT9
|
||||
|
||||
#define D3DCREATE_CTX Direct3DCreate9
|
||||
#endif
|
||||
|
||||
#ifndef D3DCREATE_SOFTWARE_VERTEXPROCESSING
|
||||
#define D3DCREATE_SOFTWARE_VERTEXPROCESSING 0
|
||||
#endif
|
||||
|
||||
#elif defined(HAVE_D3D8)
|
||||
#if 0
|
||||
#ifdef _XBOX
|
||||
#include <xtl.h>
|
||||
#else
|
||||
#include "../gfx/include/d3d8/d3d8.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Direct3D 8 */
|
||||
#if 0
|
||||
#define LPDIRECT3D LPDIRECT3D8
|
||||
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE8
|
||||
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE8
|
||||
@ -66,25 +69,18 @@
|
||||
#define LPDIRECT3DRESOURCE LPDIRECT3DRESOURCE8
|
||||
#define D3DVERTEXELEMENT D3DVERTEXELEMENT8
|
||||
#define D3DVIEWPORT D3DVIEWPORT8
|
||||
|
||||
#define ID3DSURFACE IDirect3DSurface8
|
||||
#define D3DCREATE_CTX Direct3DCreate8
|
||||
#endif
|
||||
|
||||
#if !defined(D3DLOCK_NOSYSLOCK) && defined(_XBOX)
|
||||
#define D3DLOCK_NOSYSLOCK (0)
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#define D3DSAMP_ADDRESSU D3DTSS_ADDRESSU
|
||||
#define D3DSAMP_ADDRESSV D3DTSS_ADDRESSV
|
||||
#define D3DSAMP_MAGFILTER D3DTSS_MAGFILTER
|
||||
#define D3DSAMP_MINFILTER D3DTSS_MINFILTER
|
||||
#endif
|
||||
|
||||
#if defined(_XBOX360)
|
||||
#define D3DFVF_CUSTOMVERTEX 0
|
||||
#elif defined(HAVE_D3D9)
|
||||
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_TEX1)
|
||||
#elif defined(HAVE_D3D8)
|
||||
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_DIFFUSE)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
2
deps/SPIRV-Cross/.gitignore
vendored
2
deps/SPIRV-Cross/.gitignore
vendored
@ -13,5 +13,7 @@
|
||||
*.opensdf
|
||||
*.shader
|
||||
*.a
|
||||
*.bc
|
||||
/external
|
||||
|
||||
!CMakeLists.txt
|
||||
|
13
deps/SPIRV-Cross/.travis.yml
vendored
13
deps/SPIRV-Cross/.travis.yml
vendored
@ -2,25 +2,32 @@ language: cpp
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
osx_image: xcode8.2
|
||||
|
||||
# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
|
||||
sudo: required
|
||||
dist: trusty
|
||||
|
||||
# We check out glslang at a specific revision to avoid test output mismatches
|
||||
# We check out glslang and SPIRV-Tools at specific revisions to avoid test output mismatches
|
||||
env:
|
||||
- GLSLANG_REV=b56f4ac72c57f5c50f14ddb0bf1f78eaaef21c2b
|
||||
- GLSLANG_REV=9c6f8cc29ba303b43ccf36deea6bb38a304f9b92 SPIRV_TOOLS_REV=e28edd458b729da7bbfd51e375feb33103709e6f
|
||||
|
||||
before_script:
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi
|
||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; brew install python3; fi
|
||||
- git clone https://github.com/KhronosGroup/glslang.git glslang
|
||||
- git clone https://github.com/KhronosGroup/SPIRV-Tools SPIRV-Tools
|
||||
- git clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Tools/external/spirv-headers
|
||||
|
||||
script:
|
||||
- git -C glslang checkout $GLSLANG_REV
|
||||
- git -C SPIRV-Tools checkout $SPIRV_TOOLS_REV
|
||||
- cd glslang && cmake . && make -j2 && cd ..
|
||||
- cd SPIRV-Tools && cmake . && make -j2 && cd ..
|
||||
- make -j2
|
||||
- PATH=./glslang/StandAlone:./SPIRV-Tools/tools:$PATH
|
||||
- ./test_shaders.py shaders
|
||||
- ./test_shaders.py --msl shaders-msl
|
||||
- ./test_shaders.py --hlsl shaders-hlsl
|
||||
- ./test_shaders.py shaders --opt
|
||||
- ./test_shaders.py --msl shaders-msl --opt
|
||||
- ./test_shaders.py --hlsl shaders-hlsl --opt
|
||||
|
127
deps/SPIRV-Cross/CMakeLists.txt
vendored
127
deps/SPIRV-Cross/CMakeLists.txt
vendored
@ -24,34 +24,6 @@ if(${CMAKE_GENERATOR} MATCHES "Makefile")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(spirv-cross-core STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GLSL.std.450.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_common.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.cpp)
|
||||
|
||||
add_library(spirv-cross-glsl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.hpp)
|
||||
|
||||
add_library(spirv-cross-cpp STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.cpp)
|
||||
|
||||
add_library(spirv-cross-msl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.cpp)
|
||||
|
||||
add_executable(spirv-cross main.cpp)
|
||||
target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-cpp spirv-cross-msl spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-glsl spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-msl spirv-cross-glsl)
|
||||
target_link_libraries(spirv-cross-cpp spirv-cross-glsl)
|
||||
target_include_directories(spirv-cross-core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(spirv-compiler-options "")
|
||||
set(spirv-compiler-defines "")
|
||||
|
||||
@ -71,27 +43,102 @@ if (NOT "${MSVC}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_compile_options(spirv-cross-core PRIVATE ${spirv-compiler-options})
|
||||
target_compile_options(spirv-cross-glsl PRIVATE ${spirv-compiler-options})
|
||||
target_compile_options(spirv-cross-msl PRIVATE ${spirv-compiler-options})
|
||||
target_compile_options(spirv-cross-cpp PRIVATE ${spirv-compiler-options})
|
||||
macro(extract_headers out_abs file_list)
|
||||
set(${out_abs}) # absolute paths
|
||||
foreach(_a ${file_list})
|
||||
# get_filename_component only returns the longest extension, so use a regex
|
||||
string(REGEX REPLACE ".*\\.(h|hpp)" "\\1" ext ${_a})
|
||||
if(("${ext}" STREQUAL "h") OR ("${ext}" STREQUAL "hpp"))
|
||||
list(APPEND ${out_abs} "${_a}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
macro(spirv_cross_add_library name config_name)
|
||||
add_library(${name} ${ARGN})
|
||||
extract_headers(hdrs "${ARGN}")
|
||||
target_include_directories(${name} PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
$<INSTALL_INTERFACE:include/spirv_cross>)
|
||||
set_target_properties(${name} PROPERTIES
|
||||
PUBLIC_HEADERS "${hdrs}")
|
||||
target_compile_options(${name} PRIVATE ${spirv-compiler-options})
|
||||
target_compile_definitions(${name} PRIVATE ${spirv-compiler-defines})
|
||||
install(TARGETS ${name}
|
||||
EXPORT ${config_name}Config
|
||||
RUNTIME DESTINATION bin
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
PUBLIC_HEADER DESTINATION include/spirv_cross)
|
||||
install(FILES ${hdrs} DESTINATION include/spirv_cross)
|
||||
install(EXPORT ${config_name}Config DESTINATION share/${config_name}/cmake)
|
||||
export(TARGETS ${targets} FILE ${config_name}Config.cmake)
|
||||
endmacro()
|
||||
|
||||
|
||||
spirv_cross_add_library(spirv-cross-core spirv_cross_core STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/GLSL.std.450.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_common.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-glsl spirv_cross_glsl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.hpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-cpp spirv_cross_cpp STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-msl spirv_cross_msl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.cpp)
|
||||
|
||||
spirv_cross_add_library(spirv-cross-hlsl spirv_cross_hlsl STATIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.hpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.cpp)
|
||||
|
||||
add_executable(spirv-cross main.cpp)
|
||||
target_compile_options(spirv-cross PRIVATE ${spirv-compiler-options})
|
||||
target_compile_definitions(spirv-cross-core PRIVATE ${spirv-compiler-defines})
|
||||
target_compile_definitions(spirv-cross-glsl PRIVATE ${spirv-compiler-defines})
|
||||
target_compile_definitions(spirv-cross-msl PRIVATE ${spirv-compiler-defines})
|
||||
target_compile_definitions(spirv-cross-cpp PRIVATE ${spirv-compiler-defines})
|
||||
target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines})
|
||||
|
||||
install(TARGETS spirv-cross RUNTIME DESTINATION bin)
|
||||
target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-hlsl spirv-cross-cpp spirv-cross-msl spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-glsl spirv-cross-core)
|
||||
target_link_libraries(spirv-cross-msl spirv-cross-glsl)
|
||||
target_link_libraries(spirv-cross-hlsl spirv-cross-glsl)
|
||||
target_link_libraries(spirv-cross-cpp spirv-cross-glsl)
|
||||
|
||||
# Set up tests, using only the simplest modes of the test_shaders
|
||||
# script. You have to invoke the script manually to:
|
||||
# - Update the reference files
|
||||
# - Get cycle counts from malisc
|
||||
# - Keep failing outputs
|
||||
find_package(PythonInterp)
|
||||
if(${PYTHONINTERP_FOUND} AND ${PYTHON_VERSION_MAJOR} GREATER 2)
|
||||
add_test(NAME spirv-cross-test
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders)
|
||||
if (${PYTHONINTERP_FOUND})
|
||||
if (${PYTHON_VERSION_MAJOR} GREATER 2)
|
||||
add_test(NAME spirv-cross-test
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders)
|
||||
add_test(NAME spirv-cross-test-metal
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl)
|
||||
add_test(NAME spirv-cross-test-hlsl
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl)
|
||||
add_test(NAME spirv-cross-test-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --opt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders)
|
||||
add_test(NAME spirv-cross-test-metal-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal --opt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl)
|
||||
add_test(NAME spirv-cross-test-hlsl-opt
|
||||
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl --opt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl)
|
||||
endif()
|
||||
else()
|
||||
message(WARNING "Testing disabled. Could not find python3. If you have python3 installed try running "
|
||||
"cmake with -DPYTHON_EXECUTABLE:FILEPATH=/path/to/python3 to help it find the executable")
|
||||
|
2
deps/SPIRV-Cross/GLSL.std.450.h
vendored
2
deps/SPIRV-Cross/GLSL.std.450.h
vendored
@ -13,7 +13,7 @@
|
||||
**
|
||||
** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS
|
||||
** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND
|
||||
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
|
||||
** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
|
151
deps/SPIRV-Cross/README.md
vendored
151
deps/SPIRV-Cross/README.md
vendored
@ -8,6 +8,7 @@ SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader
|
||||
|
||||
- Convert SPIR-V to readable, usable and efficient GLSL
|
||||
- Convert SPIR-V to readable, usable and efficient Metal Shading Language (MSL) [EXPERIMENTAL]
|
||||
- Convert SPIR-V to readable, usable and efficient HLSL [EXPERIMENTAL]
|
||||
- Convert SPIR-V to debuggable C++ [EXPERIMENTAL]
|
||||
- Reflection API to simplify the creation of Vulkan pipeline layouts
|
||||
- Reflection API to modify and tweak OpDecorations
|
||||
@ -121,9 +122,15 @@ Please see `samples/cpp` where some GLSL shaders are compiled to SPIR-V, decompi
|
||||
Reading through the samples should explain how to use the C++ interface.
|
||||
A simple Makefile is included to build all shaders in the directory.
|
||||
|
||||
### Using SPIRV-Cross to output GLSL shaders from glslang HLSL
|
||||
### Implementation notes
|
||||
|
||||
#### Entry point
|
||||
When using SPIR-V and SPIRV-Cross as an intermediate step for cross-compiling between high level languages there are some considerations to take into account,
|
||||
as not all features used by one high-level language are necessarily supported natively by the target shader language.
|
||||
SPIRV-Cross aims to provide the tools needed to handle these scenarios in a clean and robust way, but some manual action is required to maintain compatibility.
|
||||
|
||||
#### HLSL source to GLSL
|
||||
|
||||
##### HLSL entry points
|
||||
|
||||
When using SPIR-V shaders compiled from HLSL, there are some extra things you need to take care of.
|
||||
First make sure that the entry point is used correctly.
|
||||
@ -135,7 +142,73 @@ Cannot end a function before ending the current block.
|
||||
Likely cause: If this SPIR-V was created from glslang HLSL, make sure the entry point is valid.
|
||||
```
|
||||
|
||||
#### Separate image samplers
|
||||
##### Vertex/Fragment interface linking
|
||||
|
||||
HLSL relies on semantics in order to effectively link together shader stages. In the SPIR-V generated by glslang, the transformation from HLSL to GLSL ends up looking like
|
||||
|
||||
```
|
||||
struct VSOutput {
|
||||
// SV_Position is rerouted to gl_Position
|
||||
float4 position : SV_Position;
|
||||
float4 coord : TEXCOORD0;
|
||||
};
|
||||
|
||||
VSOutput main(...) {}
|
||||
```
|
||||
|
||||
```
|
||||
struct VSOutput {
|
||||
float4 coord;
|
||||
}
|
||||
layout(location = 0) out VSOutput _magicNameGeneratedByGlslang;
|
||||
```
|
||||
|
||||
While this works, be aware of the type of the struct which is used in the vertex stage and the fragment stage.
|
||||
There may be issues if the structure type name differs in vertex stage and fragment stage.
|
||||
|
||||
You can make use of the reflection interface to force the name of the struct type.
|
||||
|
||||
```
|
||||
// Something like this for both vertex outputs and fragment inputs.
|
||||
compiler.set_name(varying_resource.base_type_id, "VertexFragmentLinkage");
|
||||
```
|
||||
|
||||
Some platform may require identical variable name for both vertex outputs and fragment inputs. (for example MacOSX)
|
||||
to rename varaible base on location, please add
|
||||
```
|
||||
--rename-interface-variable <in|out> <location> <new_variable_name>
|
||||
```
|
||||
|
||||
#### HLSL source to legacy GLSL/ESSL
|
||||
|
||||
HLSL tends to emit varying struct types to pass data between vertex and fragment.
|
||||
This is not supported in legacy GL/GLES targets, so to support this, varying structs are flattened.
|
||||
This is done automatically, but the API user might need to be aware that this is happening in order to support all cases.
|
||||
|
||||
Modern GLES code like this:
|
||||
```
|
||||
struct Output {
|
||||
vec4 a;
|
||||
vec2 b;
|
||||
};
|
||||
out Output vout;
|
||||
```
|
||||
|
||||
Is transformed into:
|
||||
```
|
||||
struct Output {
|
||||
vec4 a;
|
||||
vec2 b;
|
||||
};
|
||||
varying vec4 Output_a;
|
||||
varying vec2 Output_b;
|
||||
```
|
||||
|
||||
Note that now, both the struct name and the member names will participate in the linking interface between vertex and fragment, so
|
||||
API users might want to ensure that both the struct names and member names match so that vertex outputs and fragment inputs can link properly.
|
||||
|
||||
|
||||
#### Separate image samplers (HLSL/Vulkan) for backends which do not support it (GLSL)
|
||||
|
||||
Another thing you need to remember is when using samplers and textures in HLSL these are separable, and not directly compatible with GLSL. If you need to use this with desktop GL/GLES, you need to call `Compiler::build_combined_image_samplers` first before calling `Compiler::compile`, or you will get an exception.
|
||||
|
||||
@ -154,7 +227,33 @@ for (auto &remap : compiler->get_combined_image_samplers())
|
||||
```
|
||||
|
||||
If your target is Vulkan GLSL, `--vulkan-semantics` will emit separate image samplers as you'd expect.
|
||||
The command line client does this automatically, but if you're calling the library, you'll need to do this yourself.
|
||||
The command line client calls `Compiler::build_combined_image_samplers` automatically, but if you're calling the library, you'll need to do this yourself.
|
||||
|
||||
#### Descriptor sets (Vulkan GLSL) for backends which do not support them (HLSL/GLSL/Metal)
|
||||
|
||||
Descriptor sets are unique to Vulkan, so make sure that descriptor set + binding is remapped to a flat binding scheme (set always 0), so that other APIs can make sense of the bindings.
|
||||
This can be done with `Compiler::set_decoration(id, spv::DecorationDescriptorSet)`.
|
||||
|
||||
#### Linking by name for targets which do not support explicit locations (legacy GLSL/ESSL)
|
||||
|
||||
Modern GLSL and HLSL sources (and SPIR-V) relies on explicit layout(location) qualifiers to guide the linking process between shader stages,
|
||||
but older GLSL relies on symbol names to perform the linking. When emitting shaders with older versions, these layout statements will be removed,
|
||||
so it is important that the API user ensures that the names of I/O variables are sanitized so that linking will work properly.
|
||||
The reflection API can rename variables, struct types and struct members to deal with these scenarios using `Compiler::set_name` and friends.
|
||||
|
||||
#### Clip-space conventions
|
||||
|
||||
SPIRV-Cross can perform some common clip space conversions on gl_Position/SV_Position by enabling `CompilerGLSL::Options.vertex.fixup_clipspace`.
|
||||
While this can be convenient, it is recommended to modify the projection matrices instead as that can achieve the same result.
|
||||
|
||||
For GLSL targets, enabling this will convert a shader which assumes `[0, w]` depth range (Vulkan / D3D / Metal) into `[-w, w]` range.
|
||||
For MSL and HLSL targets, enabling this will convert a shader in `[-w, w]` depth range (OpenGL) to `[0, w]` depth range.
|
||||
|
||||
By default, the CLI will not enable `fixup_clipspace`, but in the API you might want to set an explicit value using `CompilerGLSL::set_options()`.
|
||||
|
||||
Y-flipping of gl_Position and similar is also supported.
|
||||
The use of this is discouraged, because relying on vertex shader Y-flipping tends to get quite messy.
|
||||
To enable this, set `CompilerGLSL::Options.vertex.flip_vert_y` or `--flip-vert-y` in CLI.
|
||||
|
||||
## Contributing
|
||||
|
||||
@ -165,12 +264,38 @@ Contributions to SPIRV-Cross are welcome. See Testing and Licensing sections for
|
||||
SPIRV-Cross maintains a test suite of shaders with reference output of how the output looks after going through a roundtrip through
|
||||
glslangValidator then back through SPIRV-Cross again. The reference files are stored inside the repository in order to be able to track regressions.
|
||||
|
||||
All pull requests should ensure that test output does not change unexpectedly. This can be tested with `./test_shaders.py shaders`.
|
||||
However, when improving SPIRV-Cross there are of course legitimate cases where reference output should change.
|
||||
In these cases, run `./test_shaders.py shaders --update` to update the reference files and include these changes as part of the pull request.
|
||||
Always make sure you are running up to date glslangValidator as well as SPIRV-Tools when updating reference files.
|
||||
All pull requests should ensure that test output does not change unexpectedly. This can be tested with:
|
||||
|
||||
In short, the master branch should always be able to run `./test_shaders.py shaders` without failure.
|
||||
```
|
||||
./test_shaders.py shaders
|
||||
./test_shaders.py shaders --opt
|
||||
./test_shaders.py shaders-hlsl --hlsl
|
||||
./test_shaders.py shaders-hlsl --hlsl --opt
|
||||
./test_shaders.py shaders-msl --msl
|
||||
./test_shaders.py shaders-msl --msl --opt
|
||||
```
|
||||
|
||||
although there are a couple of convenience script for doing this:
|
||||
|
||||
```
|
||||
./checkout_glslang_spirv_tools.sh # Checks out glslang and SPIRV-Tools at a fixed revision which matches the reference output.
|
||||
./test_shaders.sh # Runs over all changes and makes sure that there are no deltas compared to reference files.
|
||||
```
|
||||
|
||||
However, when improving SPIRV-Cross there are of course legitimate cases where reference output should change.
|
||||
In these cases, run:
|
||||
|
||||
```
|
||||
./update_test_shaders.sh
|
||||
```
|
||||
|
||||
to update the reference files and include these changes as part of the pull request.
|
||||
Always make sure you are running the correct version of glslangValidator as well as SPIRV-Tools when updating reference files.
|
||||
See `checkout_glslang_spirv_tools.sh`.
|
||||
|
||||
In short, the master branch should always be able to run `./test_shaders.py shaders` and friends without failure.
|
||||
SPIRV-Cross uses Travis CI to test all pull requests, so it is not strictly needed to perform testing yourself if you have problems running it locally.
|
||||
A pull request which does not pass testing on Travis will not be accepted however.
|
||||
|
||||
When adding support for new features to SPIRV-Cross, a new shader and reference file should be added which covers usage of the new shader features in question.
|
||||
|
||||
@ -205,6 +330,14 @@ The current reference output is contained in reference/.
|
||||
|
||||
See `./test_shaders.py --help` for more.
|
||||
|
||||
### Metal backend
|
||||
|
||||
To test the roundtrip path GLSL -> SPIR-V -> MSL, `--msl` can be added, e.g. `./test_shaders.py --msl shaders-msl`.
|
||||
|
||||
### HLSL backend
|
||||
|
||||
To test the roundtrip path GLSL -> SPIR-V -> HLSL, `--hlsl` can be added, e.g. `./test_shaders.py --hlsl shaders-hlsl`.
|
||||
|
||||
### Updating regression tests
|
||||
|
||||
When legitimate changes are found, use `--update` flag to update regression files.
|
||||
|
57
deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh
vendored
Normal file
57
deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
|
||||
GLSLANG_REV=9c6f8cc29ba303b43ccf36deea6bb38a304f9b92
|
||||
SPIRV_TOOLS_REV=e28edd458b729da7bbfd51e375feb33103709e6f
|
||||
|
||||
if [ -d external/glslang ]; then
|
||||
echo "Updating glslang to revision $GLSLANG_REV."
|
||||
cd external/glslang
|
||||
git fetch origin
|
||||
git checkout $GLSLANG_REV
|
||||
else
|
||||
echo "Cloning glslang revision $GLSLANG_REV."
|
||||
mkdir -p external
|
||||
cd external
|
||||
git clone git://github.com/KhronosGroup/glslang.git
|
||||
cd glslang
|
||||
git checkout $GLSLANG_REV
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
echo "Building glslang."
|
||||
mkdir -p external/glslang-build
|
||||
cd external/glslang-build
|
||||
cmake ../glslang -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles"
|
||||
make -j$(nproc)
|
||||
cd ../..
|
||||
|
||||
if [ -d external/spirv-tools ]; then
|
||||
echo "Updating SPIRV-Tools to revision $SPIRV_TOOLS_REV."
|
||||
cd external/spirv-tools
|
||||
git fetch origin
|
||||
git checkout $SPIRV_TOOLS_REV
|
||||
else
|
||||
echo "Cloning SPIRV-Tools revision $SPIRV_TOOLS_REV."
|
||||
mkdir -p external
|
||||
cd external
|
||||
git clone git://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
|
||||
cd spirv-tools
|
||||
git checkout $SPIRV_TOOLS_REV
|
||||
|
||||
if [ -d external/spirv-headers ]; then
|
||||
cd external/spirv-headers
|
||||
git pull origin master
|
||||
cd ../..
|
||||
else
|
||||
git clone git://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
|
||||
fi
|
||||
fi
|
||||
cd ../..
|
||||
|
||||
echo "Building SPIRV-Tools."
|
||||
mkdir -p external/spirv-tools-build
|
||||
cd external/spirv-tools-build
|
||||
cmake ../spirv-tools -DCMAKE_BUILD_TYPE=Release -G"Unix Makefiles"
|
||||
make -j$(nproc)
|
||||
cd ../..
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,7 +33,7 @@ template <typename T>
|
||||
struct image2DBase
|
||||
{
|
||||
virtual ~image2DBase() = default;
|
||||
inline virtual T load(glm::ivec2 coord)
|
||||
inline virtual T load(glm::ivec2 coord) const
|
||||
{
|
||||
return T(0, 0, 0, 1);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -19,8 +19,8 @@
|
||||
|
||||
// This file must only be included by the shader generated by spirv-cross!
|
||||
|
||||
#ifndef GLM_SWIZZLE
|
||||
#define GLM_SWIZZLE
|
||||
#ifndef GLM_FORCE_SWIZZLE
|
||||
#define GLM_FORCE_SWIZZLE
|
||||
#endif
|
||||
|
||||
#ifndef GLM_FORCE_RADIANS
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
263
deps/SPIRV-Cross/main.cpp
vendored
263
deps/SPIRV-Cross/main.cpp
vendored
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015-2016 ARM Limited
|
||||
* Copyright 2015-2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -15,6 +15,8 @@
|
||||
*/
|
||||
|
||||
#include "spirv_cpp.hpp"
|
||||
#include "spirv_glsl.hpp"
|
||||
#include "spirv_hlsl.hpp"
|
||||
#include "spirv_msl.hpp"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
@ -26,19 +28,23 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable : 4996)
|
||||
#endif
|
||||
|
||||
using namespace spv;
|
||||
using namespace spirv_cross;
|
||||
using namespace std;
|
||||
|
||||
#ifdef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
|
||||
#define THROW(x) \
|
||||
do \
|
||||
{ \
|
||||
fprintf(stderr, "%s.", x); \
|
||||
exit(1); \
|
||||
} while (0)
|
||||
static inline void THROW(const char *str)
|
||||
{
|
||||
fprintf(stderr, "SPIRV-Cross will abort: %s\n", str);
|
||||
fflush(stderr);
|
||||
abort();
|
||||
}
|
||||
#else
|
||||
#define THROW(x) runtime_error(x)
|
||||
#define THROW(x) throw runtime_error(x)
|
||||
#endif
|
||||
|
||||
struct CLIParser;
|
||||
@ -187,7 +193,7 @@ static bool write_string_to_file(const char *path, const char *string)
|
||||
FILE *file = fopen(path, "w");
|
||||
if (!file)
|
||||
{
|
||||
fprintf(file, "Failed to write file: %s\n", path);
|
||||
fprintf(stderr, "Failed to write file: %s\n", path);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -200,11 +206,16 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
{
|
||||
fprintf(stderr, "%s\n", tag);
|
||||
fprintf(stderr, "=============\n\n");
|
||||
bool print_ssbo = !strcmp(tag, "ssbos");
|
||||
|
||||
for (auto &res : resources)
|
||||
{
|
||||
auto &type = compiler.get_type(res.type_id);
|
||||
auto mask = compiler.get_decoration_mask(res.id);
|
||||
|
||||
if (print_ssbo && compiler.buffer_is_hlsl_counter_buffer(res.id))
|
||||
continue;
|
||||
|
||||
// If we don't have a name, use the fallback for the type instead of the variable
|
||||
// for SSBOs and UBOs since those are the only meaningful names to use externally.
|
||||
// Push constant blocks are still accessed by name and not block name, even though they are technically Blocks.
|
||||
@ -217,7 +228,7 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
|
||||
uint32_t block_size = 0;
|
||||
if (is_sized_block)
|
||||
block_size = compiler.get_declared_struct_size(compiler.get_type(res.base_type_id));
|
||||
block_size = uint32_t(compiler.get_declared_struct_size(compiler.get_type(res.base_type_id)));
|
||||
|
||||
string array;
|
||||
for (auto arr : type.array)
|
||||
@ -234,8 +245,16 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
|
||||
fprintf(stderr, " (Binding : %u)", compiler.get_decoration(res.id, DecorationBinding));
|
||||
if (mask & (1ull << DecorationInputAttachmentIndex))
|
||||
fprintf(stderr, " (Attachment : %u)", compiler.get_decoration(res.id, DecorationInputAttachmentIndex));
|
||||
if (mask & (1ull << DecorationNonReadable))
|
||||
fprintf(stderr, " writeonly");
|
||||
if (mask & (1ull << DecorationNonWritable))
|
||||
fprintf(stderr, " readonly");
|
||||
if (is_sized_block)
|
||||
fprintf(stderr, " (BlockSize : %u bytes)", block_size);
|
||||
|
||||
uint32_t counter_id = 0;
|
||||
if (print_ssbo && compiler.buffer_get_hlsl_counter_buffer(res.id, counter_id))
|
||||
fprintf(stderr, " (HLSL counter buffer ID: %u)", counter_id);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
fprintf(stderr, "=============\n\n");
|
||||
@ -380,6 +399,21 @@ static void print_spec_constants(const Compiler &compiler)
|
||||
fprintf(stderr, "==================\n\n");
|
||||
}
|
||||
|
||||
static void print_capabilities_and_extensions(const Compiler &compiler)
|
||||
{
|
||||
fprintf(stderr, "Capabilities\n");
|
||||
fprintf(stderr, "============\n");
|
||||
for (auto &capability : compiler.get_declared_capabilities())
|
||||
fprintf(stderr, "Capability: %u\n", static_cast<unsigned>(capability));
|
||||
fprintf(stderr, "============\n\n");
|
||||
|
||||
fprintf(stderr, "Extensions\n");
|
||||
fprintf(stderr, "============\n");
|
||||
for (auto &ext : compiler.get_declared_extensions())
|
||||
fprintf(stderr, "Extension: %s\n", ext.c_str());
|
||||
fprintf(stderr, "============\n\n");
|
||||
}
|
||||
|
||||
struct PLSArg
|
||||
{
|
||||
PlsFormat format;
|
||||
@ -399,43 +433,71 @@ struct VariableTypeRemap
|
||||
string new_variable_type;
|
||||
};
|
||||
|
||||
struct InterfaceVariableRename
|
||||
{
|
||||
StorageClass storageClass;
|
||||
uint32_t location;
|
||||
string variable_name;
|
||||
};
|
||||
|
||||
struct CLIArguments
|
||||
{
|
||||
const char *input = nullptr;
|
||||
const char *output = nullptr;
|
||||
const char *cpp_interface_name = nullptr;
|
||||
uint32_t version = 0;
|
||||
uint32_t shader_model = 0;
|
||||
uint32_t msl_version = 0;
|
||||
bool es = false;
|
||||
bool set_version = false;
|
||||
bool set_shader_model = false;
|
||||
bool set_msl_version = false;
|
||||
bool set_es = false;
|
||||
bool dump_resources = false;
|
||||
bool force_temporary = false;
|
||||
bool flatten_ubo = false;
|
||||
bool fixup = false;
|
||||
bool yflip = false;
|
||||
bool sso = false;
|
||||
vector<PLSArg> pls_in;
|
||||
vector<PLSArg> pls_out;
|
||||
vector<Remap> remaps;
|
||||
vector<string> extensions;
|
||||
vector<VariableTypeRemap> variable_type_remaps;
|
||||
vector<InterfaceVariableRename> interface_variable_renames;
|
||||
vector<HLSLVertexAttributeRemap> hlsl_attr_remap;
|
||||
string entry;
|
||||
|
||||
vector<pair<string, string>> entry_point_rename;
|
||||
|
||||
uint32_t iterations = 1;
|
||||
bool cpp = false;
|
||||
bool metal = false;
|
||||
bool msl = false;
|
||||
bool hlsl = false;
|
||||
bool hlsl_compat = false;
|
||||
bool vulkan_semantics = false;
|
||||
bool flatten_multidimensional_arrays = false;
|
||||
bool use_420pack_extension = true;
|
||||
bool remove_unused = false;
|
||||
bool cfg_analysis = true;
|
||||
};
|
||||
|
||||
static void print_help()
|
||||
{
|
||||
fprintf(stderr, "Usage: spirv-cross [--output <output path>] [SPIR-V file] [--es] [--no-es] [--no-cfg-analysis] "
|
||||
"[--version <GLSL "
|
||||
"version>] [--dump-resources] [--help] [--force-temporary] [--cpp] [--cpp-interface-name <name>] "
|
||||
"[--metal] [--vulkan-semantics] [--flatten-ubo] [--fixup-clipspace] [--iterations iter] [--pls-in "
|
||||
"format input-name] [--pls-out format output-name] [--remap source_name target_name components] "
|
||||
"[--extension ext] [--entry name] [--remove-unused-variables] "
|
||||
"[--remap-variable-type <variable_name> <new_variable_type>]\n");
|
||||
fprintf(stderr, "Usage: spirv-cross [--output <output path>] [SPIR-V file] [--es] [--no-es] "
|
||||
"[--version <GLSL version>] [--dump-resources] [--help] [--force-temporary] "
|
||||
"[--vulkan-semantics] [--flatten-ubo] [--fixup-clipspace] [--flip-vert-y] [--iterations iter] "
|
||||
"[--cpp] [--cpp-interface-name <name>] "
|
||||
"[--msl] [--msl-version <MMmmpp>]"
|
||||
"[--hlsl] [--shader-model] [--hlsl-enable-compat] "
|
||||
"[--separate-shader-objects]"
|
||||
"[--pls-in format input-name] [--pls-out format output-name] [--remap source_name target_name "
|
||||
"components] [--extension ext] [--entry name] [--remove-unused-variables] "
|
||||
"[--flatten-multidimensional-arrays] [--no-420pack-extension] "
|
||||
"[--remap-variable-type <variable_name> <new_variable_type>] "
|
||||
"[--rename-interface-variable <in|out> <location> <new_variable_name>] "
|
||||
"[--set-hlsl-vertex-input-semantic <location> <semantic>] "
|
||||
"[--rename-entry-point <old> <new>] "
|
||||
"\n");
|
||||
}
|
||||
|
||||
static bool remap_generic(Compiler &compiler, const vector<Resource> &resources, const Remap &remap)
|
||||
@ -522,7 +584,34 @@ static PlsFormat pls_format(const char *str)
|
||||
return PlsNone;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
void rename_interface_variable(Compiler &compiler, const vector<Resource> &resources,
|
||||
const InterfaceVariableRename &rename)
|
||||
{
|
||||
for (auto &v : resources)
|
||||
{
|
||||
if (!compiler.has_decoration(v.id, spv::DecorationLocation))
|
||||
continue;
|
||||
|
||||
auto loc = compiler.get_decoration(v.id, spv::DecorationLocation);
|
||||
if (loc != rename.location)
|
||||
continue;
|
||||
|
||||
auto &type = compiler.get_type(v.base_type_id);
|
||||
|
||||
// This is more of a friendly variant. If we need to rename interface variables, we might have to rename
|
||||
// structs as well and make sure all the names match up.
|
||||
if (type.basetype == SPIRType::Struct)
|
||||
{
|
||||
compiler.set_name(v.base_type_id, join("SPIRV_Cross_Interface_Location", rename.location));
|
||||
for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++)
|
||||
compiler.set_member_name(v.base_type_id, i, join("InterfaceMember", i));
|
||||
}
|
||||
|
||||
compiler.set_name(v.id, rename.variable_name);
|
||||
}
|
||||
}
|
||||
|
||||
static int main_inner(int argc, char *argv[])
|
||||
{
|
||||
CLIArguments args;
|
||||
CLICallbacks cbs;
|
||||
@ -544,18 +633,36 @@ int main(int argc, char *argv[])
|
||||
args.version = parser.next_uint();
|
||||
args.set_version = true;
|
||||
});
|
||||
cbs.add("--no-cfg-analysis", [&args](CLIParser &) { args.cfg_analysis = false; });
|
||||
cbs.add("--dump-resources", [&args](CLIParser &) { args.dump_resources = true; });
|
||||
cbs.add("--force-temporary", [&args](CLIParser &) { args.force_temporary = true; });
|
||||
cbs.add("--flatten-ubo", [&args](CLIParser &) { args.flatten_ubo = true; });
|
||||
cbs.add("--fixup-clipspace", [&args](CLIParser &) { args.fixup = true; });
|
||||
cbs.add("--flip-vert-y", [&args](CLIParser &) { args.yflip = true; });
|
||||
cbs.add("--iterations", [&args](CLIParser &parser) { args.iterations = parser.next_uint(); });
|
||||
cbs.add("--cpp", [&args](CLIParser &) { args.cpp = true; });
|
||||
cbs.add("--cpp-interface-name", [&args](CLIParser &parser) { args.cpp_interface_name = parser.next_string(); });
|
||||
cbs.add("--metal", [&args](CLIParser &) { args.metal = true; });
|
||||
cbs.add("--metal", [&args](CLIParser &) { args.msl = true; }); // Legacy compatibility
|
||||
cbs.add("--msl", [&args](CLIParser &) { args.msl = true; });
|
||||
cbs.add("--hlsl", [&args](CLIParser &) { args.hlsl = true; });
|
||||
cbs.add("--hlsl-enable-compat", [&args](CLIParser &) { args.hlsl_compat = true; });
|
||||
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
|
||||
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });
|
||||
cbs.add("--no-420pack-extension", [&args](CLIParser &) { args.use_420pack_extension = false; });
|
||||
cbs.add("--extension", [&args](CLIParser &parser) { args.extensions.push_back(parser.next_string()); });
|
||||
cbs.add("--rename-entry-point", [&args](CLIParser &parser) {
|
||||
auto old_name = parser.next_string();
|
||||
auto new_name = parser.next_string();
|
||||
args.entry_point_rename.push_back({ old_name, new_name });
|
||||
});
|
||||
cbs.add("--entry", [&args](CLIParser &parser) { args.entry = parser.next_string(); });
|
||||
cbs.add("--separate-shader-objects", [&args](CLIParser &) { args.sso = true; });
|
||||
cbs.add("--set-hlsl-vertex-input-semantic", [&args](CLIParser &parser) {
|
||||
HLSLVertexAttributeRemap remap;
|
||||
remap.location = parser.next_uint();
|
||||
remap.semantic = parser.next_string();
|
||||
args.hlsl_attr_remap.push_back(move(remap));
|
||||
});
|
||||
|
||||
cbs.add("--remap", [&args](CLIParser &parser) {
|
||||
string src = parser.next_string();
|
||||
string dst = parser.next_string();
|
||||
@ -569,6 +676,19 @@ int main(int argc, char *argv[])
|
||||
args.variable_type_remaps.push_back({ move(var_name), move(new_type) });
|
||||
});
|
||||
|
||||
cbs.add("--rename-interface-variable", [&args](CLIParser &parser) {
|
||||
StorageClass cls = StorageClassMax;
|
||||
string clsStr = parser.next_string();
|
||||
if (clsStr == "in")
|
||||
cls = StorageClassInput;
|
||||
else if (clsStr == "out")
|
||||
cls = StorageClassOutput;
|
||||
|
||||
uint32_t loc = parser.next_uint();
|
||||
string var_name = parser.next_string();
|
||||
args.interface_variable_renames.push_back({ cls, loc, move(var_name) });
|
||||
});
|
||||
|
||||
cbs.add("--pls-in", [&args](CLIParser &parser) {
|
||||
auto fmt = pls_format(parser.next_string());
|
||||
auto name = parser.next_string();
|
||||
@ -579,6 +699,14 @@ int main(int argc, char *argv[])
|
||||
auto name = parser.next_string();
|
||||
args.pls_out.push_back({ move(fmt), move(name) });
|
||||
});
|
||||
cbs.add("--shader-model", [&args](CLIParser &parser) {
|
||||
args.shader_model = parser.next_uint();
|
||||
args.set_shader_model = true;
|
||||
});
|
||||
cbs.add("--msl-version", [&args](CLIParser &parser) {
|
||||
args.msl_version = parser.next_uint();
|
||||
args.set_msl_version = true;
|
||||
});
|
||||
|
||||
cbs.add("--remove-unused-variables", [&args](CLIParser &) { args.remove_unused = true; });
|
||||
|
||||
@ -612,8 +740,18 @@ int main(int argc, char *argv[])
|
||||
if (args.cpp_interface_name)
|
||||
static_cast<CompilerCPP *>(compiler.get())->set_interface_name(args.cpp_interface_name);
|
||||
}
|
||||
else if (args.metal)
|
||||
else if (args.msl)
|
||||
{
|
||||
compiler = unique_ptr<CompilerMSL>(new CompilerMSL(read_spirv_file(args.input)));
|
||||
|
||||
auto *msl_comp = static_cast<CompilerMSL *>(compiler.get());
|
||||
auto msl_opts = msl_comp->get_options();
|
||||
if (args.set_msl_version)
|
||||
msl_opts.msl_version = args.msl_version;
|
||||
msl_comp->set_options(msl_opts);
|
||||
}
|
||||
else if (args.hlsl)
|
||||
compiler = unique_ptr<CompilerHLSL>(new CompilerHLSL(read_spirv_file(args.input)));
|
||||
else
|
||||
{
|
||||
combined_image_samplers = !args.vulkan_semantics;
|
||||
@ -631,6 +769,9 @@ int main(int argc, char *argv[])
|
||||
compiler->set_variable_type_remap_callback(move(remap_cb));
|
||||
}
|
||||
|
||||
for (auto &rename : args.entry_point_rename)
|
||||
compiler->rename_entry_point(rename.first, rename.second);
|
||||
|
||||
if (!args.entry.empty())
|
||||
compiler->set_entry_point(args.entry);
|
||||
|
||||
@ -647,11 +788,38 @@ int main(int argc, char *argv[])
|
||||
if (args.set_es)
|
||||
opts.es = args.es;
|
||||
opts.force_temporary = args.force_temporary;
|
||||
opts.separate_shader_objects = args.sso;
|
||||
opts.flatten_multidimensional_arrays = args.flatten_multidimensional_arrays;
|
||||
opts.enable_420pack_extension = args.use_420pack_extension;
|
||||
opts.vulkan_semantics = args.vulkan_semantics;
|
||||
opts.vertex.fixup_clipspace = args.fixup;
|
||||
opts.cfg_analysis = args.cfg_analysis;
|
||||
opts.vertex.flip_vert_y = args.yflip;
|
||||
compiler->set_options(opts);
|
||||
|
||||
// Set HLSL specific options.
|
||||
if (args.hlsl)
|
||||
{
|
||||
auto *hlsl = static_cast<CompilerHLSL *>(compiler.get());
|
||||
auto hlsl_opts = hlsl->get_options();
|
||||
if (args.set_shader_model)
|
||||
{
|
||||
if (args.shader_model < 30)
|
||||
{
|
||||
fprintf(stderr, "Shader model earlier than 30 (3.0) not supported.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
hlsl_opts.shader_model = args.shader_model;
|
||||
}
|
||||
|
||||
if (args.hlsl_compat)
|
||||
{
|
||||
// Enable all compat options.
|
||||
hlsl_opts.point_size_compat = true;
|
||||
}
|
||||
hlsl->set_options(hlsl_opts);
|
||||
}
|
||||
|
||||
ShaderResources res;
|
||||
if (args.remove_unused)
|
||||
{
|
||||
@ -663,8 +831,12 @@ int main(int argc, char *argv[])
|
||||
res = compiler->get_shader_resources();
|
||||
|
||||
if (args.flatten_ubo)
|
||||
{
|
||||
for (auto &ubo : res.uniform_buffers)
|
||||
compiler->flatten_interface_block(ubo.id);
|
||||
compiler->flatten_buffer_block(ubo.id);
|
||||
for (auto &ubo : res.push_constant_buffers)
|
||||
compiler->flatten_buffer_block(ubo.id);
|
||||
}
|
||||
|
||||
auto pls_inputs = remap_pls(args.pls_in, res.stage_inputs, &res.subpass_inputs);
|
||||
auto pls_outputs = remap_pls(args.pls_out, res.stage_outputs, nullptr);
|
||||
@ -683,11 +855,25 @@ int main(int argc, char *argv[])
|
||||
continue;
|
||||
}
|
||||
|
||||
for (auto &rename : args.interface_variable_renames)
|
||||
{
|
||||
if (rename.storageClass == StorageClassInput)
|
||||
rename_interface_variable(*compiler, res.stage_inputs, rename);
|
||||
else if (rename.storageClass == StorageClassOutput)
|
||||
rename_interface_variable(*compiler, res.stage_outputs, rename);
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "error at --rename-interface-variable <in|out> ...\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
if (args.dump_resources)
|
||||
{
|
||||
print_resources(*compiler, res);
|
||||
print_push_constant_resources(*compiler, res.push_constant_buffers);
|
||||
print_spec_constants(*compiler);
|
||||
print_capabilities_and_extensions(*compiler);
|
||||
}
|
||||
|
||||
if (combined_image_samplers)
|
||||
@ -703,10 +889,35 @@ int main(int argc, char *argv[])
|
||||
|
||||
string glsl;
|
||||
for (uint32_t i = 0; i < args.iterations; i++)
|
||||
glsl = compiler->compile();
|
||||
{
|
||||
if (args.hlsl)
|
||||
glsl = static_cast<CompilerHLSL *>(compiler.get())->compile(move(args.hlsl_attr_remap));
|
||||
else
|
||||
glsl = compiler->compile();
|
||||
}
|
||||
|
||||
if (args.output)
|
||||
write_string_to_file(args.output, glsl.c_str());
|
||||
else
|
||||
printf("%s", glsl.c_str());
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
|
||||
return main_inner(argc, argv);
|
||||
#else
|
||||
// Make sure we catch the exception or it just disappears into the aether on Windows.
|
||||
try
|
||||
{
|
||||
return main_inner(argc, argv);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
fprintf(stderr, "SPIRV-Cross threw an exception: %s\n", e.what());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
2
deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj
vendored
2
deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj
vendored
@ -127,6 +127,7 @@
|
||||
<ClCompile Include="..\spirv_cpp.cpp" />
|
||||
<ClCompile Include="..\spirv_cross.cpp" />
|
||||
<ClCompile Include="..\spirv_glsl.cpp" />
|
||||
<ClCompile Include="..\spirv_hlsl.cpp" />
|
||||
<ClCompile Include="..\spirv_msl.cpp" />
|
||||
<ClCompile Include="..\spirv_cfg.cpp" />
|
||||
</ItemGroup>
|
||||
@ -137,6 +138,7 @@
|
||||
<ClInclude Include="..\spirv_cross.hpp" />
|
||||
<ClInclude Include="..\spirv_glsl.hpp" />
|
||||
<ClInclude Include="..\spirv.hpp" />
|
||||
<ClInclude Include="..\spirv_hlsl.hpp" />
|
||||
<ClInclude Include="..\spirv_msl.hpp" />
|
||||
<ClInclude Include="..\spirv_cfg.hpp" />
|
||||
</ItemGroup>
|
||||
|
@ -33,6 +33,9 @@
|
||||
<ClCompile Include="..\spirv_cfg.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\spirv_hlsl.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\GLSL.std.450.h">
|
||||
@ -59,5 +62,8 @@
|
||||
<ClInclude Include="..\spirv_cfg.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\spirv_hlsl.hpp">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -0,0 +1,16 @@
|
||||
static const uint _5 = 9u;
|
||||
static const uint _6 = 4u;
|
||||
static const uint3 gl_WorkGroupSize = uint3(_5, 20u, _6);
|
||||
|
||||
RWByteAddressBuffer _4 : register(u0);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_4.Store(0, asuint(asfloat(_4.Load(0)) + 1.0f));
|
||||
}
|
||||
|
||||
[numthreads(9, 20, 4)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
24
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp
vendored
Normal file
24
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
static const uint _3 = 1u;
|
||||
static const uint _4 = 3u;
|
||||
static const uint3 gl_WorkGroupSize = uint3(_3, 2u, _4);
|
||||
|
||||
RWByteAddressBuffer _8 : register(u0);
|
||||
RWByteAddressBuffer _9 : register(u1);
|
||||
|
||||
static uint3 gl_WorkGroupID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_WorkGroupID : SV_GroupID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
_8.Store(gl_WorkGroupID.x * 4 + 0, asuint(asfloat(_9.Load(gl_WorkGroupID.x * 4 + 0)) + asfloat(_8.Load(gl_WorkGroupID.x * 4 + 0))));
|
||||
}
|
||||
|
||||
[numthreads(1, 2, 3)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_WorkGroupID = stage_input.gl_WorkGroupID;
|
||||
comp_main();
|
||||
}
|
25
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/cbuffer-stripped.asm.frag
vendored
Normal file
25
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/cbuffer-stripped.asm.frag
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
cbuffer _5 : register(b0)
|
||||
{
|
||||
column_major float2x4 _5_m0 : packoffset(c0);
|
||||
float4 _5_m1 : packoffset(c4);
|
||||
};
|
||||
|
||||
static float2 _3;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 _3 : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
_3 = mul(_5_m0, _5_m1);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output._3 = _3;
|
||||
return stage_output;
|
||||
}
|
42
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unreachable.asm.frag
vendored
Normal file
42
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unreachable.asm.frag
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
static int counter;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation int counter : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float4 _21;
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _33;
|
||||
do
|
||||
{
|
||||
if (counter == 10)
|
||||
{
|
||||
_33 = 10.0f.xxxx;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
_33 = 30.0f.xxxx;
|
||||
break;
|
||||
}
|
||||
} while (false);
|
||||
FragColor = _33;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
counter = stage_input.counter;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert
vendored
Normal file
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
void vert_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
vert_main();
|
||||
}
|
28
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/vertex-id-instance-id.asm.vert
vendored
Normal file
28
deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/vertex-id-instance-id.asm.vert
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexID;
|
||||
static int gl_InstanceID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexID : SV_VertexID;
|
||||
uint gl_InstanceID : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float(gl_VertexID + gl_InstanceID).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexID = int(stage_input.gl_VertexID);
|
||||
gl_InstanceID = int(stage_input.gl_InstanceID);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
21
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/access-chains.comp
vendored
Normal file
21
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/access-chains.comp
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
RWByteAddressBuffer wo : register(u1);
|
||||
ByteAddressBuffer ro : register(t0);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
wo.Store4(gl_GlobalInvocationID.x * 64 + 272, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 64 + 160))));
|
||||
wo.Store4(gl_GlobalInvocationID.x * 16 + 480, asuint(asfloat(ro.Load4(gl_GlobalInvocationID.x * 16 + 480))));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
15
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/address-buffers.comp
vendored
Normal file
15
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/address-buffers.comp
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
RWByteAddressBuffer WriteOnly : register(u2);
|
||||
ByteAddressBuffer ReadOnly : register(t0);
|
||||
RWByteAddressBuffer ReadWrite : register(u1);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
WriteOnly.Store4(0, asuint(asfloat(ReadOnly.Load4(0))));
|
||||
ReadWrite.Store4(0, asuint(asfloat(ReadWrite.Load4(0)) + 10.0f.xxxx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
89
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/atomic.comp
vendored
Normal file
89
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/atomic.comp
vendored
Normal file
@ -0,0 +1,89 @@
|
||||
RWByteAddressBuffer ssbo : register(u2);
|
||||
RWTexture2D<uint> uImage : register(u0);
|
||||
RWTexture2D<int> iImage : register(u1);
|
||||
|
||||
groupshared int int_atomic;
|
||||
groupshared uint uint_atomic;
|
||||
groupshared int int_atomic_array[1];
|
||||
groupshared uint uint_atomic_array[1];
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uint _19;
|
||||
InterlockedAdd(uImage[int2(1, 5)], 1u, _19);
|
||||
uint _27;
|
||||
InterlockedAdd(uImage[int2(1, 5)], 1u, _27);
|
||||
iImage[int2(1, 6)] = int(_27).x;
|
||||
uint _32;
|
||||
InterlockedOr(uImage[int2(1, 5)], 1u, _32);
|
||||
uint _34;
|
||||
InterlockedXor(uImage[int2(1, 5)], 1u, _34);
|
||||
uint _36;
|
||||
InterlockedAnd(uImage[int2(1, 5)], 1u, _36);
|
||||
uint _38;
|
||||
InterlockedMin(uImage[int2(1, 5)], 1u, _38);
|
||||
uint _40;
|
||||
InterlockedMax(uImage[int2(1, 5)], 1u, _40);
|
||||
uint _44;
|
||||
InterlockedCompareExchange(uImage[int2(1, 5)], 10u, 2u, _44);
|
||||
int _47;
|
||||
InterlockedAdd(iImage[int2(1, 6)], 1, _47);
|
||||
int _49;
|
||||
InterlockedOr(iImage[int2(1, 6)], 1, _49);
|
||||
int _51;
|
||||
InterlockedXor(iImage[int2(1, 6)], 1, _51);
|
||||
int _53;
|
||||
InterlockedAnd(iImage[int2(1, 6)], 1, _53);
|
||||
int _55;
|
||||
InterlockedMin(iImage[int2(1, 6)], 1, _55);
|
||||
int _57;
|
||||
InterlockedMax(iImage[int2(1, 6)], 1, _57);
|
||||
int _61;
|
||||
InterlockedCompareExchange(iImage[int2(1, 5)], 10, 2, _61);
|
||||
uint _68;
|
||||
ssbo.InterlockedAdd(0, 1u, _68);
|
||||
uint _70;
|
||||
ssbo.InterlockedOr(0, 1u, _70);
|
||||
uint _72;
|
||||
ssbo.InterlockedXor(0, 1u, _72);
|
||||
uint _74;
|
||||
ssbo.InterlockedAnd(0, 1u, _74);
|
||||
uint _76;
|
||||
ssbo.InterlockedMin(0, 1u, _76);
|
||||
uint _78;
|
||||
ssbo.InterlockedMax(0, 1u, _78);
|
||||
uint _80;
|
||||
ssbo.InterlockedExchange(0, 1u, _80);
|
||||
uint _82;
|
||||
ssbo.InterlockedCompareExchange(0, 10u, 2u, _82);
|
||||
int _85;
|
||||
ssbo.InterlockedAdd(4, 1, _85);
|
||||
int _87;
|
||||
ssbo.InterlockedOr(4, 1, _87);
|
||||
int _89;
|
||||
ssbo.InterlockedXor(4, 1, _89);
|
||||
int _91;
|
||||
ssbo.InterlockedAnd(4, 1, _91);
|
||||
int _93;
|
||||
ssbo.InterlockedMin(4, 1, _93);
|
||||
int _95;
|
||||
ssbo.InterlockedMax(4, 1, _95);
|
||||
int _97;
|
||||
ssbo.InterlockedExchange(4, 1, _97);
|
||||
int _99;
|
||||
ssbo.InterlockedCompareExchange(4, 10, 2, _99);
|
||||
int _102;
|
||||
InterlockedAdd(int_atomic, 10, _102);
|
||||
uint _105;
|
||||
InterlockedAdd(uint_atomic, 10u, _105);
|
||||
int _110;
|
||||
InterlockedAdd(int_atomic_array[0], 10, _110);
|
||||
uint _115;
|
||||
InterlockedAdd(uint_atomic_array[0], 10u, _115);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/barriers.comp
vendored
Normal file
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/barriers.comp
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
GroupMemoryBarrier();
|
||||
AllMemoryBarrier();
|
||||
DeviceMemoryBarrier();
|
||||
DeviceMemoryBarrier();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DeviceMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
DeviceMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
AllMemoryBarrier();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
113
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/bitfield.noopt.comp
vendored
Normal file
113
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/bitfield.noopt.comp
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
uint SPIRV_Cross_bitfieldInsert(uint Base, uint Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_bitfieldInsert(uint2 Base, uint2 Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_bitfieldInsert(uint3 Base, uint3 Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint4 SPIRV_Cross_bitfieldInsert(uint4 Base, uint4 Insert, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : (((1u << Count) - 1) << (Offset & 31));
|
||||
return (Base & ~Mask) | ((Insert << Offset) & Mask);
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_bitfieldUExtract(uint Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
uint2 SPIRV_Cross_bitfieldUExtract(uint2 Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
uint3 SPIRV_Cross_bitfieldUExtract(uint3 Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
uint4 SPIRV_Cross_bitfieldUExtract(uint4 Base, uint Offset, uint Count)
|
||||
{
|
||||
uint Mask = Count == 32 ? 0xffffffff : ((1 << Count) - 1);
|
||||
return (Base >> Offset) & Mask;
|
||||
}
|
||||
|
||||
int SPIRV_Cross_bitfieldSExtract(int Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
int2 SPIRV_Cross_bitfieldSExtract(int2 Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int2 Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
int3 SPIRV_Cross_bitfieldSExtract(int3 Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int3 Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
int4 SPIRV_Cross_bitfieldSExtract(int4 Base, int Offset, int Count)
|
||||
{
|
||||
int Mask = Count == 32 ? -1 : ((1 << Count) - 1);
|
||||
int4 Masked = (Base >> Offset) & Mask;
|
||||
int ExtendShift = (32 - Count) & 31;
|
||||
return (Masked << ExtendShift) >> ExtendShift;
|
||||
}
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
int signed_value = 0;
|
||||
uint unsigned_value = 0u;
|
||||
int3 signed_values = int3(0, 0, 0);
|
||||
uint3 unsigned_values = uint3(0u, 0u, 0u);
|
||||
int s = SPIRV_Cross_bitfieldSExtract(signed_value, 5, 20);
|
||||
uint u = SPIRV_Cross_bitfieldUExtract(unsigned_value, 6, 21);
|
||||
s = int(SPIRV_Cross_bitfieldInsert(s, 40, 5, 4));
|
||||
u = SPIRV_Cross_bitfieldInsert(u, 60u, 5, 4);
|
||||
u = reversebits(u);
|
||||
s = reversebits(s);
|
||||
int v0 = countbits(u);
|
||||
int v1 = countbits(s);
|
||||
int v2 = firstbithigh(u);
|
||||
int v3 = firstbitlow(s);
|
||||
int3 s_1 = SPIRV_Cross_bitfieldSExtract(signed_values, 5, 20);
|
||||
uint3 u_1 = SPIRV_Cross_bitfieldUExtract(unsigned_values, 6, 21);
|
||||
s_1 = int3(SPIRV_Cross_bitfieldInsert(s_1, int3(40, 40, 40), 5, 4));
|
||||
u_1 = SPIRV_Cross_bitfieldInsert(u_1, uint3(60u, 60u, 60u), 5, 4);
|
||||
u_1 = reversebits(u_1);
|
||||
s_1 = reversebits(s_1);
|
||||
int3 v0_1 = countbits(u_1);
|
||||
int3 v1_1 = countbits(s_1);
|
||||
int3 v2_1 = firstbithigh(u_1);
|
||||
int3 v3_1 = firstbitlow(s_1);
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
9
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/builtins.comp
vendored
Normal file
9
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/builtins.comp
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(8, 4, 2)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
62
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/image.comp
vendored
Normal file
62
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/image.comp
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
RWTexture2D<float> uImageInF : register(u0);
|
||||
RWTexture2D<float> uImageOutF : register(u1);
|
||||
RWTexture2D<int> uImageInI : register(u2);
|
||||
RWTexture2D<int> uImageOutI : register(u3);
|
||||
RWTexture2D<uint> uImageInU : register(u4);
|
||||
RWTexture2D<uint> uImageOutU : register(u5);
|
||||
RWBuffer<float> uImageInBuffer : register(u6);
|
||||
RWBuffer<float> uImageOutBuffer : register(u7);
|
||||
RWTexture2D<float2> uImageInF2 : register(u8);
|
||||
RWTexture2D<float2> uImageOutF2 : register(u9);
|
||||
RWTexture2D<int2> uImageInI2 : register(u10);
|
||||
RWTexture2D<int2> uImageOutI2 : register(u11);
|
||||
RWTexture2D<uint2> uImageInU2 : register(u12);
|
||||
RWTexture2D<uint2> uImageOutU2 : register(u13);
|
||||
RWBuffer<float2> uImageInBuffer2 : register(u14);
|
||||
RWBuffer<float2> uImageOutBuffer2 : register(u15);
|
||||
RWTexture2D<float4> uImageInF4 : register(u16);
|
||||
RWTexture2D<float4> uImageOutF4 : register(u17);
|
||||
RWTexture2D<int4> uImageInI4 : register(u18);
|
||||
RWTexture2D<int4> uImageOutI4 : register(u19);
|
||||
RWTexture2D<uint4> uImageInU4 : register(u20);
|
||||
RWTexture2D<uint4> uImageOutU4 : register(u21);
|
||||
RWBuffer<float4> uImageInBuffer4 : register(u22);
|
||||
RWBuffer<float4> uImageOutBuffer4 : register(u23);
|
||||
RWTexture2D<float4> uImageNoFmtF : register(u24);
|
||||
RWTexture2D<uint4> uImageNoFmtU : register(u25);
|
||||
RWTexture2D<int4> uImageNoFmtI : register(u26);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
uImageOutF[int2(gl_GlobalInvocationID.xy)] = uImageInF[int2(gl_GlobalInvocationID.xy)].x;
|
||||
uImageOutI[int2(gl_GlobalInvocationID.xy)] = uImageInI[int2(gl_GlobalInvocationID.xy)].x;
|
||||
uImageOutU[int2(gl_GlobalInvocationID.xy)] = uImageInU[int2(gl_GlobalInvocationID.xy)].x;
|
||||
uImageOutBuffer[int(gl_GlobalInvocationID.x)] = uImageInBuffer[int(gl_GlobalInvocationID.x)].x;
|
||||
uImageOutF2[int2(gl_GlobalInvocationID.xy)] = uImageInF2[int2(gl_GlobalInvocationID.xy)].xy;
|
||||
uImageOutI2[int2(gl_GlobalInvocationID.xy)] = uImageInI2[int2(gl_GlobalInvocationID.xy)].xy;
|
||||
uImageOutU2[int2(gl_GlobalInvocationID.xy)] = uImageInU2[int2(gl_GlobalInvocationID.xy)].xy;
|
||||
float4 _135 = uImageInBuffer2[int(gl_GlobalInvocationID.x)].xyyy;
|
||||
uImageOutBuffer2[int(gl_GlobalInvocationID.x)] = _135.xy;
|
||||
uImageOutF4[int2(gl_GlobalInvocationID.xy)] = uImageInF4[int2(gl_GlobalInvocationID.xy)];
|
||||
int4 _165 = uImageInI4[int2(gl_GlobalInvocationID.xy)];
|
||||
uImageOutI4[int2(gl_GlobalInvocationID.xy)] = _165;
|
||||
uint4 _180 = uImageInU4[int2(gl_GlobalInvocationID.xy)];
|
||||
uImageOutU4[int2(gl_GlobalInvocationID.xy)] = _180;
|
||||
uImageOutBuffer4[int(gl_GlobalInvocationID.x)] = uImageInBuffer4[int(gl_GlobalInvocationID.x)];
|
||||
uImageNoFmtF[int2(gl_GlobalInvocationID.xy)] = _135;
|
||||
uImageNoFmtU[int2(gl_GlobalInvocationID.xy)] = _180;
|
||||
uImageNoFmtI[int2(gl_GlobalInvocationID.xy)] = _165;
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
comp_main();
|
||||
}
|
90
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rwbuffer-matrix.comp
vendored
Normal file
90
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rwbuffer-matrix.comp
vendored
Normal file
@ -0,0 +1,90 @@
|
||||
RWByteAddressBuffer _28 : register(u0);
|
||||
cbuffer _68 : register(b1)
|
||||
{
|
||||
int _68_index0 : packoffset(c0);
|
||||
int _68_index1 : packoffset(c0.y);
|
||||
};
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
float4x4 _253 = asfloat(uint4x4(_28.Load(64), _28.Load(80), _28.Load(96), _28.Load(112), _28.Load(68), _28.Load(84), _28.Load(100), _28.Load(116), _28.Load(72), _28.Load(88), _28.Load(104), _28.Load(120), _28.Load(76), _28.Load(92), _28.Load(108), _28.Load(124)));
|
||||
_28.Store4(0, asuint(_253[0]));
|
||||
_28.Store4(16, asuint(_253[1]));
|
||||
_28.Store4(32, asuint(_253[2]));
|
||||
_28.Store4(48, asuint(_253[3]));
|
||||
float2x2 _256 = asfloat(uint2x2(_28.Load(144), _28.Load(152), _28.Load(148), _28.Load(156)));
|
||||
_28.Store2(128, asuint(_256[0]));
|
||||
_28.Store2(136, asuint(_256[1]));
|
||||
float2x3 _259 = asfloat(uint2x3(_28.Load(192), _28.Load(200), _28.Load(208), _28.Load(196), _28.Load(204), _28.Load(212)));
|
||||
_28.Store3(160, asuint(_259[0]));
|
||||
_28.Store3(176, asuint(_259[1]));
|
||||
float3x2 _262 = asfloat(uint3x2(_28.Load(240), _28.Load(256), _28.Load(244), _28.Load(260), _28.Load(248), _28.Load(264)));
|
||||
_28.Store2(216, asuint(_262[0]));
|
||||
_28.Store2(224, asuint(_262[1]));
|
||||
_28.Store2(232, asuint(_262[2]));
|
||||
float4x4 _265 = asfloat(uint4x4(_28.Load4(0), _28.Load4(16), _28.Load4(32), _28.Load4(48)));
|
||||
_28.Store(64, asuint(_265[0].x));
|
||||
_28.Store(68, asuint(_265[1].x));
|
||||
_28.Store(72, asuint(_265[2].x));
|
||||
_28.Store(76, asuint(_265[3].x));
|
||||
_28.Store(80, asuint(_265[0].y));
|
||||
_28.Store(84, asuint(_265[1].y));
|
||||
_28.Store(88, asuint(_265[2].y));
|
||||
_28.Store(92, asuint(_265[3].y));
|
||||
_28.Store(96, asuint(_265[0].z));
|
||||
_28.Store(100, asuint(_265[1].z));
|
||||
_28.Store(104, asuint(_265[2].z));
|
||||
_28.Store(108, asuint(_265[3].z));
|
||||
_28.Store(112, asuint(_265[0].w));
|
||||
_28.Store(116, asuint(_265[1].w));
|
||||
_28.Store(120, asuint(_265[2].w));
|
||||
_28.Store(124, asuint(_265[3].w));
|
||||
float2x2 _268 = asfloat(uint2x2(_28.Load2(128), _28.Load2(136)));
|
||||
_28.Store(144, asuint(_268[0].x));
|
||||
_28.Store(148, asuint(_268[1].x));
|
||||
_28.Store(152, asuint(_268[0].y));
|
||||
_28.Store(156, asuint(_268[1].y));
|
||||
float2x3 _271 = asfloat(uint2x3(_28.Load3(160), _28.Load3(176)));
|
||||
_28.Store(192, asuint(_271[0].x));
|
||||
_28.Store(196, asuint(_271[1].x));
|
||||
_28.Store(200, asuint(_271[0].y));
|
||||
_28.Store(204, asuint(_271[1].y));
|
||||
_28.Store(208, asuint(_271[0].z));
|
||||
_28.Store(212, asuint(_271[1].z));
|
||||
float3x2 _274 = asfloat(uint3x2(_28.Load2(216), _28.Load2(224), _28.Load2(232)));
|
||||
_28.Store(240, asuint(_274[0].x));
|
||||
_28.Store(244, asuint(_274[1].x));
|
||||
_28.Store(248, asuint(_274[2].x));
|
||||
_28.Store(256, asuint(_274[0].y));
|
||||
_28.Store(260, asuint(_274[1].y));
|
||||
_28.Store(264, asuint(_274[2].y));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 16 + 64, asuint(1.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 8 + 144, asuint(2.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 8 + 192, asuint(3.0f));
|
||||
_28.Store(_68_index0 * 4 + _68_index1 * 16 + 240, asuint(4.0f));
|
||||
_28.Store(_68_index0 * 4 + 64, asuint(1.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 80, asuint(1.0f.xxxx.y));
|
||||
_28.Store(_68_index0 * 4 + 96, asuint(1.0f.xxxx.z));
|
||||
_28.Store(_68_index0 * 4 + 112, asuint(1.0f.xxxx.w));
|
||||
_28.Store(_68_index0 * 4 + 144, asuint(2.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 152, asuint(2.0f.xx.y));
|
||||
_28.Store(_68_index0 * 4 + 192, asuint(3.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 200, asuint(3.0f.xxx.y));
|
||||
_28.Store(_68_index0 * 4 + 208, asuint(3.0f.xxx.z));
|
||||
_28.Store(_68_index0 * 4 + 240, asuint(4.0f.x));
|
||||
_28.Store(_68_index0 * 4 + 256, asuint(4.0f.xx.y));
|
||||
_28.Store(_68_index0 * 16 + _68_index1 * 4 + 0, asuint(1.0f));
|
||||
_28.Store(_68_index0 * 8 + _68_index1 * 4 + 128, asuint(2.0f));
|
||||
_28.Store(_68_index0 * 16 + _68_index1 * 4 + 160, asuint(3.0f));
|
||||
_28.Store(_68_index0 * 8 + _68_index1 * 4 + 216, asuint(4.0f));
|
||||
_28.Store4(_68_index0 * 16 + 0, asuint(1.0f.xxxx));
|
||||
_28.Store2(_68_index0 * 8 + 128, asuint(2.0f.xx));
|
||||
_28.Store3(_68_index0 * 16 + 160, asuint(3.0f.xxx));
|
||||
_28.Store2(_68_index0 * 8 + 216, asuint(4.0f.xx));
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/shared.comp
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/shared.comp
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
static const uint3 gl_WorkGroupSize = uint3(4u, 1u, 1u);
|
||||
|
||||
ByteAddressBuffer _22 : register(t0);
|
||||
RWByteAddressBuffer _44 : register(u1);
|
||||
|
||||
static uint3 gl_GlobalInvocationID;
|
||||
static uint gl_LocalInvocationIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
|
||||
uint gl_LocalInvocationIndex : SV_GroupIndex;
|
||||
};
|
||||
|
||||
groupshared float sShared[4];
|
||||
|
||||
void comp_main()
|
||||
{
|
||||
sShared[gl_LocalInvocationIndex] = asfloat(_22.Load(gl_GlobalInvocationID.x * 4 + 0));
|
||||
GroupMemoryBarrierWithGroupSync();
|
||||
_44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[(4u - gl_LocalInvocationIndex) - 1u]));
|
||||
}
|
||||
|
||||
[numthreads(4, 1, 1)]
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
|
||||
gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
|
||||
comp_main();
|
||||
}
|
9
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/ssbo-array.comp
vendored
Normal file
9
deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/ssbo-array.comp
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
void comp_main()
|
||||
{
|
||||
}
|
||||
|
||||
[numthreads(1, 1, 1)]
|
||||
void main()
|
||||
{
|
||||
comp_main();
|
||||
}
|
32
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/basic.frag
vendored
Normal file
32
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/basic.frag
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
Texture2D<float4> uTex : register(t0);
|
||||
SamplerState _uTex_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float4 vColor;
|
||||
static float2 vTex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float2 vTex : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = vColor * uTex.Sample(_uTex_sampler, vTex);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
vTex = stage_input.vTex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/bit-conversions.frag
vendored
Normal file
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/bit-conversions.frag
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
static float2 value;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 value : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(1.0f, 0.0f, asfloat(asint(value.x)), 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
value = stage_input.value;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
27
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/boolean-mix.frag
vendored
Normal file
27
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/boolean-mix.frag
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
static float2 FragColor;
|
||||
static float2 x0;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 x0 : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool2 _27 = (x0.x > x0.y).xx;
|
||||
FragColor = float2(_27.x ? float2(1.0f, 0.0f).x : float2(0.0f, 1.0f).x, _27.y ? float2(1.0f, 0.0f).y : float2(0.0f, 1.0f).y);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
x0 = stage_input.x0;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
33
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/builtins.frag
vendored
Normal file
33
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/builtins.frag
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
static float4 gl_FragCoord;
|
||||
static float gl_FragDepth;
|
||||
static float4 FragColor;
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
float gl_FragDepth : SV_Depth;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = gl_FragCoord + vColor;
|
||||
gl_FragDepth = 0.5f;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_FragDepth = gl_FragDepth;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
27
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/bvec-operations.frag
vendored
Normal file
27
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/bvec-operations.frag
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
static float2 value;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 value : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
bool2 _25 = bool2(value.x == 0.0f, value.y == 0.0f);
|
||||
FragColor = float4(1.0f, 0.0f, float(bool2(!_25.x, !_25.y).x), float(bool2(value.x <= float2(1.5f, 0.5f).x, value.y <= float2(1.5f, 0.5f).y).x));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
value = stage_input.value;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
24
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/combined-texture-sampler-parameter.frag
vendored
Normal file
24
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/combined-texture-sampler-parameter.frag
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
Texture2D<float4> uSamplerShadow : register(t1);
|
||||
SamplerComparisonState _uSamplerShadow_sampler : register(s1);
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSampler.Sample(_uSampler_sampler, 1.0f.xx) + uSampler.Load(int3(int2(10, 10), 0))).x + uSamplerShadow.SampleCmp(_uSamplerShadow_sampler, 1.0f.xxx.xy, 1.0f);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
23
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/combined-texture-sampler-shadow.frag
vendored
Normal file
23
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/combined-texture-sampler-shadow.frag
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
Texture2D<float4> uDepth : register(t2);
|
||||
SamplerComparisonState uSampler : register(s0);
|
||||
SamplerState uSampler1 : register(s1);
|
||||
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = uDepth.SampleCmp(uSampler, 1.0f.xxx.xy, 1.0f) + uDepth.Sample(uSampler1, 1.0f.xx).x;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
43
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/constant-buffer-array.sm51.frag
vendored
Normal file
43
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/constant-buffer-array.sm51.frag
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
struct CBO_1
|
||||
{
|
||||
float4 a;
|
||||
float4 b;
|
||||
float4 c;
|
||||
float4 d;
|
||||
};
|
||||
|
||||
ConstantBuffer<CBO_1> cbo[2][4] : register(b4, space0);
|
||||
cbuffer push
|
||||
{
|
||||
float4 push_a : packoffset(c0);
|
||||
float4 push_b : packoffset(c1);
|
||||
float4 push_c : packoffset(c2);
|
||||
float4 push_d : packoffset(c3);
|
||||
};
|
||||
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = cbo[1][2].a;
|
||||
FragColor += cbo[1][2].b;
|
||||
FragColor += cbo[1][2].c;
|
||||
FragColor += cbo[1][2].d;
|
||||
FragColor += push_a;
|
||||
FragColor += push_b;
|
||||
FragColor += push_c;
|
||||
FragColor += push_d;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
9
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/early-fragment-test.frag
vendored
Normal file
9
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/early-fragment-test.frag
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
[earlydepthstencil]
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
44
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16-packing.frag
vendored
Normal file
44
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16-packing.frag
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
static float2 FP32Out;
|
||||
static uint FP16;
|
||||
static uint FP16Out;
|
||||
static float2 FP32;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation uint FP16 : TEXCOORD0;
|
||||
nointerpolation float2 FP32 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float2 FP32Out : SV_Target0;
|
||||
uint FP16Out : SV_Target1;
|
||||
};
|
||||
|
||||
uint SPIRV_Cross_packHalf2x16(float2 value)
|
||||
{
|
||||
uint2 Packed = f32tof16(value);
|
||||
return Packed.x | (Packed.y << 16);
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_unpackHalf2x16(uint value)
|
||||
{
|
||||
return f16tof32(uint2(value & 0xffff, value >> 16));
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FP32Out = SPIRV_Cross_unpackHalf2x16(FP16);
|
||||
FP16Out = SPIRV_Cross_packHalf2x16(FP32);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
FP16 = stage_input.FP16;
|
||||
FP32 = stage_input.FP32;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FP32Out = FP32Out;
|
||||
stage_output.FP16Out = FP16Out;
|
||||
return stage_output;
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query-selective.frag
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query-selective.frag
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
Texture1D<uint4> uSampler1DUint : register(t0);
|
||||
SamplerState _uSampler1DUint_sampler : register(s0);
|
||||
Texture1D<int4> uSampler1DInt : register(t0);
|
||||
SamplerState _uSampler1DInt_sampler : register(s0);
|
||||
|
||||
uint SPIRV_Cross_textureSize(Texture1D<int4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(Level, ret.x, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_textureSize(Texture1D<uint4> Tex, uint Level, out uint Param)
|
||||
{
|
||||
uint ret;
|
||||
Tex.GetDimensions(Level, ret.x, Param);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uint _17_dummy_parameter;
|
||||
uint _24_dummy_parameter;
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query.frag
vendored
Normal file
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query.frag
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
28
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/io-block.frag
vendored
Normal file
28
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/io-block.frag
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
static float4 FragColor;
|
||||
|
||||
struct VertexOut
|
||||
{
|
||||
float4 a : TEXCOORD1;
|
||||
float4 b : TEXCOORD2;
|
||||
};
|
||||
|
||||
static VertexOut _12;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = _12.a + _12.b;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(in VertexOut stage_input_12)
|
||||
{
|
||||
_12 = stage_input_12;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/matrix-input.frag
vendored
Normal file
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/matrix-input.frag
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
static float4 FragColor;
|
||||
static float4x4 m;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4x4 m : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = ((m[0] + m[1]) + m[2]) + m[3];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
m = stage_input.m;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
67
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/mod.frag
vendored
Normal file
67
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/mod.frag
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
static float4 a4;
|
||||
static float4 b4;
|
||||
static float3 a3;
|
||||
static float3 b3;
|
||||
static float2 a2;
|
||||
static float2 b2;
|
||||
static float a1;
|
||||
static float b1;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 a4 : TEXCOORD0;
|
||||
float3 a3 : TEXCOORD1;
|
||||
float2 a2 : TEXCOORD2;
|
||||
float a1 : TEXCOORD3;
|
||||
float4 b4 : TEXCOORD4;
|
||||
float3 b3 : TEXCOORD5;
|
||||
float2 b2 : TEXCOORD6;
|
||||
float b1 : TEXCOORD7;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float mod(float x, float y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float2 mod(float2 x, float2 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float3 mod(float3 x, float3 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
float4 mod(float4 x, float4 y)
|
||||
{
|
||||
return x - y * floor(x / y);
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = ((mod(a4, b4) + mod(a3, b3).xyzx) + mod(a2, b2).xyxy) + mod(a1, b1).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
a4 = stage_input.a4;
|
||||
b4 = stage_input.b4;
|
||||
a3 = stage_input.a3;
|
||||
b3 = stage_input.b3;
|
||||
a2 = stage_input.a2;
|
||||
b2 = stage_input.b2;
|
||||
a1 = stage_input.a1;
|
||||
b1 = stage_input.b1;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
31
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/mrt.frag
vendored
Normal file
31
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/mrt.frag
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
static float4 RT0;
|
||||
static float4 RT1;
|
||||
static float4 RT2;
|
||||
static float4 RT3;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 RT0 : SV_Target0;
|
||||
float4 RT1 : SV_Target1;
|
||||
float4 RT2 : SV_Target2;
|
||||
float4 RT3 : SV_Target3;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
RT0 = 1.0f.xxxx;
|
||||
RT1 = 2.0f.xxxx;
|
||||
RT2 = 3.0f.xxxx;
|
||||
RT3 = 4.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.RT0 = RT0;
|
||||
stage_output.RT1 = RT1;
|
||||
stage_output.RT2 = RT2;
|
||||
stage_output.RT3 = RT3;
|
||||
return stage_output;
|
||||
}
|
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/no-return.frag
vendored
Normal file
8
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/no-return.frag
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
16
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/no-return2.frag
vendored
Normal file
16
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/no-return2.frag
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
static float4 vColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vColor : TEXCOORD0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vColor = stage_input.vColor;
|
||||
frag_main();
|
||||
}
|
14
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/partial-write-preserve.frag
vendored
Normal file
14
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/partial-write-preserve.frag
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
struct B
|
||||
{
|
||||
float a;
|
||||
float b;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
frag_main();
|
||||
}
|
30
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/query-lod.desktop.frag
vendored
Normal file
30
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/query-lod.desktop.frag
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
Texture2D<float4> uSampler : register(t0);
|
||||
SamplerState _uSampler_sampler : register(s0);
|
||||
|
||||
static float4 FragColor;
|
||||
static float2 vTexCoord;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vTexCoord : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float _19_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vTexCoord);
|
||||
FragColor = float2(_19_tmp, _19_tmp).xyxy;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vTexCoord = stage_input.vTexCoord;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
39
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/resources.frag
vendored
Normal file
39
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/resources.frag
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
cbuffer cbuf : register(b3)
|
||||
{
|
||||
float4 cbuf_a : packoffset(c0);
|
||||
};
|
||||
cbuffer registers
|
||||
{
|
||||
float4 registers_d : packoffset(c0);
|
||||
};
|
||||
Texture2D<float4> uSampledImage : register(t4);
|
||||
SamplerState _uSampledImage_sampler : register(s4);
|
||||
Texture2D<float4> uTexture : register(t5);
|
||||
SamplerState uSampler : register(s6);
|
||||
|
||||
static float2 vTex;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vTex : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_d);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vTex = stage_input.vTex;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
57
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag
vendored
Normal file
57
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
Texture2D<float4> uSampler2D : register(t0);
|
||||
SamplerComparisonState _uSampler2D_sampler : register(s0);
|
||||
Texture2DArray<float4> uSampler2DArray : register(t1);
|
||||
SamplerComparisonState _uSampler2DArray_sampler : register(s1);
|
||||
TextureCube<float4> uSamplerCube : register(t2);
|
||||
SamplerComparisonState _uSamplerCube_sampler : register(s2);
|
||||
TextureCubeArray<float4> uSamplerCubeArray : register(t3);
|
||||
SamplerComparisonState _uSamplerCubeArray_sampler : register(s3);
|
||||
|
||||
static float3 vUVRef;
|
||||
static float4 vDirRef;
|
||||
static float FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 vUVRef : TEXCOORD0;
|
||||
float4 vDirRef : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
|
||||
{
|
||||
return coord.x / coord.y;
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
|
||||
{
|
||||
return float2(coord.x, coord.y) / coord.z;
|
||||
}
|
||||
|
||||
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
{
|
||||
return float3(coord.x, coord.y, coord.z) / coord.w;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _80 = vDirRef;
|
||||
_80.z = vDirRef.w;
|
||||
float4 _87 = vDirRef;
|
||||
_87.z = vDirRef.w;
|
||||
FragColor = (((((((uSampler2D.SampleCmp(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1)) + uSampler2DArray.SampleCmp(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1))) + uSamplerCube.SampleCmp(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w)) + uSamplerCubeArray.SampleCmp(_uSamplerCubeArray_sampler, vDirRef, 0.5f)) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1))) + uSampler2DArray.SampleCmpLevelZero(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1))) + uSamplerCube.SampleCmpLevelZero(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w)) + uSampler2D.SampleCmp(_uSampler2D_sampler, SPIRV_Cross_projectTextureCoordinate(_80.xyz), vDirRef.z, int2(1, 1))) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, SPIRV_Cross_projectTextureCoordinate(_87.xyz), vDirRef.z, int2(1, 1));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vUVRef = stage_input.vUVRef;
|
||||
vDirRef = stage_input.vDirRef;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-array.frag
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-array.frag
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
Texture2D<float4> uCombined[4] : register(t0);
|
||||
SamplerState _uCombined_sampler[4] : register(s0);
|
||||
Texture2D<float4> uTex[4] : register(t4);
|
||||
SamplerState uSampler[4] : register(s8);
|
||||
RWTexture2D<float4> uImage[8] : register(u12);
|
||||
|
||||
static float4 gl_FragCoord;
|
||||
static float2 vTex;
|
||||
static int vIndex;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 vTex : TEXCOORD0;
|
||||
nointerpolation int vIndex : TEXCOORD1;
|
||||
float4 gl_FragCoord : SV_Position;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
uImage[vIndex][int2(gl_FragCoord.xy)] = ((uCombined[vIndex].Sample(_uCombined_sampler[vIndex], vTex) + uTex[vIndex].Sample(uSampler[vIndex], vTex)) + (uCombined[vIndex + 1].Sample(_uCombined_sampler[vIndex + 1], vTex))) + (uTex[vIndex + 1].Sample(uSampler[vIndex + 1], vTex));
|
||||
}
|
||||
|
||||
void main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_FragCoord = stage_input.gl_FragCoord;
|
||||
vTex = stage_input.vTex;
|
||||
vIndex = stage_input.vIndex;
|
||||
frag_main();
|
||||
}
|
33
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant.frag
vendored
Normal file
33
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant.frag
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
static const float a = 1.0f;
|
||||
static const float b = 2.0f;
|
||||
static const int c = 3;
|
||||
static const int d = 4;
|
||||
|
||||
struct Foo
|
||||
{
|
||||
float elems[(d + 2)];
|
||||
};
|
||||
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float vec0[(c + 3)][8];
|
||||
vec0[0][0] = 10.0f;
|
||||
Foo foo;
|
||||
foo.elems[c] = 10.0f;
|
||||
FragColor = (((a + b).xxxx + vec0[0][0].xxxx) + 20.0f.xxxx) + foo.elems[c].xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
41
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/swizzle-scalar.frag
vendored
Normal file
41
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/swizzle-scalar.frag
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
static float4 Float;
|
||||
static float vFloat;
|
||||
static int4 Int;
|
||||
static int vInt;
|
||||
static float4 Float2;
|
||||
static int4 Int2;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation float vFloat : TEXCOORD0;
|
||||
nointerpolation int vInt : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 Float : SV_Target0;
|
||||
int4 Int : SV_Target1;
|
||||
float4 Float2 : SV_Target2;
|
||||
int4 Int2 : SV_Target3;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
Float = vFloat.xxxx * 2.0f;
|
||||
Int = vInt.xxxx * int4(2, 2, 2, 2);
|
||||
Float2 = 10.0f.xxxx;
|
||||
Int2 = int4(10, 10, 10, 10);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vFloat = stage_input.vFloat;
|
||||
vInt = stage_input.vInt;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.Float = Float;
|
||||
stage_output.Int = Int;
|
||||
stage_output.Float2 = Float2;
|
||||
stage_output.Int2 = Int2;
|
||||
return stage_output;
|
||||
}
|
87
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling.frag
vendored
Normal file
87
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling.frag
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
Texture1D<float4> tex1d;
|
||||
SamplerState _tex1d_sampler;
|
||||
Texture2D<float4> tex2d;
|
||||
SamplerState _tex2d_sampler;
|
||||
Texture3D<float4> tex3d;
|
||||
SamplerState _tex3d_sampler;
|
||||
TextureCube<float4> texCube;
|
||||
SamplerState _texCube_sampler;
|
||||
Texture1D<float4> tex1dShadow;
|
||||
SamplerComparisonState _tex1dShadow_sampler;
|
||||
Texture2D<float4> tex2dShadow;
|
||||
SamplerComparisonState _tex2dShadow_sampler;
|
||||
TextureCube<float4> texCubeShadow;
|
||||
SamplerComparisonState _texCubeShadow_sampler;
|
||||
Texture1DArray<float4> tex1dArray;
|
||||
SamplerState _tex1dArray_sampler;
|
||||
Texture2DArray<float4> tex2dArray;
|
||||
SamplerState _tex2dArray_sampler;
|
||||
TextureCubeArray<float4> texCubeArray;
|
||||
SamplerState _texCubeArray_sampler;
|
||||
Texture2D<float4> separateTex2d;
|
||||
SamplerState samplerNonDepth;
|
||||
Texture2D<float4> separateTex2dDepth;
|
||||
SamplerComparisonState samplerDepth;
|
||||
|
||||
static float texCoord1d;
|
||||
static float2 texCoord2d;
|
||||
static float3 texCoord3d;
|
||||
static float4 texCoord4d;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float texCoord1d : TEXCOORD0;
|
||||
float2 texCoord2d : TEXCOORD1;
|
||||
float3 texCoord3d : TEXCOORD2;
|
||||
float4 texCoord4d : TEXCOORD3;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
|
||||
{
|
||||
return coord.x / coord.y;
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
|
||||
{
|
||||
return float2(coord.x, coord.y) / coord.z;
|
||||
}
|
||||
|
||||
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
{
|
||||
return float3(coord.x, coord.y, coord.z) / coord.w;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _162 = (((((((((((((((((((tex1d.Sample(_tex1d_sampler, texCoord1d) + tex1d.Sample(_tex1d_sampler, texCoord1d, 1)) + tex1d.SampleLevel(_tex1d_sampler, texCoord1d, 2.0f)) + tex1d.SampleGrad(_tex1d_sampler, texCoord1d, 1.0f, 2.0f)) + tex1d.Sample(_tex1d_sampler, SPIRV_Cross_projectTextureCoordinate(float2(texCoord1d, 2.0f)))) + tex1d.SampleBias(_tex1d_sampler, texCoord1d, 1.0f)) + tex2d.Sample(_tex2d_sampler, texCoord2d)) + tex2d.Sample(_tex2d_sampler, texCoord2d, int2(1, 2))) + tex2d.SampleLevel(_tex2d_sampler, texCoord2d, 2.0f)) + tex2d.SampleGrad(_tex2d_sampler, texCoord2d, float2(1.0f, 2.0f), float2(3.0f, 4.0f))) + tex2d.Sample(_tex2d_sampler, SPIRV_Cross_projectTextureCoordinate(float3(texCoord2d, 2.0f)))) + tex2d.SampleBias(_tex2d_sampler, texCoord2d, 1.0f)) + tex3d.Sample(_tex3d_sampler, texCoord3d)) + tex3d.Sample(_tex3d_sampler, texCoord3d, int3(1, 2, 3))) + tex3d.SampleLevel(_tex3d_sampler, texCoord3d, 2.0f)) + tex3d.SampleGrad(_tex3d_sampler, texCoord3d, float3(1.0f, 2.0f, 3.0f), float3(4.0f, 5.0f, 6.0f))) + tex3d.Sample(_tex3d_sampler, SPIRV_Cross_projectTextureCoordinate(float4(texCoord3d, 2.0f)))) + tex3d.SampleBias(_tex3d_sampler, texCoord3d, 1.0f)) + texCube.Sample(_texCube_sampler, texCoord3d)) + texCube.SampleLevel(_texCube_sampler, texCoord3d, 2.0f)) + texCube.SampleBias(_texCube_sampler, texCoord3d, 1.0f);
|
||||
float _178 = _162.w + tex1dShadow.SampleCmp(_tex1dShadow_sampler, float3(texCoord1d, 0.0f, 0.0f).x, 0.0f);
|
||||
float4 _327 = _162;
|
||||
_327.w = _178;
|
||||
float _193 = _178 + tex2dShadow.SampleCmp(_tex2dShadow_sampler, float3(texCoord2d, 0.0f).xy, 0.0f);
|
||||
float4 _331 = _327;
|
||||
_331.w = _193;
|
||||
float4 _335 = _331;
|
||||
_335.w = _193 + texCubeShadow.SampleCmp(_texCubeShadow_sampler, float4(texCoord3d, 0.0f).xyz, 0.0f);
|
||||
float4 _308 = ((((((((((((((_335 + tex1dArray.Sample(_tex1dArray_sampler, texCoord2d)) + tex2dArray.Sample(_tex2dArray_sampler, texCoord3d)) + texCubeArray.Sample(_texCubeArray_sampler, texCoord4d)) + tex2d.GatherRed(_tex2d_sampler, texCoord2d)) + tex2d.GatherRed(_tex2d_sampler, texCoord2d)) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d)) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d)) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d)) + tex2d.GatherRed(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherRed(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherGreen(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherBlue(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.GatherAlpha(_tex2d_sampler, texCoord2d, int2(1, 1))) + tex2d.Load(int3(int2(1, 2), 0))) + separateTex2d.Sample(samplerNonDepth, texCoord2d);
|
||||
float4 _339 = _308;
|
||||
_339.w = _308.w + separateTex2dDepth.SampleCmp(samplerDepth, texCoord3d.xy, texCoord3d.z);
|
||||
FragColor = _339;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
texCoord1d = stage_input.texCoord1d;
|
||||
texCoord2d = stage_input.texCoord2d;
|
||||
texCoord3d = stage_input.texCoord3d;
|
||||
texCoord4d = stage_input.texCoord4d;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
66
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag
vendored
Normal file
66
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/texture-proj-shadow.frag
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
Texture1D<float4> uShadow1D : register(t0);
|
||||
SamplerComparisonState _uShadow1D_sampler : register(s0);
|
||||
Texture2D<float4> uShadow2D : register(t1);
|
||||
SamplerComparisonState _uShadow2D_sampler : register(s1);
|
||||
Texture1D<float4> uSampler1D : register(t2);
|
||||
SamplerState _uSampler1D_sampler : register(s2);
|
||||
Texture2D<float4> uSampler2D : register(t3);
|
||||
SamplerState _uSampler2D_sampler : register(s3);
|
||||
Texture3D<float4> uSampler3D : register(t4);
|
||||
SamplerState _uSampler3D_sampler : register(s4);
|
||||
|
||||
static float FragColor;
|
||||
static float4 vClip4;
|
||||
static float2 vClip2;
|
||||
static float3 vClip3;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 vClip3 : TEXCOORD0;
|
||||
float4 vClip4 : TEXCOORD1;
|
||||
float2 vClip2 : TEXCOORD2;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
|
||||
{
|
||||
return coord.x / coord.y;
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
|
||||
{
|
||||
return float2(coord.x, coord.y) / coord.z;
|
||||
}
|
||||
|
||||
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
|
||||
{
|
||||
return float3(coord.x, coord.y, coord.z) / coord.w;
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
float4 _20 = vClip4;
|
||||
_20.y = vClip4.w;
|
||||
FragColor = uShadow1D.SampleCmp(_uShadow1D_sampler, SPIRV_Cross_projectTextureCoordinate(_20.xy), vClip4.z);
|
||||
float4 _30 = vClip4;
|
||||
_30.z = vClip4.w;
|
||||
FragColor = uShadow2D.SampleCmp(_uShadow2D_sampler, SPIRV_Cross_projectTextureCoordinate(_30.xyz), vClip4.z);
|
||||
FragColor = uSampler1D.Sample(_uSampler1D_sampler, SPIRV_Cross_projectTextureCoordinate(vClip2)).x;
|
||||
FragColor = uSampler2D.Sample(_uSampler2D_sampler, SPIRV_Cross_projectTextureCoordinate(vClip3)).x;
|
||||
FragColor = uSampler3D.Sample(_uSampler3D_sampler, SPIRV_Cross_projectTextureCoordinate(vClip4)).x;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vClip4 = stage_input.vClip4;
|
||||
vClip2 = stage_input.vClip2;
|
||||
vClip3 = stage_input.vClip3;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unary-enclose.frag
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unary-enclose.frag
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
static float4 FragColor;
|
||||
static float4 vIn;
|
||||
static int4 vIn1;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 vIn : TEXCOORD0;
|
||||
nointerpolation int4 vIn1 : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = -(-vIn);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
vIn = stage_input.vIn;
|
||||
vIn1 = stage_input.vIn1;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
109
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unorm-snorm-packing.frag
vendored
Normal file
109
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unorm-snorm-packing.frag
vendored
Normal file
@ -0,0 +1,109 @@
|
||||
static float4 FP32Out;
|
||||
static uint UNORM8;
|
||||
static uint SNORM8;
|
||||
static uint UNORM16;
|
||||
static uint SNORM16;
|
||||
static uint UNORM8Out;
|
||||
static float4 FP32;
|
||||
static uint SNORM8Out;
|
||||
static uint UNORM16Out;
|
||||
static uint SNORM16Out;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
nointerpolation uint SNORM8 : TEXCOORD0;
|
||||
nointerpolation uint UNORM8 : TEXCOORD1;
|
||||
nointerpolation uint SNORM16 : TEXCOORD2;
|
||||
nointerpolation uint UNORM16 : TEXCOORD3;
|
||||
nointerpolation float4 FP32 : TEXCOORD4;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FP32Out : SV_Target0;
|
||||
uint UNORM8Out : SV_Target1;
|
||||
uint SNORM8Out : SV_Target2;
|
||||
uint UNORM16Out : SV_Target3;
|
||||
uint SNORM16Out : SV_Target4;
|
||||
};
|
||||
|
||||
uint SPIRV_Cross_packUnorm4x8(float4 value)
|
||||
{
|
||||
uint4 Packed = uint4(round(saturate(value) * 255.0));
|
||||
return Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24);
|
||||
}
|
||||
|
||||
float4 SPIRV_Cross_unpackUnorm4x8(uint value)
|
||||
{
|
||||
uint4 Packed = uint4(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, value >> 24);
|
||||
return float4(Packed) / 255.0;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_packSnorm4x8(float4 value)
|
||||
{
|
||||
int4 Packed = int4(round(clamp(value, -1.0, 1.0) * 127.0)) & 0xff;
|
||||
return uint(Packed.x | (Packed.y << 8) | (Packed.z << 16) | (Packed.w << 24));
|
||||
}
|
||||
|
||||
float4 SPIRV_Cross_unpackSnorm4x8(uint value)
|
||||
{
|
||||
int SignedValue = int(value);
|
||||
int4 Packed = int4(SignedValue << 24, SignedValue << 16, SignedValue << 8, SignedValue) >> 24;
|
||||
return clamp(float4(Packed) / 127.0, -1.0, 1.0);
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_packUnorm2x16(float2 value)
|
||||
{
|
||||
uint2 Packed = uint2(round(saturate(value) * 65535.0));
|
||||
return Packed.x | (Packed.y << 16);
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_unpackUnorm2x16(uint value)
|
||||
{
|
||||
uint2 Packed = uint2(value & 0xffff, value >> 16);
|
||||
return float2(Packed) / 65535.0;
|
||||
}
|
||||
|
||||
uint SPIRV_Cross_packSnorm2x16(float2 value)
|
||||
{
|
||||
int2 Packed = int2(round(clamp(value, -1.0, 1.0) * 32767.0)) & 0xffff;
|
||||
return uint(Packed.x | (Packed.y << 16));
|
||||
}
|
||||
|
||||
float2 SPIRV_Cross_unpackSnorm2x16(uint value)
|
||||
{
|
||||
int SignedValue = int(value);
|
||||
int2 Packed = int2(SignedValue << 16, SignedValue) >> 16;
|
||||
return clamp(float2(Packed) / 32767.0, -1.0, 1.0);
|
||||
}
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FP32Out = SPIRV_Cross_unpackUnorm4x8(UNORM8);
|
||||
FP32Out = SPIRV_Cross_unpackSnorm4x8(SNORM8);
|
||||
float2 _21 = SPIRV_Cross_unpackUnorm2x16(UNORM16);
|
||||
FP32Out = float4(_21.x, _21.y, FP32Out.z, FP32Out.w);
|
||||
float2 _26 = SPIRV_Cross_unpackSnorm2x16(SNORM16);
|
||||
FP32Out = float4(_26.x, _26.y, FP32Out.z, FP32Out.w);
|
||||
UNORM8Out = SPIRV_Cross_packUnorm4x8(FP32);
|
||||
SNORM8Out = SPIRV_Cross_packSnorm4x8(FP32);
|
||||
UNORM16Out = SPIRV_Cross_packUnorm2x16(FP32.xy);
|
||||
SNORM16Out = SPIRV_Cross_packSnorm2x16(FP32.zw);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
UNORM8 = stage_input.UNORM8;
|
||||
SNORM8 = stage_input.SNORM8;
|
||||
UNORM16 = stage_input.UNORM16;
|
||||
SNORM16 = stage_input.SNORM16;
|
||||
FP32 = stage_input.FP32;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FP32Out = FP32Out;
|
||||
stage_output.UNORM8Out = UNORM8Out;
|
||||
stage_output.SNORM8Out = SNORM8Out;
|
||||
stage_output.UNORM16Out = UNORM16Out;
|
||||
stage_output.SNORM16Out = SNORM16Out;
|
||||
return stage_output;
|
||||
}
|
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/various-glsl-ops.frag
vendored
Normal file
26
deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/various-glsl-ops.frag
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
static float2 interpolant;
|
||||
static float4 FragColor;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float2 interpolant : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 FragColor : SV_Target0;
|
||||
};
|
||||
|
||||
void frag_main()
|
||||
{
|
||||
FragColor = float4(0.0f, 0.0f, 0.0f, EvaluateAttributeSnapped(interpolant, 0.100000001490116119384765625f.xx).x) + float4(0.0f, 0.0f, 0.0f, ddx_coarse(interpolant.x));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
interpolant = stage_input.interpolant;
|
||||
frag_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.FragColor = FragColor;
|
||||
return stage_output;
|
||||
}
|
38
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/basic.vert
vendored
Normal file
38
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/basic.vert
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
cbuffer _16
|
||||
{
|
||||
row_major float4x4 _16_uMVP : packoffset(c0);
|
||||
};
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 aVertex;
|
||||
static float3 vNormal;
|
||||
static float3 aNormal;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 aVertex : TEXCOORD0;
|
||||
float3 aNormal : TEXCOORD1;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float3 vNormal : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(aVertex, _16_uMVP);
|
||||
vNormal = aNormal;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
aVertex = stage_input.aVertex;
|
||||
aNormal = stage_input.aNormal;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vNormal = vNormal;
|
||||
return stage_output;
|
||||
}
|
28
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/instancing.vert
vendored
Normal file
28
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/instancing.vert
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
static float4 gl_Position;
|
||||
static int gl_VertexIndex;
|
||||
static int gl_InstanceIndex;
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
uint gl_VertexIndex : SV_VertexID;
|
||||
uint gl_InstanceIndex : SV_InstanceID;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = float(gl_VertexIndex + gl_InstanceIndex).xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
gl_VertexIndex = int(stage_input.gl_VertexIndex);
|
||||
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
79
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/locations.vert
vendored
Normal file
79
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/locations.vert
vendored
Normal file
@ -0,0 +1,79 @@
|
||||
struct Foo
|
||||
{
|
||||
float3 a;
|
||||
float3 b;
|
||||
float3 c;
|
||||
};
|
||||
|
||||
static float4 gl_Position;
|
||||
static float4 Input2;
|
||||
static float4 Input4;
|
||||
static float4 Input0;
|
||||
static float vLocation0;
|
||||
static float vLocation1;
|
||||
static float vLocation2[2];
|
||||
static Foo vLocation4;
|
||||
static float vLocation9;
|
||||
|
||||
struct VertexOut
|
||||
{
|
||||
float3 color : TEXCOORD7;
|
||||
float3 foo : TEXCOORD8;
|
||||
};
|
||||
|
||||
static VertexOut vout;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 Input0 : TEXCOORD0;
|
||||
float4 Input2 : TEXCOORD2;
|
||||
float4 Input4 : TEXCOORD4;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float vLocation0 : TEXCOORD0;
|
||||
float vLocation1 : TEXCOORD1;
|
||||
float vLocation2[2] : TEXCOORD2;
|
||||
Foo vLocation4 : TEXCOORD4;
|
||||
float vLocation9 : TEXCOORD9;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
Foo _70;
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = ((1.0f.xxxx + Input2) + Input4) + Input0;
|
||||
vLocation0 = 0.0f;
|
||||
vLocation1 = 1.0f;
|
||||
vLocation2[0] = 2.0f;
|
||||
vLocation2[1] = 2.0f;
|
||||
Foo _65 = _70;
|
||||
_65.a = 1.0f.xxx;
|
||||
Foo _67 = _65;
|
||||
_67.b = 1.0f.xxx;
|
||||
Foo _69 = _67;
|
||||
_69.c = 1.0f.xxx;
|
||||
vLocation4 = _69;
|
||||
vLocation9 = 9.0f;
|
||||
vout.color = 2.0f.xxx;
|
||||
vout.foo = 4.0f.xxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input, out VertexOut stage_outputvout)
|
||||
{
|
||||
Input2 = stage_input.Input2;
|
||||
Input4 = stage_input.Input4;
|
||||
Input0 = stage_input.Input0;
|
||||
vert_main();
|
||||
stage_outputvout = vout;
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vLocation0 = vLocation0;
|
||||
stage_output.vLocation1 = vLocation1;
|
||||
stage_output.vLocation2 = vLocation2;
|
||||
stage_output.vLocation4 = vLocation4;
|
||||
stage_output.vLocation9 = vLocation9;
|
||||
return stage_output;
|
||||
}
|
35
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/matrix-attribute.vert
vendored
Normal file
35
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/matrix-attribute.vert
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
static float4 gl_Position;
|
||||
static float4x4 m;
|
||||
static float3 pos;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float3 pos : TEXCOORD0;
|
||||
float4 m_0 : TEXCOORD1_0;
|
||||
float4 m_1 : TEXCOORD1_1;
|
||||
float4 m_2 : TEXCOORD1_2;
|
||||
float4 m_3 : TEXCOORD1_3;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = mul(float4(pos, 1.0f), m);
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
m[0] = stage_input.m_0;
|
||||
m[1] = stage_input.m_1;
|
||||
m[2] = stage_input.m_2;
|
||||
m[3] = stage_input.m_3;
|
||||
pos = stage_input.pos;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
23
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/matrix-output.vert
vendored
Normal file
23
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/matrix-output.vert
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
static float4 gl_Position;
|
||||
static float4x4 m;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4x4 m : TEXCOORD0;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = 1.0f.xxxx;
|
||||
m = float4x4(float4(1.0f, 0.0f, 0.0f, 0.0f), float4(0.0f, 1.0f, 0.0f, 0.0f), float4(0.0f, 0.0f, 1.0f, 0.0f), float4(0.0f, 0.0f, 0.0f, 1.0f));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.m = m;
|
||||
return stage_output;
|
||||
}
|
18
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/no-input.vert
vendored
Normal file
18
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/no-input.vert
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
static float4 gl_Position;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = 1.0f.xxxx;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
20
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/point-size-compat.vert
vendored
Normal file
20
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/point-size-compat.vert
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
static float4 gl_Position;
|
||||
static float gl_PointSize;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = 1.0f.xxxx;
|
||||
gl_PointSize = 10.0f;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
50
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/qualifiers.vert
vendored
Normal file
50
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/qualifiers.vert
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
static float4 gl_Position;
|
||||
static float vFlat;
|
||||
static float vCentroid;
|
||||
static float vSample;
|
||||
static float vNoperspective;
|
||||
|
||||
struct Block
|
||||
{
|
||||
nointerpolation float vFlat : TEXCOORD4;
|
||||
centroid float vCentroid : TEXCOORD5;
|
||||
sample float vSample : TEXCOORD6;
|
||||
noperspective float vNoperspective : TEXCOORD7;
|
||||
};
|
||||
|
||||
static Block vout;
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
nointerpolation float vFlat : TEXCOORD0;
|
||||
centroid float vCentroid : TEXCOORD1;
|
||||
sample float vSample : TEXCOORD2;
|
||||
noperspective float vNoperspective : TEXCOORD3;
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = 1.0f.xxxx;
|
||||
vFlat = 0.0f;
|
||||
vCentroid = 1.0f;
|
||||
vSample = 2.0f;
|
||||
vNoperspective = 3.0f;
|
||||
vout.vFlat = 0.0f;
|
||||
vout.vCentroid = 1.0f;
|
||||
vout.vSample = 2.0f;
|
||||
vout.vNoperspective = 3.0f;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(out Block stage_outputvout)
|
||||
{
|
||||
vert_main();
|
||||
stage_outputvout = vout;
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
stage_output.vFlat = vFlat;
|
||||
stage_output.vCentroid = vCentroid;
|
||||
stage_output.vSample = vSample;
|
||||
stage_output.vNoperspective = vNoperspective;
|
||||
return stage_output;
|
||||
}
|
22
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/sampler-buffers.vert
vendored
Normal file
22
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/sampler-buffers.vert
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Buffer<float4> uFloatSampler : register(t1);
|
||||
Buffer<int4> uIntSampler : register(t2);
|
||||
Buffer<uint4> uUintSampler : register(t3);
|
||||
|
||||
static float4 gl_Position;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = (uFloatSampler.Load(20) + asfloat(uIntSampler.Load(40))) + asfloat(uUintSampler.Load(60));
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
44
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/struct-composite-decl.vert
vendored
Normal file
44
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/struct-composite-decl.vert
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
struct VOut
|
||||
{
|
||||
float4 a;
|
||||
float4 b;
|
||||
float4 c;
|
||||
float4 d;
|
||||
};
|
||||
|
||||
static VOut vout;
|
||||
static float4 a;
|
||||
static float4 b;
|
||||
static float4 c;
|
||||
static float4 d;
|
||||
|
||||
struct SPIRV_Cross_Input
|
||||
{
|
||||
float4 a : TEXCOORD0;
|
||||
float4 b : TEXCOORD1;
|
||||
float4 c : TEXCOORD2;
|
||||
float4 d : TEXCOORD3;
|
||||
};
|
||||
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
VOut vout : TEXCOORD0;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
VOut _26 = { a, b, c, d };
|
||||
vout = _26;
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
||||
{
|
||||
a = stage_input.a;
|
||||
b = stage_input.b;
|
||||
c = stage_input.c;
|
||||
d = stage_input.d;
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.vout = vout;
|
||||
return stage_output;
|
||||
}
|
21
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/texture_buffer.vert
vendored
Normal file
21
deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/texture_buffer.vert
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
Buffer<float4> uSamp : register(t4);
|
||||
RWBuffer<float4> uSampo : register(u5);
|
||||
|
||||
static float4 gl_Position;
|
||||
struct SPIRV_Cross_Output
|
||||
{
|
||||
float4 gl_Position : SV_Position;
|
||||
};
|
||||
|
||||
void vert_main()
|
||||
{
|
||||
gl_Position = uSamp.Load(10) + uSampo[100];
|
||||
}
|
||||
|
||||
SPIRV_Cross_Output main()
|
||||
{
|
||||
vert_main();
|
||||
SPIRV_Cross_Output stage_output;
|
||||
stage_output.gl_Position = gl_Position;
|
||||
return stage_output;
|
||||
}
|
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_iadd.asm.comp
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_iadd.asm.comp
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _3
|
||||
{
|
||||
int4 _m0;
|
||||
uint4 _m1;
|
||||
};
|
||||
|
||||
struct _4
|
||||
{
|
||||
uint4 _m0;
|
||||
int4 _m1;
|
||||
};
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = _5._m1 + uint4(_5._m0);
|
||||
_6._m0 = uint4(_5._m0) + _5._m1;
|
||||
_6._m0 = _5._m1 + _5._m1;
|
||||
_6._m0 = uint4(_5._m0 + _5._m0);
|
||||
_6._m1 = int4(_5._m1 + _5._m1);
|
||||
_6._m1 = _5._m0 + _5._m0;
|
||||
_6._m1 = int4(_5._m1) + _5._m0;
|
||||
_6._m1 = _5._m0 + int4(_5._m1);
|
||||
}
|
||||
|
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sar.asm.comp
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sar.asm.comp
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _3
|
||||
{
|
||||
int4 _m0;
|
||||
uint4 _m1;
|
||||
};
|
||||
|
||||
struct _4
|
||||
{
|
||||
uint4 _m0;
|
||||
int4 _m1;
|
||||
};
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = uint4(int4(_5._m1) >> _5._m0);
|
||||
_6._m0 = uint4(_5._m0 >> int4(_5._m1));
|
||||
_6._m0 = uint4(int4(_5._m1) >> int4(_5._m1));
|
||||
_6._m0 = uint4(_5._m0 >> _5._m0);
|
||||
_6._m1 = int4(_5._m1) >> int4(_5._m1);
|
||||
_6._m1 = _5._m0 >> _5._m0;
|
||||
_6._m1 = int4(_5._m1) >> _5._m0;
|
||||
_6._m1 = _5._m0 >> int4(_5._m1);
|
||||
}
|
||||
|
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sdiv.asm.comp
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sdiv.asm.comp
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _3
|
||||
{
|
||||
int4 _m0;
|
||||
uint4 _m1;
|
||||
};
|
||||
|
||||
struct _4
|
||||
{
|
||||
uint4 _m0;
|
||||
int4 _m1;
|
||||
};
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = uint4(int4(_5._m1) / _5._m0);
|
||||
_6._m0 = uint4(_5._m0 / int4(_5._m1));
|
||||
_6._m0 = uint4(int4(_5._m1) / int4(_5._m1));
|
||||
_6._m0 = uint4(_5._m0 / _5._m0);
|
||||
_6._m1 = int4(_5._m1) / int4(_5._m1);
|
||||
_6._m1 = _5._m0 / _5._m0;
|
||||
_6._m1 = int4(_5._m1) / _5._m0;
|
||||
_6._m1 = _5._m0 / int4(_5._m1);
|
||||
}
|
||||
|
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_slr.asm.comp
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_slr.asm.comp
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _3
|
||||
{
|
||||
int4 _m0;
|
||||
uint4 _m1;
|
||||
};
|
||||
|
||||
struct _4
|
||||
{
|
||||
uint4 _m0;
|
||||
int4 _m1;
|
||||
};
|
||||
|
||||
kernel void main0(device _3& _5 [[buffer(0)]], device _4& _6 [[buffer(1)]])
|
||||
{
|
||||
_6._m0 = _5._m1 >> uint4(_5._m0);
|
||||
_6._m0 = uint4(_5._m0) >> _5._m1;
|
||||
_6._m0 = _5._m1 >> _5._m1;
|
||||
_6._m0 = uint4(_5._m0) >> uint4(_5._m0);
|
||||
_6._m1 = int4(_5._m1 >> _5._m1);
|
||||
_6._m1 = int4(uint4(_5._m0) >> uint4(_5._m0));
|
||||
_6._m1 = int4(_5._m1 >> uint4(_5._m0));
|
||||
_6._m1 = int4(uint4(_5._m0) >> _5._m1);
|
||||
}
|
||||
|
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/multiple-entry.asm.comp
vendored
Normal file
29
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/multiple-entry.asm.comp
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _6
|
||||
{
|
||||
int4 _m0;
|
||||
uint4 _m1;
|
||||
};
|
||||
|
||||
struct _7
|
||||
{
|
||||
uint4 _m0;
|
||||
int4 _m1;
|
||||
};
|
||||
|
||||
kernel void main0(device _6& _8 [[buffer(0)]], device _7& _9 [[buffer(1)]])
|
||||
{
|
||||
_9._m0 = _8._m1 + uint4(_8._m0);
|
||||
_9._m0 = uint4(_8._m0) + _8._m1;
|
||||
_9._m0 = _8._m1 + _8._m1;
|
||||
_9._m0 = uint4(_8._m0 + _8._m0);
|
||||
_9._m1 = int4(_8._m1 + _8._m1);
|
||||
_9._m1 = _8._m0 + _8._m0;
|
||||
_9._m1 = int4(_8._m1) + _8._m0;
|
||||
_9._m1 = _8._m0 + int4(_8._m1);
|
||||
}
|
||||
|
21
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/quantize.asm.comp
vendored
Normal file
21
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/quantize.asm.comp
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct SSBO0
|
||||
{
|
||||
float scalar;
|
||||
float2 vec2_val;
|
||||
float3 vec3_val;
|
||||
float4 vec4_val;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO0& _4 [[buffer(0)]])
|
||||
{
|
||||
_4.scalar = float(half(_4.scalar));
|
||||
_4.vec2_val = float2(half2(_4.vec2_val));
|
||||
_4.vec3_val = float3(half3(_4.vec3_val));
|
||||
_4.vec4_val = float4(half4(_4.vec4_val));
|
||||
}
|
||||
|
21
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/specialization-constant-workgroup.asm.comp
vendored
Normal file
21
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/specialization-constant-workgroup.asm.comp
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint _5_tmp [[function_constant(10)]];
|
||||
constant uint _5 = is_function_constant_defined(_5_tmp) ? _5_tmp : 9u;
|
||||
constant uint _6_tmp [[function_constant(12)]];
|
||||
constant uint _6 = is_function_constant_defined(_6_tmp) ? _6_tmp : 4u;
|
||||
constant uint3 gl_WorkGroupSize = uint3(_5, 20u, _6);
|
||||
|
||||
struct SSBO
|
||||
{
|
||||
float a;
|
||||
};
|
||||
|
||||
kernel void main0(device SSBO& _4 [[buffer(0)]])
|
||||
{
|
||||
_4.a += 1.0;
|
||||
}
|
||||
|
21
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.asm.comp
vendored
Normal file
21
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.asm.comp
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
constant uint _3_tmp [[function_constant(0)]];
|
||||
constant uint _3 = is_function_constant_defined(_3_tmp) ? _3_tmp : 1u;
|
||||
constant uint _4_tmp [[function_constant(2)]];
|
||||
constant uint _4 = is_function_constant_defined(_4_tmp) ? _4_tmp : 3u;
|
||||
constant uint3 gl_WorkGroupSize = uint3(_3, 2u, _4);
|
||||
|
||||
struct _6
|
||||
{
|
||||
float _m0[1];
|
||||
};
|
||||
|
||||
kernel void main0(uint3 gl_WorkGroupID [[threadgroup_position_in_grid]], device _6& _8 [[buffer(0)]], device _6& _9 [[buffer(1)]])
|
||||
{
|
||||
_8._m0[gl_WorkGroupID.x] = _9._m0[gl_WorkGroupID.x] + _8._m0[gl_WorkGroupID.x];
|
||||
}
|
||||
|
41
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/default-member-names.asm.frag
vendored
Normal file
41
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/default-member-names.asm.frag
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct _9
|
||||
{
|
||||
float _m0;
|
||||
};
|
||||
|
||||
struct _10
|
||||
{
|
||||
float _m0;
|
||||
float _m1;
|
||||
float _m2;
|
||||
float _m3;
|
||||
float _m4;
|
||||
float _m5;
|
||||
float _m6;
|
||||
float _m7;
|
||||
float _m8;
|
||||
float _m9;
|
||||
float _m10;
|
||||
float _m11;
|
||||
_9 _m12;
|
||||
};
|
||||
|
||||
constant _10 _51 = {};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 m_3 [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0()
|
||||
{
|
||||
main0_out out = {};
|
||||
out.m_3 = float4(_51._m0, _51._m1, _51._m2, _51._m3);
|
||||
return out;
|
||||
}
|
||||
|
235
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag
vendored
Normal file
235
deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag
vendored
Normal file
@ -0,0 +1,235 @@
|
||||
#include <metal_stdlib>
|
||||
#include <simd/simd.h>
|
||||
|
||||
using namespace metal;
|
||||
|
||||
struct VertexOutput
|
||||
{
|
||||
float4 HPosition;
|
||||
float4 Uv_EdgeDistance1;
|
||||
float4 UvStuds_EdgeDistance2;
|
||||
float4 Color;
|
||||
float4 LightPosition_Fog;
|
||||
float4 View_Depth;
|
||||
float4 Normal_SpecPower;
|
||||
float3 Tangent;
|
||||
float4 PosLightSpace_Reflectance;
|
||||
float studIndex;
|
||||
};
|
||||
|
||||
struct Surface
|
||||
{
|
||||
float3 albedo;
|
||||
float3 normal;
|
||||
float specular;
|
||||
float gloss;
|
||||
float reflectance;
|
||||
float opacity;
|
||||
};
|
||||
|
||||
struct SurfaceInput
|
||||
{
|
||||
float4 Color;
|
||||
float2 Uv;
|
||||
float2 UvStuds;
|
||||
};
|
||||
|
||||
struct Globals
|
||||
{
|
||||
float4x4 ViewProjection;
|
||||
float4 ViewRight;
|
||||
float4 ViewUp;
|
||||
float4 ViewDir;
|
||||
float3 CameraPosition;
|
||||
float3 AmbientColor;
|
||||
float3 Lamp0Color;
|
||||
float3 Lamp0Dir;
|
||||
float3 Lamp1Color;
|
||||
float4 FogParams;
|
||||
float3 FogColor;
|
||||
float4 LightBorder;
|
||||
float4 LightConfig0;
|
||||
float4 LightConfig1;
|
||||
float4 LightConfig2;
|
||||
float4 LightConfig3;
|
||||
float4 RefractionBias_FadeDistance_GlowFactor;
|
||||
float4 OutlineBrightness_ShadowInfo;
|
||||
float4 ShadowMatrix0;
|
||||
float4 ShadowMatrix1;
|
||||
float4 ShadowMatrix2;
|
||||
};
|
||||
|
||||
struct Params
|
||||
{
|
||||
float4 LqmatFarTilingFactor;
|
||||
};
|
||||
|
||||
struct CB0
|
||||
{
|
||||
Globals CB0;
|
||||
};
|
||||
|
||||
struct CB2
|
||||
{
|
||||
Params CB2;
|
||||
};
|
||||
|
||||
constant VertexOutput _121 = {};
|
||||
constant SurfaceInput _122 = {};
|
||||
constant float2 _123 = {};
|
||||
constant float4 _124 = {};
|
||||
constant Surface _125 = {};
|
||||
constant float4 _192 = {};
|
||||
constant float4 _219 = {};
|
||||
constant float4 _297 = {};
|
||||
|
||||
struct main0_in
|
||||
{
|
||||
float IN_studIndex [[user(locn8)]];
|
||||
float4 IN_PosLightSpace_Reflectance [[user(locn7)]];
|
||||
float3 IN_Tangent [[user(locn6)]];
|
||||
float4 IN_Normal_SpecPower [[user(locn5)]];
|
||||
float4 IN_View_Depth [[user(locn4)]];
|
||||
float4 IN_LightPosition_Fog [[user(locn3)]];
|
||||
float4 IN_Color [[user(locn2)]];
|
||||
float4 IN_UvStuds_EdgeDistance2 [[user(locn1)]];
|
||||
float4 IN_Uv_EdgeDistance1 [[user(locn0)]];
|
||||
};
|
||||
|
||||
struct main0_out
|
||||
{
|
||||
float4 _entryPointOutput [[color(0)]];
|
||||
};
|
||||
|
||||
fragment main0_out main0(main0_in in [[stage_in]], float4 gl_FragCoord [[position]], constant CB0& _19 [[buffer(0)]], texture3d<float> LightMapTexture [[texture(0)]], sampler LightMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], texture2d<float> ShadowMapTexture [[texture(1)]], texturecube<float> EnvironmentMapTexture [[texture(2)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], texture2d<float> DiffuseMapTexture [[texture(3)]], sampler NormalMapSampler [[sampler(4)]], texture2d<float> NormalMapTexture [[texture(4)]], texture2d<float> NormalDetailMapTexture [[texture(5)]], sampler NormalDetailMapSampler [[sampler(5)]], texture2d<float> StudsMapTexture [[texture(6)]], sampler StudsMapSampler [[sampler(6)]], sampler SpecularMapSampler [[sampler(7)]], texture2d<float> SpecularMapTexture [[texture(7)]])
|
||||
{
|
||||
main0_out out = {};
|
||||
VertexOutput _128 = _121;
|
||||
_128.HPosition = gl_FragCoord;
|
||||
VertexOutput _130 = _128;
|
||||
_130.Uv_EdgeDistance1 = in.IN_Uv_EdgeDistance1;
|
||||
VertexOutput _132 = _130;
|
||||
_132.UvStuds_EdgeDistance2 = in.IN_UvStuds_EdgeDistance2;
|
||||
VertexOutput _134 = _132;
|
||||
_134.Color = in.IN_Color;
|
||||
VertexOutput _136 = _134;
|
||||
_136.LightPosition_Fog = in.IN_LightPosition_Fog;
|
||||
VertexOutput _138 = _136;
|
||||
_138.View_Depth = in.IN_View_Depth;
|
||||
VertexOutput _140 = _138;
|
||||
_140.Normal_SpecPower = in.IN_Normal_SpecPower;
|
||||
VertexOutput _142 = _140;
|
||||
_142.Tangent = in.IN_Tangent;
|
||||
VertexOutput _144 = _142;
|
||||
_144.PosLightSpace_Reflectance = in.IN_PosLightSpace_Reflectance;
|
||||
VertexOutput _146 = _144;
|
||||
_146.studIndex = in.IN_studIndex;
|
||||
SurfaceInput _147 = _122;
|
||||
_147.Color = in.IN_Color;
|
||||
SurfaceInput _149 = _147;
|
||||
_149.Uv = in.IN_Uv_EdgeDistance1.xy;
|
||||
SurfaceInput _151 = _149;
|
||||
_151.UvStuds = in.IN_UvStuds_EdgeDistance2.xy;
|
||||
SurfaceInput _156 = _151;
|
||||
_156.UvStuds.y = (fract(_151.UvStuds.y) + in.IN_studIndex) * 0.25;
|
||||
float _163 = _146.View_Depth.w * _19.CB0.RefractionBias_FadeDistance_GlowFactor.y;
|
||||
float _165 = clamp(1.0 - _163, 0.0, 1.0);
|
||||
float2 _166 = in.IN_Uv_EdgeDistance1.xy * 1.0;
|
||||
bool _173;
|
||||
float4 _193;
|
||||
do
|
||||
{
|
||||
_173 = 0.0 == 0.0;
|
||||
if (_173)
|
||||
{
|
||||
_193 = DiffuseMapTexture.sample(DiffuseMapSampler, _166);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
float _180 = 1.0 / (1.0 - 0.0);
|
||||
_193 = mix(DiffuseMapTexture.sample(DiffuseMapSampler, (_166 * 0.25)), DiffuseMapTexture.sample(DiffuseMapSampler, _166), float4(clamp((clamp(1.0 - (_146.View_Depth.w * 0.00333332992158830165863037109375), 0.0, 1.0) * _180) - (0.0 * _180), 0.0, 1.0)));
|
||||
break;
|
||||
}
|
||||
_193 = _192;
|
||||
break;
|
||||
} while (false);
|
||||
float4 _220;
|
||||
do
|
||||
{
|
||||
if (_173)
|
||||
{
|
||||
_220 = NormalMapTexture.sample(NormalMapSampler, _166);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
float _207 = 1.0 / (1.0 - 0.0);
|
||||
_220 = mix(NormalMapTexture.sample(NormalMapSampler, (_166 * 0.25)), NormalMapTexture.sample(NormalMapSampler, _166), float4(clamp((_165 * _207) - (0.0 * _207), 0.0, 1.0)));
|
||||
break;
|
||||
}
|
||||
_220 = _219;
|
||||
break;
|
||||
} while (false);
|
||||
float2 _223 = float2(1.0);
|
||||
float2 _224 = (_220.wy * 2.0) - _223;
|
||||
float3 _232 = float3(_224, sqrt(clamp(1.0 + dot(-_224, _224), 0.0, 1.0)));
|
||||
float2 _240 = (NormalDetailMapTexture.sample(NormalDetailMapSampler, (_166 * 0.0)).wy * 2.0) - _223;
|
||||
float2 _252 = _232.xy + (float3(_240, sqrt(clamp(1.0 + dot(-_240, _240), 0.0, 1.0))).xy * 0.0);
|
||||
float3 _253 = float3(_252.x, _252.y, _232.z);
|
||||
float2 _255 = _253.xy * _165;
|
||||
float3 _256 = float3(_255.x, _255.y, _253.z);
|
||||
float3 _271 = ((in.IN_Color.xyz * (_193 * 1.0).xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (StudsMapTexture.sample(StudsMapSampler, _156.UvStuds).x * 2.0);
|
||||
float4 _298;
|
||||
do
|
||||
{
|
||||
if (0.75 == 0.0)
|
||||
{
|
||||
_298 = SpecularMapTexture.sample(SpecularMapSampler, _166);
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
float _285 = 1.0 / (1.0 - 0.75);
|
||||
_298 = mix(SpecularMapTexture.sample(SpecularMapSampler, (_166 * 0.25)), SpecularMapTexture.sample(SpecularMapSampler, _166), float4(clamp((_165 * _285) - (0.75 * _285), 0.0, 1.0)));
|
||||
break;
|
||||
}
|
||||
_298 = _297;
|
||||
break;
|
||||
} while (false);
|
||||
float2 _303 = mix(float2(0.800000011920928955078125, 120.0), (_298.xy * float2(2.0, 256.0)) + float2(0.0, 0.00999999977648258209228515625), float2(_165));
|
||||
Surface _304 = _125;
|
||||
_304.albedo = _271;
|
||||
Surface _305 = _304;
|
||||
_305.normal = _256;
|
||||
float _306 = _303.x;
|
||||
Surface _307 = _305;
|
||||
_307.specular = _306;
|
||||
float _308 = _303.y;
|
||||
Surface _309 = _307;
|
||||
_309.gloss = _308;
|
||||
float _312 = (_298.xy.y * _165) * 0.0;
|
||||
Surface _313 = _309;
|
||||
_313.reflectance = _312;
|
||||
float4 _318 = float4(_271, _146.Color.w);
|
||||
float3 _329 = normalize(((in.IN_Tangent * _313.normal.x) + (cross(in.IN_Normal_SpecPower.xyz, in.IN_Tangent) * _313.normal.y)) + (in.IN_Normal_SpecPower.xyz * _313.normal.z));
|
||||
float3 _332 = -_19.CB0.Lamp0Dir;
|
||||
float _333 = dot(_329, _332);
|
||||
float _357 = clamp(dot(step(_19.CB0.LightConfig3.xyz, abs(in.IN_LightPosition_Fog.xyz - _19.CB0.LightConfig2.xyz)), float3(1.0)), 0.0, 1.0);
|
||||
float4 _368 = mix(LightMapTexture.sample(LightMapSampler, (in.IN_LightPosition_Fog.xyz.yzx - (in.IN_LightPosition_Fog.xyz.yzx * _357))), _19.CB0.LightBorder, float4(_357));
|
||||
float2 _376 = ShadowMapTexture.sample(ShadowMapSampler, in.IN_PosLightSpace_Reflectance.xyz.xy).xy;
|
||||
float _392 = (1.0 - (((step(_376.x, in.IN_PosLightSpace_Reflectance.xyz.z) * clamp(9.0 - (20.0 * abs(in.IN_PosLightSpace_Reflectance.xyz.z - 0.5)), 0.0, 1.0)) * _376.y) * _19.CB0.OutlineBrightness_ShadowInfo.w)) * _368.w;
|
||||
float3 _403 = mix(_318.xyz, EnvironmentMapTexture.sample(EnvironmentMapSampler, reflect(-in.IN_View_Depth.xyz, _329)).xyz, float3(_312));
|
||||
float4 _404 = float4(_403.x, _403.y, _403.z, _318.w);
|
||||
float3 _422 = (((_19.CB0.AmbientColor + (((_19.CB0.Lamp0Color * clamp(_333, 0.0, 1.0)) + (_19.CB0.Lamp1Color * max(-_333, 0.0))) * _392)) + _368.xyz) * _404.xyz) + (_19.CB0.Lamp0Color * (((step(0.0, _333) * _306) * _392) * pow(clamp(dot(_329, normalize(_332 + normalize(in.IN_View_Depth.xyz))), 0.0, 1.0), _308)));
|
||||
float4 _425 = float4(_422.x, _422.y, _422.z, _124.w);
|
||||
_425.w = _404.w;
|
||||
float2 _435 = min(in.IN_Uv_EdgeDistance1.wz, in.IN_UvStuds_EdgeDistance2.wz);
|
||||
float _439 = min(_435.x, _435.y) / _163;
|
||||
float3 _445 = _425.xyz * clamp((clamp((_163 * _19.CB0.OutlineBrightness_ShadowInfo.x) + _19.CB0.OutlineBrightness_ShadowInfo.y, 0.0, 1.0) * (1.5 - _439)) + _439, 0.0, 1.0);
|
||||
float4 _446 = float4(_445.x, _445.y, _445.z, _425.w);
|
||||
float3 _453 = mix(_19.CB0.FogColor, _446.xyz, float3(clamp(_146.LightPosition_Fog.w, 0.0, 1.0)));
|
||||
out._entryPointOutput = float4(_453.x, _453.y, _453.z, _446.w);
|
||||
return out;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user