diff --git a/.gitignore b/.gitignore index 89426b7bff..bc65d666b0 100644 --- a/.gitignore +++ b/.gitignore @@ -68,6 +68,10 @@ menu/driverspzarch.c .pc /media/shaders_glsl/ /obj-w32/ +.cproject +.settings +libretro-super +run.sh # Wii U *.depend diff --git a/.project b/.project index 871dee54b0..b5f91e201f 100644 --- a/.project +++ b/.project @@ -5,7 +5,23 @@ + + org.eclipse.cdt.managedbuilder.core.genmakebuilder + clean,full,incremental, + + + + + org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder + full,incremental, + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + org.eclipse.cdt.managedbuilder.core.managedBuildNature + org.eclipse.cdt.managedbuilder.core.ScannerConfigNature diff --git a/.travis.yml b/.travis.yml index e950b2c19b..5fa1900042 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ matrix: - g++-mingw-w64-i686 - mingw-w64-i686-dev script: - - CROSS_COMPILE=i686-w64-mingw32- ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 && make HAVE_ZLIB=1 HAVE_BUILTINZLIB=1 HAVE_RPNG=1 + - CROSS_COMPILE=i686-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501" ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 && make HAVE_ZLIB=1 HAVE_BUILTINZLIB=1 HAVE_RPNG=1 - compiler: mingw-x64 addons: apt: @@ -18,7 +18,7 @@ matrix: - g++-mingw-w64-x86-64 - mingw-w64-x86-64-dev script: - - CROSS_COMPILE=x86_64-w64-mingw32- ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 && make HAVE_ZLIB=1 HAVE_BUILTINZLIB=1 HAVE_RPNG=1 + - CROSS_COMPILE=x86_64-w64-mingw32- CFLAGS="-D_WIN32_WINNT=0x0501" ./configure --disable-d3d8 --disable-d3d9 --disable-d3d10 --disable-d3d11 --disable-d3d12 && make HAVE_ZLIB=1 HAVE_BUILTINZLIB=1 HAVE_RPNG=1 - compiler: gcc - compiler: clang addons: @@ -64,3 +64,5 @@ addons: build_command_prepend: "./configure; make clean" build_command: "make" branch_pattern: coverity_scan +notifications: + email: false diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 561af49173..2e6b11d97a 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -22,10 +22,7 @@ "macFrameworkPath": [ "/System/Library/Frameworks", "/Library/Frameworks" - ], - "compilerPath": "/usr/bin/clang", - "cStandard": "c11", - "cppStandard": "c++17" + ] }, { "name": "Linux", @@ -70,7 +67,9 @@ ], "limitSymbolsToIncludedHeaders": true, "databaseFilename": "" - } + }, + "cStandard": "c11", + "cppStandard": "c++17" }, { "name": "msys2-mingw32", @@ -125,5 +124,5 @@ } } ], - "version": 3 + "version": 4 } \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json index 6e1f69631a..e7552247cc 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,44 +5,41 @@ "version": "0.2.0", "configurations": [ { - "name": "msys2-mingw64 debug", + "name": "(gdb) Launch", "type": "cppdbg", "request": "launch", "program": "${workspaceFolder}/retroarch.exe", - "args": [], + "args": ["-v"], "stopAtEntry": false, "cwd": "${workspaceFolder}", "environment": [], - "externalConsole": true, + "externalConsole": false, "MIMode": "gdb", "miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe", "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } ] }, - { - "name": "msys2-mingw32 debug", + { + "name": "(gdb) Attach", "type": "cppdbg", - "request": "launch", + "request": "attach", "program": "${workspaceFolder}/retroarch.exe", - "args": [], - "stopAtEntry": false, - "cwd": "${workspaceFolder}", - "environment": [], - "externalConsole": true, + "processId": "${command:pickProcess}", "MIMode": "gdb", - "miDebuggerPath": "c:\\msys64\\mingw32\\bin\\gdb.exe", + "miDebuggerPath": "c:\\msys64\\mingw64\\bin\\gdb.exe", "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } ] - } + }, + ] } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index e90ca77e4a..345f8a0f8e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -12,6 +12,8 @@ "files.associations": { "frontend_driver.h": "c", "*.in": "c", - "*.rh": "c" + "*.rh": "c", + "array": "c", }, + "C_Cpp.dimInactiveRegions": false, } \ No newline at end of file diff --git a/CHANGES.md b/CHANGES.md index 400723e915..c9ed1b06de 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,28 +1,114 @@ -# 1.7.2 (future) +# 1.7.4 (future) +- ANDROID: Add sustained performance mode, can be turned on/off in Power Management settings menu. +- ANDROID: Powerstate/battery level support. +- CHEEVOS: Fix crash when scrolling Achievement List while Unofficial Achievements enabled (#6732). +- CHEEVOS: Added hitcounts support for PauseIf/ResetIf (#6817). +- COMMON: Automatically hide "Configuration Override options" in Quick Menu. +- COMMON: Small Bugfix to not trigger savestate code when pressing Reset. +- COMMON: Added libsixel video driver. +- EMSCRIPTEN: Fix Game Focus Toggle. +- HID/OSX: Fix to set hid device registration deterministic (#6497), to address issue #6640 re-adding dynamic device registration. +- LOCALIZATION: Update Italian translation. +- LOCALIZATION: Update Japanese translation. +- LOCALIZATION: Update Polish translation. +- LOCALIZATION: Update Portuguese / Brazilian translation. +- LOCALIZATION: Update Russian translation. +- LOCALIZATION: Update Spanish translation. +- MIDI: Add MIDI support to the libretro API. Dosbox is the first proof of concept core implementing libretro MIDI. +- MIDI: Add a Windows driver for MIDI, based on winmm. +- MENU/QT/WIMP: QT QSlider styling for Dark Theme. +- MENU/QT/WIMP: Remove button ghostly inside highlighting. +- METAL: Initial work-in-progress video driver for Metal. macOS-only right now, and currently requires macOS 10.13. +- METAL: Supports XMB/MaterialUI, has a menu display driver. Has a font rendering driver. +- METAL/SLANG: Slang shaders should be compatible with Metal video driver. +- QNX: Fix Game Focus Toggle. +- PS3: Add audio mixer support for FLAC and MP3. +- PSP: Use proper button labels, fix inverted R-Stick Y axis. +- REMAPS: Fix the way offsets are calculated for keyboard remapping. +- RUNAHEAD: Fix full-screen mode change breaking Secondary Core's environment variables. +- VITA: Use proper button labels, fix inverted R-Stick Y axis. +- VULKAN: Fix two validation errors. +- VULKAN: Try to avoid creating swapchains redundantly. Should fix black screen and having to alt tab out of window again to get display working on Nvidia GPUs (Windows). +- VULKAN/OSX: Initial MoltenVK support. Not enabled yet, several MoltenVK bugs should be fixed first before we can have it fully working. +- WINDOWS/DINPUT: Add rumble support. +- WINDOWS/DINPUT: Fix Game Focus Toggle. +- WINDOWS/RAWINPUT: Fix Game Focus Toggle. +- X11: Fix Game Focus Toggle. +- WII: Change deflicker setting to work in 480p or higher, and always enables vfilter so that the user can easily change brightness. +- WIIU: Fix out-of-bounds rendering bug +- WIIU: Implement UDP broadcast network logging on Wii U. +- WIIU: Audio should no longer clip. + +# 1.7.3 +- AUDIO: Audio mixer supports FLAC/MP3 file types now! +- COMMON: Fixed bug 'crashing in cores that don't range check retro_set_controller_type'. Some people were having crashes when device is set to RETRO_DEVICE_NONE and the cores don't check the number of ports, in VBAM's case it was overflowing and crashing. QuickNES was crashing too. +- COMMON: Fixed buffer overflow in url encoding (affecting MSVC2010/2013). +- COMMON: (QuickMenu) Added Configuration Override submenu. +- HID: Merge new HID subsystem. +- HID: Fix WaveBird support for the Wii U GCA. +- HID/OSX: Fix regression with IODHIDManager - gamepads which are connected later would not be autoconfigured. +- LOCALIZATION: Update Italian translation. +- LOCALIZATION: Update Japanese translation. +- LOCALIZATION: Update Portuguese translation. +- MENU: New WIMP Qt GUI! +- MENU: Audio mixer now works in the menu without any cores loaded. You have to enable the setting 'Enable menu audio' for this to work. +- REMAPPING/OVERLAYS: Fix regression - overlays could no longer be remapped. +- SCANNER: Add Wii Backup File WBFS support. +- X11: CRT SwitchRes support for X11/Linux. + +# 1.7.2 - ANDROID/OPENSL: Prevent crashes when setting audio latency too low (buffer count can never be lower than 2 now). +- CRT: Added CRT SwitchRes. +- COMMON: Hide the 'Core delete' option if the 'Core updater' is also hidden. - COMMON: Add way to reset core association for playlist entry. - COMMON: Fix invalid long command line options causing infinite loop on Windows - COMMON: Add OSD statistics for video/audio/core. - COMMON: Added runahead system; allows you to drive down latency even further. +- COMMON: Fix buggy behavior that could happen with ZIP file reading on some platforms as a result of not initializing struct. - CHEEVOS: Support Atari 2600, Virtual Boy, and Arcade (only Neo Geo, CPS-1, CPS-2 and CPS-3 and only with fbalpha core). - CHEEVOS: Add option to automatically take a screenshot when an achievement is triggered. -- D3D11: Experimental hardware renderer. Allows for libretro cores to use D3D11 for hardware rendering. -- D3D11/D3D12: Fix crashes with completely black or white thumbnail textures in XMB. +- CHEEVOS: Fixed incompatibilities with Neo Geo Pocket achievement sets. +- CHEEVOS: Store only login token, not password. +- D3D10: Added D3D10 driver to release build. Has working shaders (Slang), overlay, and menu display driver support. Should be on par capabilities wise +with D3D11 driver except for there being no hardware rendering right now. +- D3D11: Experimental hardware renderer. Allows for libretro cores to use D3D11 for hardware rendering. First core to use this is PPSSPP. +- D3D11: Increase backwards compatibility, shaders compile with Shader Model 4.0 now, added support for more feature levels. +- D3D10/D3D11/D3D12: Fix crashes with completely black or white thumbnail textures in XMB. +- GUI: Support disabling window decorations on Windows and Linux. - LIBRETRO: Addition - Functions to enable and disable audio and video, and an environment function to query status of audio and video enables. - LOCALIZATION: Update Italian translation. - LOCALIZATION: Update Polish translation. -- MENU: Disable XMB shadow icons by default for PowerPC and ARM for performance reasons. +- MENU: Add Rewind/Latency/Overlay settings to Quick Menu, add options to show/hide them (User Interface -> Views -> Quick Menu) +- MENU/RGUI: Only show Menu Linear Filter for RGUI and only show it for +video drivers that implement it (D3D8/9/10/11/12/GL) +- MENU/RGUI: Add User Interface -> Appearance options. +- MENU/RGUI: D3D8/D3D9: Hookup Menu Linear Filter +- MENU/XMB: Disable XMB shadow icons by default for PowerPC and ARM for performance reasons. - MENU/XMB: Left/right thumbnails are now automatically scaled according to layout. - MENU/XMB: Add Left Thumbnails (additional to the right). - MENU/XMB: Fixed left/right tab regression. - MENU/XMB: Fix scaling of tall images that were cut on bottom previously. - MENU/XMB: Menu scale factor setting now changes texts length, image scaling and margins. - MENU/XMB: Mouse cursor scales correctly now. +- MENU/XMB: Add toggle to show/hide Playlist tabs. +- MENU/XMB: Add menu layout - can switch between Desktop, Handheld and Auto. +- MENU/XMB: Don't load menu pipeline shaders unless XMB is selected (D3D10/D3D11/D3D12/GL/Vulkan) +- MENU/VIDEO: Only show black frame insertion for the video drivers/context drivers +that support it (so far this includes - D3D8/D3D9, OpenGL, Vulkan) +- MENU/VIDEO: Only show max swapchain images if supported by video driver and/or context driver (so far this includes - DRM EGL context driver, VideoCore EGL context driver, Vulkan) - MENU/MaterialUI: Automatic DPI Scaling should be much improved now, now scales as expected at 1440p and 4K resolutions. - MENU/MaterialUI: Fix wrong calculation of an entry height causing long playlists to end up outside of screen range. This also could cause crashes on low DPI screens. - IOS: Fixed crash when opening downloaded roms from Safari or using the "Open in.." functionality. Added the compiler flag to support keyboard remapping to controls. - IOS: Fixed buffer overlap that caused a crash while trying to download GLSL shaders from the buildbot. - PS3: fix URLS +- REMAPS: Mapping keyboard keys from more than one gamepad (works with dosbox) +- REMAPS: Mapping more than one button to the same action +- REMAPS: Unmapping buttons +- REMAPS: Unmapping analogs +- REMAPS: Mapping a button to trigger an analog response (tested with mupen, can run on SM64 with the d-pad now, triggers a full analog tilt) +- REMAPS: Mapping an analog to another analog (having more than one analog mapped to the same output causes issues) +- REMAPS: Mapping an analog to produce a button response +- SCANNER: Should be able to scan dual-layer Wii disc images now, filestream code now supports files larger than 4GB. - SHADERS/SLANG: Slang shaders should work again on Android version and MSVC versions (basically all the Griffin-based versions). - SHADERS: If GL context is GLES2/3/Core context, Cg shaders are unavailable. Applies to shader list too. - SHADERS: Hide cg/glsl shaders from being able to be selected if D3D8/9/10/11/Vulkan video drivers are selected. @@ -36,7 +122,7 @@ - WINDOWS/MSVC 2003/2005/2010/2013/2015/2017: Add Cheevos support. - VITA: Bugfix for 'PS Vita takes many time to start to accept input' issue. - X11: Allow compositor disabling on X11 fullscreen through _NET_WM_BYPASS_COMPOSITOR -- X11: Prioritize _NET_WM_STATE_FULLSCREEN in true fullscreen mode +- X11: Prioritize _NET_WM_STATE_FULLSCREEN_ in true fullscreen mode - WIIU: Fix OOB read/write in keyboard driver. # 1.7.1 diff --git a/Makefile b/Makefile index a9e72cb4b7..7e66bdb181 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ endif include Makefile.common ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang"),1) - DEFINES += -Wno-invalid-source-encoding + DEFINES += -Wno-invalid-source-encoding -Wno-incompatible-ms-struct endif ifeq ($(shell $(CC) -v 2>&1 | grep -c "tcc"),1) @@ -92,21 +92,22 @@ APPEND_CFLAGS := $(CFLAGS) CXXFLAGS += $(APPEND_CFLAGS) -std=c++11 -D__STDC_CONSTANT_MACROS OBJCFLAGS := $(CFLAGS) -D__STDC_CONSTANT_MACROS -ifeq ($(CXX_BUILD), 1) - LINK = $(CXX) - CFLAGS := $(CXXFLAGS) -xc++ - CFLAGS += -DCXX_BUILD - CXXFLAGS += -DCXX_BUILD -else - ifeq ($(NEED_CXX_LINKER),1) +ifeq ($(HAVE_CXX), 1) + ifeq ($(CXX_BUILD), 1) + LINK = $(CXX) + CFLAGS := $(CXXFLAGS) -xc++ + CFLAGS += -DCXX_BUILD + CXXFLAGS += -DCXX_BUILD + else ifeq ($(NEED_CXX_LINKER),1) LINK = $(CXX) - else ifeq ($(findstring Win32,$(OS)),) - LINK = $(CC) else - # directx-related code is c++ - LINK = $(CXX) + LINK = $(CC) endif +else + LINK = $(CC) +endif +ifneq ($(CXX_BUILD), 1) ifneq ($(GNU90_BUILD), 1) ifneq ($(findstring icc,$(CC)),) CFLAGS += -std=c99 -D_GNU_SOURCE @@ -133,7 +134,7 @@ RARCH_OBJ := $(addprefix $(OBJDIR)/,$(OBJ)) ifneq ($(X86),) CFLAGS += -m32 - CXXLAGS += -m32 + CXXFLAGS += -m32 LDFLAGS += -m32 endif @@ -150,8 +151,29 @@ ifneq ($(findstring $(GPERFTOOLS),tcmalloc),) LIBS += -ltcmalloc endif +# Qt MOC generation, required for QObject-derived classes +ifneq ($(MOC_HEADERS),) + # prefix moc_ to base filename of paths and change extension from h to cpp, so a/b/foo.h becomes a/b/moc_foo.cpp + MOC_SRC := $(join $(addsuffix moc_,$(addprefix $(OBJDIR)/,$(dir $(MOC_HEADERS)))), $(notdir $(MOC_HEADERS:.h=.cpp))) + MOC_OBJ := $(patsubst %.cpp,%.o,$(MOC_SRC)) + RARCH_OBJ += $(MOC_OBJ) +endif + all: $(TARGET) config.mk +$(MOC_SRC): + @$(if $(Q), $(shell echo echo MOC $<),) + $(eval MOC_TMP := $(patsubst %.h,%_moc.cpp,$@)) + $(Q)$(MOC) -o $(MOC_TMP) $< + +$(foreach x,$(join $(addsuffix :,$(MOC_SRC)),$(MOC_HEADERS)),$(eval $x)) + +$(MOC_OBJ): + @$(if $(Q), $(shell echo echo CXX $<),) + $(Q)$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEFINES) -MMD -c -o $@ $< + +$(foreach x,$(join $(addsuffix :,$(MOC_OBJ)),$(MOC_SRC)),$(eval $x)) + ifeq ($(MAKECMDGOALS),clean) config.mk: else @@ -250,3 +272,6 @@ clean: rm -f *.d .PHONY: all install uninstall clean + +print-%: + @echo '$*=$($*)' diff --git a/Makefile.common b/Makefile.common index 7163289e68..5710d4012f 100644 --- a/Makefile.common +++ b/Makefile.common @@ -147,6 +147,8 @@ ifneq ($(GIT_VERSION),) endif # General object files +DEFINES += -DHAVE_DR_MP3 +CFLAGS += -DHAVE_DR_MP3 OBJ += frontend/frontend.o \ frontend/frontend_driver.o \ @@ -198,12 +200,15 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/hash/rhash.o \ audio/audio_driver.o \ $(LIBRETRO_COMM_DIR)/audio/audio_mixer.o \ + input/common/input_common.o \ input/input_driver.o \ + input/input_mapper.o \ led/led_driver.o \ led/drivers/led_null.o \ gfx/video_coord_array.o \ gfx/video_display_server.o \ gfx/video_driver.o \ + gfx/video_crt_switch.o \ camera/camera_driver.o \ wifi/wifi_driver.o \ location/location_driver.o \ @@ -259,6 +264,8 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/features/features_cpu.o \ performance_counters.o \ verbosity.o \ + midi/midi_driver.o \ + midi/drivers/null_midi.o ifeq ($(HAVE_RUNAHEAD), 1) DEFINES += -DHAVE_RUNAHEAD @@ -319,23 +326,27 @@ DEFINES += -DHAVE_IMAGEVIEWER OBJ += cores/libretro-imageviewer/image_core.o endif -# Qt - -ifeq ($(HAVE_QT_WRAPPER), 1) -OBJ += ui/drivers/ui_qt.o -LIBS += -lQt5Quick -lQt5Widgets -lQt5Gui -lQt5Qml -lQt5Network -lQt5Core -L./ui/drivers/qt/build/release/ -LIBS += -lwrapper -endif +# Qt WIMP GUI ifeq ($(HAVE_QT), 1) OBJ += ui/drivers/ui_qt.o \ ui/drivers/qt/ui_qt_application.o \ ui/drivers/qt/ui_qt_window.o \ ui/drivers/qt/ui_qt_browser_window.o \ + ui/drivers/qt/ui_qt_load_core_window.o \ ui/drivers/qt/ui_qt_msg_window.o +MOC_HEADERS += ui/drivers/ui_qt.h \ + ui/drivers/qt/ui_qt_load_core_window.h + +DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) -DHAVE_MAIN +#DEFINES += $(QT5WEBENGINE_CFLAGS) +LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) +#LIBS += $(QT5WEBENGINE_LIBS) +NEED_CXX_LINKER = 1 + ifneq ($(findstring Linux,$(OS)),) -DEFINES += -I/usr/include/qt -fPIC +DEFINES += -fPIC endif endif @@ -677,6 +688,12 @@ ifeq ($(HAVE_XAUDIO), 1) LIBS += -lole32 endif +ifeq ($(HAVE_WINMM), 1) + OBJ += midi/drivers/winmm_midi.o + DEFINES += -DHAVE_WINMM + LIBS += -lwinmm +endif + # Audio Resamplers ifeq ($(HAVE_NEON),1) @@ -1038,15 +1055,24 @@ ifeq ($(HAVE_CACA), 1) endif endif +ifeq ($(HAVE_SIXEL), 1) + DEFINES += -DHAVE_SIXEL + CFLAGS += -I/usr/include/sixel + OBJ += gfx/drivers/sixel_gfx.o gfx/drivers_font/sixel_font.o \ + gfx/drivers_context/sixel_ctx.o + LIBS += -lsixel + + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_sixel.o + endif +endif + ifeq ($(HAVE_PLAIN_DRM), 1) OBJ += gfx/drivers/drm_gfx.o CFLAGS += -I/usr/include/libdrm LIBS += -ldrm endif -OBJ += \ - gfx/drivers_renderchain/null_renderchain.o - ifeq ($(HAVE_GL_CONTEXT), 1) DEFINES += -DHAVE_OPENGL -DHAVE_GLSL OBJ += gfx/drivers/gl.o \ @@ -1098,11 +1124,30 @@ ifneq ($(C89_BUILD), 1) ifneq ($(HAVE_OPENGLES), 1) OBJ += cores/libretro-ffmpeg/ffmpeg_fft.o DEFINES += -I$(DEPS_DIR) -DHAVE_GL_FFT - NEED_CXX_LINKER=1 endif endif endif +ifeq ($(HAVE_METAL), 1) + DEFINES += -DHAVE_METAL + OBJ += gfx/common/metal/Context.o \ + gfx/common/metal/Filter.o \ + gfx/common/metal/RendererCommon.o \ + gfx/common/metal/View.o \ + gfx/common/metal/TexturedView.o \ + gfx/common/metal/MenuDisplay.o \ + gfx/common/metal_common.o \ + gfx/drivers/metal.o \ + menu/drivers_display/menu_display_metal.o \ + gfx/drivers_font/metal_raster_font.o +endif + +ifeq ($(HAVE_MPV), 1) + OBJ += cores/libretro-mpv/mpv-libretro.o + DEFINES += -I$(DEPS_DIR) -DHAVE_MPV + LIBS += -lmpv +endif + ifeq ($(HAVE_OPENGLES), 1) LIBS += $(OPENGLES_LIBS) DEFINES += $(OPENGLES_CFLAGS) -DHAVE_OPENGLES @@ -1194,7 +1239,7 @@ ifeq ($(HAVE_VULKAN), 1) ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/drivers_display/menu_display_vulkan.o endif - LIBS += -lstdc++ + NEED_CXX_LINKER = 1 DEFINES += -DHAVE_VULKAN INCLUDE_DIRS += -Igfx/include @@ -1269,14 +1314,15 @@ endif endif ifeq ($(HAVE_HLSL), 1) - OBJ += gfx/drivers_renderchain/d3d9_hlsl_renderchain.o \ - gfx/drivers_shader/shader_hlsl.o + OBJ += gfx/drivers_renderchain/d3d9_hlsl_renderchain.o endif endif ifeq ($(HAVE_D3D10), 1) OBJ += gfx/drivers/d3d10.o \ - gfx/common/d3d10_common.o + gfx/common/d3d10_common.o \ + gfx/drivers_font/d3d10_font.o \ + menu/drivers_display/menu_display_d3d10.o DEFINES += -DHAVE_D3D10 endif @@ -1383,9 +1429,14 @@ ifeq ($(HAVE_GLSLANG), 1) $(wildcard $(DEPS_DIR)/glslang/glslang/OGLCompilersDLL/*.cpp) \ $(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/*.cpp) \ $(wildcard $(DEPS_DIR)/glslang/glslang/glslang/MachineIndependent/preprocessor/*.cpp) \ - $(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp) \ $(wildcard $(DEPS_DIR)/glslang/glslang/glslang/OSDependent/$(GLSLANG_PLATFORM)/*.cpp) +ifneq ($(findstring Win32,$(OS)),) +DEFINES += -DENABLE_HLSL +GLSLANG_SOURCES += $(wildcard $(DEPS_DIR)/glslang/glslang/hlsl/*.cpp) +endif + + OBJ += $(GLSLANG_SOURCES:.cpp=.o) endif @@ -1446,6 +1497,8 @@ endif ifeq ($(HAVE_BUILTINFLAC),1) HAVE_FLAC = 1 + DEFINES += -DHAVE_DR_FLAC -I$(DEPS_DIR) + CFLAGS += -DHAVE_DR_FLAC CFLAGS += -DHAVE_FLAC -I$(DEPS_DIR)/libFLAC/include DEFINES += -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 \ -DFLAC_PACKAGE_VERSION="\"retroarch\"" @@ -1472,7 +1525,8 @@ ifeq ($(HAVE_BUILTINFLAC),1) endif OBJ += $(FLACOBJ) else ifeq ($(HAVE_FLAC),1) - LIBS += $(FLAC_LIBS) + DEFINES += -DHAVE_FLAC + LIBS += $(FLAC_LIBS) endif ifeq ($(HAVE_ZLIB), 1) @@ -1483,7 +1537,7 @@ ifeq ($(HAVE_ZLIB), 1) ifeq ($(HAVE_BUILTINZLIB), 1) OBJ += $(DEPS_DIR)/libz/adler32.o \ $(DEPS_DIR)/libz/compress.o \ - $(DEPS_DIR)/libz/crc32.o \ + $(DEPS_DIR)/libz/libz-crc32.o \ $(DEPS_DIR)/libz/deflate.o \ $(DEPS_DIR)/libz/gzclose.o \ $(DEPS_DIR)/libz/gzlib.o \ @@ -1502,19 +1556,27 @@ ifeq ($(HAVE_ZLIB), 1) endif endif -ifeq ($(HAVE_FLAC), 1) -ifeq ($(HAVE_7ZIP), 1) -ifeq ($(HAVE_ZLIB), 1) - DEFINES += -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR +ifeq ($(HAVE_CHD), 1) CFLAGS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr - OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/bitstream.o \ - $(LIBRETRO_COMM_DIR)/formats/libchdr/cdrom.o \ - $(LIBRETRO_COMM_DIR)/formats/libchdr/chd.o \ - $(LIBRETRO_COMM_DIR)/formats/libchdr/flac.o \ - $(LIBRETRO_COMM_DIR)/formats/libchdr/huffman.o \ + DEFINES += -DHAVE_CHD -DWANT_SUBCODE -DWANT_RAW_DATA_SECTOR + OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_bitstream.o \ + $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_cdrom.o \ + $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_chd.o \ + $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_huffman.o \ $(LIBRETRO_COMM_DIR)/streams/chd_stream.o -endif -endif + + ifeq ($(HAVE_FLAC), 1) + OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac.o \ + $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_flac_codec.o + endif + + ifeq ($(HAVE_7ZIP), 1) + OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_lzma.o + endif + + ifeq ($(HAVE_ZLIB), 1) + OBJ += $(LIBRETRO_COMM_DIR)/formats/libchdr/libchdr_zlib.o + endif endif ifeq ($(HAVE_RTGA), 1) @@ -1616,8 +1678,27 @@ ifeq ($(HAVE_NETWORKING), 1) $(LIBRETRO_COMM_DIR)/utils/md5.o endif - ifeq ($(HAVE_KEYMAPPER), 1) - OBJ += input/input_mapper.o + ifeq ($(HAVE_DISCORD), 1) + DEFINES += -DHAVE_DISCORD + DEFINES += -Ideps/discord-rpc/include/ -Ideps/discord-rpc/thirdparty/rapidjson-1.1.0/include/ + OBJ += deps/discord-rpc/src/discord_rpc.o \ + deps/discord-rpc/src/rpc_connection.o \ + deps/discord-rpc/src/serialization.o \ + discord/discord.o +ifneq ($(findstring Win32,$(OS)),) + OBJ += deps/discord-rpc/src/discord_register_win.o \ + deps/discord-rpc/src/connection_win.o + LIBS += -lpsapi -ladvapi32 +endif +ifneq ($(findstring Linux,$(OS)),) + OBJ += deps/discord-rpc/src/discord_register_linux.o \ + deps/discord-rpc/src/connection_unix.o +endif +ifneq ($(findstring Darwin,$(OS)),) + OBJ += deps/discord-rpc/src/discord_register_osx.o \ + deps/discord-rpc/src/connection_unix.o +endif + endif ifeq ($(HAVE_NETWORKGAMEPAD), 1) diff --git a/Makefile.ctr b/Makefile.ctr index d47cc66c25..5e5f210307 100644 --- a/Makefile.ctr +++ b/Makefile.ctr @@ -5,7 +5,7 @@ DEBUG = 0 GRIFFIN_BUILD = 1 WHOLE_ARCHIVE_LINK = 0 BUILD_3DSX = 1 -BUILD_3DS = 1 +BUILD_3DS = 0 BUILD_CIA = 1 LIBCTRU_NO_DEPRECATION = 1 @@ -31,6 +31,12 @@ OBJ += ctr/ctr_system.o OBJ += ctr/ctr_memory.o OBJ += ctr/ctr_linear.o OBJ += ctr/gpu_old.o +OBJ += ctr/exec-3dsx/exec_cia.o \ + ctr/exec-3dsx/exec_3dsx.o \ + ctr/exec-3dsx/mini-hb-menu/launch.o \ + ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.o \ + ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o \ + ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.o ifeq ($(APP_BIG_TEXT_SECTION), 1) APP_USE_SVCHAX = 1 @@ -162,7 +168,7 @@ endif all: $(TARGET) -$(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA) $(TARGET).core +$(TARGET): $(TARGET_3DSX) $(TARGET_3DS) $(TARGET_CIA) $(TARGET).3dsx: $(TARGET).elf $(TARGET).elf: $(OBJ) libretro_ctr.a @@ -255,9 +261,6 @@ $(TARGET).3ds: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF) $(TARGET).cia: $(TARGET).elf $(TARGET).bnr $(TARGET).icn $(APP_RSF) $(MAKEROM) -f cia -o $@ $(MAKEROM_ARGS_COMMON) -DAPP_ENCRYPTED=false -$(TARGET).core: $(TARGET).elf - echo $(APP_UNIQUE_ID) > $(TARGET).core - clean: rm -f $(OBJ) @@ -265,7 +268,6 @@ clean: rm -f $(TARGET).elf rm -f $(TARGET).3ds rm -f $(TARGET).cia - rm -f $(TARGET).core rm -f $(TARGET).smdh rm -f $(TARGET).bnr rm -f $(TARGET).icn diff --git a/Makefile.ctr.salamander b/Makefile.ctr.salamander index f356cd9e78..2c45a1bfe2 100644 --- a/Makefile.ctr.salamander +++ b/Makefile.ctr.salamander @@ -2,12 +2,12 @@ TARGET := retroarch_3ds_salamander LIBRETRO = DEBUG = 0 -BUILD_3DSX = 0 +BUILD_3DSX = 1 BUILD_3DS = 0 BUILD_CIA = 1 -APP_TITLE = Retroarch 3DS -APP_DESCRIPTION = Retroarch 3DS +APP_TITLE = RetroArch 3DS +APP_DESCRIPTION = RetroArch 3DS APP_AUTHOR = Team Libretro APP_PRODUCT_CODE = RETROARCH-3DS APP_UNIQUE_ID = 0xBAC00 @@ -39,6 +39,13 @@ OBJ := ctr/ctr_system.o \ libretro-common/hash/rhash.o \ file_path_str.o \ verbosity.o + +OBJ += ctr/exec-3dsx/exec_cia.o \ + ctr/exec-3dsx/exec_3dsx.o \ + ctr/exec-3dsx/mini-hb-menu/launch.o \ + ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.o \ + ctr/exec-3dsx/mini-hb-menu/loaders/hax2.o \ + ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.o ifeq ($(strip $(DEVKITPRO)),) $(error "Please set DEVKITPRO in your environment. export DEVKITPRO=devkitpro") @@ -182,7 +189,7 @@ ifeq ($(APP_BIG_TEXT_SECTION), 1) else rm -f $(TARGET).xml endif - -3dsxtool $< $@ $(_3DSXFLAGS) + $(DEVKITARM)/bin/3dsxtool $< $@ $(_3DSXFLAGS) $(TARGET).elf: ctr/3dsx_custom_crt0.o $(LD) $(LDFLAGS) $(OBJ) $(LIBDIRS) $(LIBS) -o $@ diff --git a/Makefile.msvc b/Makefile.msvc index 77d02fc9fa..3ece3af7a4 100644 --- a/Makefile.msvc +++ b/Makefile.msvc @@ -25,6 +25,7 @@ HAVE_XAUDIO := 1 HAVE_XINPUT := 1 HAVE_WASAPI := 0 HAVE_THREAD_STORAGE := 1 +HAVE_WINMM := 1 HAVE_RPNG := 1 HAVE_ZLIB := 1 @@ -53,7 +54,6 @@ HAVE_NETWORK_CMD := 1 HAVE_OVERLAY := 1 HAVE_LANGEXTRA := 1 HAVE_CHEEVOS := 1 -HAVE_KEYMAPPER := 1 HAVE_SHADERPIPELINE := 1 HAVE_IMAGEVIEWER := 1 diff --git a/Makefile.ps3 b/Makefile.ps3 index f3f29d18de..16f731e05f 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -4,7 +4,7 @@ include version.all #set to GCC for debug builds for use with debugger CELL_BUILD_TOOLS = SNC CELL_GPU_TYPE = RSX -CELL_PSGL_VERSION = ultra-opt +CELL_PSGL_VERSION = opt ASSETS_DIR := media/assets @@ -63,7 +63,7 @@ endif PPU_SRCS = griffin/griffin.c -DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD +DEFINES += -DHAVE_MENU -DHAVE_RGUI -DHAVE_XMB -DHAVE_LIBRETRODB -DHAVE_MATERIALUI -DHAVE_SHADERPIPELINE -DRARCH_INTERNAL -DMSB_FIRST -DHAVE_OVERLAY -DHAVE_CC_RESAMPLER -DHAVE_STB_VORBIS -DHAVE_STB_FONT -DHAVE_RUNAHEAD -DHAVE_DR_MP3 -DHAVE_DR_FLAC ifeq ($(DEX_BUILD), 1) DEFINES += -DDEX_BUILD @@ -96,7 +96,7 @@ ifeq ($(CELL_BUILD_TOOLS), SNC) PPU_CXXLD = $(CELL_SDK)/host-win32/sn/bin/ps3ppuld.exe PPU_CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe PPU_CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe -else ifneq($(system_platform), win) +else ifneq ($(system_platform), win) PPU_CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe PPU_CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe PPU_CXXLD = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ld.exe @@ -119,7 +119,7 @@ DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LA ifeq ($(DEBUG), 1) PPU_OPTIMIZE_LV := -O0 -g else - PPU_OPTIMIZE_LV := -O3 -g + PPU_OPTIMIZE_LV := -O2 -g endif ifeq ($(HAVE_LOGGER), 1) diff --git a/Makefile.ps3.cobra b/Makefile.ps3.cobra index ce6f755c0a..3a270b2dd6 100644 --- a/Makefile.ps3.cobra +++ b/Makefile.ps3.cobra @@ -2,7 +2,7 @@ include version.all #which compiler to build with - GCC or SNC #set to GCC for debug builds for use with debugger -CELL_BUILD_TOOLS = SNC +CELL_BUILD_TOOLS = GCC CELL_GPU_TYPE = RSX CELL_PSGL_VERSION = ultra-opt diff --git a/Makefile.ps3.salamander b/Makefile.ps3.salamander index 49c8c9a719..c769ff105c 100644 --- a/Makefile.ps3.salamander +++ b/Makefile.ps3.salamander @@ -1,4 +1,4 @@ -CELL_BUILD_TOOLS = SNC +CELL_BUILD_TOOLS = GCC CELL_SDK ?= /usr/local/cell HAVE_LOGGER = 0 CELL_MK_DIR ?= $(CELL_SDK)/samples/mk diff --git a/Makefile.switch b/Makefile.switch index a477749409..db887842c5 100644 --- a/Makefile.switch +++ b/Makefile.switch @@ -6,12 +6,13 @@ WHOLE_ARCHIVE_LINK = 0 OBJ := -DEFINES := -DSWITCH=1 -U__linux__ -U__linux +DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL -DHAVE_DYNAMIC ifeq ($(GRIFFIN_BUILD), 1) OBJ += griffin/griffin.o DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_NEON -DHAVE_MATERIALUI -DHAVE_LIBRETRODB -DHAVE_CC_RESAMPLER DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB + DEFINES += -DHAVE_RUNAHEAD -DHAVE_DYNAMIC else HAVE_CC_RESAMPLER = 1 HAVE_MENU_COMMON = 1 @@ -29,6 +30,8 @@ else HAVE_STATIC_VIDEO_FILTERS = 1 HAVE_STATIC_AUDIO_FILTERS = 1 HAVE_MENU = 1 + HAVE_RUNAHEAD = 1 + HAVE_DYNAMIC = 1 include Makefile.common BLACKLIST := @@ -44,7 +47,7 @@ endif include $(LIBTRANSISTOR_HOME)/libtransistor.mk -INCDIRS := -I. -Ideps/libz -Ilibretro-common/include -Ideps/stb -I$(LIBTRANSISTOR_HOME)/build/sdl2_install/include/SDL2/ +INCDIRS := -I. -Ideps -Ideps/libz -Ilibretro-common/include -Ideps/stb -I$(LIBTRANSISTOR_HOME)/build/sdl2_install/include/SDL2/ LIBDIRS := -L. TARGETS := $(TARGET).nro diff --git a/Makefile.vita b/Makefile.vita index 25d79a673e..5645c9cabd 100644 --- a/Makefile.vita +++ b/Makefile.vita @@ -16,7 +16,7 @@ DEFINES := ifeq ($(GRIFFIN_BUILD), 1) OBJ += griffin/griffin.o DEFINES += -DHAVE_GRIFFIN=1 - DEFINES += -DHAVE_NEON -DHAVE_MENU -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB + DEFINES += -DHAVE_NEON -DHAVE_MENU -DHAVE_XMB -DHAVE_MATERIALUI -DHAVE_LIBRETRODB DEFINES -DHAVE_KEYMAPPER DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER ifeq ($(DEBUG), 1) DEFINES += -DHAVE_NETLOGGER diff --git a/Makefile.wiiu b/Makefile.wiiu index 0f512f5638..83c890e2a8 100644 --- a/Makefile.wiiu +++ b/Makefile.wiiu @@ -6,10 +6,10 @@ DEBUG = 0 GRIFFIN_BUILD = 0 SALAMANDER_BUILD = 0 WHOLE_ARCHIVE_LINK = 0 -WIIU_HID = 0 +WIIU_HID = 1 +HAVE_RUNAHEAD = 1 WIIU_LOG_RPX = 0 BUILD_DIR = objs/wiiu -PC_DEVELOPMENT_IP_ADDRESS ?= PC_DEVELOPMENT_TCP_PORT ?= ifeq ($(SALAMANDER_BUILD),1) @@ -28,11 +28,11 @@ ifneq ($(V), 1) endif OBJ := -OBJ += wiiu/input/wpad_driver.o -OBJ += wiiu/input/kpad_driver.o -OBJ += wiiu/input/pad_functions.o +OBJ += wiiu/main.o OBJ += wiiu/system/memory.o +OBJ += wiiu/system/atomic.o OBJ += wiiu/system/exception_handler.o +OBJ += wiiu/system/missing_libc_functions.o OBJ += wiiu/fs/sd_fat_devoptab.o OBJ += wiiu/fs/fs_utils.o OBJ += wiiu/hbl.o @@ -45,18 +45,14 @@ endif ifeq ($(WIIU_HID),1) DEFINES += -DWIIU_HID - OBJ += wiiu/input/hidpad_driver.o - OBJ += wiiu/input/wiiu_hid.o + OBJ += input/drivers_joypad/wiiu/hidpad_driver.o + OBJ += input/drivers_hid/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 + input/common/hid/hid_device_driver.o \ + input/common/hid/device_wiiu_gca.o \ + input/common/hid/device_ds3.o \ + input/common/hid/device_ds4.o \ + input/common/hid/device_null.o endif ifeq ($(SALAMANDER_BUILD),1) @@ -83,13 +79,15 @@ ifeq ($(SALAMANDER_BUILD),1) else DEFINES += -DRARCH_INTERNAL DEFINES += -DHAVE_KEYMAPPER - DEFINES += -DHAVE_RUNAHEAD DEFINES += -DHAVE_UPDATE_ASSETS DEFINES += -DHAVE_FILTERS_BUILTIN DEFINES += -DHAVE_SLANG DEFINES += -DHAVE_SHADERPIPELINE - OBJ += wiiu/system/missing_libc_functions.o +ifeq ($(HAVE_RUNAHEAD),1) + DEFINES += -DHAVE_RUNAHEAD +endif + OBJ += wiiu/shader_utils.o OBJ += gfx/drivers/gx2_shaders/tex.o OBJ += gfx/drivers/gx2_shaders/sprite.o @@ -120,8 +118,7 @@ else HAVE_RGUI = 1 HAVE_ZLIB = 1 HAVE_7ZIP = 1 - HAVE_BUILTINZLIB = 1 - HAVE_KEYMAPPER = 1 + HAVE_BUILTINZLIB = 0 HAVE_LIBRETRODB = 1 HAVE_ZARCH = 0 HAVE_MATERIALUI = 1 @@ -148,6 +145,10 @@ else OBJ += menu/drivers_display/menu_display_wiiu.o OBJ += input/drivers/wiiu_input.o OBJ += input/drivers_joypad/wiiu_joypad.o + OBJ += input/drivers_joypad/wiiu/wpad_driver.o + OBJ += input/drivers_joypad/wiiu/kpad_driver.o + OBJ += input/drivers_joypad/wiiu/pad_functions.o + OBJ += audio/drivers/wiiu_audio.o OBJ += frontend/drivers/platform_wiiu.o endif @@ -161,10 +162,6 @@ DEFINES += -DWIIU -DMSB_FIRST -D__WUT__ DEFINES += -DHAVE_MAIN DEFINES += -DRARCH_CONSOLE -ifneq ($(PC_DEVELOPMENT_IP_ADDRESS),) - DEFINES += -DPC_DEVELOPMENT_IP_ADDRESS='"$(PC_DEVELOPMENT_IP_ADDRESS)"' -endif - ifneq ($(PC_DEVELOPMENT_TCP_PORT),) DEFINES += -DPC_DEVELOPMENT_TCP_PORT=$(PC_DEVELOPMENT_TCP_PORT) endif @@ -197,7 +194,16 @@ else ELF2RPL := $(ELF2RPL).exe endif -INCDIRS := -I. -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include +INCDIRS := -I. +INCDIRS += -Ideps +INCDIRS += -Ideps/stb +INCDIRS += -Ideps/libz +INCDIRS += -Ideps/7zip +INCDIRS += -Ilibretro-common/include +INCDIRS += -Iinput/include +INCDIRS += -Iwiiu +INCDIRS += -Iwiiu/include +INCDIRS += -I$(DEVKITPRO)/portlibs/ppc/include LIBDIRS := -L. -L$(DEVKITPRO)/portlibs/ppc/lib CFLAGS := -mwup -mcpu=750 -meabi -mhard-float @@ -226,7 +232,7 @@ CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions LDFLAGS += -Wl,--gc-sections -LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm +LIBS := $(WHOLE_START) -lretro_wiiu $(WHOLE_END) -lm -lpng -lz ifneq ($(WANT_LIBFAT), 1) LIBS += -lfat diff --git a/Makefile.win b/Makefile.win index 26c3f7aa37..932d0f896f 100644 --- a/Makefile.win +++ b/Makefile.win @@ -18,6 +18,7 @@ HAVE_PYTHON = 0 DYNAMIC = 1 HAVE_XINPUT = 1 +HAVE_WINMM = 1 HAVE_SDL := 0 HAVE_SDL2 := 0 diff --git a/README.md b/README.md index ccf7c912ec..1e4105cc53 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ # RetroArch RetroArch is the reference frontend for the libretro API. -Popular examples of implementations for this API includes videogame system emulators and game engines as well as +Popular examples of implementations for this API includes video game system emulators and game engines as well as more generalized 3D programs. These programs are instantiated as dynamic libraries. We refer to these as "libretro cores". @@ -27,12 +27,11 @@ interface to include support for emulators and/or game engines. libretro is comp ## Binaries -Latest Windows binaries are currently hosted on the [buildbot](http://buildbot.libretro.com/). +Latest binaries are currently hosted on the [buildbot](http://buildbot.libretro.com/). ## Support -To reach developers, either make an issue here on GitHub, make a thread on the [forum](http://www.libretro.com/forums/), -or visit our IRC channel: #retroarch @ irc.freenode.org. +To reach developers, either make an issue here on GitHub, make a thread on the [forum](http://www.libretro.com/forums/), chat on [Discord](https://discord.gg/C4amCeV), or visit our IRC channel: #retroarch @ irc.freenode.org. ## Documentation @@ -51,13 +50,13 @@ More developer-centric stuff is found [here](https://github.com/libretro/libretr RetroArch attempts to be small and lean while still having all the useful core features expected from an emulator. -It is designed to be very portable and features a gamepad-centric UI. +It is designed to be very portable and features a gamepad-centric and touchscreen UI. It also has a full-featured command-line interface. In some areas, RetroArch goes beyond and emphasizes on not-so-common technical features such as multi-pass shader support, -real-time rewind (Braid-style), video recording (using FFmpeg), etc. +real-time rewind (Braid-style), video recording (using FFmpeg), run-ahead input latency removal, etc. -RetroArch also emphasizes on being easy to integrate into various launcher frontends. +RetroArch also emphasizes being easy to integrate into various launcher frontends. ## Platforms @@ -66,22 +65,24 @@ RetroArch has been ported to the following platforms: - DOS - Windows - Linux - - Emscripten + - Emscripten (WebAssembly and JavaScript) - FreeBSD - NetBSD - OpenBSD - Haiku - Solaris - - MacOS X + - macOS (PPC, x86-32 and x86-64) - PlayStation 3 - PlayStation Portable - PlayStation Vita - Original Microsoft Xbox - Microsoft Xbox 360 (Libxenon/XeXDK) - - Nintendo Wii, GameCube (Libogc) - - Nintendo WiiU + - Nintendo GameCube + - Nintendo Wii + - Nintendo Wii U - Nintendo 3DS - Nintendo Switch + - Nintendo NES/SNES Classic Edition - Raspberry Pi - Android - iOS @@ -144,3 +145,115 @@ To configure joypads, use the built-in menu or the `retroarch-joyconfig` command ## Compiling and installing Instructions for compiling and installing RetroArch can be found in the [Libretro/RetroArch Documentation Center](https://docs.libretro.com/). + +## CRT 15Khz Resolution Switching + +CRT SwitchRes will turn on, on the fly. However, you will need to restart RetroArch to disable it. With CRT SwitchRes enable RetroArch will start in 2560 x 480 @ 60. + +If you are running Windows, before enabling the CRT SwitchRes options please make sure you have installed CRTEmudriver and installed some modelines. The minimum modelines for all games to switch correctly are: + +- 2560 x 192 @ 60.000000 +- 2560 x 200 @ 60.000000 +- 2560 x 240 @ 60.000000 +- 2560 x 224 @ 60.000000 +- 2560 x 237 @ 60.000000 +- 2560 x 256 @ 50.000000 +- 2560 x 254 @ 55.000000 +- 2560 x 448 @ 60.000000 +- 2560 x 480 @ 60.000000 + +Install these modelines replacing 2560 with your desired super resolution. The above resolutions are NTSC only so if you would be playing any PAL content please add PAL modelines: + +- 2560 x 192 @ 50.000000 +- 2560 x 200 @ 50.000000 +- 2560 x 240 @ 50.000000 +- 2560 x 224 @ 50.000000 +- 2560 x 288 @ 50.000000 +- 2560 x 237 @ 50.000000 +- 2560 x 254 @ 55.000000 +- 2560 x 448 @ 50.000000 +- 2560 x 480 @ 50.000000 + +Some games will require higher PAL resolutions which should also be installed: + +- 2560 x 512 @ 50.000000 +- 2560 x 576 @ 50.000000 + +Ideally install all these modelines and everything will work great. + +## Super Resolutions + +The default super resolution is 2560. It is displayed just under the CRT switch option, which can be found in video settings. This can be changed within the retroarch.cfg. The only compatible resolutions are 1920, 2560 and 3840. Any other resolutions will be ignored and native switching will be activated. + +## Native Resolutions + +If native resolutions are activated you will need a whole new set of modelines: + +- 512 x 240 @ 50.006977 SNESpal +- 512 x 224 @ 50.006977 SNESpal +- 512 x 448 @ 50.006977 SNESpal +- 512 x 240 @ 60.098812 SNESntsc +- 512 x 224 @ 60.098812 SNESntsc +- 512 x 448 @ 60.098812 SNESntsc +- 256 x 240 @ 50.006977 SNESpal +- 256 x 448 @ 50.006977 SNESpal +- 256 x 240 @ 60.098812 SNESntsc +- 256 x 448 @ 60.098812 SNESntsc +- 320 x 240 @ 59.922745 MDntsc +- 320 x 448 @ 59.922745 MDntp +- 320 x 480 @ 59.922745 MDntsc +- 256 x 192 @ 59.922745 MDntsc +- 320 x 224 @ 59.922745 MDntsc +- 256 x 224 @ 59.922745 MDntsc +- 320 x 288 @ 49.701458 MDpal +- 320 x 576 @ 49.701458 MDpal +- 256 x 192 @ 49.701458 MDpal +- 320 x 224 @ 49.701458 MDpal +- 320 x 240 @ 49.701458 MDpal +- 320 x 448 @ 49.701458 MDpal +- 320 x 480 @ 49.701458 MDpal +- 256 x 224 @ 49.701458 MDpal +- 256 x 288 @ 49.701458 MSYSpal +- 256 x 240 @ 60.098812 NESntsc +- 256 x 240 @ 50.006977 NESpal + +- 640 x 480 @ 60.130001 N64ntsc +- 640 x 237 @ 60.130001 N64ntsc +- 640 x 240 @ 60.130001 N64ntsc +- 640 x 480 @ 50.000000 N64pal +- 640 x 576 @ 50.000000 n64pal +- 640 x 288 @ 50.000000 n64pal + +- 256 x 252 @ 49.759998 PSXpal +- 384 x 252 @ 49.759998 PSXpal +- 640 x 540 @ 49.759998 PSXpal +- 320 x 252 @ 49.759998 PSXpal +- 640 x 252 @ 49.759998 PSXpal + +- 384 x 240 @ 59.941002 PSXntsc +- 256 x 480 @ 59.941002 PSXntsc + +- 352 x 240 @ 59.820000 Saturn/SGFX_NTSCp +- 704 x 240 @ 59.820000 SaturnNTSCp +- 352 x 480 @ 59.820000 SaturnNTSCi +- 704 x 480 @ 59.820000 SaturnNTSCi +- 352 x 288 @ 49.701458 SaturnPALp +- 704 x 288 @ 49.701458 SaturnPALp +- 352 x 576 @ 49.701458 SaturnPALi +- 704 x 576 @ 49.701458 SaturnPALi + +- 240 x 160 @ 59.730000 GBA +- 320 x 200 @ 60.000000 Doom + +// Arcade + +- 400 x 254 @ 54.706841 MK +- 384 x 224 @ 59.637405 CPS1 + +These modelines are more accurate giving exact hz. However, some games may have unwanted results. This is due to mid-scanline resolution changes on the original hardware. For the best results super resolutions are the way to go. + +## CRT resolution switching & MAME + +Some arcade resolutions can be very different from consumer CRTs. There is resolution detection to ensure MAME games will be displayed in the closest available resolution but drawn at their native resolution within this resolution. Meaning that the MAME game will look just like the original hardware. + +MAME ROMs that run in a vertical aspect like DoDonPachi need to be rotated within MAME before resolution switching and aspect correction will work. Do this before enabling CRT SwitchRes so that RetroArch will run in your desktop resolution. Once you have rotated any games that may need it turn CRT SwitchRes on. diff --git a/audio/audio_driver.c b/audio/audio_driver.c index fb06d65ffb..e35fbd7951 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -45,7 +45,15 @@ #define AUDIO_BUFFER_FREE_SAMPLES_COUNT (8 * 1024) -#define AUDIO_MIXER_MAX_STREAMS 8 +/** + * db_to_gain: + * @db : Decibels. + * + * Converts decibels to voltage gain. + * + * Returns: voltage gain value. + **/ +#define db_to_gain(db) (powf(10.0f, (db) / 20.0f)) static const audio_driver_t *audio_drivers[] = { #ifdef HAVE_ALSA @@ -122,18 +130,6 @@ static const audio_driver_t *audio_drivers[] = { NULL, }; -struct audio_mixer_stream -{ - audio_mixer_sound_t *handle; - audio_mixer_voice_t *voice; - audio_mixer_stop_cb_t stop_cb; - enum audio_mixer_state state; - float volume; - void *buf; - size_t bufsize; -}; - -static unsigned audio_mixer_current_max_idx = 0; static struct audio_mixer_stream audio_mixer_streams[AUDIO_MIXER_MAX_STREAMS] = {{0}}; static size_t audio_driver_chunk_size = 0; @@ -183,6 +179,11 @@ static void *audio_driver_context_audio_data = NULL; static bool audio_suspended = false; +static void audio_mixer_play_stop_sequential_cb( + audio_mixer_sound_t *sound, unsigned reason); +static void audio_mixer_play_stop_cb( + audio_mixer_sound_t *sound, unsigned reason); + enum resampler_quality audio_driver_get_resampler_quality(void) { settings_t *settings = config_get_ptr(); @@ -193,6 +194,22 @@ enum resampler_quality audio_driver_get_resampler_quality(void) return (enum resampler_quality)settings->uints.audio_resampler_quality; } +audio_mixer_stream_t *audio_driver_mixer_get_stream(unsigned i) +{ + if (i > (AUDIO_MIXER_MAX_STREAMS-1)) + return NULL; + return &audio_mixer_streams[i]; +} + +const char *audio_driver_mixer_get_stream_name(unsigned i) +{ + if (i > (AUDIO_MIXER_MAX_STREAMS-1)) + return "N/A"; + if (!string_is_empty(audio_mixer_streams[i].name)) + return audio_mixer_streams[i].name; + return "N/A"; +} + /** * compute_audio_buffer_statistics: * @@ -213,7 +230,7 @@ bool compute_audio_buffer_statistics(audio_statistics_t *stats) if (!stats || samples < 3) return false; - stats->samples = audio_driver_free_samples_count; + stats->samples = (unsigned)audio_driver_free_samples_count; #ifdef WARPUP /* uint64 to double not implemented, fair chance @@ -368,6 +385,12 @@ static bool audio_driver_deinit_internal(void) return true; } +static void audio_driver_mixer_init(unsigned out_rate) +{ + audio_mixer_init(out_rate); +} + + static bool audio_driver_init_internal(bool audio_cb_inited) { unsigned new_rate = 0; @@ -524,7 +547,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited) { audio_driver_buffer_size = current_audio->buffer_size(audio_driver_context_audio_data); - audio_driver_control = true; + audio_driver_control = true; } else RARCH_WARN("Audio rate control was desired, but driver does not support needed features.\n"); @@ -534,7 +557,7 @@ static bool audio_driver_init_internal(bool audio_cb_inited) audio_driver_free_samples_count = 0; - audio_mixer_init(settings->uints.audio_out_rate); + audio_driver_mixer_init(settings->uints.audio_out_rate); /* Threaded driver is initially stopped. */ if ( @@ -576,20 +599,17 @@ void audio_driver_set_nonblocking_state(bool enable) static void audio_driver_flush(const int16_t *data, size_t samples) { struct resampler_data src_data; - bool is_perfcnt_enable = false; - bool is_paused = false; - bool is_idle = false; - bool is_slowmotion = false; - const void *output_data = NULL; - unsigned output_frames = 0; - float audio_volume_gain = !audio_driver_mute_enable ? + bool is_perfcnt_enable = false; + bool is_paused = false; + bool is_idle = false; + bool is_slowmotion = false; + const void *output_data = NULL; + unsigned output_frames = 0; + float audio_volume_gain = !audio_driver_mute_enable ? audio_driver_volume_gain : 0.0f; - src_data.data_in = NULL; - src_data.data_out = NULL; - src_data.input_frames = 0; - src_data.output_frames = 0; - src_data.ratio = 0.0f; + src_data.data_out = NULL; + src_data.output_frames = 0; if (recording_data) recording_push_audio(data, samples); @@ -606,8 +626,8 @@ static void audio_driver_flush(const int16_t *data, size_t samples) convert_s16_to_float(audio_driver_input_data, data, samples, audio_volume_gain); - src_data.data_in = audio_driver_input_data; - src_data.input_frames = samples >> 1; + src_data.data_in = audio_driver_input_data; + src_data.input_frames = samples >> 1; if (audio_driver_dsp) @@ -662,7 +682,7 @@ static void audio_driver_flush(const int16_t *data, size_t samples) #endif } - src_data.ratio = audio_source_ratio_current; + src_data.ratio = audio_source_ratio_current; if (is_slowmotion) { @@ -675,7 +695,7 @@ static void audio_driver_flush(const int16_t *data, size_t samples) if (audio_mixer_active) { bool override = audio_driver_mixer_mute_enable ? true : - (audio_driver_mixer_volume_gain != 0.0f) ? true : false; + (audio_driver_mixer_volume_gain != 1.0f) ? true : false; float mixer_gain = !audio_driver_mixer_mute_enable ? audio_driver_mixer_volume_gain : 0.0f; audio_mixer_mix(audio_driver_output_samples_buf, @@ -725,6 +745,22 @@ void audio_driver_sample(int16_t left, int16_t right) audio_driver_data_ptr = 0; } +void audio_driver_menu_sample(void) +{ + static int16_t samples_buf[1024] = {0}; + struct retro_system_av_info + *av_info = video_viewport_get_system_av_info(); + const struct retro_system_timing *info = + (const struct retro_system_timing*)&av_info->timing; + unsigned sample_count = (info->sample_rate / info->fps) * 2; + while (sample_count > 1024) + { + audio_driver_flush(samples_buf, 1024); + sample_count -= 1024; + } + audio_driver_flush(samples_buf, sample_count); +} + /** * audio_driver_sample_batch: * @data : pointer to audio buffer. @@ -840,13 +876,13 @@ void audio_driver_monitor_adjust_system_rates(void) { float timing_skew; settings_t *settings = config_get_ptr(); - struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); float video_refresh_rate = settings->floats.video_refresh_rate; float max_timing_skew = settings->floats.audio_max_timing_skew; - const struct retro_system_timing *info = av_info ? - (const struct retro_system_timing*)&av_info->timing : NULL; + struct retro_system_av_info *av_info = video_viewport_get_system_av_info(); + const struct retro_system_timing *info = + (const struct retro_system_timing*)&av_info->timing; - if (!info || info->sample_rate <= 0.0) + if (info->sample_rate <= 0.0) return; timing_skew = fabs(1.0f - info->fps / video_refresh_rate); @@ -976,6 +1012,12 @@ bool audio_driver_mixer_extension_supported(const char *ext) string_list_append(str_list, "mod", attr); string_list_append(str_list, "s3m", attr); string_list_append(str_list, "xm", attr); +#endif +#ifdef HAVE_DR_FLAC + string_list_append(str_list, "flac", attr); +#endif +#ifdef HAVE_DR_MP3 + string_list_append(str_list, "mp3", attr); #endif string_list_append(str_list, "wav", attr); @@ -1021,18 +1063,16 @@ static void audio_mixer_play_stop_cb( { unsigned i = (unsigned)idx; -#if 0 - if (audio_mixer_streams[i].buf != NULL) - free(audio_mixer_streams[i].buf); -#endif + if (!string_is_empty(audio_mixer_streams[i].name)) + free(audio_mixer_streams[i].name); + audio_mixer_streams[i].name = NULL; audio_mixer_streams[i].state = AUDIO_STREAM_STATE_NONE; audio_mixer_streams[i].volume = 0.0f; audio_mixer_streams[i].buf = NULL; audio_mixer_streams[i].stop_cb = NULL; audio_mixer_streams[i].handle = NULL; audio_mixer_streams[i].voice = NULL; - audio_mixer_current_max_idx--; } break; case AUDIO_MIXER_SOUND_STOPPED: @@ -1042,15 +1082,75 @@ static void audio_mixer_play_stop_cb( } } +static void audio_mixer_play_stop_sequential_cb( + audio_mixer_sound_t *sound, unsigned reason) +{ + int idx = audio_mixer_find_index(sound); + + switch (reason) + { + case AUDIO_MIXER_SOUND_FINISHED: + audio_mixer_destroy(sound); + + if (idx >= 0) + { + unsigned i = (unsigned)idx; + + if (!string_is_empty(audio_mixer_streams[i].name)) + free(audio_mixer_streams[i].name); + + audio_mixer_streams[i].name = NULL; + audio_mixer_streams[i].state = AUDIO_STREAM_STATE_NONE; + audio_mixer_streams[i].volume = 0.0f; + audio_mixer_streams[i].buf = NULL; + audio_mixer_streams[i].stop_cb = NULL; + audio_mixer_streams[i].handle = NULL; + audio_mixer_streams[i].voice = NULL; + + i++; + + for (; i < AUDIO_MIXER_MAX_STREAMS; i++) + { + if (audio_mixer_streams[i].state == AUDIO_STREAM_STATE_STOPPED) + { + audio_driver_mixer_play_stream_sequential(i); + break; + } + } + } + break; + case AUDIO_MIXER_SOUND_STOPPED: + break; + case AUDIO_MIXER_SOUND_REPEATED: + break; + } +} + +bool audio_driver_mixer_get_free_stream_slot(unsigned *id) +{ + unsigned i; + for (i = 0; i < AUDIO_MIXER_MAX_STREAMS; i++) + { + if (audio_mixer_streams[i].state == AUDIO_STREAM_STATE_NONE) + { + *id = i; + return true; + } + } + + return false; +} + bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params) { + unsigned free_slot = 0; audio_mixer_voice_t *voice = NULL; audio_mixer_sound_t *handle = NULL; audio_mixer_stop_cb_t stop_cb = audio_mixer_play_stop_cb; bool looped = false; void *buf = NULL; - - if (audio_mixer_current_max_idx >= AUDIO_MIXER_MAX_STREAMS) + + if (!audio_driver_mixer_get_free_stream_slot(&free_slot)) return false; if (params->state == AUDIO_STREAM_STATE_NONE) @@ -1074,9 +1174,18 @@ bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params) case AUDIO_MIXER_TYPE_MOD: handle = audio_mixer_load_mod(buf, (int32_t)params->bufsize); break; + case AUDIO_MIXER_TYPE_FLAC: +#ifdef HAVE_DR_FLAC + handle = audio_mixer_load_flac(buf, (int32_t)params->bufsize); +#endif + break; + case AUDIO_MIXER_TYPE_MP3: +#ifdef HAVE_DR_MP3 + handle = audio_mixer_load_mp3(buf, (int32_t)params->bufsize); +#endif + break; case AUDIO_MIXER_TYPE_NONE: - free(buf); - return false; + break; } if (!handle) @@ -1085,74 +1194,193 @@ bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params) return false; } - if (params->state == AUDIO_STREAM_STATE_PLAYING) + switch (params->state) { - voice = audio_mixer_play(handle, looped, params->volume, stop_cb); - audio_set_bool(AUDIO_ACTION_MIXER, true); - } - else if (params->state == AUDIO_STREAM_STATE_PLAYING_LOOPED) - { - looped = true; - voice = audio_mixer_play(handle, looped, params->volume, stop_cb); - audio_set_bool(AUDIO_ACTION_MIXER, true); + case AUDIO_STREAM_STATE_PLAYING_LOOPED: + looped = true; + voice = audio_mixer_play(handle, looped, params->volume, stop_cb); + break; + case AUDIO_STREAM_STATE_PLAYING: + voice = audio_mixer_play(handle, looped, params->volume, stop_cb); + break; + case AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL: + stop_cb = audio_mixer_play_stop_sequential_cb; + voice = audio_mixer_play(handle, looped, params->volume, stop_cb); + break; + default: + break; } - audio_mixer_streams[audio_mixer_current_max_idx].buf = buf; - audio_mixer_streams[audio_mixer_current_max_idx].handle = handle; - audio_mixer_streams[audio_mixer_current_max_idx].voice = voice; - audio_mixer_streams[audio_mixer_current_max_idx].state = params->state; - audio_mixer_streams[audio_mixer_current_max_idx].volume = params->volume; - audio_mixer_streams[audio_mixer_current_max_idx].stop_cb = stop_cb; + audio_mixer_active = true; - audio_mixer_current_max_idx++; + audio_mixer_streams[free_slot].name = !string_is_empty(params->basename) ? strdup(params->basename) : NULL; + audio_mixer_streams[free_slot].buf = buf; + audio_mixer_streams[free_slot].handle = handle; + audio_mixer_streams[free_slot].voice = voice; + audio_mixer_streams[free_slot].state = params->state; + audio_mixer_streams[free_slot].volume = params->volume; + audio_mixer_streams[free_slot].stop_cb = stop_cb; return true; } -static void audio_driver_mixer_remove_stream(unsigned i) +enum audio_mixer_state audio_driver_mixer_get_stream_state(unsigned i) { - audio_mixer_sound_t *handle = audio_mixer_streams[i].handle; - audio_mixer_voice_t *voice = audio_mixer_streams[i].voice; + if (i >= AUDIO_MIXER_MAX_STREAMS) + return AUDIO_STREAM_STATE_NONE; + + return audio_mixer_streams[i].state; +} + +static void audio_driver_mixer_play_stream_internal(unsigned i, unsigned type) +{ + bool set_state = false; + + if (i >= AUDIO_MIXER_MAX_STREAMS) + return; + + switch (audio_mixer_streams[i].state) + { + case AUDIO_STREAM_STATE_STOPPED: + audio_mixer_streams[i].voice = audio_mixer_play(audio_mixer_streams[i].handle, + (type == AUDIO_STREAM_STATE_PLAYING_LOOPED) ? true : false, + 1.0f, audio_mixer_streams[i].stop_cb); + set_state = true; + break; + case AUDIO_STREAM_STATE_PLAYING: + case AUDIO_STREAM_STATE_PLAYING_LOOPED: + case AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL: + case AUDIO_STREAM_STATE_NONE: + break; + } + + if (set_state) + audio_mixer_streams[i].state = (enum audio_mixer_state)type; +} + +void audio_driver_mixer_play_stream(unsigned i) +{ + audio_mixer_streams[i].stop_cb = audio_mixer_play_stop_cb; + audio_driver_mixer_play_stream_internal(i, AUDIO_STREAM_STATE_PLAYING); +} + +void audio_driver_mixer_play_stream_looped(unsigned i) +{ + audio_mixer_streams[i].stop_cb = audio_mixer_play_stop_cb; + audio_driver_mixer_play_stream_internal(i, AUDIO_STREAM_STATE_PLAYING_LOOPED); +} + +void audio_driver_mixer_play_stream_sequential(unsigned i) +{ + audio_mixer_streams[i].stop_cb = audio_mixer_play_stop_sequential_cb; + audio_driver_mixer_play_stream_internal(i, AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL); +} + +float audio_driver_mixer_get_stream_volume(unsigned i) +{ + if (i >= AUDIO_MIXER_MAX_STREAMS) + return 0.0f; + + return audio_mixer_streams[i].volume; +} + +void audio_driver_mixer_set_stream_volume(unsigned i, float vol) +{ + audio_mixer_voice_t *voice = NULL; + + if (i >= AUDIO_MIXER_MAX_STREAMS) + return; + + audio_mixer_streams[i].volume = vol; + + voice = audio_mixer_streams[i].voice; + + if (voice) + audio_mixer_voice_set_volume(voice, db_to_gain(vol)); +} + +void audio_driver_mixer_stop_stream(unsigned i) +{ + bool set_state = false; + + if (i >= AUDIO_MIXER_MAX_STREAMS) + return; switch (audio_mixer_streams[i].state) { case AUDIO_STREAM_STATE_PLAYING: - if (voice) - audio_mixer_stop(voice); - if (handle) - audio_mixer_destroy(handle); - break; case AUDIO_STREAM_STATE_PLAYING_LOOPED: - if (voice) - audio_mixer_stop(voice); - if (handle) - audio_mixer_destroy(handle); + case AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL: + set_state = true; break; case AUDIO_STREAM_STATE_STOPPED: - if (handle) - audio_mixer_destroy(handle); + case AUDIO_STREAM_STATE_NONE: + break; + } + + if (set_state) + { + audio_mixer_voice_t *voice = audio_mixer_streams[i].voice; + + if (voice) + audio_mixer_stop(voice); + audio_mixer_streams[i].state = AUDIO_STREAM_STATE_STOPPED; + audio_mixer_streams[i].volume = 1.0f; + } +} + +void audio_driver_mixer_remove_stream(unsigned i) +{ + bool destroy = false; + + if (i >= AUDIO_MIXER_MAX_STREAMS) + return; + + switch (audio_mixer_streams[i].state) + { + case AUDIO_STREAM_STATE_PLAYING: + case AUDIO_STREAM_STATE_PLAYING_LOOPED: + case AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL: + audio_driver_mixer_stop_stream(i); + destroy = true; + break; + case AUDIO_STREAM_STATE_STOPPED: + destroy = true; break; case AUDIO_STREAM_STATE_NONE: break; } - audio_mixer_streams[i].state = AUDIO_STREAM_STATE_NONE; - audio_mixer_streams[i].volume = 0.0f; - audio_mixer_streams[i].stop_cb = NULL; - audio_mixer_streams[i].handle = NULL; - audio_mixer_streams[i].voice = NULL; + if (destroy) + { + audio_mixer_sound_t *handle = audio_mixer_streams[i].handle; + if (handle) + audio_mixer_destroy(handle); + + if (!string_is_empty(audio_mixer_streams[i].name)) + free(audio_mixer_streams[i].name); + + audio_mixer_streams[i].state = AUDIO_STREAM_STATE_NONE; + audio_mixer_streams[i].stop_cb = NULL; + audio_mixer_streams[i].volume = 0.0f; + audio_mixer_streams[i].handle = NULL; + audio_mixer_streams[i].voice = NULL; + audio_mixer_streams[i].name = NULL; + } } static void audio_driver_mixer_deinit(void) { unsigned i; - audio_set_bool(AUDIO_ACTION_MIXER, false); + audio_mixer_active = false; for (i = 0; i < AUDIO_MIXER_MAX_STREAMS; i++) + { + audio_driver_mixer_stop_stream(i); audio_driver_mixer_remove_stream(i); + } - audio_mixer_current_max_idx = 0; audio_mixer_done(); } @@ -1351,15 +1579,6 @@ void audio_set_bool(enum audio_action action, bool val) } } -/** - * db_to_gain: - * @db : Decibels. - * - * Converts decibels to voltage gain. - * - * Returns: voltage gain value. - **/ -#define db_to_gain(db) (powf(10.0f, (db) / 20.0f)) void audio_set_float(enum audio_action action, float val) { diff --git a/audio/audio_driver.h b/audio/audio_driver.h index 6dfacaa89f..a2cdad4f41 100644 --- a/audio/audio_driver.h +++ b/audio/audio_driver.h @@ -35,6 +35,8 @@ RETRO_BEGIN_DECLS #define AUDIO_MAX_RATIO 16 +#define AUDIO_MIXER_MAX_STREAMS 16 + enum audio_action { AUDIO_ACTION_NONE = 0, @@ -46,6 +48,27 @@ enum audio_action AUDIO_ACTION_MIXER }; +enum audio_mixer_state +{ + AUDIO_STREAM_STATE_NONE = 0, + AUDIO_STREAM_STATE_STOPPED, + AUDIO_STREAM_STATE_PLAYING, + AUDIO_STREAM_STATE_PLAYING_LOOPED, + AUDIO_STREAM_STATE_PLAYING_SEQUENTIAL +}; + +typedef struct audio_mixer_stream +{ + audio_mixer_sound_t *handle; + audio_mixer_voice_t *voice; + audio_mixer_stop_cb_t stop_cb; + enum audio_mixer_state state; + float volume; + void *buf; + char *name; + size_t bufsize; +} audio_mixer_stream_t; + typedef struct audio_statistics { float average_buffer_saturation; @@ -137,20 +160,13 @@ typedef struct audio_driver size_t (*buffer_size)(void *data); } audio_driver_t; -enum audio_mixer_state -{ - AUDIO_STREAM_STATE_NONE = 0, - AUDIO_STREAM_STATE_STOPPED, - AUDIO_STREAM_STATE_PLAYING, - AUDIO_STREAM_STATE_PLAYING_LOOPED -}; - typedef struct audio_mixer_stream_params { float volume; enum audio_mixer_type type; enum audio_mixer_state state; void *buf; + char *basename; size_t bufsize; audio_mixer_stop_cb_t cb; } audio_mixer_stream_params_t; @@ -271,10 +287,32 @@ bool audio_driver_deinit(void); bool audio_driver_init(void); +void audio_driver_menu_sample(void); + +audio_mixer_stream_t *audio_driver_mixer_get_stream(unsigned i); + bool audio_driver_mixer_add_stream(audio_mixer_stream_params_t *params); +void audio_driver_mixer_play_stream(unsigned i); + +void audio_driver_mixer_play_stream_sequential(unsigned i); + +void audio_driver_mixer_play_stream_looped(unsigned i); + +void audio_driver_mixer_stop_stream(unsigned i); + +float audio_driver_mixer_get_stream_volume(unsigned i); + +void audio_driver_mixer_set_stream_volume(unsigned i, float vol); + +void audio_driver_mixer_remove_stream(unsigned i); + enum resampler_quality audio_driver_get_resampler_quality(void); +enum audio_mixer_state audio_driver_mixer_get_stream_state(unsigned i); + +const char *audio_driver_mixer_get_stream_name(unsigned i); + bool compute_audio_buffer_statistics(audio_statistics_t *stats); extern audio_driver_t audio_rsound; diff --git a/audio/drivers/wiiu_audio.c b/audio/drivers/wiiu_audio.c index 437ee310bf..0ea9106206 100644 --- a/audio/drivers/wiiu_audio.c +++ b/audio/drivers/wiiu_audio.c @@ -84,7 +84,7 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency, u16 setup_buf[0x30] = {0}; setup_buf[0x25] = 2; /* we request 2 channels */ AXInitParams init = {AX_INIT_RENDERER_48KHZ, 0, 0}; - AXVoiceVeData ve = {0xF000, 0}; + AXVoiceVeData ve = {0x8000, 0}; ax_audio_t* ax = (ax_audio_t*)calloc(1, sizeof(ax_audio_t)); if (!ax) diff --git a/cheevos/cheevos.c b/cheevos/cheevos.c index 57f027641f..c542783d29 100644 --- a/cheevos/cheevos.c +++ b/cheevos/cheevos.c @@ -107,6 +107,8 @@ #define CHEEVOS_JSON_KEY_LEADERBOARDS 0xf1247d2dU #define CHEEVOS_JSON_KEY_MEM 0x0b8807e4U #define CHEEVOS_JSON_KEY_FORMAT 0xb341208eU +#define CHEEVOS_JSON_KEY_SUCCESS 0x110461deU +#define CHEEVOS_JSON_KEY_ERROR 0x0d2011cfU typedef struct { @@ -284,6 +286,8 @@ static cheevos_locals_t cheevos_locals = }; bool cheevos_loaded = false; +bool cheevos_hardcore_active = false; +bool cheevos_hardcore_paused = false; int cheats_are_enabled = 0; int cheats_were_enabled = 0; @@ -299,6 +303,15 @@ int cheats_were_enabled = 0; Supporting functions. *****************************************************************************/ +#ifndef CHEEVOS_VERBOSE + +void cheevos_log(const char *fmt, ...) +{ + (void)fmt; +} + +#endif + static unsigned size_in_megabytes(unsigned val) { return (val * 1024 * 1024); @@ -308,7 +321,7 @@ static unsigned size_in_megabytes(unsigned val) static void cheevos_log_url(const char* format, const char* url) { #ifdef CHEEVOS_LOG_PASSWORD - RARCH_LOG(format, url); + CHEEVOS_LOG(format, url); #else char copy[256]; char* aux = NULL; @@ -359,340 +372,11 @@ static void cheevos_log_url(const char* format, const char* url) *aux = 0; } - RARCH_LOG(format, copy); + CHEEVOS_LOG(format, copy); #endif } #endif -#ifdef CHEEVOS_VERBOSE -static void cheevos_add_char(char** aux, size_t* left, char k) -{ - if (*left >= 1) - { - **aux = k; - (*aux)++; - (*left)--; - } -} - -static void cheevos_add_string(char** aux, size_t* left, const char* s) -{ - size_t len = strlen(s); - - if (*left >= len) - { - strcpy(*aux, s); - *aux += len; - *left -= len; - } -} - -static void cheevos_add_hex(char** aux, size_t* left, unsigned v) -{ - char buffer[32]; - - snprintf(buffer, sizeof(buffer), "%06x", v); - buffer[sizeof(buffer) - 1] = 0; - - cheevos_add_string(aux, left, buffer); -} - -static void cheevos_add_uint(char** aux, size_t* left, unsigned v) -{ - char buffer[32]; - - snprintf(buffer, sizeof(buffer), "%u", v); - buffer[sizeof(buffer) - 1] = 0; - - cheevos_add_string(aux, left, buffer); -} - -static void cheevos_add_int(char** aux, size_t* left, int v) -{ - char buffer[32]; - - snprintf(buffer, sizeof(buffer), "%d", v); - buffer[sizeof(buffer) - 1] = 0; - - cheevos_add_string(aux, left, buffer); -} - -static void cheevos_log_var(const cheevos_var_t* var) -{ - if (!var) - return; - - RARCH_LOG("[CHEEVOS]: size: %s\n", - var->size == CHEEVOS_VAR_SIZE_BIT_0 ? "bit 0" : - var->size == CHEEVOS_VAR_SIZE_BIT_1 ? "bit 1" : - var->size == CHEEVOS_VAR_SIZE_BIT_2 ? "bit 2" : - var->size == CHEEVOS_VAR_SIZE_BIT_3 ? "bit 3" : - var->size == CHEEVOS_VAR_SIZE_BIT_4 ? "bit 4" : - var->size == CHEEVOS_VAR_SIZE_BIT_5 ? "bit 5" : - var->size == CHEEVOS_VAR_SIZE_BIT_6 ? "bit 6" : - var->size == CHEEVOS_VAR_SIZE_BIT_7 ? "bit 7" : - var->size == CHEEVOS_VAR_SIZE_NIBBLE_LOWER ? "low nibble" : - var->size == CHEEVOS_VAR_SIZE_NIBBLE_UPPER ? "high nibble" : - var->size == CHEEVOS_VAR_SIZE_EIGHT_BITS ? "byte" : - var->size == CHEEVOS_VAR_SIZE_SIXTEEN_BITS ? "word" : - var->size == CHEEVOS_VAR_SIZE_THIRTYTWO_BITS ? "dword" : - "?" - ); - RARCH_LOG("[CHEEVOS]: type: %s\n", - var->type == CHEEVOS_VAR_TYPE_ADDRESS ? "address" : - var->type == CHEEVOS_VAR_TYPE_VALUE_COMP ? "value" : - var->type == CHEEVOS_VAR_TYPE_DELTA_MEM ? "delta" : - var->type == CHEEVOS_VAR_TYPE_DYNAMIC_VAR ? "dynamic" : - "?" - ); - RARCH_LOG("[CHEEVOS]: value: %u\n", var->value); -} - -static void cheevos_log_cond(const cheevos_cond_t* cond) -{ - if (!cond) - return; - - RARCH_LOG("[CHEEVOS]: condition %p\n", cond); - RARCH_LOG("[CHEEVOS]: type: %s\n", - cond->type == CHEEVOS_COND_TYPE_STANDARD ? "standard" : - cond->type == CHEEVOS_COND_TYPE_PAUSE_IF ? "pause" : - cond->type == CHEEVOS_COND_TYPE_RESET_IF ? "reset" : - cond->type == CHEEVOS_COND_TYPE_ADD_SOURCE ? "add source" : - cond->type == CHEEVOS_COND_TYPE_SUB_SOURCE ? "sub source" : - cond->type == CHEEVOS_COND_TYPE_ADD_HITS ? "add hits" : - "?" - ); - RARCH_LOG("[CHEEVOS]: req_hits: %u\n", cond->req_hits); - RARCH_LOG("[CHEEVOS]: source:\n"); - cheevos_log_var(&cond->source); - RARCH_LOG("[CHEEVOS]: op: %s\n", - cond->op == CHEEVOS_COND_OP_EQUALS ? "==" : - cond->op == CHEEVOS_COND_OP_LESS_THAN ? "<" : - cond->op == CHEEVOS_COND_OP_LESS_THAN_OR_EQUAL ? "<=" : - cond->op == CHEEVOS_COND_OP_GREATER_THAN ? ">" : - cond->op == CHEEVOS_COND_OP_GREATER_THAN_OR_EQUAL ? ">=" : - cond->op == CHEEVOS_COND_OP_NOT_EQUAL_TO ? "!=" : - "?" - ); - RARCH_LOG("[CHEEVOS]: target:\n"); - cheevos_log_var(&cond->target); -} - -static void cheevos_log_cheevo(const cheevo_t* cheevo, - const cheevos_field_t* memaddr_ud) -{ - if (!cheevo || !memaddr_ud) - return; - - RARCH_LOG("[CHEEVOS]: cheevo %p\n", cheevo); - RARCH_LOG("[CHEEVOS]: id: %u\n", cheevo->id); - RARCH_LOG("[CHEEVOS]: title: %s\n", cheevo->title); - RARCH_LOG("[CHEEVOS]: desc: %s\n", cheevo->description); - RARCH_LOG("[CHEEVOS]: author: %s\n", cheevo->author); - RARCH_LOG("[CHEEVOS]: badge: %s\n", cheevo->badge); - RARCH_LOG("[CHEEVOS]: points: %u\n", cheevo->points); - RARCH_LOG("[CHEEVOS]: sets: TBD\n"); - RARCH_LOG("[CHEEVOS]: memaddr: %.*s\n", - (int)memaddr_ud->length, memaddr_ud->string); -} - -static void cheevos_add_var_size(char** aux, size_t* left, - const cheevos_var_t* var) -{ - if (!var) - return; - - switch( var->size ) - { - case CHEEVOS_VAR_SIZE_BIT_0: - cheevos_add_char(aux, left, 'M'); - break; - case CHEEVOS_VAR_SIZE_BIT_1: - cheevos_add_char(aux, left, 'N'); - break; - case CHEEVOS_VAR_SIZE_BIT_2: - cheevos_add_char(aux, left, 'O'); - break; - case CHEEVOS_VAR_SIZE_BIT_3: - cheevos_add_char(aux, left, 'P'); - break; - case CHEEVOS_VAR_SIZE_BIT_4: - cheevos_add_char(aux, left, 'Q'); - break; - case CHEEVOS_VAR_SIZE_BIT_5: - cheevos_add_char(aux, left, 'R'); - break; - case CHEEVOS_VAR_SIZE_BIT_6: - cheevos_add_char(aux, left, 'S'); - break; - case CHEEVOS_VAR_SIZE_BIT_7: - cheevos_add_char(aux, left, 'T'); - break; - case CHEEVOS_VAR_SIZE_NIBBLE_LOWER: - cheevos_add_char(aux, left, 'L'); - break; - case CHEEVOS_VAR_SIZE_NIBBLE_UPPER: - cheevos_add_char(aux, left, 'U'); - break; - case CHEEVOS_VAR_SIZE_EIGHT_BITS: - cheevos_add_char(aux, left, 'H'); - break; - case CHEEVOS_VAR_SIZE_THIRTYTWO_BITS: - cheevos_add_char(aux, left, 'X'); - break; - case CHEEVOS_VAR_SIZE_SIXTEEN_BITS: - default: - cheevos_add_char(aux, left, ' '); - break; - } -} - -static void cheevos_add_var(const cheevos_var_t* var, char** memaddr, - size_t *left) -{ - if (!var) - return; - - if ( var->type == CHEEVOS_VAR_TYPE_ADDRESS - || var->type == CHEEVOS_VAR_TYPE_DELTA_MEM) - { - if (var->type == CHEEVOS_VAR_TYPE_DELTA_MEM) - cheevos_add_char(memaddr, left, 'd'); - else if (var->is_bcd) - cheevos_add_char(memaddr, left, 'b'); - - cheevos_add_string(memaddr, left, "0x"); - cheevos_add_var_size(memaddr, left, var); - cheevos_add_hex(memaddr, left, var->value); - } - else if (var->type == CHEEVOS_VAR_TYPE_VALUE_COMP) - { - cheevos_add_uint(memaddr, left, var->value); - } -} - -static void cheevos_build_memaddr(const cheevos_condition_t* condition, - char* memaddr, size_t left) -{ - size_t i, j; - const cheevos_cond_t* cond; - const cheevos_condset_t *condset; - char *aux = memaddr; - - left--; /* reserve one char for the null terminator */ - - for (i = 0, condset = condition->condsets; - i < condition->count; i++, condset++) - { - if (i != 0) - cheevos_add_char(&aux, &left, 'S'); - - for (j = 0, cond = condset->conds; - j < condset->count; j++, cond++) - { - if (j != 0) - cheevos_add_char(&aux, &left, '_'); - - if (cond->type == CHEEVOS_COND_TYPE_RESET_IF) - cheevos_add_string(&aux, &left, "R:"); - else if (cond->type == CHEEVOS_COND_TYPE_PAUSE_IF) - cheevos_add_string(&aux, &left, "P:"); - else if (cond->type == CHEEVOS_COND_TYPE_ADD_SOURCE) - cheevos_add_string(&aux, &left, "A:"); - else if (cond->type == CHEEVOS_COND_TYPE_SUB_SOURCE) - cheevos_add_string(&aux, &left, "B:"); - else if (cond->type == CHEEVOS_COND_TYPE_ADD_HITS) - cheevos_add_string(&aux, &left, "C:"); - - cheevos_add_var(&cond->source, &aux, &left); - - switch (cond->op) - { - case CHEEVOS_COND_OP_EQUALS: - cheevos_add_char(&aux, &left, '='); - break; - case CHEEVOS_COND_OP_GREATER_THAN: - cheevos_add_char(&aux, &left, '>'); - break; - case CHEEVOS_COND_OP_GREATER_THAN_OR_EQUAL: - cheevos_add_string(&aux, &left, ">="); - break; - case CHEEVOS_COND_OP_LESS_THAN: - cheevos_add_char(&aux, &left, '<'); - break; - case CHEEVOS_COND_OP_LESS_THAN_OR_EQUAL: - cheevos_add_string(&aux, &left, "<="); - break; - case CHEEVOS_COND_OP_NOT_EQUAL_TO: - cheevos_add_string(&aux, &left, "!="); - break; - } - - cheevos_add_var(&cond->target, &aux, &left); - - if (cond->req_hits > 0) - { - cheevos_add_char(&aux, &left, '.'); - cheevos_add_uint(&aux, &left, cond->req_hits); - cheevos_add_char(&aux, &left, '.'); - } - } - } - - *aux = 0; -} - -static void cheevos_post_log_cheevo(const cheevo_t* cheevo) -{ - char memaddr[256]; - if (!cheevo) - return; - cheevos_build_memaddr(&cheevo->condition, memaddr, sizeof(memaddr)); - RARCH_LOG("[CHEEVOS]: memaddr (computed): %s\n", memaddr); -} - -static void cheevos_log_lboard(const cheevos_leaderboard_t* lb) -{ - unsigned i; - char mem[256]; - char* aux = NULL; - size_t left = 0; - - if (!lb) - return; - - RARCH_LOG("[CHEEVOS]: leaderboard %p\n", lb); - RARCH_LOG("[CHEEVOS]: id: %u\n", lb->id); - RARCH_LOG("[CHEEVOS]: title: %s\n", lb->title); - RARCH_LOG("[CHEEVOS]: desc: %s\n", lb->description); - - cheevos_build_memaddr(&lb->start, mem, sizeof(mem)); - RARCH_LOG("[CHEEVOS]: start: %s\n", mem); - - cheevos_build_memaddr(&lb->cancel, mem, sizeof(mem)); - RARCH_LOG("[CHEEVOS]: cancel: %s\n", mem); - - cheevos_build_memaddr(&lb->submit, mem, sizeof(mem)); - RARCH_LOG("[CHEEVOS]: submit: %s\n", mem); - - left = sizeof(mem); - aux = mem; - - for (i = 0; i < lb->value.count; i++) - { - if (i != 0) - cheevos_add_char(&aux, &left, '_'); - - cheevos_add_var(&lb->value.terms[i].var, &aux, &left); - cheevos_add_char(&aux, &left, '*'); - cheevos_add_int(&aux, &left, lb->value.terms[i].multiplier); - } - - RARCH_LOG("[CHEEVOS]: value: %s\n", mem); -} -#endif - static uint32_t cheevos_djb2(const char* str, size_t length) { const unsigned char *aux = (const unsigned char*)str; @@ -962,10 +646,8 @@ static int cheevos_parse_condition( cheevos_cond_count_in_set(memaddr, set); condset->conds = NULL; -#ifdef CHEEVOS_VERBOSE - RARCH_LOG("[CHEEVOS]: set %p (index=%u)\n", condset, set); - RARCH_LOG("[CHEEVOS]: conds: %u\n", condset->count); -#endif + CHEEVOS_LOG("[CHEEVOS]: set %p (index=%u)\n", condset, set); + CHEEVOS_LOG("[CHEEVOS]: conds: %u\n", condset->count); if (condset->count) { @@ -1210,23 +892,15 @@ static int cheevos_new_cheevo(cheevos_readud_t *ud) cheevo->last = 1; cheevo->modified = 0; - if ( !cheevo->title || - !cheevo->description || - !cheevo->author || + if ( !cheevo->title || + !cheevo->description || + !cheevo->author || !cheevo->badge) goto error; -#ifdef CHEEVOS_VERBOSE - cheevos_log_cheevo(cheevo, &ud->memaddr); -#endif - if (cheevos_parse_condition(&cheevo->condition, ud->memaddr.string)) goto error; -#ifdef CHEEVOS_VERBOSE - cheevos_post_log_cheevo(cheevo); -#endif - return 0; error: @@ -1334,12 +1008,10 @@ static int cheevos_new_lboard(cheevos_readud_t *ud) if (!ldb || !ud) return -1; + lboard = ldb + ud->lboard_count++; - if (!lboard) - return -1; - - lboard->id = strtol(ud->id.string, NULL, 10); + lboard->id = (unsigned)strtol(ud->id.string, NULL, 10); lboard->format = cheevos_parse_format(&ud->format); lboard->title = cheevos_dupstr(&ud->title); lboard->description = cheevos_dupstr(&ud->desc); @@ -1350,10 +1022,6 @@ static int cheevos_new_lboard(cheevos_readud_t *ud) if (cheevos_parse_mem(lboard, ud->memaddr.string)) goto error; -#ifdef CHEEVOS_VERBOSE - cheevos_log_lboard(lboard); -#endif - return 0; error: @@ -1548,7 +1216,7 @@ static int cheevos_parse(const char *json) calloc(lboard_count, sizeof(cheevos_leaderboard_t)); cheevos_locals.lboard_count = lboard_count; - if ( !cheevos_locals.core.cheevos || + if ( !cheevos_locals.core.cheevos || !cheevos_locals.unofficial.cheevos || !cheevos_locals.leaderboards) { @@ -1596,7 +1264,7 @@ static int cheevos_test_condition(cheevos_cond_t *cond) if (!cond) return 0; - sval = cheevos_var_get_value(&cond->source) + + sval = cheevos_var_get_value(&cond->source) + cheevos_locals.add_buffer; tval = cheevos_var_get_value(&cond->target); @@ -1621,62 +1289,31 @@ static int cheevos_test_condition(cheevos_cond_t *cond) return 1; } -static int cheevos_test_cond_set(const cheevos_condset_t *condset, - int *dirty_conds, int *reset_conds, int match_any) +static int cheevos_test_pause_cond_set(const cheevos_condset_t *condset, + int *dirty_conds, int *reset_conds, int process_pause) { int cond_valid = 0; - int set_valid = 1; - const cheevos_cond_t *end = NULL; + int set_valid = 1; /* must start true so AND logic works */ cheevos_cond_t *cond = NULL; - - if (!condset) - return 0; - - end = condset->conds + condset->count; + const cheevos_cond_t *end = condset->conds + condset->count; cheevos_locals.add_buffer = 0; cheevos_locals.add_hits = 0; - /* Now, read all Pause conditions, and if any are true, - * do not process further (retain old state). */ - for (cond = condset->conds; cond < end; cond++) { - if (cond->type != CHEEVOS_COND_TYPE_PAUSE_IF) - continue; - - /* Reset by default, set to 1 if hit! */ - cond->curr_hits = 0; - - if (cheevos_test_condition(cond)) - { - cond->curr_hits = 1; - *dirty_conds = 1; - - /* Early out: this achievement is paused, - * do not process any further! */ - return 0; - } - } - - /* Read all standard conditions, and process as normal: */ - for (cond = condset->conds; cond < end; cond++) - { - if ( cond->type == CHEEVOS_COND_TYPE_PAUSE_IF || - cond->type == CHEEVOS_COND_TYPE_RESET_IF) + if (cond->pause != process_pause) continue; if (cond->type == CHEEVOS_COND_TYPE_ADD_SOURCE) { cheevos_locals.add_buffer += cheevos_var_get_value(&cond->source); - set_valid &= 1; continue; } if (cond->type == CHEEVOS_COND_TYPE_SUB_SOURCE) { cheevos_locals.add_buffer -= cheevos_var_get_value(&cond->source); - set_valid &= 1; continue; } @@ -1692,17 +1329,17 @@ static int cheevos_test_cond_set(const cheevos_condset_t *condset, continue; } - if ( (cond->req_hits != 0) && - (cond->curr_hits + cheevos_locals.add_hits) >= cond->req_hits) - { - cheevos_locals.add_buffer = 0; - cheevos_locals.add_hits = 0; - continue; - } - + /* always evaluate the condition to ensure delta values get tracked correctly */ cond_valid = cheevos_test_condition(cond); - if (cond_valid) + /* if the condition has a target hit count that has already been met, + * it's automatically true, even if not currently true. */ + if ( (cond->req_hits != 0) && + (cond->curr_hits + cheevos_locals.add_hits) >= cond->req_hits) + { + cond_valid = 1; + } + else if (cond_valid) { cond->curr_hits++; *dirty_conds = 1; @@ -1711,38 +1348,100 @@ static int cheevos_test_cond_set(const cheevos_condset_t *condset, if (cond->req_hits == 0) ; /* Not a hit-based requirement: ignore any additional logic! */ else if ((cond->curr_hits + cheevos_locals.add_hits) < cond->req_hits) - cond_valid = 0; /* Not entirely valid yet! */ - - if (match_any) - break; + cond_valid = 0; /* HitCount target has not yet been met, condition is not yet valid. */ } cheevos_locals.add_buffer = 0; cheevos_locals.add_hits = 0; - /* Sequential or non-sequential? */ - set_valid &= cond_valid; - } - - /* Now, ONLY read reset conditions! */ - for (cond = condset->conds; cond < end; cond++) - { - if (cond->type != CHEEVOS_COND_TYPE_RESET_IF) - continue; - - cond_valid = cheevos_test_condition(cond); - - if (cond_valid) + if (cond->type == CHEEVOS_COND_TYPE_PAUSE_IF) { - *reset_conds = 1; /* Resets all hits found so far */ - set_valid = 0; /* Cannot be valid if we've hit a reset condition. */ - break; /* No point processing any further reset conditions. */ + /* as soon as we find a PauseIf that evaluates to true, + * stop processing the rest of the group. */ + if (cond_valid) + return 1; + + /* if we make it to the end of the function, make sure we are + * indicating nothing matched. if we do find a later PauseIf match, + * it'll automatically return true via the previous condition. */ + set_valid = 0; + + if (cond->req_hits == 0) + { + /* PauseIf didn't evaluate true, and doesn't have a HitCount, + * reset the HitCount to indicate the condition didn't match. */ + if (cond->curr_hits != 0) + { + cond->curr_hits = 0; + *dirty_conds = 1; + } + } + else + { + /* PauseIf has a HitCount that hasn't been met, ignore it for now. */ + } } + else if (cond->type == CHEEVOS_COND_TYPE_RESET_IF) + { + if (cond_valid) + { + *reset_conds = 1; /* Resets all hits found so far */ + set_valid = 0; /* Cannot be valid if we've hit a reset condition. */ + } + } + else /* Sequential or non-sequential? */ + set_valid &= cond_valid; } return set_valid; } +static int cheevos_test_cond_set(const cheevos_condset_t *condset, + int *dirty_conds, int *reset_conds) +{ + int in_pause = 0; + int has_pause = 0; + cheevos_cond_t *cond = NULL; + + if (!condset) + return 1; /* important: empty group must evaluate true */ + + /* the ints below are used for Pause conditions and their dependent AddSource/AddHits. */ + + /* this loop needs to go backwards to check AddSource/AddHits */ + cond = condset->conds + condset->count - 1; + for (; cond >= condset->conds; cond--) + { + if (cond->type == CHEEVOS_COND_TYPE_PAUSE_IF) + { + has_pause = 1; + in_pause = 1; + cond->pause = 1; + } + else if (cond->type == CHEEVOS_COND_TYPE_ADD_SOURCE || + cond->type == CHEEVOS_COND_TYPE_SUB_SOURCE || + cond->type == CHEEVOS_COND_TYPE_ADD_HITS) + { + cond->pause = in_pause; + } + else + { + in_pause = 0; + cond->pause = 0; + } + } + + if (has_pause) + { /* one or more Pause conditions exists, if any of them are true, + * stop processing this group. */ + if (cheevos_test_pause_cond_set(condset, dirty_conds, reset_conds, 1)) + return 0; + } + + /* process the non-Pause conditions to see if the group is true */ + return cheevos_test_pause_cond_set(condset, dirty_conds, reset_conds, 0); +} + static int cheevos_reset_cond_set(cheevos_condset_t *condset, int deltas) { int dirty = 0; @@ -1801,14 +1500,14 @@ static int cheevos_test_cheevo(cheevo_t *cheevo) if (condset < end) { - ret_val = cheevos_test_cond_set(condset, &dirty_conds, &reset_conds, 0); + ret_val = cheevos_test_cond_set(condset, &dirty_conds, &reset_conds); condset++; } while (condset < end) { ret_val_sub_cond |= cheevos_test_cond_set( - condset, &dirty_conds, &reset_conds, 0); + condset, &dirty_conds, &reset_conds); condset++; } @@ -1879,7 +1578,7 @@ static void cheevos_make_unlock_url(const cheevo_t *cheevo, settings->arrays.cheevos_username, cheevos_locals.token, cheevo->id, - settings->bools.cheevos_hardcore_mode_enable ? 1 : 0 + settings->bools.cheevos_hardcore_mode_enable && !cheevos_hardcore_paused ? 1 : 0 ); url[url_size - 1] = 0; @@ -1896,14 +1595,14 @@ static void cheevos_unlocked(void *task_data, void *user_data, if (!error) { - RARCH_LOG("[CHEEVOS]: awarded achievement %u.\n", cheevo->id); + CHEEVOS_LOG("[CHEEVOS]: awarded achievement %u.\n", cheevo->id); } else { char url[256]; url[0] = '\0'; - RARCH_ERR("[CHEEVOS]: error awarding achievement %u, retrying...\n", cheevo->id); + CHEEVOS_ERR("[CHEEVOS]: error awarding achievement %u, retrying...\n", cheevo->id); cheevos_make_unlock_url(cheevo, url, sizeof(url)); task_push_http_transfer(url, true, NULL, cheevos_unlocked, cheevo); @@ -1922,7 +1621,7 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set) end = set->cheevos + set->count; - if (settings && settings->bools.cheevos_hardcore_mode_enable) + if (settings && settings->bools.cheevos_hardcore_mode_enable && !cheevos_hardcore_paused) mode = CHEEVOS_ACTIVE_HARDCORE; for (cheevo = set->cheevos; cheevo < end; cheevo++) @@ -1934,7 +1633,7 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set) if (cheevo->last) { cheevos_condset_t* condset = cheevo->condition.condsets; - const cheevos_condset_t* end = cheevo->condition.condsets + const cheevos_condset_t* end = cheevo->condition.condsets + cheevo->condition.count; for (; condset < end; condset++) @@ -1951,7 +1650,7 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set) if (mode == CHEEVOS_ACTIVE_HARDCORE) cheevo->active &= ~CHEEVOS_ACTIVE_SOFTCORE; - RARCH_LOG("[CHEEVOS]: awarding cheevo %u: %s (%s).\n", + CHEEVOS_LOG("[CHEEVOS]: awarding cheevo %u: %s (%s).\n", cheevo->id, cheevo->title, cheevo->description); snprintf(msg, sizeof(msg), "Achievement Unlocked: %s", @@ -1976,9 +1675,9 @@ static void cheevos_test_cheevo_set(const cheevoset_t *set) if (take_screenshot(shotname, true, video_driver_cached_frame_has_valid_framebuffer())) - RARCH_LOG("[CHEEVOS]: got a screenshot for cheevo %u\n", cheevo->id); + CHEEVOS_LOG("[CHEEVOS]: got a screenshot for cheevo %u\n", cheevo->id); else - RARCH_LOG("[CHEEVOS]: failed to get screenshot for cheevo %u\n", cheevo->id); + CHEEVOS_LOG("[CHEEVOS]: failed to get screenshot for cheevo %u\n", cheevo->id); } } @@ -2006,14 +1705,14 @@ static int cheevos_test_lboard_condition(const cheevos_condition_t* condition) if (condset < end) { ret_val = cheevos_test_cond_set( - condset, &dirty_conds, &reset_conds, 0); + condset, &dirty_conds, &reset_conds); condset++; } while (condset < end) { ret_val_sub_cond |= cheevos_test_cond_set( - condset, &dirty_conds, &reset_conds, 0); + condset, &dirty_conds, &reset_conds); condset++; } @@ -2044,7 +1743,7 @@ static int cheevos_expr_value(cheevos_expr_t* expr) if (expr->compare_count >= ARRAY_SIZE(values)) { - RARCH_ERR("[CHEEVOS]: too many values in the leaderboard expression: %u\n", expr->compare_count); + CHEEVOS_ERR("[CHEEVOS]: too many values in the leaderboard expression: %u\n", expr->compare_count); return 0; } @@ -2054,11 +1753,11 @@ static int cheevos_expr_value(cheevos_expr_t* expr) { if (current_value >= ARRAY_SIZE(values)) { - RARCH_ERR("[CHEEVOS]: too many values in the leaderboard expression: %u\n", current_value); + CHEEVOS_ERR("[CHEEVOS]: too many values in the leaderboard expression: %u\n", current_value); return 0; } - values[current_value] += + values[current_value] += cheevos_var_get_value(&term->var) * term->multiplier; if (term->compare_next) @@ -2128,11 +1827,11 @@ static void cheevos_lboard_submit(void *task_data, void *user_data, if (!error) { - RARCH_ERR("[CHEEVOS]: error submitting leaderboard %u\n", lboard->id); + CHEEVOS_ERR("[CHEEVOS]: error submitting leaderboard %u\n", lboard->id); return; } - RARCH_LOG("[CHEEVOS]: submitted leaderboard %u.\n", lboard->id); + CHEEVOS_LOG("[CHEEVOS]: submitted leaderboard %u.\n", lboard->id); } static void cheevos_test_leaderboards(void) @@ -2151,10 +1850,8 @@ static void cheevos_test_leaderboards(void) if (value != lboard->last_value) { -#ifdef CHEEVOS_VERBOSE - RARCH_LOG("[CHEEVOS]: value lboard %s %u\n", + CHEEVOS_LOG("[CHEEVOS]: value lboard %s %u\n", lboard->title, value); -#endif lboard->last_value = value; } @@ -2165,7 +1862,7 @@ static void cheevos_test_leaderboards(void) /* failsafe for improper LBs */ if (value == 0) { - RARCH_LOG("[CHEEVOS]: error: lboard %s tried to submit 0\n", + CHEEVOS_LOG("[CHEEVOS]: error: lboard %s tried to submit 0\n", lboard->title); runloop_msg_queue_push("Leaderboard attempt cancelled!", 0, 2 * 60, false); @@ -2179,7 +1876,7 @@ static void cheevos_test_leaderboards(void) cheevos_make_lboard_url(lboard, url, sizeof(url)); task_push_http_transfer(url, true, NULL, cheevos_lboard_submit, lboard); - RARCH_LOG("[CHEEVOS]: submit lboard %s\n", lboard->title); + CHEEVOS_LOG("[CHEEVOS]: submit lboard %s\n", lboard->title); cheevos_format_value(value, lboard->format, formatted_value, sizeof(formatted_value)); @@ -2192,7 +1889,7 @@ static void cheevos_test_leaderboards(void) if (cheevos_test_lboard_condition(&lboard->cancel)) { - RARCH_LOG("[CHEEVOS]: cancel lboard %s\n", lboard->title); + CHEEVOS_LOG("[CHEEVOS]: cancel lboard %s\n", lboard->title); lboard->active = 0; runloop_msg_queue_push("Leaderboard attempt cancelled!", 0, 2 * 60, false); @@ -2204,7 +1901,7 @@ static void cheevos_test_leaderboards(void) { char msg[256]; - RARCH_LOG("[CHEEVOS]: start lboard %s\n", lboard->title); + CHEEVOS_LOG("[CHEEVOS]: start lboard %s\n", lboard->title); lboard->active = 1; lboard->last_value = -1; @@ -2317,10 +2014,10 @@ static int cheevos_deactivate__json_number(void *userdata, } if (found) - RARCH_LOG("[CHEEVOS]: deactivated unlocked cheevo %u (%s).\n", + CHEEVOS_LOG("[CHEEVOS]: deactivated unlocked cheevo %u (%s).\n", cheevo->id, cheevo->title); else - RARCH_ERR("[CHEEVOS]: unknown cheevo to deactivate: %u.\n", id); + CHEEVOS_ERR("[CHEEVOS]: unknown cheevo to deactivate: %u.\n", id); } return 0; @@ -2359,7 +2056,7 @@ void cheevos_reset_game(void) if (!cheevo) return; - + end = cheevo + cheevos_locals.core.count; for (; cheevo < end; cheevo++) @@ -2375,7 +2072,7 @@ void cheevos_reset_game(void) void cheevos_populate_menu(void *data) { #ifdef HAVE_MENU - unsigned i; + unsigned i = 0; unsigned items_found = 0; settings_t *settings = config_get_ptr(); menu_displaylist_info_t *info = (menu_displaylist_info_t*)data; @@ -2383,40 +2080,55 @@ void cheevos_populate_menu(void *data) cheevo_t *cheevo = cheevos_locals.core.cheevos; end = cheevo + cheevos_locals.core.count; + if(settings->bools.cheevos_enable && settings->bools.cheevos_hardcore_mode_enable + && cheevos_loaded) + { + if (!cheevos_hardcore_paused) + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_PAUSE), + msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE), + MENU_ENUM_LABEL_ACHIEVEMENT_PAUSE, + MENU_SETTING_ACTION_PAUSE_ACHIEVEMENTS, 0, 0); + else + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACHIEVEMENT_RESUME), + msg_hash_to_str(MENU_ENUM_LABEL_ACHIEVEMENT_RESUME), + MENU_ENUM_LABEL_ACHIEVEMENT_RESUME, + MENU_SETTING_ACTION_RESUME_ACHIEVEMENTS, 0, 0); + } + if (cheevo) { for (i = 0; cheevo < end; i++, cheevo++) { if (!(cheevo->active & CHEEVOS_ACTIVE_HARDCORE)) { - menu_entries_append_enum(info->list, cheevo->title, + menu_entries_append_enum(info->list, cheevo->title, cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE, MENU_SETTINGS_CHEEVOS_START + i, 0, 0); - items_found++; - set_badge_info(&badges_ctx, i, cheevo->badge, + set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_HARDCORE)); } else if (!(cheevo->active & CHEEVOS_ACTIVE_SOFTCORE)) { - menu_entries_append_enum(info->list, cheevo->title, + menu_entries_append_enum(info->list, cheevo->title, cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY, MENU_SETTINGS_CHEEVOS_START + i, 0, 0); - items_found++; - set_badge_info(&badges_ctx, i, cheevo->badge, + set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE)); } else { - menu_entries_append_enum(info->list, cheevo->title, + menu_entries_append_enum(info->list, cheevo->title, cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY, MENU_SETTINGS_CHEEVOS_START + i, 0, 0); - items_found++; - set_badge_info(&badges_ctx, i, cheevo->badge, + set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE)); } + items_found++; } } @@ -2426,7 +2138,7 @@ void cheevos_populate_menu(void *data) { end = cheevo + cheevos_locals.unofficial.count; - for (i = cheevos_locals.core.count; cheevo < end; i++, cheevo++) + for (i = items_found; cheevo < end; i++, cheevo++) { if (!(cheevo->active & CHEEVOS_ACTIVE_HARDCORE)) { @@ -2434,7 +2146,6 @@ void cheevos_populate_menu(void *data) cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY_HARDCORE, MENU_SETTINGS_CHEEVOS_START + i, 0, 0); - items_found++; set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_HARDCORE)); } @@ -2444,7 +2155,6 @@ void cheevos_populate_menu(void *data) cheevo->description, MENU_ENUM_LABEL_CHEEVOS_UNLOCKED_ENTRY, MENU_SETTINGS_CHEEVOS_START + i, 0, 0); - items_found++; set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE)); } @@ -2454,10 +2164,10 @@ void cheevos_populate_menu(void *data) cheevo->description, MENU_ENUM_LABEL_CHEEVOS_LOCKED_ENTRY, MENU_SETTINGS_CHEEVOS_START + i, 0, 0); - items_found++; set_badge_info(&badges_ctx, i, cheevo->badge, (cheevo->active & CHEEVOS_ACTIVE_SOFTCORE)); } + items_found++; } } @@ -2487,7 +2197,7 @@ bool cheevos_get_description(cheevos_ctx_desc_t *desc) if (desc->idx >= cheevos_locals.core.count) { cheevos = cheevos_locals.unofficial.cheevos; - desc->idx -= cheevos_locals.unofficial.count; + desc->idx -= cheevos_locals.core.count; } if (!string_is_empty(cheevos[desc->idx].description)) @@ -2516,9 +2226,7 @@ bool cheevos_unload(void) if (running) { -#ifdef CHEEVOS_VERBOSE - RARCH_LOG("[CHEEVOS]: Asked the load thread to terminate\n"); -#endif + CHEEVOS_LOG("[CHEEVOS]: Asked the load thread to terminate\n"); task_queue_cancel_task(cheevos_locals.task); #ifdef HAVE_THREADS @@ -2544,6 +2252,7 @@ bool cheevos_unload(void) cheevos_locals.unofficial.count = 0; cheevos_loaded = false; + cheevos_hardcore_paused = false; return true; } @@ -2556,19 +2265,19 @@ bool cheevos_toggle_hardcore_mode(void) return false; /* reset and deinit rewind to avoid cheat the score */ - if (settings->bools.cheevos_hardcore_mode_enable) + if (settings->bools.cheevos_hardcore_mode_enable && !cheevos_hardcore_paused) { const char *msg = msg_hash_to_str( MSG_CHEEVOS_HARDCORE_MODE_ENABLE); - /* send reset core cmd to avoid any user + /* send reset core cmd to avoid any user * savestate previusly loaded. */ command_event(CMD_EVENT_RESET, NULL); if (settings->bools.rewind_enable) command_event(CMD_EVENT_REWIND_DEINIT, NULL); - RARCH_LOG("%s\n", msg); + CHEEVOS_LOG("%s\n", msg); runloop_msg_queue_push(msg, 0, 3 * 60, true); } else @@ -2583,7 +2292,7 @@ bool cheevos_toggle_hardcore_mode(void) static void cheevos_patch_addresses(cheevoset_t* set) { unsigned i; - cheevo_t* cheevo = NULL; + cheevo_t* cheevo = NULL; if (!set) return; @@ -2612,7 +2321,7 @@ static void cheevos_patch_addresses(cheevoset_t* set) cheevos_var_patch_addr(&cond->source, cheevos_locals.console_id); #ifdef CHEEVOS_DUMP_ADDRS - RARCH_LOG("[CHEEVOS]: s-var %03d:%08X\n", + CHEEVOS_LOG("[CHEEVOS]: s-var %03d:%08X\n", cond->source.bank_id + 1, cond->source.value); #endif break; @@ -2628,7 +2337,7 @@ static void cheevos_patch_addresses(cheevoset_t* set) cheevos_var_patch_addr(&cond->target, cheevos_locals.console_id); #ifdef CHEEVOS_DUMP_ADDRS - RARCH_LOG("[CHEEVOS]: t-var %03d:%08X\n", + CHEEVOS_LOG("[CHEEVOS]: t-var %03d:%08X\n", cond->target.bank_id + 1, cond->target.value); #endif break; @@ -2665,7 +2374,7 @@ static void cheevos_patch_lb_conditions(cheevos_condition_t* condition) cheevos_var_patch_addr(&cond->source, cheevos_locals.console_id); #ifdef CHEEVOS_DUMP_ADDRS - RARCH_LOG("[CHEEVOS]: s-var %03d:%08X\n", + CHEEVOS_LOG("[CHEEVOS]: s-var %03d:%08X\n", cond->source.bank_id + 1, cond->source.value); #endif break; @@ -2679,7 +2388,7 @@ static void cheevos_patch_lb_conditions(cheevos_condition_t* condition) cheevos_var_patch_addr(&cond->target, cheevos_locals.console_id); #ifdef CHEEVOS_DUMP_ADDRS - RARCH_LOG("[CHEEVOS]: t-var %03d:%08X\n", + CHEEVOS_LOG("[CHEEVOS]: t-var %03d:%08X\n", cond->target.bank_id + 1, cond->target.value); #endif break; @@ -2708,7 +2417,7 @@ static void cheevos_patch_lb_expressions(cheevos_expr_t* expression) case CHEEVOS_VAR_TYPE_DELTA_MEM: cheevos_var_patch_addr(&term->var, cheevos_locals.console_id); #ifdef CHEEVOS_DUMP_ADDRS - RARCH_LOG("[CHEEVOS]: s-var %03d:%08X\n", + CHEEVOS_LOG("[CHEEVOS]: s-var %03d:%08X\n", term->var.bank_id + 1, term->var.value); #endif break; @@ -2756,8 +2465,9 @@ void cheevos_test(void) if (settings->bools.cheevos_test_unofficial) cheevos_test_cheevo_set(&cheevos_locals.unofficial); - if (settings->bools.cheevos_hardcore_mode_enable && - settings->bools.cheevos_leaderboards_enable) + if (settings->bools.cheevos_hardcore_mode_enable && + settings->bools.cheevos_leaderboards_enable && + !cheevos_hardcore_paused) cheevos_test_leaderboards(); } } @@ -2787,14 +2497,14 @@ cheevos_console_t cheevos_get_console(void) /* Uncomment the following two lines to debug cheevos_iterate, this will * disable the coroutine yielding. - * + * * The code is very easy to understand. It's meant to be like BASIC: * CORO_GOTO will jump execution to another label, CORO_GOSUB will * call another label, and CORO_RET will return from a CORO_GOSUB. - * + * * This coroutine code is inspired in a very old pure C implementation * that runs everywhere: - * + * * https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html */ /*#undef CORO_YIELD @@ -2911,6 +2621,8 @@ static int cheevos_iterate(coro_t *coro) CORO_ENTER(); + + cheevos_locals.addrs_patched = false; coro->settings = config_get_ptr(); @@ -2927,26 +2639,26 @@ static int cheevos_iterate(coro_t *coro) cheevos_locals.meminfo[3].id = RETRO_MEMORY_RTC; core_get_memory(&cheevos_locals.meminfo[3]); - RARCH_LOG("[CHEEVOS]: system RAM: %p %u\n", + CHEEVOS_LOG("[CHEEVOS]: system RAM: %p %u\n", cheevos_locals.meminfo[0].data, cheevos_locals.meminfo[0].size); - RARCH_LOG("[CHEEVOS]: save RAM: %p %u\n", + CHEEVOS_LOG("[CHEEVOS]: save RAM: %p %u\n", cheevos_locals.meminfo[1].data, cheevos_locals.meminfo[1].size); - RARCH_LOG("[CHEEVOS]: video RAM: %p %u\n", + CHEEVOS_LOG("[CHEEVOS]: video RAM: %p %u\n", cheevos_locals.meminfo[2].data, cheevos_locals.meminfo[2].size); - RARCH_LOG("[CHEEVOS]: RTC: %p %u\n", + CHEEVOS_LOG("[CHEEVOS]: RTC: %p %u\n", cheevos_locals.meminfo[3].data, cheevos_locals.meminfo[3].size); /* Bail out if cheevos are disabled. - * But set the above anyways, + * But set the above anyways, * command_read_ram needs it. */ if (!coro->settings->bools.cheevos_enable) CORO_STOP(); - /* Load the content into memory, or copy it + /* Load the content into memory, or copy it * over to our own buffer */ if (!coro->data) { @@ -3034,7 +2746,7 @@ static int cheevos_iterate(coro_t *coro) { if (finders[coro->i].ext_hashes[coro->j] == hash) { - RARCH_LOG("[CHEEVOS]: testing %s.\n", + CHEEVOS_LOG("[CHEEVOS]: testing %s.\n", finders[coro->i].name); /* @@ -3059,7 +2771,7 @@ static int cheevos_iterate(coro_t *coro) if (finders[coro->i].ext_hashes) continue; - RARCH_LOG("[CHEEVOS]: testing %s.\n", + CHEEVOS_LOG("[CHEEVOS]: testing %s.\n", finders[coro->i].name); /* @@ -3072,7 +2784,7 @@ static int cheevos_iterate(coro_t *coro) goto found; } - RARCH_LOG("[CHEEVOS]: this game doesn't feature achievements.\n"); + CHEEVOS_LOG("[CHEEVOS]: this game doesn't feature achievements.\n"); CORO_STOP(); found: @@ -3098,7 +2810,7 @@ found: if (!coro->json) { runloop_msg_queue_push("Error loading achievements.", 0, 5 * 60, false); - RARCH_ERR("[CHEEVOS]: error loading achievements.\n"); + CHEEVOS_ERR("[CHEEVOS]: error loading achievements.\n"); CORO_STOP(); } #endif @@ -3137,6 +2849,7 @@ found: cheevos_locals.unofficial.count = 0; cheevos_loaded = false; + cheevos_hardcore_paused = false; CORO_STOP(); } @@ -3162,7 +2875,7 @@ found: const cheevo_t* end = cheevo + cheevos_locals.core.count; int number_of_unlocked = cheevos_locals.core.count; - if (coro->settings->bools.cheevos_hardcore_mode_enable) + if (coro->settings->bools.cheevos_hardcore_mode_enable && !cheevos_hardcore_paused) mode = CHEEVOS_ACTIVE_HARDCORE; for (; cheevo < end; cheevo++) @@ -3317,7 +3030,7 @@ found: /* from FCEU core - check if Trainer included in ROM data */ MD5_Init(&coro->md5); - coro->offset = sizeof(coro->header) + (coro->header.rom_type & 4 + coro->offset = sizeof(coro->header) + (coro->header.rom_type & 4 ? sizeof(coro->header) : 0); coro->count = 0x4000 * coro->bytes; CORO_GOSUB(EVAL_MD5); @@ -3428,7 +3141,7 @@ found: { char gameid[16]; - RARCH_LOG( + CHEEVOS_LOG( "[CHEEVOS]: getting game id for hash %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x\n", coro->hash[ 0], coro->hash[ 1], coro->hash[ 2], coro->hash[ 3], coro->hash[ 4], coro->hash[ 5], coro->hash[ 6], coro->hash[ 7], @@ -3461,14 +3174,14 @@ found: { if ((void*)coro->json) free((void*)coro->json); - RARCH_ERR("[CHEEVOS]: error getting game_id.\n"); + CHEEVOS_ERR("[CHEEVOS]: error getting game_id.\n"); CORO_RET(); } if ((void*)coro->json) free((void*)coro->json); - RARCH_LOG("[CHEEVOS]: got game id %s.\n", gameid); - coro->gameid = strtol(gameid, NULL, 10); + CHEEVOS_LOG("[CHEEVOS]: got game id %s.\n", gameid); + coro->gameid = (unsigned)strtol(gameid, NULL, 10); CORO_RET(); } @@ -3497,11 +3210,11 @@ found: if (!coro->json) { - RARCH_ERR("[CHEEVOS]: error getting achievements for game id %u.\n", coro->gameid); + CHEEVOS_ERR("[CHEEVOS]: error getting achievements for game id %u.\n", coro->gameid); CORO_STOP(); } - RARCH_LOG("[CHEEVOS]: got achievements for game id %u.\n", coro->gameid); + CHEEVOS_LOG("[CHEEVOS]: got achievements for game id %u.\n", coro->gameid); CORO_RET(); /************************************************************************** @@ -3554,7 +3267,7 @@ found: if (!badge_exists(coro->badge_fullpath)) { #ifdef CHEEVOS_LOG_BADGES - RARCH_LOG( + CHEEVOS_LOG( "[CHEEVOS]: downloading badge %s\n", coro->badge_fullpath); #endif @@ -3569,7 +3282,7 @@ found: { if (!filestream_write_file(coro->badge_fullpath, coro->json, coro->k)) - RARCH_ERR("[CHEEVOS]: error writing badge %s\n", coro->badge_fullpath); + CHEEVOS_ERR("[CHEEVOS]: error writing badge %s\n", coro->badge_fullpath); else free(coro->json); } @@ -3589,29 +3302,43 @@ found: { char urle_user[64]; - char urle_pwd[64]; + char urle_login[64]; const char *username = coro ? coro->settings->arrays.cheevos_username : NULL; - const char *password = coro ? coro->settings->arrays.cheevos_password : NULL; + const char *login = NULL; + bool via_token = false; - if (!username || !*username || !password || !*password) + if (coro) + { + if (string_is_empty(coro->settings->arrays.cheevos_password)) + { + via_token = true; + login = coro->settings->arrays.cheevos_token; + } + else + login = coro->settings->arrays.cheevos_password; + } + else + login = NULL; + + if (string_is_empty(username) || string_is_empty(login)) { runloop_msg_queue_push( - "Missing Retro Achievements account information.", + "Missing RetroAchievements account information.", 0, 5 * 60, false); runloop_msg_queue_push( "Please fill in your account information in Settings.", 0, 5 * 60, false); - RARCH_ERR("[CHEEVOS]: username and/or password not informed.\n"); + CHEEVOS_ERR("[CHEEVOS]: login info not informed.\n"); CORO_STOP(); } cheevos_url_encode(username, urle_user, sizeof(urle_user)); - cheevos_url_encode(password, urle_pwd, sizeof(urle_pwd)); + cheevos_url_encode(login, urle_login, sizeof(urle_login)); snprintf( coro->url, sizeof(coro->url), - "http://retroachievements.org/dorequest.php?r=login&u=%s&p=%s", - urle_user, urle_pwd + "http://retroachievements.org/dorequest.php?r=login&u=%s&%c=%s", + urle_user, via_token ? 't' : 'p', urle_login ); coro->url[sizeof(coro->url) - 1] = 0; @@ -3626,32 +3353,67 @@ found: if (coro->json) { - int res = cheevos_get_value( + char error_response[64]; + char error_message[256]; + + cheevos_get_value( + coro->json, + CHEEVOS_JSON_KEY_ERROR, + error_response, + sizeof(error_response) + ); + + /* No error, continue with login */ + if (string_is_empty(error_response)) + { + int res = cheevos_get_value( coro->json, CHEEVOS_JSON_KEY_TOKEN, cheevos_locals.token, sizeof(cheevos_locals.token)); + if ((void*)coro->json) + free((void*)coro->json); + + if (!res) + { + if (coro->settings->bools.cheevos_verbose_enable) + { + char msg[256]; + snprintf(msg, sizeof(msg), + "RetroAchievements: Logged in as \"%s\".", + coro->settings->arrays.cheevos_username); + msg[sizeof(msg) - 1] = 0; + runloop_msg_queue_push(msg, 0, 3 * 60, false); + } + + /* Save token to config and clear pass on success */ + *coro->settings->arrays.cheevos_password = '\0'; + strncpy( + coro->settings->arrays.cheevos_token, + cheevos_locals.token, sizeof(cheevos_locals.token) + ); + CORO_RET(); + } + } + if ((void*)coro->json) free((void*)coro->json); - if (!res) - { - if (coro->settings->bools.cheevos_verbose_enable) - { - char msg[256]; - snprintf(msg, sizeof(msg), - "RetroAchievements: logged in as \"%s\".", - coro->settings->arrays.cheevos_username); - msg[sizeof(msg) - 1] = 0; - runloop_msg_queue_push(msg, 0, 3 * 60, false); - } - CORO_RET(); - } + /* Site returned error, display it */ + snprintf(error_message, sizeof(error_message), + "RetroAchievements: %s", + error_response); + error_message[sizeof(error_message) - 1] = 0; + runloop_msg_queue_push(error_message, 0, 5 * 60, false); + *coro->settings->arrays.cheevos_token = '\0'; + + CORO_STOP(); } - runloop_msg_queue_push("Retro Achievements login error.", 0, 5 * 60, false); - RARCH_ERR("[CHEEVOS]: error getting user token.\n"); + runloop_msg_queue_push("RetroAchievements: Error contacting server.", 0, 5 * 60, false); + CHEEVOS_ERR("[CHEEVOS]: error getting user token.\n"); + CORO_STOP(); /************************************************************************** @@ -3682,7 +3444,7 @@ found: for (coro->k = 0; coro->k < 5; coro->k++) { if (coro->k != 0) - RARCH_LOG("[CHEEVOS]: Retrying HTTP request: %u of 5\n", coro->k + 1); + CHEEVOS_LOG("[CHEEVOS]: Retrying HTTP request: %u of 5\n", coro->k + 1); coro->json = NULL; coro->conn = net_http_connection_new( @@ -3733,7 +3495,7 @@ found: coro->json[length] = 0; } - coro->k = length; + coro->k = (unsigned)length; net_http_delete(coro->http); net_http_connection_free(coro->conn); CORO_RET(); @@ -3744,7 +3506,7 @@ found: net_http_connection_free(coro->conn); } - RARCH_LOG("[CHEEVOS]: Couldn't connect to server after 5 tries\n"); + CHEEVOS_LOG("[CHEEVOS]: Couldn't connect to server after 5 tries\n"); CORO_RET(); /************************************************************************** @@ -3762,7 +3524,7 @@ found: coro->url, sizeof(coro->url), "http://retroachievements.org/dorequest.php?r=unlocks&u=%s&t=%s&g=%u&h=0", coro->settings->arrays.cheevos_username, - cheevos_locals.token, coro->gameid + cheevos_locals.token, coro->gameid ); coro->url[sizeof(coro->url) - 1] = 0; @@ -3776,15 +3538,15 @@ found: if (coro->json) { if (!cheevos_deactivate_unlocks(coro->json, CHEEVOS_ACTIVE_SOFTCORE)) - RARCH_LOG("[CHEEVOS]: deactivated unlocked achievements in softcore mode.\n"); + CHEEVOS_LOG("[CHEEVOS]: deactivated unlocked achievements in softcore mode.\n"); else - RARCH_ERR("[CHEEVOS]: error deactivating unlocked achievements in softcore mode.\n"); + CHEEVOS_ERR("[CHEEVOS]: error deactivating unlocked achievements in softcore mode.\n"); if ((void*)coro->json) free((void*)coro->json); } else - RARCH_ERR("[CHEEVOS]: error retrieving list of unlocked achievements in softcore mode.\n"); + CHEEVOS_ERR("[CHEEVOS]: error retrieving list of unlocked achievements in softcore mode.\n"); /* Deactivate achievements in hardcore mode. */ snprintf( @@ -3805,15 +3567,15 @@ found: if (coro->json) { if (!cheevos_deactivate_unlocks(coro->json, CHEEVOS_ACTIVE_HARDCORE)) - RARCH_LOG("[CHEEVOS]: deactivated unlocked achievements in hardcore mode.\n"); + CHEEVOS_LOG("[CHEEVOS]: deactivated unlocked achievements in hardcore mode.\n"); else - RARCH_ERR("[CHEEVOS]: error deactivating unlocked achievements in hardcore mode.\n"); + CHEEVOS_ERR("[CHEEVOS]: error deactivating unlocked achievements in hardcore mode.\n"); if ((void*)coro->json) free((void*)coro->json); } else - RARCH_ERR("[CHEEVOS]: error retrieving list of unlocked achievements in hardcore mode.\n"); + CHEEVOS_ERR("[CHEEVOS]: error retrieving list of unlocked achievements in hardcore mode.\n"); #endif CORO_RET(); @@ -3829,7 +3591,7 @@ found: coro->url, sizeof(coro->url), "http://retroachievements.org/dorequest.php?r=postactivity&u=%s&t=%s&a=3&m=%u", coro->settings->arrays.cheevos_username, - cheevos_locals.token, coro->gameid + cheevos_locals.token, coro->gameid ); coro->url[sizeof(coro->url) - 1] = 0; @@ -3842,14 +3604,14 @@ found: if (coro->json) { - RARCH_LOG("[CHEEVOS]: posted playing activity.\n"); + CHEEVOS_LOG("[CHEEVOS]: posted playing activity.\n"); if ((void*)coro->json) free((void*)coro->json); } else - RARCH_ERR("[CHEEVOS]: error posting playing activity.\n"); + CHEEVOS_ERR("[CHEEVOS]: error posting playing activity.\n"); - RARCH_LOG("[CHEEVOS]: posted playing activity.\n"); + CHEEVOS_LOG("[CHEEVOS]: posted playing activity.\n"); CORO_RET(); CORO_LEAVE(); @@ -3870,16 +3632,14 @@ static void cheevos_task_handler(retro_task_t *task) cheevos_locals.task = NULL; CHEEVOS_UNLOCK(cheevos_locals.task_lock); -#ifdef CHEEVOS_VERBOSE if (task_get_cancelled(task)) { - RARCH_LOG("[CHEEVOS]: Load task cancelled\n"); + CHEEVOS_LOG("[CHEEVOS]: Load task cancelled\n"); } else { - RARCH_LOG("[CHEEVOS]: Load task finished\n"); + CHEEVOS_LOG("[CHEEVOS]: Load task finished\n"); } -#endif if (coro->data) free(coro->data); @@ -3898,6 +3658,7 @@ bool cheevos_load(const void *data) coro_t *coro = NULL; cheevos_loaded = false; + cheevos_hardcore_paused = false; if (!cheevos_locals.core_supports || !data) return false; diff --git a/cheevos/cheevos.h b/cheevos/cheevos.h index dd070ef441..45c799dfe3 100644 --- a/cheevos/cheevos.h +++ b/cheevos/cheevos.h @@ -38,6 +38,20 @@ End of setup #define CHEEVOS_TAG "[CHEEVOS]: " +#ifdef CHEEVOS_VERBOSE + +#define CHEEVOS_LOG RARCH_LOG +#define CHEEVOS_ERR RARCH_ERR + +#else + +void cheevos_log(const char *fmt, ...); + +#define CHEEVOS_LOG cheevos_log +#define CHEEVOS_ERR cheevos_log + +#endif + typedef struct cheevos_ctx_desc { unsigned idx; @@ -139,6 +153,8 @@ bool cheevos_get_support_cheevos(void); cheevos_console_t cheevos_get_console(void); extern bool cheevos_loaded; +extern bool cheevos_hardcore_active; +extern bool cheevos_hardcore_paused; extern int cheats_are_enabled; extern int cheats_were_enabled; diff --git a/cheevos/cond.c b/cheevos/cond.c index 3566f8e6bf..9f665900c9 100644 --- a/cheevos/cond.c +++ b/cheevos/cond.c @@ -65,7 +65,7 @@ static cheevos_cond_op_t cheevos_cond_parse_operator(const char** memaddr) } else { - RARCH_ERR(CHEEVOS_TAG "unknown operator %c\n.", *str); + CHEEVOS_ERR(CHEEVOS_TAG "unknown operator %c\n.", *str); op = CHEEVOS_COND_OP_EQUALS; } @@ -168,9 +168,6 @@ void cheevos_cond_parse_in_set(cheevos_cond_t* cond, const char* memaddr, unsign if (index == which) { cheevos_cond_parse(cond, &memaddr); -#ifdef CHEEVOS_VERBOSE - /*cheevos_log_cond(cond);*/ -#endif cond++; } else diff --git a/cheevos/cond.h b/cheevos/cond.h index 5fc0e532b6..ee7cb668a1 100644 --- a/cheevos/cond.h +++ b/cheevos/cond.h @@ -47,6 +47,7 @@ typedef struct cheevos_cond_type_t type; unsigned req_hits; unsigned curr_hits; + char pause; cheevos_var_t source; cheevos_cond_op_t op; diff --git a/cheevos/var.c b/cheevos/var.c index 41884a72b6..5f13c2b8b6 100644 --- a/cheevos/var.c +++ b/cheevos/var.c @@ -24,17 +24,6 @@ #include "../core.h" #include "../verbosity.h" -static void STUB_LOG(const char *fmt, ...) -{ - (void)fmt; -} - -#ifdef CHEEVOS_VERBOSE -#define CHEEVOS_LOG RARCH_LOG -#else -#define CHEEVOS_LOG STUB_LOG -#endif - /***************************************************************************** Parsing *****************************************************************************/ @@ -191,12 +180,6 @@ void cheevos_var_patch_addr(cheevos_var_t* var, cheevos_console_t console) var->value -= 0x2000; } } - else if (console == CHEEVOS_CONSOLE_NEOGEO_POCKET) - { - if (var->value >= 0x4000 && var->value <= 0x7fff) - CHEEVOS_LOG(CHEEVOS_TAG "NGP memory address %X adjusted to %X\n", var->value, var->value - 0x004000); - var->value -= 0x4000; - } if (system->mmaps.num_descriptors != 0) { @@ -333,7 +316,7 @@ uint8_t* cheevos_var_get_memory(const cheevos_var_t* var) meminfo.id = RETRO_MEMORY_RTC; break; default: - RARCH_ERR(CHEEVOS_TAG "invalid bank id: %s\n", var->bank_id); + CHEEVOS_ERR(CHEEVOS_TAG "invalid bank id: %s\n", var->bank_id); break; } diff --git a/command.c b/command.c index ab871166c0..a33f8e1faf 100644 --- a/command.c +++ b/command.c @@ -44,6 +44,12 @@ #include "cheevos/var.h" #endif +#ifdef HAVE_DISCORD +#include "discord/discord.h" +#endif + +#include "midi/midi_driver.h" + #ifdef HAVE_MENU #include "menu/menu_driver.h" #include "menu/menu_content.h" @@ -169,6 +175,7 @@ static const struct cmd_map map[] = { { "DISK_NEXT", RARCH_DISK_NEXT }, { "DISK_PREV", RARCH_DISK_PREV }, { "GRAB_MOUSE_TOGGLE", RARCH_GRAB_MOUSE_TOGGLE }, + { "UI_COMPANION_TOGGLE", RARCH_UI_COMPANION_TOGGLE }, { "GAME_FOCUS_TOGGLE", RARCH_GAME_FOCUS_TOGGLE }, { "MENU_TOGGLE", RARCH_MENU_TOGGLE }, { "MENU_UP", RETRO_DEVICE_ID_JOYPAD_UP }, @@ -1015,7 +1022,7 @@ static void command_event_init_controllers(void) /* Ideally these checks shouldn't be required but if we always * call core_set_controller_port_device input won't work on * cores that don't set port information properly */ - if (info && info->ports.size != 0 && i < info->ports.size) + if (info && info->ports.size != 0) set_controller = true; break; default: @@ -1029,7 +1036,7 @@ static void command_event_init_controllers(void) break; } - if (set_controller) + if (set_controller && i < info->ports.size) { pad.device = device; pad.port = i; @@ -1087,7 +1094,7 @@ static void command_event_load_auto_state(void) #endif #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) goto error; #endif @@ -1274,8 +1281,8 @@ static bool command_event_init_core(enum rarch_core_type *data) if (!core_load(settings->uints.input_poll_type_behavior)) return false; - rarch_ctl(RARCH_CTL_SET_FRAME_LIMIT, NULL); + rarch_ctl(RARCH_CTL_SET_FRAME_LIMIT, NULL); return true; } @@ -1296,7 +1303,9 @@ static void command_event_restore_default_shader_preset(void) static void command_event_restore_remaps(void) { - if (rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL)) + if (rarch_ctl(RARCH_CTL_IS_REMAPS_CORE_ACTIVE, NULL) || + rarch_ctl(RARCH_CTL_IS_REMAPS_CONTENT_DIR_ACTIVE, NULL) || + rarch_ctl(RARCH_CTL_IS_REMAPS_GAME_ACTIVE, NULL)) input_remapping_set_defaults(true); } @@ -1325,7 +1334,7 @@ static bool command_event_save_auto_state(void) goto error; #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) goto error; #endif @@ -1386,7 +1395,6 @@ static bool command_event_save_config( static bool command_event_save_core_config(void) { char msg[128]; - bool ret = false; bool found_path = false; bool overrides_active = false; const char *core_path = NULL; @@ -1493,7 +1501,7 @@ static bool command_event_save_core_config(void) free(config_dir); free(config_name); free(config_path); - return ret; + return true; } /** @@ -1519,6 +1527,7 @@ static void command_event_save_current_config(enum override_type type) break; case OVERRIDE_GAME: case OVERRIDE_CORE: + case OVERRIDE_CONTENT_DIR: if (config_save_overrides(type)) { strlcpy(msg, msg_hash_to_str(MSG_OVERRIDES_SAVED_SUCCESSFULLY), sizeof(msg)); @@ -1705,17 +1714,11 @@ void command_playlist_update_write( const char *core_path, const char *core_display_name, const char *crc32, - const char *db_name) + const char *db_name) { playlist_t *plist = (playlist_t*)data; - playlist_t *playlist = NULL; + playlist_t *playlist = plist ? plist : playlist_get_cached(); - if (plist) - playlist = plist; -#ifdef HAVE_MENU - else - menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); -#endif if (!playlist) return; @@ -1742,8 +1745,8 @@ void command_playlist_update_write( **/ bool command_event(enum event_command cmd, void *data) { - settings_t *settings = config_get_ptr(); - bool boolean = false; + static bool discord_inited = false; + bool boolean = false; switch (cmd) { @@ -1793,10 +1796,11 @@ bool command_event(enum event_command cmd, void *data) return false; #endif - libretro_get_system_info( + if (!libretro_get_system_info( core_path, system, - &system_info->load_no_content); + &system_info->load_no_content)) + return false; info_find.path = core_path; if (!core_info_load(&info_find)) @@ -1809,11 +1813,17 @@ bool command_event(enum event_command cmd, void *data) } break; case CMD_EVENT_LOAD_CORE: - command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL); + { + bool success = command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL); + #ifndef HAVE_DYNAMIC command_event(CMD_EVENT_QUIT, NULL); +#else + if (!success) + return false; #endif break; + } case CMD_EVENT_LOAD_STATE: /* Immutable - disallow savestate load when * we absolutely cannot change game state. */ @@ -1821,20 +1831,24 @@ bool command_event(enum event_command cmd, void *data) return false; #ifdef HAVE_CHEEVOS - { - settings_t *settings = config_get_ptr(); - if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable) - return false; - } + if (cheevos_hardcore_active) + return false; #endif - - return command_event_main_state(cmd); + if (!command_event_main_state(cmd)) + return false; + break; case CMD_EVENT_UNDO_LOAD_STATE: - return command_event_main_state(cmd); + if (!command_event_main_state(cmd)) + return false; + break; case CMD_EVENT_UNDO_SAVE_STATE: - return command_event_main_state(cmd); + if (!command_event_main_state(cmd)) + return false; + break; case CMD_EVENT_RESIZE_WINDOWED_SCALE: - return command_event_resize_windowed_scale(); + if (!command_event_resize_windowed_scale()) + return false; + break; case CMD_EVENT_MENU_TOGGLE: #ifdef HAVE_MENU if (menu_driver_is_alive()) @@ -1860,12 +1874,12 @@ bool command_event(enum event_command cmd, void *data) #if HAVE_NETWORKING netplay_driver_ctl(RARCH_NETPLAY_CTL_RESET, NULL); #endif - return command_event_main_state(cmd); + return false; case CMD_EVENT_SAVE_STATE: { settings_t *settings = config_get_ptr(); #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) return false; #endif @@ -1875,7 +1889,9 @@ bool command_event(enum event_command cmd, void *data) configuration_set_int(settings, settings->ints.state_slot, new_state_slot); } } - return command_event_main_state(cmd); + if (!command_event_main_state(cmd)) + return false; + break; case CMD_EVENT_SAVE_STATE_DECREMENT: { settings_t *settings = config_get_ptr(); @@ -1925,36 +1941,39 @@ bool command_event(enum event_command cmd, void *data) } break; case CMD_EVENT_QUIT: - return retroarch_main_quit(); + if (!retroarch_main_quit()) + return false; + break; case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE: #ifdef HAVE_CHEEVOS cheevos_toggle_hardcore_mode(); #endif break; - /* this fallthrough is on purpose, it should do + /* this fallthrough is on purpose, it should do a CMD_EVENT_REINIT too */ case CMD_EVENT_REINIT_FROM_TOGGLE: retroarch_unset_forced_fullscreen(); case CMD_EVENT_REINIT: + video_driver_reinit(); { - video_driver_reinit(); - { - const input_driver_t *input_drv = input_get_ptr(); - void *input_data = input_get_data(); - /* Poll input to avoid possibly stale data to corrupt things. */ - if (input_drv && input_drv->poll) - input_drv->poll(input_data); - } - command_event(CMD_EVENT_GAME_FOCUS_TOGGLE, (void*)(intptr_t)-1); + const input_driver_t *input_drv = input_get_ptr(); + void *input_data = input_get_data(); + /* Poll input to avoid possibly stale data to corrupt things. */ + if (input_drv && input_drv->poll) + input_drv->poll(input_data); + } + command_event(CMD_EVENT_GAME_FOCUS_TOGGLE, (void*)(intptr_t)-1); #ifdef HAVE_MENU + { + settings_t *settings = config_get_ptr(); menu_display_set_framebuffer_dirty_flag(); if (settings->bools.video_fullscreen) video_driver_hide_mouse(); if (menu_driver_is_alive()) command_event(CMD_EVENT_VIDEO_SET_BLOCKING_STATE, NULL); -#endif } +#endif break; case CMD_EVENT_CHEATS_DEINIT: cheat_manager_state_free(); @@ -1967,21 +1986,17 @@ bool command_event(enum event_command cmd, void *data) cheat_manager_apply_cheats(); break; case CMD_EVENT_REWIND_DEINIT: - { #ifdef HAVE_CHEEVOS - settings_t *settings = config_get_ptr(); - if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable) - return false; + if (cheevos_hardcore_active) + return false; #endif - - state_manager_event_deinit(); - } + state_manager_event_deinit(); break; case CMD_EVENT_REWIND_INIT: { settings_t *settings = config_get_ptr(); #ifdef HAVE_CHEEVOS - if (cheevos_loaded && settings->bools.cheevos_hardcore_mode_enable) + if (cheevos_hardcore_active) return false; #endif if (settings->bools.rewind_enable) @@ -1992,7 +2007,7 @@ TODO: Add a setting for these tweaks */ if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL)) #endif { - state_manager_event_init((unsigned)settings->rewind_buffer_size); + state_manager_event_init((unsigned)settings->sizes.rewind_buffer_size); } } } @@ -2016,7 +2031,7 @@ TODO: Add a setting for these tweaks */ case CMD_EVENT_AUTOSAVE_INIT: command_event(CMD_EVENT_AUTOSAVE_DEINIT, NULL); #ifdef HAVE_THREADS - { + { #ifdef HAVE_NETWORKING /* Only enable state manager if netplay is not underway TODO: Add a setting for these tweaks */ @@ -2030,16 +2045,21 @@ TODO: Add a setting for these tweaks */ else runloop_unset(RUNLOOP_ACTION_AUTOSAVE); } - } + } #endif break; case CMD_EVENT_AUTOSAVE_STATE: command_event_save_auto_state(); break; case CMD_EVENT_AUDIO_STOP: - return audio_driver_stop(); + midi_driver_set_all_sounds_off(); + if (!audio_driver_stop()) + return false; + break; case CMD_EVENT_AUDIO_START: - return audio_driver_start(rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL)); + if (!audio_driver_start(rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL))) + return false; + break; case CMD_EVENT_AUDIO_MUTE_TOGGLE: { bool audio_mute_enable = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE)); @@ -2128,7 +2148,7 @@ TODO: Add a setting for these tweaks */ } g_defaults.music_history = NULL; -#ifdef HAVE_FFMPEG +#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) if (g_defaults.video_history) { playlist_write_file(g_defaults.video_history); @@ -2178,7 +2198,7 @@ TODO: Add a setting for these tweaks */ settings->paths.path_content_music_history, content_history_size); -#ifdef HAVE_FFMPEG +#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) RARCH_LOG("%s: [%s].\n", msg_hash_to_str(MSG_LOADING_HISTORY_FILE), settings->paths.path_content_video_history); @@ -2202,11 +2222,22 @@ TODO: Add a setting for these tweaks */ break; case CMD_EVENT_CORE_INFO_INIT: { + char ext_name[255]; settings_t *settings = config_get_ptr(); + + ext_name[0] = '\0'; + command_event(CMD_EVENT_CORE_INFO_DEINIT, NULL); + if (!frontend_driver_get_core_extension(ext_name, sizeof(ext_name))) + return false; + if (!string_is_empty(settings->paths.directory_libretro)) - core_info_init_list(); + core_info_init_list(settings->paths.path_libretro_info, + settings->paths.directory_libretro, + ext_name, + settings->bools.show_hidden_files + ); } break; case CMD_EVENT_CORE_DEINIT: @@ -2301,7 +2332,7 @@ TODO: Add a setting for these tweaks */ case CMD_EVENT_RESUME: rarch_menu_running_finished(); if (ui_companion_is_on_foreground()) - ui_companion_driver_toggle(); + ui_companion_driver_toggle(false); break; case CMD_EVENT_ADD_TO_FAVORITES: { @@ -2350,7 +2381,7 @@ TODO: Add a setting for these tweaks */ runloop_msg_queue_push(msg_hash_to_str(MSG_RESET_CORE_ASSOCIATION), 1, 180, true); break; - } + } case CMD_EVENT_RESTART_RETROARCH: if (!frontend_driver_set_fork(FRONTEND_FORK_RESTART)) return false; @@ -2364,6 +2395,9 @@ TODO: Add a setting for these tweaks */ case CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE: command_event_save_current_config(OVERRIDE_CORE); break; + case CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR: + command_event_save_current_config(OVERRIDE_CONTENT_DIR); + break; case CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_GAME: command_event_save_current_config(OVERRIDE_GAME); break; @@ -2496,17 +2530,18 @@ TODO: Add a setting for these tweaks */ /* buf is expected to be address|port */ char *buf = (char *)data; static struct string_list *hostname = NULL; + settings_t *settings = config_get_ptr(); hostname = string_split(buf, "|"); command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); RARCH_LOG("[netplay] connecting to %s:%d\n", hostname->elems[0].data, !string_is_empty(hostname->elems[1].data) - ? atoi(hostname->elems[1].data) : 55435); + ? atoi(hostname->elems[1].data) : settings->uints.netplay_port); if (!init_netplay(NULL, hostname->elems[0].data, !string_is_empty(hostname->elems[1].data) - ? atoi(hostname->elems[1].data) : 55435)) + ? atoi(hostname->elems[1].data) : settings->uints.netplay_port)) { command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); string_list_free(hostname); @@ -2529,17 +2564,18 @@ TODO: Add a setting for these tweaks */ /* buf is expected to be address|port */ char *buf = (char *)data; static struct string_list *hostname = NULL; + settings_t *settings = config_get_ptr(); hostname = string_split(buf, "|"); command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); RARCH_LOG("[netplay] connecting to %s:%d\n", hostname->elems[0].data, !string_is_empty(hostname->elems[1].data) - ? atoi(hostname->elems[1].data) : 55435); + ? atoi(hostname->elems[1].data) : settings->uints.netplay_port); if (!init_netplay_deferred(hostname->elems[0].data, !string_is_empty(hostname->elems[1].data) - ? atoi(hostname->elems[1].data) : 55435)) + ? atoi(hostname->elems[1].data) : settings->uints.netplay_port)) { command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); string_list_free(hostname); @@ -2572,7 +2608,7 @@ TODO: Add a setting for these tweaks */ case CMD_EVENT_FULLSCREEN_TOGGLE: { settings_t *settings = config_get_ptr(); - bool new_fullscreen_state = !settings->bools.video_fullscreen + bool new_fullscreen_state = !settings->bools.video_fullscreen && !retroarch_is_forced_fullscreen(); if (!video_driver_has_windowed()) return false; @@ -2608,14 +2644,13 @@ TODO: Add a setting for these tweaks */ command_event(CMD_EVENT_REMOTE_DEINIT, NULL); input_driver_init_remote(); break; - case CMD_EVENT_MAPPER_DEINIT: input_driver_deinit_mapper(); break; case CMD_EVENT_MAPPER_INIT: command_event(CMD_EVENT_MAPPER_DEINIT, NULL); input_driver_init_mapper(); - break; + break; case CMD_EVENT_LOG_FILE_DEINIT: retro_main_log_file_deinit(); break; @@ -2624,8 +2659,10 @@ TODO: Add a setting for these tweaks */ const char *path = (const char*)data; if (string_is_empty(path)) return false; - return command_event_disk_control_append_image(path); + if (!command_event_disk_control_append_image(path)) + return false; } + break; case CMD_EVENT_DISK_EJECT_TOGGLE: { rarch_system_info_t *info = runloop_get_system_info(); @@ -2731,6 +2768,9 @@ TODO: Add a setting for these tweaks */ video_driver_show_mouse(); } break; + case CMD_EVENT_UI_COMPANION_TOGGLE: + ui_companion_driver_toggle(true); + break; case CMD_EVENT_GAME_FOCUS_TOGGLE: { static bool game_focus_state = false; @@ -2803,6 +2843,41 @@ TODO: Add a setting for these tweaks */ #if HAVE_LIBUI extern int libui_main(void); libui_main(); +#endif + break; + case CMD_EVENT_DISCORD_INIT: +#ifdef HAVE_DISCORD + { + settings_t *settings = config_get_ptr(); + + if (!settings->bools.discord_enable) + return false; + if (discord_inited) + return true; + + discord_init(); + discord_inited = true; + } +#endif + break; + case CMD_EVENT_DISCORD_DEINIT: +#ifdef HAVE_DISCORD + if (!discord_inited) + return false; + + discord_shutdown(); + discord_inited = false; +#endif + break; + case CMD_EVENT_DISCORD_UPDATE: +#ifdef HAVE_DISCORD + if (!data || !discord_inited) + return false; + + { + discord_userdata_t *userdata = (discord_userdata_t*)data; + discord_update(userdata->status); + } #endif break; case CMD_EVENT_NONE: diff --git a/command.h b/command.h index 9cc3e3ce17..6b50d6f3eb 100644 --- a/command.h +++ b/command.h @@ -139,7 +139,7 @@ enum event_command /* Add a playlist entry to favorites. */ CMD_EVENT_ADD_TO_FAVORITES, /* Reset playlist entry associated core to DETECT */ - CMD_EVENT_RESET_CORE_ASSOCIATION, + CMD_EVENT_RESET_CORE_ASSOCIATION, /* Toggles pause. */ CMD_EVENT_PAUSE_TOGGLE, /* Pauses RetroArch. */ @@ -149,6 +149,7 @@ enum event_command CMD_EVENT_PAUSE_CHECKS, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE, + CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CONTENT_DIR, CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_GAME, CMD_EVENT_MENU_SAVE_CONFIG, CMD_EVENT_MENU_PAUSE_LIBRETRO, @@ -218,6 +219,8 @@ enum event_command CMD_EVENT_GRAB_MOUSE_TOGGLE, /* Toggles game focus. */ CMD_EVENT_GAME_FOCUS_TOGGLE, + /* Toggles desktop menu. */ + CMD_EVENT_UI_COMPANION_TOGGLE, /* Toggles fullscreen mode. */ CMD_EVENT_FULLSCREEN_TOGGLE, CMD_EVENT_PERFCNT_REPORT_FRONTEND_LOG, @@ -228,6 +231,9 @@ enum event_command CMD_EVENT_DISABLE_OVERRIDES, CMD_EVENT_RESTORE_REMAPS, CMD_EVENT_RESTORE_DEFAULT_SHADER_PRESET, + CMD_EVENT_DISCORD_INIT, + CMD_EVENT_DISCORD_DEINIT, + CMD_EVENT_DISCORD_UPDATE, CMD_EVENT_LIBUI_TEST }; @@ -271,7 +277,7 @@ void command_playlist_push_write( void command_playlist_update_write( void *data, size_t idx, - const char *path, + const char *path, const char *label, const char *core_path, const char *core_display_name, diff --git a/config.def.h b/config.def.h index 48041da022..189449b793 100644 --- a/config.def.h +++ b/config.def.h @@ -67,6 +67,10 @@ static bool bundle_assets_extract_enable = false; static bool materialui_icons_enable = true; #endif +static const bool crt_switch_resolution = false; +static const int crt_switch_resolution_super = 2560; + + static const bool def_history_list_enable = true; static const bool def_playlist_entry_remove = true; static const bool def_playlist_entry_rename = true; @@ -177,7 +181,7 @@ static unsigned swap_interval = 1; static const bool video_threaded = false; #if defined(HAVE_THREADS) -#if defined(GEKKO) || defined(PSP) || defined(_3DS) +#if defined(GEKKO) || defined(PSP) /* For single-core consoles right now it's better to have this be disabled. */ static const bool threaded_data_runloop_enable = false; #else @@ -257,10 +261,12 @@ static bool quick_menu_show_options = true; static bool quick_menu_show_controls = true; static bool quick_menu_show_cheats = true; static bool quick_menu_show_shaders = true; -static bool quick_menu_show_save_core_overrides = true; -static bool quick_menu_show_save_game_overrides = true; static bool quick_menu_show_information = true; +static bool quick_menu_show_save_core_overrides = true; +static bool quick_menu_show_save_game_overrides = true; +static bool quick_menu_show_save_content_dir_overrides = true; + static bool kiosk_mode_enable = false; static bool menu_show_online_updater = true; @@ -271,6 +277,7 @@ static bool menu_show_configurations = true; static bool menu_show_help = true; static bool menu_show_quit_retroarch = true; static bool menu_show_reboot = true; +static bool menu_show_shutdown = true; #if defined(HAVE_LAKKA) || defined(VITA) || defined(_3DS) static bool menu_show_core_updater = false; #else @@ -283,7 +290,7 @@ static bool content_show_favorites = true; static bool content_show_images = true; #endif static bool content_show_music = true; -#ifdef HAVE_FFMPEG +#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) static bool content_show_video = true; #endif #ifdef HAVE_NETWORKING @@ -293,6 +300,7 @@ static bool content_show_history = true; #ifdef HAVE_LIBRETRODB static bool content_show_add = true; #endif +static bool content_show_playlists = true; #ifdef HAVE_XMB static unsigned xmb_scale_factor = 100; @@ -300,6 +308,7 @@ static unsigned xmb_alpha_factor = 75; static unsigned menu_font_color_red = 255; static unsigned menu_font_color_green = 255; static unsigned menu_font_color_blue = 255; +static unsigned xmb_menu_layout = 0; static unsigned xmb_icon_theme = XMB_ICON_THEME_MONOCHROME; static unsigned xmb_theme = XMB_THEME_ELECTRIC_BLUE; #if defined(HAVE_LAKKA) || defined(__arm__) || defined(__PPC64__) || defined(__ppc64__) || defined(__powerpc64__) || defined(__powerpc__) || defined(__ppc__) || defined(__POWERPC__) @@ -515,6 +524,9 @@ static const bool rewind_enable = false; * 15-20MB per minute. Very game dependant. */ static const unsigned rewind_buffer_size = 20 << 20; /* 20MiB */ +/* The amount of MB to increase/decrease the rewind_buffer_size when it is changed via the UI. */ +static const unsigned rewind_buffer_size_step = 10; /* 10MB */ + /* How many frames to rewind at a time. */ static const unsigned rewind_granularity = 1; @@ -595,6 +607,9 @@ static const unsigned run_ahead_frames = 1; /* When using the Run Ahead feature, use a secondary instance of the core. */ static const bool run_ahead_secondary_instance = true; +/* Hide warning messages when using the Run Ahead feature. */ +static const bool run_ahead_hide_warnings = false; + /* Enable stdin/network command interface. */ static const bool network_cmd_enable = false; static const uint16_t network_cmd_port = 55355; @@ -650,6 +665,8 @@ static const unsigned input_poll_type_behavior = 2; static const unsigned input_bind_timeout = 5; +static const unsigned input_bind_hold = 2; + static const unsigned menu_thumbnails_default = 3; static const unsigned menu_left_thumbnails_default = 0; @@ -664,6 +681,12 @@ static const bool ui_companion_start_on_boot = true; static const bool ui_companion_enable = false; +/* Currently only used to show the WIMP UI on startup */ +static const bool ui_companion_toggle = false; + +/* Only init the WIMP UI for this session if this is enabled */ +static const bool desktop_menu_enable = true; + #if defined(__QNX__) || defined(_XBOX1) || defined(_XBOX360) || defined(__CELLOS_LV2__) || (defined(__MACH__) && defined(IOS)) || defined(ANDROID) || defined(WIIU) || defined(HAVE_NEON) || defined(GEKKO) || defined(__ARM_NEON__) static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_LOWER; #elif defined(PSP) || defined(_3DS) || defined(VITA) @@ -672,13 +695,25 @@ static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_ static enum resampler_quality audio_resampler_quality_level = RESAMPLER_QUALITY_NORMAL; #endif +/* MIDI */ +static const char *midi_input = "Off"; +static const char *midi_output = "Off"; +static const unsigned midi_volume = 100; + +/* Only applies to Android 7.0 (API 24) and up */ +static const bool sustained_performance_mode = false; + #if defined(ANDROID) -#if defined(ANDROID_ARM) +#if defined(ANDROID_ARM_V7) static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/"; +#elif defined(ANDROID_ARM) +static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi/"; #elif defined(ANDROID_AARCH64) static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/arm64-v8a/"; #elif defined(ANDROID_X86) static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/x86/"; +#elif defined(ANDROID_X64) +static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/x86_64/"; #else static char buildbot_server_url[] = ""; #endif diff --git a/config.def.keybinds.h b/config.def.keybinds.h index 298f9971a6..d941a210cf 100644 --- a/config.def.keybinds.h +++ b/config.def.keybinds.h @@ -97,6 +97,7 @@ static const struct retro_keybind retro_keybinds_1[] = { { true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE }, { true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE }, { true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE }, + { true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE }, { true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE }, #else { true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, NO_BTN, 0, AXIS_NONE }, @@ -172,6 +173,7 @@ static const struct retro_keybind retro_keybinds_1[] = { { true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE }, { true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_F11, NO_BTN, NO_BTN, 0, AXIS_NONE }, { true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_SCROLLOCK, NO_BTN, NO_BTN, 0, AXIS_NONE }, + { true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_F5, NO_BTN, NO_BTN, 0, AXIS_NONE }, { true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_F1, NO_BTN, NO_BTN, 0, AXIS_NONE }, #endif }; diff --git a/config.features.h b/config.features.h index 96b06539ba..f05836d122 100644 --- a/config.features.h +++ b/config.features.h @@ -80,6 +80,12 @@ static const bool _vulkan_supp = true; static const bool _vulkan_supp = false; #endif +#ifdef HAVE_METAL +static const bool _metal_supp = true; +#else +static const bool _metal_supp = false; +#endif + #if defined(HAVE_OPENGLES) || defined(HAVE_OPENGLES2) || defined(HAVE_OPENGLES3) || defined(HAVE_OPENGLES_3_1) || defined(HAVE_OPENGLES_3_2) static const bool _opengles_supp = true; #else @@ -272,6 +278,12 @@ static const bool _ffmpeg_supp = true; static const bool _ffmpeg_supp = false; #endif +#ifdef HAVE_MPV +static const bool _mpv_supp = true; +#else +static const bool _mpv_supp = false; +#endif + #ifdef HAVE_FREETYPE static const bool _freetype_supp = true; #else diff --git a/configuration.c b/configuration.c index f3a2f5b6f3..c681a2ab1e 100644 --- a/configuration.c +++ b/configuration.c @@ -52,6 +52,8 @@ #include "tasks/tasks_internal.h" +#include "../list_special.h" + static const char* invalid_filename_chars[] = { /* https://support.microsoft.com/en-us/help/905231/information-about-the-characters-that-you-cannot-use-in-site-names--fo */ "~", "#", "%", "&", "*", "{", "}", "\\", ":", "[", "]", "?", "/", "|", "\'", "\"", @@ -90,6 +92,16 @@ struct config_uint_setting enum rarch_override_setting override; }; +struct config_size_setting +{ + const char *ident; + size_t *ptr; + bool def_enable; + size_t def; + bool handle; + enum rarch_override_setting override; +}; + struct config_float_setting { const char *ident; @@ -123,6 +135,7 @@ enum video_driver_enum { VIDEO_GL = 0, VIDEO_VULKAN, + VIDEO_METAL, VIDEO_DRM, VIDEO_XVIDEO, VIDEO_SDL, @@ -282,9 +295,16 @@ enum record_driver_enum RECORD_NULL }; +enum midi_driver_enum +{ + MIDI_WINMM = RECORD_NULL + 1, + MIDI_NULL +}; #if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__) static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL; +#elif defined(HAVE_METAL) +static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL; #elif defined(GEKKO) static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WII; #elif defined(WIIU) @@ -387,6 +407,12 @@ static enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_FFMPEG; static enum record_driver_enum RECORD_DEFAULT_DRIVER = RECORD_NULL; #endif +#ifdef HAVE_WINMM +static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_WINMM; +#else +static enum midi_driver_enum MIDI_DEFAULT_DRIVER = MIDI_NULL; +#endif + #if defined(XENON) static enum input_driver_enum INPUT_DEFAULT_DRIVER = INPUT_XENON360; #elif defined(_XBOX360) || defined(_XBOX) || defined(HAVE_XINPUT2) || defined(HAVE_XINPUT_XBOX1) @@ -537,6 +563,9 @@ static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_NULL; #define SETTING_UINT(key, configval, default_enable, default_setting, handle_setting) \ GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_uint_setting, handle_setting) +#define SETTING_SIZE(key, configval, default_enable, default_setting, handle_setting) \ + GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_size_setting, handle_setting) + #define SETTING_PATH(key, configval, default_enable, default_setting, handle_setting) \ GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_path_setting, handle_setting) @@ -701,6 +730,8 @@ const char *config_get_default_video(void) return "gl"; case VIDEO_VULKAN: return "vulkan"; + case VIDEO_METAL: + return "metal"; case VIDEO_DRM: return "drm"; case VIDEO_WII: @@ -1010,6 +1041,26 @@ const char *config_get_default_menu(void) return "null"; } +const char *config_get_default_midi(void) +{ + enum midi_driver_enum default_driver = MIDI_DEFAULT_DRIVER; + + switch (default_driver) + { + case MIDI_WINMM: + return "winmm"; + case MIDI_NULL: + break; + } + + return "null"; +} + +const char *config_get_midi_driver_options(void) +{ + return char_list_new_special(STRING_LIST_MIDI_DRIVERS, NULL); +} + bool config_overlay_enable_default(void) { if (g_defaults.overlay.set) @@ -1038,6 +1089,7 @@ static struct config_array_setting *populate_settings_array(settings_t *settings #ifdef HAVE_CHEEVOS SETTING_ARRAY("cheevos_username", settings->arrays.cheevos_username, false, NULL, true); SETTING_ARRAY("cheevos_password", settings->arrays.cheevos_password, false, NULL, true); + SETTING_ARRAY("cheevos_token", settings->arrays.cheevos_token, false, NULL, true); #endif SETTING_ARRAY("video_context_driver", settings->arrays.video_context_driver, false, NULL, true); SETTING_ARRAY("audio_driver", settings->arrays.audio_driver, false, NULL, true); @@ -1050,6 +1102,9 @@ static struct config_array_setting *populate_settings_array(settings_t *settings SETTING_ARRAY("bundle_assets_dst_path_subdir", settings->arrays.bundle_assets_dst_subdir, false, NULL, true); SETTING_ARRAY("led_driver", settings->arrays.led_driver, false, NULL, true); SETTING_ARRAY("netplay_mitm_server", settings->arrays.netplay_mitm_server, false, NULL, true); + SETTING_ARRAY("midi_driver", settings->arrays.midi_driver, false, NULL, true); + SETTING_ARRAY("midi_input", settings->arrays.midi_input, true, midi_input, true); + SETTING_ARRAY("midi_output", settings->arrays.midi_output, true, midi_output, true); *size = count; return tmp; @@ -1184,6 +1239,8 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, 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); SETTING_BOOL("ui_companion_enable", &settings->bools.ui_companion_enable, true, ui_companion_enable, false); + SETTING_BOOL("ui_companion_toggle", &settings->bools.ui_companion_toggle, false, ui_companion_toggle, false); + SETTING_BOOL("desktop_menu_enable", &settings->bools.desktop_menu_enable, true, desktop_menu_enable, false); SETTING_BOOL("video_gpu_record", &settings->bools.video_gpu_record, true, gpu_record, false); SETTING_BOOL("input_remap_binds_enable", &settings->bools.input_remap_binds_enable, true, true, false); SETTING_BOOL("all_users_control_menu", &settings->bools.input_all_users_control_menu, true, all_users_control_menu, false); @@ -1227,6 +1284,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("run_ahead_enabled", &settings->bools.run_ahead_enabled, true, false, false); SETTING_BOOL("run_ahead_secondary_instance", &settings->bools.run_ahead_secondary_instance, true, false, false); + SETTING_BOOL("run_ahead_hide_warnings", &settings->bools.run_ahead_hide_warnings, true, false, 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); @@ -1249,6 +1307,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("video_vsync", &settings->bools.video_vsync, true, vsync, false); SETTING_BOOL("video_hard_sync", &settings->bools.video_hard_sync, true, hard_sync, false); SETTING_BOOL("video_black_frame_insertion", &settings->bools.video_black_frame_insertion, true, black_frame_insertion, false); + SETTING_BOOL("crt_switch_resolution", &settings->bools.crt_switch_resolution, true, crt_switch_resolution, false); SETTING_BOOL("video_disable_composition", &settings->bools.video_disable_composition, true, disable_composition, false); SETTING_BOOL("pause_nonactive", &settings->bools.pause_nonactive, true, pause_nonactive, false); SETTING_BOOL("video_gpu_screenshot", &settings->bools.video_gpu_screenshot, true, gpu_screenshot, false); @@ -1256,12 +1315,14 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("keyboard_gamepad_enable", &settings->bools.input_keyboard_gamepad_enable, true, true, false); SETTING_BOOL("core_set_supports_no_game_enable", &settings->bools.set_supports_no_game_enable, true, true, false); SETTING_BOOL("audio_enable", &settings->bools.audio_enable, true, audio_enable, false); + SETTING_BOOL("audio_enable_menu", &settings->bools.audio_enable_menu, true, false, false); SETTING_BOOL("audio_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE), true, false, false); SETTING_BOOL("audio_mixer_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MIXER_MUTE_ENABLE), true, false, false); SETTING_BOOL("location_allow", &settings->bools.location_allow, true, false, false); SETTING_BOOL("video_font_enable", &settings->bools.video_font_enable, true, font_enable, false); SETTING_BOOL("core_updater_auto_extract_archive", &settings->bools.network_buildbot_auto_extract_archive, true, true, false); SETTING_BOOL("camera_allow", &settings->bools.camera_allow, true, false, false); + SETTING_BOOL("discord_allow", &settings->bools.discord_enable, true, false, false); #if defined(VITA) SETTING_BOOL("input_backtouch_enable", &settings->bools.input_backtouch_enable, false, false, false); SETTING_BOOL("input_backtouch_toggle", &settings->bools.input_backtouch_toggle, false, false, false); @@ -1298,6 +1359,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("quick_menu_show_shaders", &settings->bools.quick_menu_show_shaders, true, quick_menu_show_shaders, false); SETTING_BOOL("quick_menu_show_save_core_overrides", &settings->bools.quick_menu_show_save_core_overrides, true, quick_menu_show_save_core_overrides, false); SETTING_BOOL("quick_menu_show_save_game_overrides", &settings->bools.quick_menu_show_save_game_overrides, true, quick_menu_show_save_game_overrides, false); + SETTING_BOOL("quick_menu_show_save_content_dir_overrides", &settings->bools.quick_menu_show_save_content_dir_overrides, true, quick_menu_show_save_content_dir_overrides, false); SETTING_BOOL("quick_menu_show_information", &settings->bools.quick_menu_show_information, true, quick_menu_show_information, false); SETTING_BOOL("kiosk_mode_enable", &settings->bools.kiosk_mode_enable, true, kiosk_mode_enable, false); SETTING_BOOL("content_show_settings", &settings->bools.menu_content_show_settings, true, content_show_settings, false); @@ -1306,7 +1368,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, SETTING_BOOL("content_show_images", &settings->bools.menu_content_show_images, true, content_show_images, false); #endif SETTING_BOOL("content_show_music", &settings->bools.menu_content_show_music, true, content_show_music, false); -#ifdef HAVE_FFMPEG +#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) SETTING_BOOL("content_show_video", &settings->bools.menu_content_show_video, true, content_show_video, false); #endif #ifdef HAVE_NETWORKING @@ -1316,13 +1378,18 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #ifdef HAVE_LIBRETRODB SETTING_BOOL("content_show_add", &settings->bools.menu_content_show_add, true, content_show_add, false); #endif + SETTING_BOOL("content_show_playlists", &settings->bools.menu_content_show_playlists, true, content_show_playlists, false); SETTING_BOOL("menu_show_load_core", &settings->bools.menu_show_load_core, true, menu_show_load_core, false); SETTING_BOOL("menu_show_load_content", &settings->bools.menu_show_load_content, true, menu_show_load_content, false); SETTING_BOOL("menu_show_information", &settings->bools.menu_show_information, true, menu_show_information, false); SETTING_BOOL("menu_show_configurations", &settings->bools.menu_show_configurations, true, menu_show_configurations, false); + SETTING_BOOL("menu_show_latency", &settings->bools.menu_show_latency, true, true, false); + SETTING_BOOL("menu_show_rewind", &settings->bools.menu_show_rewind, true, true, false); + SETTING_BOOL("menu_show_overlays", &settings->bools.menu_show_overlays, true, true, false); SETTING_BOOL("menu_show_help", &settings->bools.menu_show_help, true, menu_show_help, false); SETTING_BOOL("menu_show_quit_retroarch", &settings->bools.menu_show_quit_retroarch, true, menu_show_quit_retroarch, false); SETTING_BOOL("menu_show_reboot", &settings->bools.menu_show_reboot, true, menu_show_reboot, false); + SETTING_BOOL("menu_show_shutdown", &settings->bools.menu_show_shutdown, true, menu_show_shutdown, false); SETTING_BOOL("menu_show_online_updater", &settings->bools.menu_show_online_updater, true, menu_show_online_updater, false); SETTING_BOOL("menu_show_core_updater", &settings->bools.menu_show_core_updater, true, menu_show_core_updater, false); SETTING_BOOL("filter_by_current_core", &settings->bools.filter_by_current_core, false, false /* TODO */, false); @@ -1334,6 +1401,11 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #ifdef HAVE_MATERIALUI SETTING_BOOL("materialui_icons_enable", &settings->bools.menu_materialui_icons_enable, true, materialui_icons_enable, false); #endif +#ifdef HAVE_RGUI + SETTING_BOOL("rgui_background_filler_thickness_enable", &settings->bools.menu_rgui_background_filler_thickness_enable, true, true, false); + SETTING_BOOL("rgui_border_filler_thickness_enable", &settings->bools.menu_rgui_border_filler_thickness_enable, true, true, false); + SETTING_BOOL("rgui_border_filler_enable", &settings->bools.menu_rgui_border_filler_enable, true, true, false); +#endif #ifdef HAVE_XMB SETTING_BOOL("xmb_shadows_enable", &settings->bools.menu_xmb_shadows_enable, true, xmb_shadows_enable, false); SETTING_BOOL("xmb_vertical_thumbnails", &settings->bools.menu_xmb_vertical_thumbnails, true, xmb_vertical_thumbnails, false); @@ -1363,9 +1435,6 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings, #ifdef HAVE_NETWORKGAMEPAD SETTING_BOOL("network_remote_enable", &settings->bools.network_remote_enable, false, false /* TODO */, false); #endif -#ifdef HAVE_KEYMAPPER - SETTING_BOOL("keymapper_enable", &settings->bools.keymapper_enable, true, true /* TODO */, false); -#endif #ifdef HAVE_NETWORKING SETTING_BOOL("netplay_nat_traversal", &settings->bools.netplay_nat_traversal, true, true, false); #endif @@ -1400,6 +1469,8 @@ 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); SETTING_BOOL("video_window_show_decorations", &settings->bools.video_window_show_decorations, true, window_decorations, false); + SETTING_BOOL("sustained_performance_mode", &settings->bools.sustained_performance_mode, true, sustained_performance_mode, false); + *size = count; return tmp; @@ -1446,6 +1517,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, struct config_uint_setting *tmp = (struct config_uint_setting*)malloc((*size + 1) * sizeof(struct config_uint_setting)); SETTING_UINT("input_bind_timeout", &settings->uints.input_bind_timeout, true, input_bind_timeout, false); + SETTING_UINT("input_bind_hold", &settings->uints.input_bind_hold, true, input_bind_hold, false); SETTING_UINT("input_turbo_period", &settings->uints.input_turbo_period, true, turbo_period, false); SETTING_UINT("input_duty_cycle", &settings->uints.input_turbo_duty_cycle, true, turbo_duty_cycle, false); SETTING_UINT("input_max_users", input_driver_get_uint(INPUT_ACTION_MAX_USERS), true, input_max_users, false); @@ -1454,6 +1526,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("audio_resampler_quality", &settings->uints.audio_resampler_quality, true, audio_resampler_quality_level, false); SETTING_UINT("audio_block_frames", &settings->uints.audio_block_frames, true, 0, false); SETTING_UINT("rewind_granularity", &settings->uints.rewind_granularity, true, rewind_granularity, false); + SETTING_UINT("rewind_buffer_size_step", &settings->uints.rewind_buffer_size_step, true, rewind_buffer_size_step, false); SETTING_UINT("autosave_interval", &settings->uints.autosave_interval, true, autosave_interval, false); SETTING_UINT("libretro_log_level", &settings->uints.libretro_log_level, true, libretro_log_level, false); SETTING_UINT("keyboard_gamepad_mapping_type",&settings->uints.input_keyboard_gamepad_mapping_type, true, 1, false); @@ -1470,9 +1543,6 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, #ifdef HAVE_NETWORKGAMEPAD SETTING_UINT("network_remote_base_port", &settings->uints.network_remote_base_port, true, network_remote_base_port, false); #endif -#ifdef HAVE_KEYMAPPER - SETTING_UINT("keymapper_port", &settings->uints.keymapper_port, true, 0, false); -#endif #ifdef GEKKO SETTING_UINT("video_viwidth", &settings->uints.video_viwidth, true, video_viwidth, false); #endif @@ -1483,6 +1553,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false); SETTING_UINT("xmb_alpha_factor", &settings->uints.menu_xmb_alpha_factor, true, xmb_alpha_factor, false); SETTING_UINT("xmb_scale_factor", &settings->uints.menu_xmb_scale_factor, true, xmb_scale_factor, false); + SETTING_UINT("xmb_layout", &settings->uints.menu_xmb_layout, true, xmb_menu_layout, false); SETTING_UINT("xmb_theme", &settings->uints.menu_xmb_theme, true, xmb_icon_theme, false); SETTING_UINT("xmb_menu_color_theme", &settings->uints.menu_xmb_color_theme, true, xmb_theme, false); SETTING_UINT("menu_font_color_red", &settings->uints.menu_font_color_red, true, menu_font_color_red, false); @@ -1494,6 +1565,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, #endif SETTING_UINT("audio_out_rate", &settings->uints.audio_out_rate, true, out_rate, false); SETTING_UINT("custom_viewport_width", &settings->video_viewport_custom.width, false, 0 /* TODO */, false); + SETTING_UINT("crt_switch_resolution_super", &settings->uints.crt_switch_resolution_super, true, crt_switch_resolution_super, false); SETTING_UINT("custom_viewport_height", &settings->video_viewport_custom.height, false, 0 /* TODO */, false); SETTING_UINT("custom_viewport_x", (unsigned*)&settings->video_viewport_custom.x, false, 0 /* TODO */, false); SETTING_UINT("custom_viewport_y", (unsigned*)&settings->video_viewport_custom.y, false, 0 /* TODO */, false); @@ -1524,6 +1596,20 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings, SETTING_UINT("run_ahead_frames", &settings->uints.run_ahead_frames, true, 1, false); + SETTING_UINT("midi_volume", &settings->uints.midi_volume, true, midi_volume, false); + + *size = count; + + return tmp; +} + +static struct config_size_setting *populate_settings_size(settings_t *settings, int *size) +{ + unsigned count = 0; + struct config_size_setting *tmp = (struct config_size_setting*)malloc((*size + 1) * sizeof(struct config_size_setting)); + + SETTING_SIZE("rewind_buffer_size", &settings->sizes.rewind_buffer_size, true, rewind_buffer_size, false); + *size = count; return tmp; @@ -1564,6 +1650,7 @@ static void config_set_defaults(void) int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder); int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder); int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder); + int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder); const char *def_video = config_get_default_video(); const char *def_audio = config_get_default_audio(); const char *def_audio_resampler = config_get_default_audio_resampler(); @@ -1577,11 +1664,13 @@ static void config_set_defaults(void) const char *def_led = config_get_default_led(); const char *def_location = config_get_default_location(); const char *def_record = config_get_default_record(); + const char *def_midi = config_get_default_midi(); const char *def_mitm = netplay_mitm_server; struct config_float_setting *float_settings = populate_settings_float (settings, &float_settings_size); struct config_bool_setting *bool_settings = populate_settings_bool (settings, &bool_settings_size); struct config_int_setting *int_settings = populate_settings_int (settings, &int_settings_size); struct config_uint_setting *uint_settings = populate_settings_uint (settings, &uint_settings_size); + struct config_size_setting *size_settings = populate_settings_size (settings, &size_settings_size); if (bool_settings && (bool_settings_size > 0)) { @@ -1616,6 +1705,17 @@ static void config_set_defaults(void) free(uint_settings); } + if (size_settings && (size_settings_size > 0)) + { + for (i = 0; i < (unsigned)size_settings_size; i++) + { + if (size_settings[i].def_enable) + *size_settings[i].ptr = size_settings[i].def; + } + + free(size_settings); + } + if (float_settings && (float_settings_size > 0)) { for (i = 0; i < (unsigned)float_settings_size; i++) @@ -1657,6 +1757,9 @@ static void config_set_defaults(void) if (def_record) strlcpy(settings->arrays.record_driver, def_record, sizeof(settings->arrays.record_driver)); + if (def_midi) + strlcpy(settings->arrays.midi_driver, + def_midi, sizeof(settings->arrays.midi_driver)); if (def_mitm) strlcpy(settings->arrays.netplay_mitm_server, def_mitm, sizeof(settings->arrays.netplay_mitm_server)); @@ -1674,7 +1777,7 @@ static void config_set_defaults(void) #endif #endif -#ifdef HAVE_FFMPEG +#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) configuration_set_bool(settings, settings->bools.multimedia_builtin_mediaplayer_enable, true); #else configuration_set_bool(settings, settings->bools.multimedia_builtin_mediaplayer_enable, false); @@ -1704,8 +1807,6 @@ static void config_set_defaults(void) audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume); audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume); - settings->rewind_buffer_size = rewind_buffer_size; - #ifdef HAVE_LAKKA settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH); settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH); @@ -1723,6 +1824,7 @@ static void config_set_defaults(void) #ifdef HAVE_CHEEVOS *settings->arrays.cheevos_username = '\0'; *settings->arrays.cheevos_password = '\0'; + *settings->arrays.cheevos_token = '\0'; #endif input_config_reset(); @@ -1973,6 +2075,13 @@ static void config_set_defaults(void) free(temp_str); } + if (midi_input) + strlcpy(settings->arrays.midi_input, + midi_input, sizeof(settings->arrays.midi_input)); + if (midi_output) + strlcpy(settings->arrays.midi_output, + midi_output, sizeof(settings->arrays.midi_output)); + /* Avoid reloading config on every content load */ if (default_block_config_read) rarch_ctl(RARCH_CTL_SET_BLOCK_CONFIG_READ, NULL); @@ -2006,7 +2115,7 @@ static config_file_t *open_default_config_file(void) (void)path_size; -#if defined(_WIN32) && !defined(_XBOX) +#if defined(_WIN32) && !defined(_XBOX) && !defined(__WINRT__) fill_pathname_application_path(app_path, path_size); fill_pathname_resolve_relative(conf_path, app_path, file_path_str(FILE_PATH_MAIN_CONFIG), path_size); @@ -2295,6 +2404,7 @@ 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") || + string_is_equal(settings->arrays.video_driver, "metal") || string_is_equal(settings->arrays.video_driver, "d3d11") || string_is_equal(settings->arrays.video_driver, "d3d12") || string_is_equal(settings->arrays.video_driver, "gx2")) @@ -2395,12 +2505,14 @@ static bool config_load_file(const char *path, bool set_defaults, int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder); int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder); int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder); + int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder); int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder); int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder); struct config_bool_setting *bool_settings = populate_settings_bool (settings, &bool_settings_size); struct config_float_setting *float_settings = populate_settings_float (settings, &float_settings_size); struct config_int_setting *int_settings = populate_settings_int (settings, &int_settings_size); struct config_uint_setting *uint_settings = populate_settings_uint (settings, &uint_settings_size); + struct config_size_setting *size_settings = populate_settings_size (settings, &size_settings_size); struct config_array_setting *array_settings = populate_settings_array (settings, &array_settings_size); struct config_path_setting *path_settings = populate_settings_path (settings, &path_settings_size); @@ -2525,6 +2637,23 @@ static bool config_load_file(const char *path, bool set_defaults, *uint_settings[i].ptr = tmp; } + for (i = 0; i < (unsigned)size_settings_size; i++) + { + size_t tmp = 0; + if (config_get_size_t(conf, size_settings[i].ident, &tmp)) + *size_settings[i].ptr = tmp ; + /* Special case for rewind_buffer_size - need to convert low values to what they were + * intended to be based on the default value in config.def.h + * If the value is less than 10000 then multiple by 1MB because if the retroarch.cfg + * file contains rewind_buffer_size = "100" then that ultimately gets interpreted as + * 100MB, so ensure the internal values represent that.*/ + if ( strcmp(size_settings[i].ident, "rewind_buffer_size") == 0 ) { + if ( *size_settings[i].ptr < 10000) { + *size_settings[i].ptr = *size_settings[i].ptr * 1024 * 1024 ; + } + } + } + for (i = 0; i < MAX_USERS; i++) { char buf[64]; @@ -2556,13 +2685,6 @@ static bool config_load_file(const char *path, bool set_defaults, CONFIG_GET_INT_BASE(conf, settings, uints.led_map[i], buf); } - { - /* ugly hack around C89 not allowing mixing declarations and code */ - int buffer_size = 0; - if (config_get_int(conf, "rewind_buffer_size", &buffer_size)) - settings->rewind_buffer_size = buffer_size * UINT64_C(1000000); - } - /* Hexadecimal settings */ @@ -2883,8 +3005,10 @@ static bool config_load_file(const char *path, bool set_defaults, settings->arrays.video_driver); settings->paths.path_shader[0] = '\0'; break; + } } -} + + frontend_driver_set_sustained_performance_mode(settings->bools.sustained_performance_mode); ret = true; @@ -2933,6 +3057,7 @@ bool config_load_override(void) char *buf = NULL; char *core_path = NULL; char *game_path = NULL; + char *content_path = NULL; char *config_directory = NULL; config_file_t *new_conf = NULL; bool should_append = false; @@ -2940,6 +3065,10 @@ bool config_load_override(void) const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; + + if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -2948,6 +3077,8 @@ bool config_load_override(void) malloc(PATH_MAX_LENGTH * sizeof(char)); core_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); + content_path = (char*) + malloc(PATH_MAX_LENGTH * sizeof(char)); buf = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); config_directory = (char*) @@ -2957,23 +3088,29 @@ bool config_load_override(void) fill_pathname_application_special(config_directory, path_size, APPLICATION_SPECIAL_DIRECTORY_CONFIG); - /* Concatenate strings into full paths for core_path, game_path */ + /* Concatenate strings into full paths for core_path, game_path, content_path */ fill_pathname_join_special_ext(game_path, config_directory, core_name, game_name, file_path_str(FILE_PATH_CONFIG_EXTENSION), path_size); + fill_pathname_join_special_ext(content_path, + config_directory, core_name, + content_dir_name, + file_path_str(FILE_PATH_CONFIG_EXTENSION), + path_size); + fill_pathname_join_special_ext(core_path, config_directory, core_name, core_name, file_path_str(FILE_PATH_CONFIG_EXTENSION), path_size); + /* per-core overrides */ /* Create a new config file from core_path */ new_conf = config_file_new(core_path); - /* If a core override exists, add its location to append_config_path */ if (new_conf) { RARCH_LOG("[overrides] core-specific overrides found at %s.\n", @@ -2988,10 +3125,45 @@ bool config_load_override(void) RARCH_LOG("[overrides] no core-specific overrides found at %s.\n", core_path); + /* per-content-dir overrides */ + /* Create a new config file from content_path */ + new_conf = config_file_new(content_path); + + if (new_conf) + { + char *temp_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); + + temp_path[0] = '\0'; + + config_file_free(new_conf); + + RARCH_LOG("[overrides] content-dir-specific overrides found at %s.\n", + game_path); + + if (should_append) + { + RARCH_LOG("[overrides] content-dir-specific overrides stacking on top of previous overrides.\n"); + strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), path_size); + strlcat(temp_path, "|", path_size); + strlcat(temp_path, content_path, path_size); + } + else + strlcpy(temp_path, content_path, path_size); + + path_set(RARCH_PATH_CONFIG_APPEND, temp_path); + + free(temp_path); + + should_append = true; + } + else + RARCH_LOG("[overrides] no content-dir-specific overrides found at %s.\n", + content_path); + + /* per-game overrides */ /* Create a new config file from game_path */ new_conf = config_file_new(game_path); - /* If a game override exists, add it's location to append_config_path */ if (new_conf) { char *temp_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); @@ -3005,6 +3177,7 @@ bool config_load_override(void) if (should_append) { + RARCH_LOG("[overrides] game-specific overrides stacking on top of previous overrides\n"); strlcpy(temp_path, path_get(RARCH_PATH_CONFIG_APPEND), path_size); strlcat(temp_path, "|", path_size); strlcat(temp_path, game_path, path_size); @@ -3055,6 +3228,7 @@ bool config_load_override(void) free(buf); free(config_directory); free(core_path); + free(content_path); free(game_path); return true; @@ -3062,6 +3236,7 @@ error: free(buf); free(config_directory); free(core_path); + free(content_path); free(game_path); return false; } @@ -3113,11 +3288,16 @@ bool config_load_remap(void) char *remap_directory = NULL; char *core_path = NULL; char *game_path = NULL; + char *content_path = NULL; config_file_t *new_conf = NULL; settings_t *settings = config_get_ptr(); rarch_system_info_t *system = runloop_get_system_info(); const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; + + if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -3136,8 +3316,12 @@ bool config_load_remap(void) /* final path for game-specific configuration (prefix+suffix) */ game_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); + /* final path for content-dir-specific configuration (prefix+suffix) */ + content_path = (char*) + malloc(PATH_MAX_LENGTH * sizeof(char)); remap_directory[0] = core_path[0] = game_path[0] = '\0'; + strlcpy(remap_directory, settings->paths.directory_input_remapping, path_size); @@ -3150,6 +3334,12 @@ bool config_load_remap(void) file_path_str(FILE_PATH_REMAP_EXTENSION), path_size); + fill_pathname_join_special_ext(content_path, + remap_directory, core_name, + content_dir_name, + file_path_str(FILE_PATH_REMAP_EXTENSION), + path_size); + fill_pathname_join_special_ext(game_path, remap_directory, core_name, game_name, @@ -3177,6 +3367,28 @@ bool config_load_remap(void) input_remapping_set_defaults(false); } + /* Create a new config file from content_path */ + new_conf = config_file_new(content_path); + + /* If a content-dir remap file exists, load it. */ + if (new_conf) + { + RARCH_LOG("Remaps: content-dir-specific remap found at %s.\n", content_path); + if (input_remapping_load_file(new_conf, content_path)) + { + runloop_msg_queue_push(msg_hash_to_str( + MSG_GAME_REMAP_FILE_LOADED), 1, 100, true); + rarch_ctl(RARCH_CTL_SET_REMAPS_CONTENT_DIR_ACTIVE, NULL); + goto success; + } + } + else + { + RARCH_LOG("Remaps: no content-dir-specific remap found at %s.\n", content_path); + input_remapping_set_defaults(false); + } + + /* Create a new config file from core_path */ new_conf = config_file_new(core_path); @@ -3228,21 +3440,21 @@ success: bool config_load_shader_preset(void) { unsigned idx; - char parent_name[PATH_MAX_LENGTH]; size_t path_size = PATH_MAX_LENGTH * sizeof(char); config_file_t *new_conf = NULL; char *shader_directory = NULL; char *core_path = NULL; char *game_path = NULL; - char *parent_path = NULL; + char *content_path = NULL; settings_t *settings = config_get_ptr(); rarch_system_info_t *system = runloop_get_system_info(); const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) - fill_pathname_parent_dir_name(parent_name, path_get(RARCH_PATH_BASENAME), sizeof(parent_name)); + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -3262,7 +3474,7 @@ bool config_load_shader_preset(void) game_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); /* final path for parent-dir-specific configuration (prefix+suffix) */ - parent_path = (char*) + content_path = (char*) malloc(PATH_MAX_LENGTH * sizeof(char)); shader_directory[0] = core_path[0] = game_path[0] = '\0'; @@ -3313,26 +3525,26 @@ bool config_load_shader_preset(void) if (!check_shader_compatibility((enum file_path_enum)(idx))) continue; /* Concatenate strings into full paths for core_path, parent path */ - fill_pathname_join_special_ext(parent_path, + fill_pathname_join_special_ext(content_path, shader_directory, core_name, - parent_name, + content_dir_name, file_path_str((enum file_path_enum)(idx)), path_size); /* Create a new config file from parent path */ - new_conf = config_file_new(parent_path); + new_conf = config_file_new(content_path); if (!new_conf) { - RARCH_LOG("Shaders: no parent-dir-specific preset found at %s.\n", - parent_path); + RARCH_LOG("Shaders: no content-dir-specific preset found at %s.\n", + content_path); continue; } /* Parent-dir shader preset exists, load it. */ - RARCH_LOG("Shaders: parent-dir-specific shader preset found at %s.\n", - parent_path); - retroarch_set_shader_preset(parent_path); + RARCH_LOG("Shaders: content-dir-specific shader preset found at %s.\n", + content_path); + retroarch_set_shader_preset(content_path); goto success; } @@ -3367,14 +3579,14 @@ bool config_load_shader_preset(void) free(shader_directory); free(core_path); free(game_path); - free(parent_path); + free(content_path); return false; success: free(shader_directory); free(core_path); free(game_path); - free(parent_path); + free(content_path); config_file_free(new_conf); return true; } @@ -3522,14 +3734,14 @@ static void save_keybind_mbutton(config_file_t *conf, const char *base, const struct retro_keybind *bind, bool save_empty) { - char key[64]; + char key[64]; - key[0] = '\0'; + key[0] = '\0'; - fill_pathname_join_delim_concat(key, prefix, - base, '_', "_mbtn", sizeof(key)); + fill_pathname_join_delim_concat(key, prefix, + base, '_', "_mbtn", sizeof(key)); - switch ( bind->mbutton ) + switch ( bind->mbutton ) { case RETRO_DEVICE_ID_MOUSE_LEFT: config_set_uint64(conf, key, 1); @@ -3775,8 +3987,7 @@ bool config_save_autoconf_profile(const char *path, unsigned user) error: free(buf); free(autoconf_file); - if (path_new) - free(path_new); + free(path_new); return false; } @@ -3797,6 +4008,7 @@ bool config_save_file(const char *path) struct config_bool_setting *bool_settings = NULL; struct config_int_setting *int_settings = NULL; struct config_uint_setting *uint_settings = NULL; + struct config_size_setting *size_settings = NULL; struct config_float_setting *float_settings = NULL; struct config_array_setting *array_settings = NULL; struct config_path_setting *path_settings = NULL; @@ -3806,6 +4018,7 @@ bool config_save_file(const char *path) int float_settings_size = sizeof(settings->floats)/ sizeof(settings->floats.placeholder); int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder); int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder); + int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder); int array_settings_size = sizeof(settings->arrays)/ sizeof(settings->arrays.placeholder); int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder); @@ -3822,6 +4035,7 @@ bool config_save_file(const char *path) bool_settings = populate_settings_bool (settings, &bool_settings_size); int_settings = populate_settings_int (settings, &int_settings_size); uint_settings = populate_settings_uint (settings, &uint_settings_size); + size_settings = populate_settings_size (settings, &size_settings_size); float_settings = populate_settings_float (settings, &float_settings_size); array_settings = populate_settings_array (settings, &array_settings_size); path_settings = populate_settings_path (settings, &path_settings_size); @@ -3899,6 +4113,18 @@ bool config_save_file(const char *path) free(uint_settings); } + if (size_settings && (size_settings_size > 0)) + { + for (i = 0; i < (unsigned)size_settings_size; i++) + if (!size_settings[i].override || + !retroarch_override_setting_is_set(size_settings[i].override, NULL)) + config_set_int(conf, + size_settings[i].ident, + *size_settings[i].ptr); + + free(size_settings); + } + for (i = 0; i < MAX_USERS; i++) { char cfg[64]; @@ -4018,8 +4244,10 @@ bool config_save_overrides(int override_type) struct config_bool_setting *bool_overrides = NULL; struct config_int_setting *int_settings = NULL; struct config_uint_setting *uint_settings = NULL; + struct config_size_setting *size_settings = NULL; struct config_int_setting *int_overrides = NULL; struct config_uint_setting *uint_overrides = NULL; + struct config_size_setting *size_overrides = NULL; struct config_float_setting *float_settings = NULL; struct config_float_setting *float_overrides= NULL; struct config_array_setting *array_settings = NULL; @@ -4030,16 +4258,22 @@ bool config_save_overrides(int override_type) char *override_directory = NULL; char *core_path = NULL; char *game_path = NULL; + char *content_path = NULL; settings_t *overrides = config_get_ptr(); int bool_settings_size = sizeof(settings->bools) / sizeof(settings->bools.placeholder); int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder); int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder); int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder); + int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder); int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder); int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder); rarch_system_info_t *system = runloop_get_system_info(); const char *core_name = system ? system->info.library_name : NULL; const char *game_name = path_basename(path_get(RARCH_PATH_BASENAME)); + char content_dir_name[PATH_MAX_LENGTH]; + + if (!string_is_empty(path_get(RARCH_PATH_BASENAME))) + fill_pathname_parent_dir_name(content_dir_name, path_get(RARCH_PATH_BASENAME), sizeof(content_dir_name)); if (string_is_empty(core_name) || string_is_empty(game_name)) return false; @@ -4049,6 +4283,7 @@ bool config_save_overrides(int override_type) override_directory = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); core_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); game_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); + content_path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); config_directory[0] = override_directory[0] = core_path[0] = game_path[0] = '\0'; @@ -4068,6 +4303,12 @@ bool config_save_overrides(int override_type) file_path_str(FILE_PATH_CONFIG_EXTENSION), path_size); + fill_pathname_join_special_ext(content_path, + config_directory, core_name, + content_dir_name, + file_path_str(FILE_PATH_CONFIG_EXTENSION), + path_size); + fill_pathname_join_special_ext(core_path, config_directory, core_name, core_name, @@ -4092,6 +4333,10 @@ bool config_save_overrides(int override_type) tmp_i = sizeof(settings->uints) / sizeof(settings->uints.placeholder); uint_overrides = populate_settings_uint (overrides, &tmp_i); + size_settings = populate_settings_size(settings, &size_settings_size); + tmp_i = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder); + size_overrides = populate_settings_size (overrides, &tmp_i); + float_settings = populate_settings_float(settings, &float_settings_size); tmp_i = sizeof(settings->floats) / sizeof(settings->floats.placeholder); float_overrides = populate_settings_float(overrides, &tmp_i); @@ -4144,6 +4389,18 @@ bool config_save_overrides(int override_type) (*uint_overrides[i].ptr)); } } + for (i = 0; i < (unsigned)size_settings_size; i++) + { + if ((*size_settings[i].ptr) != (*size_overrides[i].ptr)) + { + RARCH_LOG(" original: %s=%d\n", + size_settings[i].ident, (*size_settings[i].ptr)); + RARCH_LOG(" override: %s=%d\n", + size_overrides[i].ident, (*size_overrides[i].ptr)); + config_set_int(conf, size_overrides[i].ident, + (*size_overrides[i].ptr)); + } + } for (i = 0; i < (unsigned)float_settings_size; i++) { if ((*float_settings[i].ptr) != (*float_overrides[i].ptr)) @@ -4172,6 +4429,11 @@ bool config_save_overrides(int override_type) for (i = 0; i < (unsigned)path_settings_size; i++) { + + /* blacklist video_shader, better handled by shader presets*/ + /* to-do: add setting to control blacklisting */ + if (string_is_equal(path_settings[i].ident, "video_shader")) + continue; if (!string_is_equal(path_settings[i].ptr, path_overrides[i].ptr)) { RARCH_LOG(" original: %s=%s\n", @@ -4202,6 +4464,9 @@ bool config_save_overrides(int override_type) config_set_int(conf, cfg, overrides->uints.input_joypad_map[i]); } + + /* blacklist these since they are handled by remaps */ + /* to-do: add setting to control blacklisting if (settings->uints.input_libretro_device[i] != overrides->uints.input_libretro_device[i]) { @@ -4215,6 +4480,7 @@ bool config_save_overrides(int override_type) snprintf(cfg, sizeof(cfg), "input_player%u_analog_dpad_mode", i + 1); config_set_int(conf, cfg, overrides->uints.input_analog_dpad_mode[i]); } + */ } ret = false; @@ -4231,6 +4497,11 @@ bool config_save_overrides(int override_type) RARCH_LOG ("[overrides] path %s\n", game_path); ret = config_file_write(conf, game_path); break; + case OVERRIDE_CONTENT_DIR: + /* Create a new config file from content_path */ + RARCH_LOG ("[overrides] path %s\n", content_path); + ret = config_file_write(conf, content_path); + break; default: break; } @@ -4246,6 +4517,8 @@ bool config_save_overrides(int override_type) free(int_settings); if (uint_settings) free(uint_settings); + if (size_settings) + free(size_settings); if (int_overrides) free(int_overrides); if (uint_overrides) diff --git a/configuration.h b/configuration.h index b43facf5f6..8955319959 100644 --- a/configuration.h +++ b/configuration.h @@ -57,6 +57,7 @@ enum override_type { OVERRIDE_NONE = 0, OVERRIDE_CORE, + OVERRIDE_CONTENT_DIR, OVERRIDE_GAME }; @@ -95,9 +96,11 @@ typedef struct settings bool video_statistics_show; bool video_framecount_show; bool video_msg_bgcolor_enable; + bool crt_switch_resolution; /* Audio */ bool audio_enable; + bool audio_enable_menu; bool audio_sync; bool audio_rate_control; bool audio_wasapi_exclusive_mode; @@ -146,7 +149,14 @@ typedef struct settings bool menu_show_help; bool menu_show_quit_retroarch; bool menu_show_reboot; + bool menu_show_shutdown; + bool menu_show_latency; + bool menu_show_rewind; + bool menu_show_overlays; bool menu_materialui_icons_enable; + bool menu_rgui_background_filler_thickness_enable; + bool menu_rgui_border_filler_thickness_enable; + bool menu_rgui_border_filler_enable; bool menu_xmb_shadows_enable; bool menu_xmb_vertical_thumbnails; bool menu_content_show_settings; @@ -157,6 +167,7 @@ typedef struct settings bool menu_content_show_netplay; bool menu_content_show_history; bool menu_content_show_add; + bool menu_content_show_playlists; bool menu_unified_controls; bool quick_menu_show_take_screenshot; bool quick_menu_show_save_load_state; @@ -168,6 +179,7 @@ typedef struct settings bool quick_menu_show_shaders; bool quick_menu_show_save_core_overrides; bool quick_menu_show_save_game_overrides; + bool quick_menu_show_save_content_dir_overrides; bool quick_menu_show_information; bool kiosk_mode_enable; @@ -189,6 +201,8 @@ typedef struct settings bool ui_suspend_screensaver_enable; bool ui_companion_start_on_boot; bool ui_companion_enable; + bool ui_companion_toggle; + bool desktop_menu_enable; /* Cheevos */ bool cheevos_enable; @@ -217,6 +231,7 @@ typedef struct settings bool bundle_assets_extract_enable; /* Misc. */ + bool discord_enable; bool threaded_data_runloop_enable; bool set_supports_no_game_enable; bool auto_screenshot_filename; @@ -226,6 +241,7 @@ typedef struct settings bool rewind_enable; bool run_ahead_enabled; bool run_ahead_secondary_instance; + bool run_ahead_hide_warnings; bool pause_nonactive; bool block_sram_overwrite; bool savestate_auto_index; @@ -260,6 +276,8 @@ typedef struct settings bool automatically_add_content_to_playlist; bool video_window_show_decorations; + + bool sustained_performance_mode; } bools; struct @@ -315,6 +333,7 @@ typedef struct settings unsigned input_turbo_duty_cycle; unsigned input_bind_timeout; + unsigned input_bind_hold; unsigned input_menu_toggle_gamepad_combo; unsigned input_keyboard_gamepad_mapping_type; @@ -329,6 +348,7 @@ typedef struct settings unsigned content_history_size; unsigned libretro_log_level; unsigned rewind_granularity; + unsigned rewind_buffer_size_step; unsigned autosave_interval; unsigned network_cmd_port; unsigned network_remote_base_port; @@ -336,6 +356,7 @@ typedef struct settings unsigned video_window_x; unsigned video_window_y; unsigned video_window_opacity; + unsigned crt_switch_resolution_super; unsigned video_monitor_index; unsigned video_fullscreen_x; unsigned video_fullscreen_y; @@ -356,6 +377,7 @@ typedef struct settings unsigned menu_entry_normal_color; unsigned menu_entry_hover_color; unsigned menu_title_color; + unsigned menu_xmb_layout; unsigned menu_xmb_shader_pipeline; unsigned menu_xmb_scale_factor; unsigned menu_xmb_alpha_factor; @@ -379,15 +401,23 @@ typedef struct settings unsigned input_libretro_device[MAX_USERS]; unsigned input_analog_dpad_mode[MAX_USERS]; - unsigned input_keymapper_ids[RARCH_CUSTOM_BIND_LIST_END]; + unsigned input_keymapper_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END]; unsigned input_remap_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END]; unsigned led_map[MAX_LEDS]; unsigned run_ahead_frames; + + unsigned midi_volume; } uints; + struct + { + size_t placeholder; + size_t rewind_buffer_size; + } sizes; + struct { char placeholder; @@ -401,11 +431,13 @@ typedef struct settings char menu_driver[32]; char cheevos_username[32]; char cheevos_password[32]; + char cheevos_token[32]; char video_context_driver[32]; char audio_driver[32]; char audio_resampler[32]; char input_driver[32]; char input_joypad_driver[32]; + char midi_driver[32]; char input_keyboard_layout[64]; @@ -419,6 +451,9 @@ typedef struct settings char bundle_assets_dst_subdir[PATH_MAX_LENGTH]; char netplay_mitm_server[255]; + + char midi_input[32]; + char midi_output[32]; } arrays; struct @@ -481,7 +516,6 @@ typedef struct settings video_viewport_t video_viewport_custom; - size_t rewind_buffer_size; } settings_t; /** @@ -565,6 +599,9 @@ const char *config_get_default_joypad(void); **/ const char *config_get_default_menu(void); +const char *config_get_default_midi(void); +const char *config_get_midi_driver_options(void); + const char *config_get_default_record(void); /** diff --git a/content.h b/content.h index ad4211c5a0..5e25e47c64 100644 --- a/content.h +++ b/content.h @@ -92,17 +92,16 @@ void content_clear_subsystem(void); void content_set_subsystem(unsigned subsystem); /* Get the current subsystem*/ -int content_get_subsystem(); +int content_get_subsystem(void); /* Add a rom to the subsystem rom buffer */ void content_add_subsystem(const char* path); /* Get the current subsystem rom id */ -int content_get_subsystem_rom_id(); +unsigned content_get_subsystem_rom_id(void); /* Set environment variables before a subsystem load */ -void content_set_subsystem_info(); - +void content_set_subsystem_info(void); RETRO_END_DECLS diff --git a/core_impl.c b/core_impl.c index 7c2585a0c2..f1516fab7c 100644 --- a/core_impl.c +++ b/core_impl.c @@ -290,6 +290,8 @@ bool core_load_game(retro_ctx_load_content_info_t *load_info) bool contentless = false; bool is_inited = false; + video_driver_set_cached_frame_ptr(NULL); + #ifdef HAVE_RUNAHEAD set_load_content_info(load_info); clear_controller_port_map(); @@ -373,12 +375,16 @@ bool core_get_system_av_info(struct retro_system_av_info *av_info) bool core_reset(void) { + video_driver_set_cached_frame_ptr(NULL); + current_core.retro_reset(); return true; } bool core_init(void) { + video_driver_set_cached_frame_ptr(NULL); + current_core.retro_init(); current_core.inited = true; return true; @@ -386,6 +392,8 @@ bool core_init(void) bool core_unload(void) { + video_driver_set_cached_frame_ptr(NULL); + current_core.retro_deinit(); return true; } @@ -396,9 +404,12 @@ bool core_unload_game(void) video_driver_free_hw_context(); audio_driver_stop(); + video_driver_set_cached_frame_ptr(NULL); + current_core.retro_unload_game(); current_core.game_loaded = false; + return true; } diff --git a/core_info.c b/core_info.c index 76b979046b..18bcfeffec 100644 --- a/core_info.c +++ b/core_info.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -26,14 +27,10 @@ #include "config.h" #endif -#include "retroarch.h" #include "verbosity.h" -#include "config.def.h" #include "core_info.h" -#include "configuration.h" #include "file_path_special.h" -#include "list_special.h" static const char *core_info_tmp_path = NULL; static const struct string_list *core_info_tmp_list = NULL; @@ -154,6 +151,7 @@ static void core_info_list_free(core_info_list_t *core_info_list) free(info->systemname); free(info->system_manufacturer); free(info->display_name); + free(info->display_version); free(info->supported_extensions); free(info->authors); free(info->permissions); @@ -224,21 +222,23 @@ static bool core_info_list_iterate( return true; } -static core_info_list_t *core_info_list_new(const char *path) +static core_info_list_t *core_info_list_new(const char *path, + const char *libretro_info_dir, + const char *exts, + bool show_hidden_files) { size_t i; core_info_t *core_info = NULL; core_info_list_t *core_info_list = NULL; - struct string_list *contents = dir_list_new_special( - path, DIR_LIST_CORES, NULL); - settings_t *settings = config_get_ptr(); - const char *path_basedir = !string_is_empty(settings->paths.path_libretro_info) ? - settings->paths.path_libretro_info : settings->paths.directory_libretro; - + const char *path_basedir = libretro_info_dir; + struct string_list *contents = dir_list_new( + path, exts, + false, + show_hidden_files, + false, false); if (!contents) return NULL; - core_info_list = (core_info_list_t*)calloc(1, sizeof(*core_info_list)); if (!core_info_list) goto error; @@ -279,6 +279,13 @@ static core_info_list_t *core_info_list_new(const char *path) free(tmp); tmp = NULL; } + if (config_get_string(conf, "display_version", &tmp) + && !string_is_empty(tmp)) + { + core_info[i].display_version = strdup(tmp); + free(tmp); + tmp = NULL; + } if (config_get_string(conf, "corename", &tmp) && !string_is_empty(tmp)) { @@ -518,7 +525,8 @@ static core_info_t *core_info_find_internal( static bool core_info_list_update_missing_firmware_internal( core_info_list_t *core_info_list, const char *core, - const char *systemdir) + const char *systemdir, + bool *set_missing_bios) { size_t i; core_info_t *info = NULL; @@ -535,7 +543,6 @@ static bool core_info_list_update_missing_firmware_internal( path = (char*)malloc(PATH_MAX_LENGTH * sizeof(char)); path[0] = '\0'; - rarch_ctl(RARCH_CTL_UNSET_MISSING_BIOS, NULL); for (i = 0; i < info->firmware_count; i++) { @@ -547,7 +554,7 @@ static bool core_info_list_update_missing_firmware_internal( info->firmware[i].missing = !filestream_exists(path); if (info->firmware[i].missing && !info->firmware[i].optional) { - rarch_ctl(RARCH_CTL_SET_MISSING_BIOS, NULL); + *set_missing_bios = true; RARCH_WARN("Firmware missing: %s\n", info->firmware[i].path); } } @@ -635,14 +642,13 @@ void core_info_deinit_list(void) core_info_curr_list = NULL; } -bool core_info_init_list(void) +bool core_info_init_list(const char *path_info, const char *dir_cores, + const char *exts, bool show_hidden_files) { - settings_t *settings = config_get_ptr(); - - if (settings) - core_info_curr_list = core_info_list_new(settings->paths.directory_libretro); - - if (!core_info_curr_list) + if (!(core_info_curr_list = core_info_list_new(dir_cores, + !string_is_empty(path_info) ? path_info : dir_cores, + exts, + show_hidden_files))) return false; return true; } @@ -655,13 +661,15 @@ bool core_info_get_list(core_info_list_t **core) return true; } -bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info) +bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info, + bool *set_missing_bios) { if (!info) return false; return core_info_list_update_missing_firmware_internal( core_info_curr_list, - info->path, info->directory.system); + info->path, info->directory.system, + set_missing_bios); } bool core_info_load(core_info_ctx_find_t *info) @@ -751,16 +759,15 @@ void core_info_list_get_supported_cores(core_info_list_t *core_info_list, *num_infos = supported; } -void core_info_get_name(const char *path, char *s, size_t len) +void core_info_get_name(const char *path, char *s, size_t len, + const char *path_info, const char *dir_cores, + const char *exts, bool show_hidden_files) { size_t i; - settings_t *settings = config_get_ptr(); - struct string_list *contents = dir_list_new_special( - settings->paths.directory_libretro, - DIR_LIST_CORES, NULL); - const char *path_basedir = !string_is_empty(settings->paths.path_libretro_info) ? - settings->paths.path_libretro_info : settings->paths.directory_libretro; - + const char *path_basedir = !string_is_empty(path_info) ? + path_info : dir_cores; + struct string_list *contents = dir_list_new( + dir_cores, exts, false, show_hidden_files, false, false); if (!contents) return; @@ -786,7 +793,7 @@ void core_info_get_name(const char *path, char *s, size_t len) continue; } - conf = config_file_new(info_path); + conf = config_file_new(info_path); if (!conf) { diff --git a/core_info.h b/core_info.h index c058e8d937..f87805e605 100644 --- a/core_info.h +++ b/core_info.h @@ -43,6 +43,7 @@ typedef struct char *path; void *config_data; char *display_name; + char *display_version; char *core_name; char *system_manufacturer; char *systemname; @@ -97,7 +98,9 @@ bool core_info_list_get_display_name(core_info_list_t *list, bool core_info_get_display_name(const char *path, char *s, size_t len); -void core_info_get_name(const char *path, char *s, size_t len); +void core_info_get_name(const char *path, char *s, size_t len, + const char *path_info, const char *dir_cores, + const char *exts, bool show_hidden_files); core_info_t *core_info_get(core_info_list_t *list, size_t i); @@ -109,11 +112,13 @@ bool core_info_get_current_core(core_info_t **core); void core_info_deinit_list(void); -bool core_info_init_list(void); +bool core_info_init_list(const char *path_info, const char *dir_cores, + const char *exts, bool show_hidden_files); bool core_info_get_list(core_info_list_t **core); -bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info); +bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info, + bool *set_missing_bios); bool core_info_find(core_info_ctx_find_t *info, const char *name); diff --git a/core_type.h b/core_type.h index e4a66058e5..e8933de6bd 100644 --- a/core_type.h +++ b/core_type.h @@ -21,6 +21,7 @@ enum rarch_core_type CORE_TYPE_PLAIN = 0, CORE_TYPE_DUMMY, CORE_TYPE_FFMPEG, + CORE_TYPE_MPV, CORE_TYPE_IMAGEVIEWER, CORE_TYPE_NETRETROPAD, CORE_TYPE_VIDEO_PROCESSOR diff --git a/cores/internal_cores.h b/cores/internal_cores.h index 6ef7d74f8c..08e916d63e 100644 --- a/cores/internal_cores.h +++ b/cores/internal_cores.h @@ -136,6 +136,62 @@ size_t libretro_ffmpeg_retro_get_memory_size(unsigned id); #endif +#ifdef HAVE_MPV +/* Internal mpv core. */ + +void libretro_mpv_retro_init(void); + +void libretro_mpv_retro_deinit(void); + +unsigned libretro_mpv_retro_api_version(void); + +void libretro_mpv_retro_get_system_info(struct retro_system_info *info); + +void libretro_mpv_retro_get_system_av_info(struct retro_system_av_info *info); + +void libretro_mpv_retro_set_environment(retro_environment_t cb); + +void libretro_mpv_retro_set_video_refresh(retro_video_refresh_t cb); + +void libretro_mpv_retro_set_audio_sample(retro_audio_sample_t cb); + +void libretro_mpv_retro_set_audio_sample_batch(retro_audio_sample_batch_t cb); + +void libretro_mpv_retro_set_input_poll(retro_input_poll_t cb); + +void libretro_mpv_retro_set_input_state(retro_input_state_t cb); + +void libretro_mpv_retro_set_controller_port_device(unsigned port, unsigned device); + +void libretro_mpv_retro_reset(void); + +void libretro_mpv_retro_run(void); + +size_t libretro_mpv_retro_serialize_size(void); + +bool libretro_mpv_retro_serialize(void *data, size_t size); + +bool libretro_mpv_retro_unserialize(const void *data, size_t size); + +void libretro_mpv_retro_cheat_reset(void); + +void libretro_mpv_retro_cheat_set(unsigned index, bool enabled, const char *code); + +bool libretro_mpv_retro_load_game(const struct retro_game_info *game); + +bool libretro_mpv_retro_load_game_special(unsigned game_type, + const struct retro_game_info *info, size_t num_info); + +void libretro_mpv_retro_unload_game(void); + +unsigned libretro_mpv_retro_get_region(void); + +void *libretro_mpv_retro_get_memory_data(unsigned id); + +size_t libretro_mpv_retro_get_memory_size(unsigned id); + +#endif + #ifdef HAVE_IMAGEVIEWER /* Internal image viewer core. */ diff --git a/cores/libretro-mpv/Makefile b/cores/libretro-mpv/Makefile index 5b84e98581..a48ea471a7 100644 --- a/cores/libretro-mpv/Makefile +++ b/cores/libretro-mpv/Makefile @@ -114,7 +114,7 @@ endif CFLAGS += -I../../libretro-common/include OBJECTS := mpv-libretro.o -LDFLAGS += -lmpv -ldl -lm +LDFLAGS += -lmpv -lm CFLAGS += -Wall -pedantic all: $(TARGET) diff --git a/cores/libretro-mpv/README.md b/cores/libretro-mpv/README.md index 9ef302196c..369cc730ee 100644 --- a/cores/libretro-mpv/README.md +++ b/cores/libretro-mpv/README.md @@ -1,17 +1,46 @@ # libretro-mpv -mpv media player as a libretro core. A proof of concept release is now available. +mpv media player as a libretro core. A proof of concept release is now +available. -Aims to use features already established in mpv that are not currently available in Retroarch movieplayer. +Aims to use features already established in mpv that are not currently +available in Retroarch movieplayer. -I want to be able to use Retroarch as my movie player on my embedded devices (Raspberry Pi) and desktop using hardware acceleration without having to use Kodi or mpv directly. Thus allowing for a more integrated experience, and smaller root filesystem. +I want to be able to use Retroarch as my movie player on my embedded devices +(Raspberry Pi) and desktop using hardware acceleration without having to use +Kodi or mpv directly. Thus allowing for a more integrated experience, and +smaller root filesystem. ## Compiling -Retroarch must be compiled with `--disable-ffmpeg` to stop the integrated movieplayer from playing the input file. +### Overview + +Retroarch must be compiled with `--disable-ffmpeg` to stop the integrated +movieplayer from playing the input file. FFmpeg (preferably master branch) must be compiled with `--enable-shared`. mpv must be compiled with `--enable-libmpv-shared`. Then run `make` in the mpv-libretro folder. + +### Compiling with Mingw-w64 on Windows + +RetroArch must be compiled with `--disable-ffmpeg` and have OpenGL or +OpenGLES enabled. Compiling RetroArch is not described here. + +1. Open `Minwg-w64 64 bit` (not MSYS2 shell). +2. Install ffmpeg using `pacman -S mingw64/mingw-w64-x86_64-ffmpeg`. +3. Clone the ao_cb branch of https://github.com/deltabeard/mpv.git . This fork has the audio +callback patches required for libretro-mpv. +4. Follow the instructions at https://github.com/mpv-player/mpv/blob/master/DOCS/compile-windows.md#native-compilation-with-msys2 to compile mpv. +5. Download libretro-mpv release 0.3.alpha by either checking out the + `audio-cb-new` branch of `https://github.com/libretro/libretro-mpv.git` or + by downloading + https://github.com/libretro/libretro-mpv/archive/0.3.alpha.tar.gz . +6. Run `make` in the libretro-mpv folder. If using OpenGLES, run `make + platform=gles` instead. + +Overall, the dependencies required to build libretro-mpv are: +- ffmpeg 4.0 (provided by mingw64/mingw-w64-x86_64-ffmpeg) +- mpv from https://github.com/deltabeard/mpv.git fork. diff --git a/cores/libretro-mpv/internal_cores.h b/cores/libretro-mpv/internal_cores.h new file mode 100644 index 0000000000..7e1a2aab98 --- /dev/null +++ b/cores/libretro-mpv/internal_cores.h @@ -0,0 +1 @@ +#include "../internal_cores.h" diff --git a/cores/libretro-mpv/mpv-libretro.c b/cores/libretro-mpv/mpv-libretro.c index 3f95acc50e..c84ebd2561 100644 --- a/cores/libretro-mpv/mpv-libretro.c +++ b/cores/libretro-mpv/mpv-libretro.c @@ -14,26 +14,28 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + #include #include #include #include #include -#include - -#ifdef HAVE_OPENGLES -#include -#endif #ifdef HAVE_LOCALE #include #endif #include -#include +#include #include +#ifdef RARCH_INTERNAL +#include "internal_cores.h" +#define CORE_PREFIX(s) libretro_mpv_##s +#else +#define CORE_PREFIX(s) s +#endif + #include "version.h" static struct retro_hw_render_callback hw_render; @@ -41,28 +43,25 @@ static struct retro_hw_render_callback hw_render; static struct retro_log_callback logging; static retro_log_printf_t log_cb; -static retro_video_refresh_t video_cb; -static retro_audio_sample_t audio_cb; -static retro_audio_sample_batch_t audio_batch_cb; -static retro_environment_t environ_cb; -static retro_input_poll_t input_poll_cb; -static retro_input_state_t input_state_cb; +static retro_video_refresh_t CORE_PREFIX(video_cb); +static retro_audio_sample_t CORE_PREFIX(audio_cb); +static retro_audio_sample_batch_t CORE_PREFIX(audio_batch_cb); +static retro_environment_t CORE_PREFIX(environ_cb); +static retro_input_poll_t CORE_PREFIX(input_poll_cb); +static retro_input_state_t CORE_PREFIX(input_state_cb); static mpv_handle *mpv; -static mpv_opengl_cb_context *mpv_gl; - -/* Keep track of the number of events in mpv queue */ -static unsigned int event_waiting = 0; +static mpv_render_context *mpv_gl; /* Save the current playback time for context changes */ -static int64_t *playback_time = 0; +static int64_t playback_time = 0; /* filepath required globaly as mpv is reopened on context change */ static char *filepath = NULL; static volatile int frame_queue = 0; -void queue_new_frame(void *cb_ctx) +void on_mpv_redraw(void *cb_ctx) { frame_queue++; } @@ -76,52 +75,59 @@ static void fallback_log(enum retro_log_level level, const char *fmt, ...) va_end(va); } -static void print_mpv_logs(void) +/** + * Process various events triggered by mpv, such as printing log messages. + * + * \param event_block Wait until the mpv triggers specified event. Should be + * NULL if no wait is required. + */ +static void process_mpv_events(mpv_event_id event_block) { - /* Print out mpv logs */ - if(event_waiting > 0) + do { - while(1) + mpv_event *mp_event = mpv_wait_event(mpv, 0); + if(event_block == MPV_EVENT_NONE && + mp_event->event_id == MPV_EVENT_NONE) + break; + + if(mp_event->event_id == event_block) + event_block = MPV_EVENT_NONE; + + if(mp_event->event_id == MPV_EVENT_LOG_MESSAGE) { - 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)); - } + 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; - event_waiting = 0; + if(eof->reason == MPV_END_FILE_REASON_EOF) + CORE_PREFIX(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 */ + }; + + CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_MESSAGE, &ra_msg);RETRO_ENVIRONMENT_SHUTDOWN +#endif + } + else if(mp_event->event_id == MPV_EVENT_NONE) + continue; + else + { + log_cb(RETRO_LOG_INFO, "mpv: %s\n", + mpv_event_name(mp_event->event_id)); + } } + while(1); } static void *get_proc_address_mpv(void *fn_ctx, const char *name) @@ -134,58 +140,38 @@ static void *get_proc_address_mpv(void *fn_ctx, const char *name) void *proc_addr = (void *) hw_render.get_proc_address(name); #pragma GCC diagnostic pop -#ifdef HAVE_OPENGLES - /* 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); - } - } -#endif - 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) +void CORE_PREFIX(retro_init)(void) { - event_waiting++; -} + if(mpv_client_api_version() != MPV_CLIENT_API_VERSION) + { + log_cb(RETRO_LOG_WARN, "libmpv version mismatch. Please update or " + "recompile mpv-libretro after updating libmpv."); + } -void retro_init(void) -{ return; } -void retro_deinit(void) -{ - return; -} +void CORE_PREFIX(retro_deinit)(void) +{} -unsigned retro_api_version(void) +unsigned CORE_PREFIX(retro_api_version)(void) { return RETRO_API_VERSION; } -void retro_set_controller_port_device(unsigned port, unsigned device) +void CORE_PREFIX(retro_set_controller_port_device)(unsigned port, unsigned device) { log_cb(RETRO_LOG_INFO, "Plugging device %u into port %u.\n", device, port); return; } -void retro_get_system_info(struct retro_system_info *info) +void CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info) { memset(info, 0, sizeof(*info)); info->library_name = "mpv"; @@ -206,18 +192,19 @@ void retro_get_system_info(struct retro_system_info *info) "vtt|wav|wsd|xl|xm|xmgz|xmr|xmv|xmz|xvag|y4m|yop|yuv|yuv10"; } -void retro_get_system_av_info(struct retro_system_av_info *info) +void CORE_PREFIX(retro_get_system_av_info)(struct retro_system_av_info *info) { float sampling_rate = 48000.0f; +#if 0 struct retro_variable var = { .key = "test_aspect" }; - environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var); + CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var); var.key = "test_samplerate"; - if(environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) + if(CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) sampling_rate = strtof(var.value, NULL); - +#endif info->timing = (struct retro_system_timing) { .fps = 60.0, .sample_rate = sampling_rate, @@ -235,15 +222,17 @@ void retro_get_system_av_info(struct retro_system_av_info *info) }; } -void retro_set_environment(retro_environment_t cb) +void CORE_PREFIX(retro_set_environment)(retro_environment_t cb) { - environ_cb = cb; + CORE_PREFIX(environ_cb) = cb; static const struct retro_variable vars[] = { - { "test_samplerate", "Sample Rate; 48000|30000|20000" }, +#if 0 + { "test_samplerate", "Sample Rate; 48000" }, { "test_opt0", "Test option #0; false|true" }, { "test_opt1", "Test option #1; 0" }, { "test_opt2", "Test option #2; 0|1|foo|3" }, +#endif { NULL, NULL }, }; @@ -258,6 +247,7 @@ void retro_set_environment(retro_environment_t cb) static void context_reset(void) { const char *cmd[] = {"loadfile", filepath, NULL}; + int ret; #ifdef HAVE_LOCALE setlocale(LC_NUMERIC, "C"); @@ -265,66 +255,68 @@ static void context_reset(void) mpv = mpv_create(); - if(mpv == NULL) + if(!mpv) { log_cb(RETRO_LOG_ERROR, "failed creating context\n"); exit(EXIT_FAILURE); } - if(mpv_initialize(mpv) < 0) + if((ret = mpv_initialize(mpv)) < 0) { - log_cb(RETRO_LOG_ERROR, "mpv init failed\n"); + log_cb(RETRO_LOG_ERROR, "mpv init failed: %s\n", mpv_error_string(ret)); exit(EXIT_FAILURE); } - /* When normal mpv events are available. */ - mpv_set_wakeup_callback(mpv, on_mpv_events, NULL); - - 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 - * returns NULL if no OpenGL support is compiled. - */ - mpv_gl = mpv_get_sub_api(mpv, MPV_SUB_API_OPENGL_CB); - - if(mpv_gl == NULL) + if((ret = mpv_request_log_messages(mpv, "v")) < 0) { - log_cb(RETRO_LOG_ERROR, "failed to create mpv GL API handle\n"); + log_cb(RETRO_LOG_ERROR, "mpv logging failed: %s\n", + mpv_error_string(ret)); + } + + mpv_render_param params[] = { + {MPV_RENDER_PARAM_API_TYPE, MPV_RENDER_API_TYPE_OPENGL}, + {MPV_RENDER_PARAM_OPENGL_INIT_PARAMS, &(mpv_opengl_init_params){ + .get_proc_address = get_proc_address_mpv, + }}, + {0} + }; + + if((ret = mpv_render_context_create(&mpv_gl, mpv, params)) < 0) + { + log_cb(RETRO_LOG_ERROR, "failed to initialize mpv GL context: %s\n", + mpv_error_string(ret)); 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"); - goto err; - } + mpv_render_context_set_update_callback(mpv_gl, on_mpv_redraw, NULL); - /* Actually using the opengl_cb state has to be explicitly requested. - * Otherwise, mpv will create a separate platform window. - */ - if(mpv_set_option_string(mpv, "vo", "opengl-cb") < 0) - { - log_cb(RETRO_LOG_ERROR, "failed to set video output to OpenGL\n"); - goto err; - } - - mpv_opengl_cb_set_update_callback(mpv_gl, queue_new_frame, NULL); - - mpv_set_option_string(mpv, "ao", "audio-cb"); + mpv_set_option_string(mpv, "ao", "libmpv"); /* Attempt to enable hardware acceleration. MPV will fallback to software * decoding on failure. */ - if(mpv_set_option_string(mpv, "hwdec", "auto") < 0) - log_cb(RETRO_LOG_ERROR, "failed to set hwdec option\n"); - - if(mpv_command(mpv, cmd) != 0) + if((ret = mpv_set_option_string(mpv, "hwdec", "auto")) < 0) { - log_cb(RETRO_LOG_ERROR, "failed to issue mpv_command to load file\n"); + log_cb(RETRO_LOG_ERROR, "failed to set hwdec option: %s\n", + mpv_error_string(ret)); + } + + if((ret = mpv_command(mpv, cmd)) != 0) + { + log_cb(RETRO_LOG_ERROR, "mpv_command failed to load input file: %s\n", + mpv_error_string(ret)); goto err; } + /* TODO #2: Check for the highest samplerate in audio stream, and use that. + * Fall back to 48kHz otherwise. + * We currently force the audio to be sampled at 48KHz. + */ + mpv_set_option_string(mpv, "af", "format=s16:48000:stereo"); + //mpv_set_option_string(mpv, "opengl-swapinterval", "0"); + + /* Process any events whilst we wait for playback to begin. */ + process_mpv_events(MPV_EVENT_NONE); /* 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 @@ -332,20 +324,14 @@ static void context_reset(void) * * This also seems to fix some black screen issues. */ - while(mpv_set_property(mpv, - "playback-time", MPV_FORMAT_INT64, &playback_time) < 0) + if(playback_time != 0) { - /* Garbage fix to overflowing log */ - usleep(10); + process_mpv_events(MPV_EVENT_PLAYBACK_RESTART); + while(mpv_set_property(mpv, + "playback-time", MPV_FORMAT_INT64, &playback_time) < 0) + {} } - /* TODO #2: Check for the highest samplerate in audio stream, and use that. - * Fall back to 48kHz otherwise. - * We currently force the audio to be sampled at 48KHz. - */ - mpv_set_option_string(mpv, "audio-samplerate", "48000"); - mpv_set_option_string(mpv, "opengl-swapinterval", "0"); - /* The following works best when vsync is switched off in Retroarch. */ //mpv_set_option_string(mpv, "video-sync", "display-resample"); //mpv_set_option_string(mpv, "display-fps", "60"); @@ -356,14 +342,14 @@ static void context_reset(void) err: /* Print mpv logs to see why mpv failed. */ - print_mpv_logs(); + process_mpv_events(MPV_EVENT_NONE); exit(EXIT_FAILURE); } static void context_destroy(void) { mpv_get_property(mpv, "playback-time", MPV_FORMAT_INT64, &playback_time); - mpv_opengl_cb_uninit_gl(mpv_gl); + mpv_render_context_free(mpv_gl); mpv_terminate_destroy(mpv); log_cb(RETRO_LOG_INFO, "Context destroyed.\n"); } @@ -378,60 +364,77 @@ static bool retro_init_hw_context(void) hw_render.context_reset = context_reset; hw_render.context_destroy = context_destroy; - if (!environ_cb(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render)) + if (!CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_HW_RENDER, &hw_render)) return false; return true; } -void retro_set_audio_sample(retro_audio_sample_t cb) +void CORE_PREFIX(retro_set_audio_sample)(retro_audio_sample_t cb) { - audio_cb = cb; + CORE_PREFIX(audio_cb) = cb; } -void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) +void CORE_PREFIX(retro_set_audio_sample_batch)(retro_audio_sample_batch_t cb) { - audio_batch_cb = cb; + CORE_PREFIX(audio_batch_cb) = cb; } -void retro_set_input_poll(retro_input_poll_t cb) +void CORE_PREFIX(retro_set_input_poll)(retro_input_poll_t cb) { - input_poll_cb = cb; + CORE_PREFIX(input_poll_cb) = cb; } -void retro_set_input_state(retro_input_state_t cb) +void CORE_PREFIX(retro_set_input_state)(retro_input_state_t cb) { - input_state_cb = cb; + CORE_PREFIX(input_state_cb) = cb; } -void retro_set_video_refresh(retro_video_refresh_t cb) +void CORE_PREFIX(retro_set_video_refresh)(retro_video_refresh_t cb) { - video_cb = cb; + CORE_PREFIX(video_cb) = cb; } -void retro_reset(void) +void CORE_PREFIX(retro_reset)(void) { - return; } static void audio_callback(double fps) { /* Obtain len samples to reduce lag. */ int len = 48000 / (int)floor(fps); - static int16_t frames[512]; + const unsigned int buff_len = 1024; + uint8_t buff[buff_len]; - while(len > 0) + if(len < 4) + len = 4; + + do { - int mpv_len = mpv_audio_callback(&frames, len > 512 ? 512*2 : len*2); - //printf("mpv cb: %d\n", mpv_len); - if(mpv_len < 1) - return; + len = len - (len % 4); - len -= mpv_len; + int ret = mpv_audio_callback(mpv, &buff, + len > buff_len ? buff_len : len); - //printf("acb: %lu\n", audio_batch_cb(frames, mpv_len)); - audio_batch_cb(frames, mpv_len); + if(ret < 0) + { +#if 0 + log_cb(RETRO_LOG_ERROR, "mpv encountered an error in audio " + "callback: %d.\n", ret); +#endif + return; + } + + /* mpv may refuse to buffer audio if the first video frame has not + * displayed yet. */ + if(ret == 0) + return; + + len -= ret; + + CORE_PREFIX(audio_batch_cb)((const int16_t*)buff, ret); } + while(len > 4); } static void retropad_update_input(void) @@ -445,7 +448,7 @@ static void retropad_update_input(void) struct Input current; static struct Input last; - input_poll_cb(); + CORE_PREFIX(input_poll_cb)(); /* Commands that are called on rising edge only */ @@ -456,11 +459,11 @@ static void retropad_update_input(void) * Unsure if saving the memory is worth the extra checks, costing CPU time, * but both are incredibly miniscule anyway. */ - current.l = input_state_cb(0, RETRO_DEVICE_JOYPAD, + current.l = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_L) != 0 ? 1 : 0; - current.r = input_state_cb(0, RETRO_DEVICE_JOYPAD, + current.r = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R) != 0 ? 1 : 0; - current.a = input_state_cb(0, RETRO_DEVICE_JOYPAD, + current.a = CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A) != 0 ? 1 : 0; if(current.l == 1 && last.l == 0) @@ -473,24 +476,24 @@ static void retropad_update_input(void) mpv_command_string(mpv, "cycle pause"); /* TODO #3: Press and hold commands with small delay */ - if(input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, + if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT)) mpv_command_string(mpv, "seek -5"); - if(input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, + if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT)) mpv_command_string(mpv, "seek 5"); - if(input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, + if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP)) mpv_command_string(mpv, "seek 60"); - if(input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, + if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN)) mpv_command_string(mpv, "seek -60"); /* Press and hold commands */ - if(input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, + if (CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X)) mpv_command_string(mpv, "show-progress"); @@ -502,7 +505,7 @@ static void retropad_update_input(void) last.a = current.a; } -void retro_run(void) +void CORE_PREFIX(retro_run)(void) { /* We only need to update the base video size once, and we do it here since * the input file is not processed during the first @@ -546,51 +549,60 @@ void retro_run(void) }; if(width > 0 && height > 0) - environ_cb(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &av_info); + CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &av_info); updated_video_dimensions = true; } - print_mpv_logs(); - retropad_update_input(); /* TODO #2: Implement an audio callback feature in to libmpv */ audio_callback(container_fps); + process_mpv_events(MPV_EVENT_NONE); + #if 1 if(frame_queue > 0) { - mpv_opengl_cb_draw(mpv_gl, hw_render.get_current_framebuffer(), width, height); - video_cb(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0); + mpv_render_param params[] = { + {MPV_RENDER_PARAM_OPENGL_FBO, &(mpv_opengl_fbo){ + .fbo = hw_render.get_current_framebuffer(), + .w = width, + .h = height, + }}, + {0} + }; + mpv_render_context_render(mpv_gl, params); + CORE_PREFIX(video_cb)(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0); frame_queue--; } else - video_cb(NULL, width, height, 0); + CORE_PREFIX(video_cb)(NULL, width, height, 0); #else mpv_opengl_cb_draw(mpv_gl, hw_render.get_current_framebuffer(), width, height); - video_cb(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0); + CORE_PREFIX(video_cb)(RETRO_HW_FRAME_BUFFER_VALID, width, height, 0); #endif + return; } /* No save-state support */ -size_t retro_serialize_size(void) +size_t CORE_PREFIX(retro_serialize_size)(void) { return 0; } -bool retro_serialize(void *data_, size_t size) +bool CORE_PREFIX(retro_serialize)(void *data_, size_t size) { return true; } -bool retro_unserialize(const void *data_, size_t size) +bool CORE_PREFIX(retro_unserialize)(const void *data_, size_t size) { return true; } -bool retro_load_game(const struct retro_game_info *info) +bool CORE_PREFIX(retro_load_game)(const struct retro_game_info *info) { /* Supported on most systems. */ enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_XRGB8888; @@ -607,21 +619,30 @@ bool retro_load_game(const struct retro_game_info *info) { 0 }, }; + if(info->path == NULL) + return false; + /* Copy the file path to a global variable as we need it in context_reset() * where mpv is initialised. */ - filepath = strdup(info->path); + if((filepath = malloc(strlen(info->path)+1)) == NULL) + { + log_cb(RETRO_LOG_ERROR, "Unable to allocate memory for filepath\n"); + return false; + } - environ_cb(RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS, desc); + strcpy(filepath,info->path); + + CORE_PREFIX(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) == false) + if(CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt) == false) { log_cb(RETRO_LOG_ERROR, "XRGB8888 is not supported.\n"); /* Try RGB565 */ fmt = RETRO_PIXEL_FORMAT_RGB565; - environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt); + CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt); } if(retro_init_hw_context() == false) @@ -633,41 +654,39 @@ bool retro_load_game(const struct retro_game_info *info) return true; } -bool retro_load_game_special(unsigned type, const struct retro_game_info *info, +bool CORE_PREFIX(retro_load_game_special)(unsigned type, const struct retro_game_info *info, size_t num) { return false; } -void retro_unload_game(void) +void CORE_PREFIX(retro_unload_game)(void) { free(filepath); filepath = NULL; - - return; } -unsigned retro_get_region(void) +unsigned CORE_PREFIX(retro_get_region)(void) { return RETRO_REGION_NTSC; } -void *retro_get_memory_data(unsigned id) +void *CORE_PREFIX(retro_get_memory_data)(unsigned id) { return NULL; } -size_t retro_get_memory_size(unsigned id) +size_t CORE_PREFIX(retro_get_memory_size)(unsigned id) { return 0; } -void retro_cheat_reset(void) -{ - return; -} +void CORE_PREFIX(retro_cheat_reset)(void) +{} -void retro_cheat_set(unsigned index, bool enabled, const char *code) +void CORE_PREFIX(retro_cheat_set)(unsigned index, bool enabled, const char *code) { - return; + (void)index; + (void)enabled; + (void)code; } diff --git a/cores/libretro-mpv/version.h b/cores/libretro-mpv/version.h index 203d2c70db..494a513a0b 100644 --- a/cores/libretro-mpv/version.h +++ b/cores/libretro-mpv/version.h @@ -1,3 +1,3 @@ #ifndef LIBRETRO_MPV_VERSION -#define LIBRETRO_MPV_VERSION "0.2.alpha" +#define LIBRETRO_MPV_VERSION "0.3.alpha" #endif diff --git a/ctr/ctr_system.c b/ctr/ctr_system.c index 29594251e7..9126ba009e 100644 --- a/ctr/ctr_system.c +++ b/ctr/ctr_system.c @@ -1,5 +1,6 @@ #include <3ds.h> #include +#include <3ds/services/apt.h> #include #include #include diff --git a/ctr/exec-3dsx/exec_3dsx.c b/ctr/exec-3dsx/exec_3dsx.c new file mode 100644 index 0000000000..7de5b374e6 --- /dev/null +++ b/ctr/exec-3dsx/exec_3dsx.c @@ -0,0 +1,85 @@ +#include +#include +#include +#include + +#include "mini-hb-menu/common.h" + + +extern const loaderFuncs_s loader_Ninjhax1; +extern const loaderFuncs_s loader_Ninjhax2; +extern const loaderFuncs_s loader_Rosalina; + +static void (*launch_3dsx)(const char* path, argData_s* args, executableMetadata_s* em); + + +static int exec_3dsx_actual(const char* path, const char** args, bool appendPath){ + struct stat sBuff; + argData_s newProgramArgs; + unsigned int argChars = 0; + unsigned int argNum = 0; + bool fileExists; + bool inited; + + if(path == NULL || path[0] == '\0'){ + errno = EINVAL; + return -1; + } + + fileExists = stat(path, &sBuff) == 0; + if(!fileExists){ + errno = ENOENT; + return -1; + } + else if(S_ISDIR(sBuff.st_mode)){ + errno = EINVAL; + return -1; + } + + //args the string functions write to the passed string, this will cause a write to read only memory sot the string must be cloned + memset(newProgramArgs.buf, '\0', sizeof(newProgramArgs.buf)); + newProgramArgs.dst = (char*)&newProgramArgs.buf[1]; + if(appendPath){ + strcpy(newProgramArgs.dst, path); + newProgramArgs.dst += strlen(path) + 1; + newProgramArgs.buf[0]++; + + } + while(args[argNum] != NULL){ + strcpy(newProgramArgs.dst, args[argNum]); + newProgramArgs.dst += strlen(args[argNum]) + 1; + newProgramArgs.buf[0]++; + argNum++; + } + + inited = loader_Rosalina.init(); + launch_3dsx = loader_Rosalina.launchFile; + + if(!inited){ + inited = loader_Ninjhax2.init(); + launch_3dsx = loader_Ninjhax2.launchFile; + } + + if(!inited){ + inited = loader_Ninjhax1.init(); + launch_3dsx = loader_Ninjhax1.launchFile; + } + + if(inited){ + osSetSpeedupEnable(false); + launch_3dsx(path, &newProgramArgs, NULL); + exit(0); + } + + //should never be reached + errno = ENOTSUP; + return -1; +} + +int exec_3dsx(const char* path, const char** args){ + return exec_3dsx_actual(path, args, true/*appendPath*/); +} + +int exec_3dsx_no_path_in_args(const char* path, const char** args){ + return exec_3dsx_actual(path, args, false/*appendPath*/); +} \ No newline at end of file diff --git a/ctr/exec-3dsx/exec_3dsx.h b/ctr/exec-3dsx/exec_3dsx.h new file mode 100644 index 0000000000..d260331cb0 --- /dev/null +++ b/ctr/exec-3dsx/exec_3dsx.h @@ -0,0 +1,9 @@ +#ifndef EXEC_3DSX_H +#define EXEC_3DSX_H + +//since 3dsx programs are not guaranteed access to the OS, the 3dsx bootloader run by the exploit must run the next program +//your program must have no extra threads running when this is called, these limits do not apply to exec_cia +int exec_3dsx_no_path_in_args(const char* path, const char** args); +int exec_3dsx(const char* path, const char** args); + +#endif \ No newline at end of file diff --git a/ctr/exec-3dsx/exec_cia.c b/ctr/exec-3dsx/exec_cia.c new file mode 100644 index 0000000000..7c4c19551d --- /dev/null +++ b/ctr/exec-3dsx/exec_cia.c @@ -0,0 +1,203 @@ +#include +#include +#include +#include +#include <3ds.h> + + +#define FILE_CHUNK_SIZE 4096 + + +typedef struct{ + u32 argc; + char args[0x300 - 0x4]; +}ciaParam; + + +char argvHmac[0x20] = {0x1d, 0x78, 0xff, 0xb9, 0xc5, 0xbc, 0x78, 0xb7, 0xac, 0x29, 0x1d, 0x3e, 0x16, 0xd0, 0xcf, 0x53, 0xef, 0x12, 0x58, 0x83, 0xb6, 0x9e, 0x2f, 0x79, 0x47, 0xf9, 0x35, 0x61, 0xeb, 0x50, 0xd7, 0x67}; + + +static void errorAndQuit(const char* errorStr){ + errorConf error; + + errorInit(&error, ERROR_TEXT, CFG_LANGUAGE_EN); + errorText(&error, errorStr); + errorDisp(&error); + exit(0); +} + +static int isCiaInstalled(u64 titleId, u16 version){ + u32 titlesToRetrieve; + u32 titlesRetrieved; + u64* titleIds; + bool titleExists = false; + AM_TitleEntry titleInfo; + Result failed; + + failed = AM_GetTitleCount(MEDIATYPE_SD, &titlesToRetrieve); + if(R_FAILED(failed)) + return -1; + + titleIds = malloc(titlesToRetrieve * sizeof(uint64_t)); + if(titleIds == NULL) + return -1; + + failed = AM_GetTitleList(&titlesRetrieved, MEDIATYPE_SD, titlesToRetrieve, titleIds); + if(R_FAILED(failed)) + return -1; + + for(u32 titlesToCheck = 0; titlesToCheck < titlesRetrieved; titlesToCheck++){ + if(titleIds[titlesToCheck] == titleId){ + titleExists = true; + break; + } + } + + free(titleIds); + + if(titleExists){ + failed = AM_GetTitleInfo(MEDIATYPE_SD, 1 /*titleCount*/, &titleId, &titleInfo); + if(R_FAILED(failed)) + return -1; + + if(titleInfo.version == version) + return 1; + } + + return 0; +} + +static int installCia(Handle ciaFile){ + Result failed; + Handle outputHandle; + u64 fileSize; + u64 fileOffset = 0; + u32 bytesRead; + u32 bytesWritten; + u8 transferBuffer[FILE_CHUNK_SIZE]; + + failed = AM_StartCiaInstall(MEDIATYPE_SD, &outputHandle); + if(R_FAILED(failed)) + return -1; + + failed = FSFILE_GetSize(ciaFile, &fileSize); + if(R_FAILED(failed)) + return -1; + + while(fileOffset < fileSize){ + u64 bytesRemaining = fileSize - fileOffset; + failed = FSFILE_Read(ciaFile, &bytesRead, fileOffset, transferBuffer, bytesRemaining < FILE_CHUNK_SIZE ? bytesRemaining : FILE_CHUNK_SIZE); + if(R_FAILED(failed)){ + AM_CancelCIAInstall(outputHandle); + return -1; + } + + failed = FSFILE_Write(outputHandle, &bytesWritten, fileOffset, transferBuffer, bytesRead, 0); + if(R_FAILED(failed)){ + AM_CancelCIAInstall(outputHandle); + if(R_DESCRIPTION(failed) == RD_ALREADY_EXISTS) + return 1; + return -1; + } + + if(bytesWritten != bytesRead){ + AM_CancelCIAInstall(outputHandle); + return -1; + } + + fileOffset += bytesWritten; + } + + failed = AM_FinishCiaInstall(outputHandle); + if(R_FAILED(failed)) + return -1; + + return 1; +} + +int exec_cia(const char* path, const char** args){ + struct stat sBuff; + bool fileExists; + bool inited; + + if(path == NULL || path[0] == '\0'){ + errno = EINVAL; + return -1; + } + + fileExists = stat(path, &sBuff) == 0; + if(!fileExists){ + errno = ENOENT; + return -1; + } + else if(S_ISDIR(sBuff.st_mode)){ + errno = EINVAL;; + return -1; + } + + inited = R_SUCCEEDED(amInit()) && R_SUCCEEDED(fsInit()); + if(inited){ + Result res; + AM_TitleEntry ciaInfo; + FS_Archive ciaArchive; + Handle ciaFile; + int ciaInstalled; + ciaParam param; + int argsLength; + + //open cia file + res = FSUSER_OpenArchive(&ciaArchive, ARCHIVE_SDMC, fsMakePath(PATH_EMPTY, "")); + if(R_FAILED(res)) + errorAndQuit("Cant open SD FS archive."); + + res = FSUSER_OpenFile(&ciaFile, ciaArchive, fsMakePath(PATH_ASCII, path + 5/*skip "sdmc:"*/), FS_OPEN_READ, 0); + if(R_FAILED(res)) + errorAndQuit("Cant open CIA file."); + + res = AM_GetCiaFileInfo(MEDIATYPE_SD, &ciaInfo, ciaFile); + if(R_FAILED(res)) + errorAndQuit("Cant get CIA file info."); + + ciaInstalled = isCiaInstalled(ciaInfo.titleID, ciaInfo.version); + if(ciaInstalled == -1){ + //error + errorAndQuit("Could not read title id list."); + } + else if(ciaInstalled == 0){ + //not installed + int error = installCia(ciaFile); + if(error == -1) + errorAndQuit("Cant install CIA."); + } + + FSFILE_Close(ciaFile); + FSUSER_CloseArchive(ciaArchive); + + param.argc = 0; + argsLength = 0; + char* argLocation = param.args; + while(args[param.argc] != NULL){ + strcpy(argLocation, args[param.argc]); + argLocation += strlen(args[param.argc]) + 1; + argsLength += strlen(args[param.argc]) + 1; + param.argc++; + } + + res = APT_PrepareToDoApplicationJump(0, ciaInfo.titleID, 0x1); + if(R_FAILED(res)) + errorAndQuit("CIA cant run, cant prepare."); + + res = APT_DoApplicationJump(¶m, sizeof(param.argc) + argsLength, argvHmac); + if(R_FAILED(res)) + errorAndQuit("CIA cant run, cant jump."); + + //wait for application jump, for some reason its not instant + while(1); + } + + //should never be reached + amExit(); + fsExit(); + errno = ENOTSUP; + return -1; +} diff --git a/ctr/exec-3dsx/exec_cia.h b/ctr/exec-3dsx/exec_cia.h new file mode 100644 index 0000000000..4c751de922 --- /dev/null +++ b/ctr/exec-3dsx/exec_cia.h @@ -0,0 +1,6 @@ +#ifndef EXEC_CIA_H +#define EXEC_CIA_H + +int exec_cia(const char* path, const char** args); + +#endif \ No newline at end of file diff --git a/ctr/exec-3dsx/mini-hb-menu/common.h b/ctr/exec-3dsx/mini-hb-menu/common.h new file mode 100644 index 0000000000..ef354d46d2 --- /dev/null +++ b/ctr/exec-3dsx/mini-hb-menu/common.h @@ -0,0 +1,95 @@ +#pragma once + +// C stdlib includes +#include +#include +#include +#include +#include +#include +#include +#include + +// 3DS includes +#include <3ds.h> + + +#define ENTRY_ARGBUFSIZE 0x400 +#define NUM_SERVICESTHATMATTER 5 + +typedef enum +{ + StrId_Loading = 0, + StrId_Directory, + StrId_DefaultLongTitle, + StrId_DefaultPublisher, + StrId_IOError, + StrId_CouldNotOpenFile, + + StrId_NoAppsFound_Title, + StrId_NoAppsFound_Msg, + + StrId_Reboot, + StrId_ReturnToHome, + + StrId_TitleSelector, + StrId_ErrorReadingTitleMetadata, + StrId_NoTitlesFound, + StrId_SelectTitle, + + StrId_NoTargetTitleSupport, + StrId_MissingTargetTitle, + + StrId_NetLoader, + StrId_NetLoaderUnavailable, + StrId_NetLoaderOffline, + StrId_NetLoaderError, + StrId_NetLoaderActive, + StrId_NetLoaderTransferring, + + StrId_Max, +} StrId; + + +typedef struct +{ + char* dst; + u32 buf[ENTRY_ARGBUFSIZE/sizeof(u32)]; +} argData_s; + +typedef struct +{ + bool scanned; + u32 sectionSizes[3]; + bool servicesThatMatter[NUM_SERVICESTHATMATTER]; +} executableMetadata_s; + +typedef struct +{ + u32 num; + u32 text_end; + u32 data_address; + u32 data_size; + u32 processLinearOffset; + u32 processHookAddress; + u32 processAppCodeAddress; + u32 processHookTidLow, processHookTidHigh; + u32 mediatype; + bool capabilities[0x10]; // {socuAccess, csndAccess, qtmAccess, nfcAccess, httpcAccess, reserved...} +} memmap_header_t; + +typedef struct +{ + u32 src, dst, size; +} memmap_entry_t; + +typedef struct +{ + memmap_header_t header; + memmap_entry_t map[]; +} memmap_t; + +#define memmapSize(m) (sizeof(memmap_header_t) + sizeof(memmap_entry_t)*(m)->header.num) + + +#include "launch.h" diff --git a/ctr/exec-3dsx/mini-hb-menu/launch.c b/ctr/exec-3dsx/mini-hb-menu/launch.c new file mode 100644 index 0000000000..e5adf30581 --- /dev/null +++ b/ctr/exec-3dsx/mini-hb-menu/launch.c @@ -0,0 +1,22 @@ +#include "common.h" + +Handle launchOpenFile(const char* path) +{ + if (strncmp(path, "sdmc:/", 6) == 0) + path += 5; + else if (*path != '/') + return 0; + + // Convert the executable path to UTF-16 + static uint16_t __utf16path[PATH_MAX+1]; + ssize_t units = utf8_to_utf16(__utf16path, (const uint8_t*)path, PATH_MAX); + if (units < 0 || units >= PATH_MAX) return 0; + __utf16path[units] = 0; + + // Open the file directly + FS_Path apath = { PATH_EMPTY, 1, (u8*)"" }; + FS_Path fpath = { PATH_UTF16, (units+1)*2, (u8*)__utf16path }; + Handle file; + Result res = FSUSER_OpenFileDirectly(&file, ARCHIVE_SDMC, apath, fpath, FS_OPEN_READ, 0); + return R_SUCCEEDED(res) ? file : 0; +} diff --git a/ctr/exec-3dsx/mini-hb-menu/launch.h b/ctr/exec-3dsx/mini-hb-menu/launch.h new file mode 100644 index 0000000000..95ba6c95a9 --- /dev/null +++ b/ctr/exec-3dsx/mini-hb-menu/launch.h @@ -0,0 +1,26 @@ +#pragma once + +#include "common.h" + +extern void (*__system_retAddr)(void); + +enum +{ + LOADER_SHOW_REBOOT = 0x01, + LOADER_NEED_SCAN = 0x02 +}; + +typedef struct +{ + // Mandatory fields + const char* name; + u32 flags; + bool (* init)(void); + void (* deinit)(void); + void (* launchFile)(const char* path, argData_s* args, executableMetadata_s* em); + + // Optional fields + void (* useTitle)(u64 tid, u8 mediatype); +} loaderFuncs_s; + +Handle launchOpenFile(const char* path); \ No newline at end of file diff --git a/ctr/exec-3dsx/mini-hb-menu/loaders/hax2.c b/ctr/exec-3dsx/mini-hb-menu/loaders/hax2.c new file mode 100644 index 0000000000..08522f3b7f --- /dev/null +++ b/ctr/exec-3dsx/mini-hb-menu/loaders/hax2.c @@ -0,0 +1,73 @@ +#include "../common.h" + +typedef struct +{ + s32 processId; + bool capabilities[0x10]; +} processEntry_s; + +typedef void (*callBootloader_2x_fn)(Handle file, u32* argbuf, u32 arglength); +typedef void (*callBootloaderNewProcess_2x_fn)(s32 processId, u32* argbuf, u32 arglength); +typedef void (*callBootloaderRunTitle_2x_fn)(u8 mediatype, u32* argbuf, u32 argbuflength, u32 tid_low, u32 tid_high); +typedef void (*callBootloaderRunTitleCustom_2x_fn)(u8 mediatype, u32* argbuf, u32 argbuflength, u32 tid_low, u32 tid_high, memmap_t* mmap); +typedef void (*getBestProcess_2x_fn)(u32 sectionSizes[3], bool* requirements, int num_requirements, processEntry_s* out, int out_size, int* out_len); + +#define callBootloader_2x ((callBootloader_2x_fn)0x00100000) +#define callBootloaderNewProcess_2x ((callBootloaderNewProcess_2x_fn)0x00100008) +#define callBootloaderRunTitle_2x ((callBootloaderRunTitle_2x_fn)0x00100010) +#define callBootloaderRunTitleCustom_2x ((callBootloaderRunTitleCustom_2x_fn)0x00100014) +#define getBestProcess_2x ((getBestProcess_2x_fn)0x0010000C) + +static s32 targetProcess = -1; +static u64 targetTid; +static u8 targetMediatype; +static Handle fileHandle; +static u32 argBuf[ENTRY_ARGBUFSIZE/sizeof(u32)]; +static u32 argBufLen; +static u32 memMapBuf[0x40]; +static bool useMemMap; + +static bool init(void) +{ + return R_SUCCEEDED(amInit()); +} + +static void deinit(void) +{ + amExit(); +} + +static void bootloaderJump(void) +{ + if (targetProcess == -1) + callBootloader_2x(fileHandle, argBuf, argBufLen); + else if (targetProcess == -2) + { + if (useMemMap) + callBootloaderRunTitleCustom_2x(targetMediatype, argBuf, argBufLen, (u32)targetTid, (u32)(targetTid>>32), (memmap_t*)memMapBuf); + else + callBootloaderRunTitle_2x(targetMediatype, argBuf, argBufLen, (u32)targetTid, (u32)(targetTid>>32)); + } + else + callBootloaderNewProcess_2x(targetProcess, argBuf, argBufLen); +} + +static void launchFile(const char* path, argData_s* args, executableMetadata_s* em) +{ + fileHandle = launchOpenFile(path); + if (fileHandle==0) + return; + argBufLen = args->dst - (char*)args->buf; + memcpy(argBuf, args->buf, argBufLen); + __system_retAddr = bootloaderJump; +} + +const loaderFuncs_s loader_Ninjhax2 = +{ + .name = "hax 2.x", + .flags = LOADER_SHOW_REBOOT | LOADER_NEED_SCAN, + .init = init, + .deinit = deinit, + .launchFile = launchFile, + //.useTitle = useTitle, +}; diff --git a/ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.c b/ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.c new file mode 100644 index 0000000000..8fd05663d3 --- /dev/null +++ b/ctr/exec-3dsx/mini-hb-menu/loaders/ninjhax1.c @@ -0,0 +1,43 @@ +#include "../common.h" + +static void (*callBootloader_1x)(Handle hb, Handle file); +static void (*setArgs_1x)(u32* src, u32 length); +static Handle fileHandle; + +static bool init(void) +{ + Result res = hbInit(); + if (R_FAILED(res)) + return false; + + HB_GetBootloaderAddresses((void**)&callBootloader_1x, (void**)&setArgs_1x); + return true; +} + +static void deinit(void) +{ + hbExit(); +} + +static void bootloaderJump(void) +{ + callBootloader_1x(0x00000000, fileHandle); +} + +static void launchFile(const char* path, argData_s* args, executableMetadata_s* em) +{ + fileHandle = launchOpenFile(path); + if (fileHandle==0) + return; + setArgs_1x(args->buf, sizeof(args->buf)); + __system_retAddr = bootloaderJump; +} + +const loaderFuncs_s loader_Ninjhax1 = +{ + .name = "ninjhax 1.x", + .flags = LOADER_SHOW_REBOOT, + .init = init, + .deinit = deinit, + .launchFile = launchFile, +}; diff --git a/ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.c b/ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.c new file mode 100644 index 0000000000..fd9046e8fa --- /dev/null +++ b/ctr/exec-3dsx/mini-hb-menu/loaders/rosalina.c @@ -0,0 +1,56 @@ +#include "../common.h" + +static Handle hbldrHandle; + +static bool init(void) +{ + return R_SUCCEEDED(svcConnectToPort(&hbldrHandle, "hb:ldr")); +} + +static Result HBLDR_SetTarget(const char* path) +{ + u32 pathLen = strlen(path) + 1; + u32* cmdbuf = getThreadCommandBuffer(); + + cmdbuf[0] = IPC_MakeHeader(2, 0, 2); //0x20002 + cmdbuf[1] = IPC_Desc_StaticBuffer(pathLen, 0); + cmdbuf[2] = (u32)path; + + Result rc = svcSendSyncRequest(hbldrHandle); + if (R_SUCCEEDED(rc)) rc = cmdbuf[1]; + return rc; +} + +static Result HBLDR_SetArgv(const void* buffer, u32 size) +{ + u32* cmdbuf = getThreadCommandBuffer(); + + cmdbuf[0] = IPC_MakeHeader(3, 0, 2); //0x30002 + cmdbuf[1] = IPC_Desc_StaticBuffer(size, 1); + cmdbuf[2] = (u32)buffer; + + Result rc = svcSendSyncRequest(hbldrHandle); + if (R_SUCCEEDED(rc)) rc = cmdbuf[1]; + return rc; +} + +static void deinit(void) +{ + svcCloseHandle(hbldrHandle); +} + +static void launchFile(const char* path, argData_s* args, executableMetadata_s* em) +{ + if (strncmp(path, "sdmc:/",6) == 0) + path += 5; + HBLDR_SetTarget(path); + HBLDR_SetArgv(args->buf, sizeof(args->buf)); +} + +const loaderFuncs_s loader_Rosalina = +{ + .name = "Rosalina", + .init = init, + .deinit = deinit, + .launchFile = launchFile, +}; diff --git a/database_info.c b/database_info.c index 433bd275aa..894ae250ac 100644 --- a/database_info.c +++ b/database_info.c @@ -21,11 +21,13 @@ #include #include #include +#include +#include #include #include "libretro-db/libretrodb.h" -#include "list_special.h" +#include "core_info.h" #include "database_info.h" #include "verbosity.h" @@ -366,16 +368,22 @@ static void dir_list_prioritize(struct string_list *list) } database_info_handle_t *database_info_dir_init(const char *dir, - enum database_type type, retro_task_t *task) + enum database_type type, retro_task_t *task, + bool show_hidden_files) { - struct string_list *list = NULL; - database_info_handle_t *db = (database_info_handle_t*) + core_info_list_t *core_info_list = NULL; + struct string_list *list = NULL; + database_info_handle_t *db = (database_info_handle_t*) calloc(1, sizeof(*db)); if (!db) return NULL; - list = dir_list_new_special(dir, DIR_LIST_RECURSIVE, NULL); + core_info_get_list(&core_info_list); + + list = dir_list_new(dir, core_info_list->all_ext, + false, show_hidden_files, + false, true); if (!list) { diff --git a/database_info.h b/database_info.h index 2664577e6f..aa0f5b8011 100644 --- a/database_info.h +++ b/database_info.h @@ -126,7 +126,8 @@ database_info_list_t *database_info_list_new(const char *rdb_path, void database_info_list_free(database_info_list_t *list); database_info_handle_t *database_info_dir_init(const char *dir, - enum database_type type, retro_task_t *task); + enum database_type type, retro_task_t *task, + bool show_hidden_files); database_info_handle_t *database_info_file_init(const char *path, enum database_type type, retro_task_t *task); diff --git a/defaults.h b/defaults.h index 2373d0bf00..117e14a39a 100644 --- a/defaults.h +++ b/defaults.h @@ -107,7 +107,7 @@ struct defaults playlist_t *image_history; #endif playlist_t *music_history; -#ifdef HAVE_FFMPEG +#if defined(HAVE_FFMPEG) || defined(HAVE_MPV) playlist_t *video_history; #endif #endif diff --git a/deps/SPIRV-Cross/.travis.yml b/deps/SPIRV-Cross/.travis.yml index 26941f43a3..8e09d61957 100644 --- a/deps/SPIRV-Cross/.travis.yml +++ b/deps/SPIRV-Cross/.travis.yml @@ -2,32 +2,17 @@ language: cpp os: - linux - osx -osx_image: xcode8.3 +osx_image: xcode9.3beta # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. sudo: required dist: trusty -# We check out glslang and SPIRV-Tools at specific revisions to avoid test output mismatches -env: - - GLSLANG_REV=9c6f8cc29ba303b43ccf36deea6bb38a304f9b92 SPIRV_TOOLS_REV=e28edd458b729da7bbfd51e375feb33103709e6f - before_script: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade 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 + - ./checkout_glslang_spirv_tools.sh 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 .. + - ./build_glslang_spirv_tools.sh Debug 2 - 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 + - ./test_shaders.sh diff --git a/deps/SPIRV-Cross/CMakeLists.txt b/deps/SPIRV-Cross/CMakeLists.txt index 659315c785..2849b6957d 100644 --- a/deps/SPIRV-Cross/CMakeLists.txt +++ b/deps/SPIRV-Cross/CMakeLists.txt @@ -93,6 +93,10 @@ 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-reflect spirv_cross_reflect STATIC + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.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) @@ -110,7 +114,7 @@ target_compile_options(spirv-cross PRIVATE ${spirv-compiler-options}) 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-util spirv-cross-core) +target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-hlsl spirv-cross-cpp spirv-cross-reflect spirv-cross-msl spirv-cross-util spirv-cross-core) target_link_libraries(spirv-cross-util spirv-cross-core) target_link_libraries(spirv-cross-glsl spirv-cross-core) target_link_libraries(spirv-cross-msl spirv-cross-glsl) @@ -128,12 +132,21 @@ if (${PYTHONINTERP_FOUND}) 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-no-opt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py + ${CMAKE_CURRENT_SOURCE_DIR}/shaders-no-opt) 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-metal-no-opt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal + ${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl-no-opt) 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-hlsl-no-opt + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl + ${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl-no-opt) add_test(NAME spirv-cross-test-opt COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --opt ${CMAKE_CURRENT_SOURCE_DIR}/shaders) diff --git a/deps/SPIRV-Cross/README.md b/deps/SPIRV-Cross/README.md index a6f5231e7a..d3c1a93a07 100644 --- a/deps/SPIRV-Cross/README.md +++ b/deps/SPIRV-Cross/README.md @@ -3,6 +3,7 @@ SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader languages. [![Build Status](https://travis-ci.org/KhronosGroup/SPIRV-Cross.svg?branch=master)](https://travis-ci.org/KhronosGroup/SPIRV-Cross) +[![Build Status](https://ci.appveyor.com/api/projects/status/github/KhronosGroup/SPIRV-Cross?svg=true&branch=master)](https://ci.appveyor.com/project/HansKristian-ARM/SPIRV-Cross) ## Features @@ -10,6 +11,7 @@ SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader - Convert SPIR-V to readable, usable and efficient Metal Shading Language (MSL) - Convert SPIR-V to readable, usable and efficient HLSL - Convert SPIR-V to debuggable C++ [EXPERIMENTAL] + - Convert SPIR-V to a JSON reflection format [EXPERIMENTAL] - Reflection API to simplify the creation of Vulkan pipeline layouts - Reflection API to modify and tweak OpDecorations - Supports "all" of vertex, fragment, tessellation, geometry and compute shaders. @@ -24,7 +26,7 @@ However, most missing features are expected to be "trivial" improvements at this SPIRV-Cross has been tested on Linux, OSX and Windows. -The make and CMake build flavors offer the option to treat exceptions as assertions. To disable exceptions for make just append SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=1 to the command line. For CMake append -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=ON. By default exceptions are enabled. +The make and CMake build flavors offer the option to treat exceptions as assertions. To disable exceptions for make just append `SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=1` to the command line. For CMake append `-DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS=ON`. By default exceptions are enabled. ### Linux and macOS @@ -38,6 +40,8 @@ MinGW-w64 based compilation works with `make`, and an MSVC 2013 solution is also ### Using the C++ API +For more in-depth documentation than what's provided in this README, please have a look at the [Wiki](https://github.com/KhronosGroup/SPIRV-Cross/wiki). + To perform reflection and convert to other shader languages you can use the SPIRV-Cross API. For example: @@ -279,6 +283,7 @@ 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. +./build_glslang_spirv_tools.sh # Builds glslang and SPIRV-Tools. ./test_shaders.sh # Runs over all changes and makes sure that there are no deltas compared to reference files. ``` diff --git a/deps/SPIRV-Cross/appveyor.yml b/deps/SPIRV-Cross/appveyor.yml new file mode 100644 index 0000000000..2f427f1804 --- /dev/null +++ b/deps/SPIRV-Cross/appveyor.yml @@ -0,0 +1,31 @@ + +environment: + matrix: + - GENERATOR: "Visual Studio 12 2013 Win64" + CONFIG: Debug + + - GENERATOR: "Visual Studio 12 2013 Win64" + CONFIG: Release + + - GENERATOR: "Visual Studio 14 2015 Win64" + CONFIG: Debug + + - GENERATOR: "Visual Studio 14 2015 Win64" + CONFIG: Release + + - GENERATOR: "Visual Studio 12 2013" + CONFIG: Debug + + - GENERATOR: "Visual Studio 12 2013" + CONFIG: Release + + - GENERATOR: "Visual Studio 14 2015" + CONFIG: Debug + + - GENERATOR: "Visual Studio 14 2015" + CONFIG: Release + +build_script: + - git submodule update --init + - cmake "-G%GENERATOR%" -H. -B_builds + - cmake --build _builds --config "%CONFIG%" diff --git a/deps/SPIRV-Cross/build_glslang_spirv_tools.sh b/deps/SPIRV-Cross/build_glslang_spirv_tools.sh new file mode 100755 index 0000000000..a966427935 --- /dev/null +++ b/deps/SPIRV-Cross/build_glslang_spirv_tools.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +PROFILE=Release +if [ ! -z $1 ]; then + PROFILE=$1 +fi + +NPROC=$(nproc) +if [ ! -z $2 ]; then + NPROC=$2 +fi + +echo "Building glslang." +mkdir -p external/glslang-build +cd external/glslang-build +cmake ../glslang -DCMAKE_BUILD_TYPE=$PROFILE -G"Unix Makefiles" +make -j$NPROC +cd ../.. + +echo "Building SPIRV-Tools." +mkdir -p external/spirv-tools-build +cd external/spirv-tools-build +cmake ../spirv-tools -DCMAKE_BUILD_TYPE=$PROFILE -G"Unix Makefiles" -DSPIRV_WERROR=OFF +make -j$NPROC +cd ../.. + diff --git a/deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh b/deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh index a4674c14e1..b751fb8e7f 100755 --- a/deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh +++ b/deps/SPIRV-Cross/checkout_glslang_spirv_tools.sh @@ -1,7 +1,7 @@ #!/bin/bash -GLSLANG_REV=9c6f8cc29ba303b43ccf36deea6bb38a304f9b92 -SPIRV_TOOLS_REV=e28edd458b729da7bbfd51e375feb33103709e6f +GLSLANG_REV=461ea09943e0e88ea854ab9e3b42d17d728af2ad +SPIRV_TOOLS_REV=53bc1623ecd3cc304d0d6feed8385e70c7ab30d3 if [ -d external/glslang ]; then echo "Updating glslang to revision $GLSLANG_REV." @@ -18,13 +18,6 @@ else 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 @@ -37,21 +30,15 @@ else 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) + +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 + cd ../.. diff --git a/deps/SPIRV-Cross/format_all.sh b/deps/SPIRV-Cross/format_all.sh index 05efeb3eae..fcfffc57f8 100755 --- a/deps/SPIRV-Cross/format_all.sh +++ b/deps/SPIRV-Cross/format_all.sh @@ -1,6 +1,7 @@ #!/bin/bash -for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp main.cpp +#for file in spirv_*.{cpp,hpp} include/spirv_cross/*.{hpp,h} samples/cpp/*.cpp main.cpp +for file in spirv_*.{cpp,hpp} main.cpp do echo "Formatting file: $file ..." clang-format -style=file -i $file diff --git a/deps/SPIRV-Cross/main.cpp b/deps/SPIRV-Cross/main.cpp index 4f0265d1af..69bd135c1a 100644 --- a/deps/SPIRV-Cross/main.cpp +++ b/deps/SPIRV-Cross/main.cpp @@ -19,6 +19,7 @@ #include "spirv_glsl.hpp" #include "spirv_hlsl.hpp" #include "spirv_msl.hpp" +#include "spirv_reflect.hpp" #include #include #include @@ -122,7 +123,7 @@ struct CLIParser THROW("Tried to parse uint, but nothing left in arguments"); } - uint32_t val = stoul(*argv); + uint64_t val = stoul(*argv); if (val > numeric_limits::max()) { THROW("next_uint() out of range"); @@ -131,7 +132,7 @@ struct CLIParser argc--; argv++; - return val; + return uint32_t(val); } double next_double() @@ -149,6 +150,22 @@ struct CLIParser return val; } + // Return a string only if it's not prefixed with `--`, otherwise return the default value + const char *next_value_string(const char *default_value) + { + if (!argc) + { + return default_value; + } + + if (0 == strncmp("--", *argv, 2)) + { + return default_value; + } + + return next_string(); + } + const char *next_string() { if (!argc) @@ -212,7 +229,6 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec 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; @@ -221,8 +237,8 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec // 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. bool is_push_constant = compiler.get_storage_class(res.id) == StorageClassPushConstant; - bool is_block = (compiler.get_decoration_mask(type.self) & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; + bool is_block = compiler.get_decoration_bitset(type.self).get(DecorationBlock) || + compiler.get_decoration_bitset(type.self).get(DecorationBufferBlock); bool is_sized_block = is_block && (compiler.get_storage_class(res.id) == StorageClassUniform || compiler.get_storage_class(res.id) == StorageClassUniformConstant); uint32_t fallback_id = !is_push_constant && is_block ? res.base_type_id : res.id; @@ -231,6 +247,12 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec if (is_sized_block) block_size = uint32_t(compiler.get_declared_struct_size(compiler.get_type(res.base_type_id))); + Bitset mask; + if (print_ssbo) + mask = compiler.get_buffer_block_flags(res.id); + else + mask = compiler.get_decoration_bitset(res.id); + string array; for (auto arr : type.array) array = join("[", arr ? convert_to_string(arr) : "", "]") + array; @@ -238,17 +260,17 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec fprintf(stderr, " ID %03u : %s%s", res.id, !res.name.empty() ? res.name.c_str() : compiler.get_fallback_name(fallback_id).c_str(), array.c_str()); - if (mask & (1ull << DecorationLocation)) + if (mask.get(DecorationLocation)) fprintf(stderr, " (Location : %u)", compiler.get_decoration(res.id, DecorationLocation)); - if (mask & (1ull << DecorationDescriptorSet)) + if (mask.get(DecorationDescriptorSet)) fprintf(stderr, " (Set : %u)", compiler.get_decoration(res.id, DecorationDescriptorSet)); - if (mask & (1ull << DecorationBinding)) + if (mask.get(DecorationBinding)) fprintf(stderr, " (Binding : %u)", compiler.get_decoration(res.id, DecorationBinding)); - if (mask & (1ull << DecorationInputAttachmentIndex)) + if (mask.get(DecorationInputAttachmentIndex)) fprintf(stderr, " (Attachment : %u)", compiler.get_decoration(res.id, DecorationInputAttachmentIndex)); - if (mask & (1ull << DecorationNonReadable)) + if (mask.get(DecorationNonReadable)) fprintf(stderr, " writeonly"); - if (mask & (1ull << DecorationNonWritable)) + if (mask.get(DecorationNonWritable)) fprintf(stderr, " readonly"); if (is_sized_block) fprintf(stderr, " (BlockSize : %u bytes)", block_size); @@ -284,7 +306,7 @@ static const char *execution_model_to_str(spv::ExecutionModel model) static void print_resources(const Compiler &compiler, const ShaderResources &res) { - uint64_t modes = compiler.get_execution_mode_mask(); + auto &modes = compiler.get_execution_mode_bitset(); fprintf(stderr, "Entry points:\n"); auto entry_points = compiler.get_entry_points_and_stages(); @@ -293,11 +315,7 @@ static void print_resources(const Compiler &compiler, const ShaderResources &res fprintf(stderr, "\n"); fprintf(stderr, "Execution modes:\n"); - for (unsigned i = 0; i < 64; i++) - { - if (!(modes & (1ull << i))) - continue; - + modes.for_each_bit([&](uint32_t i) { auto mode = static_cast(i); uint32_t arg0 = compiler.get_execution_mode_argument(mode, 0); uint32_t arg1 = compiler.get_execution_mode_argument(mode, 1); @@ -353,7 +371,7 @@ static void print_resources(const Compiler &compiler, const ShaderResources &res default: break; } - } + }); fprintf(stderr, "\n"); print_resources(compiler, "subpass inputs", res.subpass_inputs); @@ -460,6 +478,7 @@ struct CLIArguments bool fixup = false; bool yflip = false; bool sso = false; + bool support_nonzero_baseinstance = true; vector pls_in; vector pls_out; vector remaps; @@ -480,6 +499,7 @@ struct CLIArguments uint32_t iterations = 1; bool cpp = false; + string reflect; bool msl = false; bool hlsl = false; bool hlsl_compat = false; @@ -487,25 +507,49 @@ struct CLIArguments bool flatten_multidimensional_arrays = false; bool use_420pack_extension = true; bool remove_unused = false; + bool combined_samplers_inherit_bindings = false; }; static void print_help() { - fprintf(stderr, "Usage: spirv-cross [--output ] [SPIR-V file] [--es] [--no-es] " - "[--version ] [--dump-resources] [--help] [--force-temporary] " - "[--vulkan-semantics] [--flatten-ubo] [--fixup-clipspace] [--flip-vert-y] [--iterations iter] " - "[--cpp] [--cpp-interface-name ] " - "[--msl] [--msl-version ]" - "[--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] [--stage ] [--remove-unused-variables] " - "[--flatten-multidimensional-arrays] [--no-420pack-extension] " - "[--remap-variable-type ] " - "[--rename-interface-variable ] " - "[--set-hlsl-vertex-input-semantic ] " - "[--rename-entry-point ] " + fprintf(stderr, "Usage: spirv-cross\n" + "\t[--output ]\n" + "\t[SPIR-V file]\n" + "\t[--es]\n" + "\t[--no-es]\n" + "\t[--version ]\n" + "\t[--dump-resources]\n" + "\t[--help]\n" + "\t[--force-temporary]\n" + "\t[--vulkan-semantics]\n" + "\t[--flatten-ubo]\n" + "\t[--fixup-clipspace]\n" + "\t[--flip-vert-y]\n" + "\t[--iterations iter]\n" + "\t[--cpp]\n" + "\t[--cpp-interface-name ]\n" + "\t[--msl]\n" + "\t[--msl-version ]\n" + "\t[--hlsl]\n" + "\t[--reflect]\n" + "\t[--shader-model]\n" + "\t[--hlsl-enable-compat]\n" + "\t[--separate-shader-objects]\n" + "\t[--pls-in format input-name]\n" + "\t[--pls-out format output-name]\n" + "\t[--remap source_name target_name components]\n" + "\t[--extension ext]\n" + "\t[--entry name]\n" + "\t[--stage ]\n" + "\t[--remove-unused-variables]\n" + "\t[--flatten-multidimensional-arrays]\n" + "\t[--no-420pack-extension]\n" + "\t[--remap-variable-type ]\n" + "\t[--rename-interface-variable ]\n" + "\t[--set-hlsl-vertex-input-semantic ]\n" + "\t[--rename-entry-point ]\n" + "\t[--combined-samplers-inherit-bindings]\n" + "\t[--no-support-nonzero-baseinstance]\n" "\n"); } @@ -640,6 +684,7 @@ static int main_inner(int argc, char *argv[]) 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("--reflect", [&args](CLIParser &parser) { args.reflect = parser.next_value_string("json"); }); cbs.add("--cpp-interface-name", [&args](CLIParser &parser) { args.cpp_interface_name = parser.next_string(); }); cbs.add("--metal", [&args](CLIParser &) { args.msl = true; }); // Legacy compatibility cbs.add("--msl", [&args](CLIParser &) { args.msl = true; }); @@ -711,6 +756,10 @@ static int main_inner(int argc, char *argv[]) }); cbs.add("--remove-unused-variables", [&args](CLIParser &) { args.remove_unused = true; }); + cbs.add("--combined-samplers-inherit-bindings", + [&args](CLIParser &) { args.combined_samplers_inherit_bindings = true; }); + + cbs.add("--no-support-nonzero-baseinstance", [&](CLIParser &) { args.support_nonzero_baseinstance = false; }); cbs.default_handler = [&args](const char *value) { args.input = value; }; cbs.error_handler = [] { print_help(); }; @@ -732,8 +781,20 @@ static int main_inner(int argc, char *argv[]) return EXIT_FAILURE; } - unique_ptr compiler; + // Special case reflection because it has little to do with the path followed by code-outputting compilers + if (!args.reflect.empty()) + { + CompilerReflection compiler(read_spirv_file(args.input)); + compiler.set_format(args.reflect); + auto json = compiler.compile(); + if (args.output) + write_string_to_file(args.output, json.c_str()); + else + printf("%s", json.c_str()); + return EXIT_SUCCESS; + } + unique_ptr compiler; bool combined_image_samplers = false; bool build_dummy_sampler = false; @@ -748,10 +809,10 @@ static int main_inner(int argc, char *argv[]) compiler = unique_ptr(new CompilerMSL(read_spirv_file(args.input))); auto *msl_comp = static_cast(compiler.get()); - auto msl_opts = msl_comp->get_options(); + auto msl_opts = msl_comp->get_msl_options(); if (args.set_msl_version) msl_opts.msl_version = args.msl_version; - msl_comp->set_options(msl_opts); + msl_comp->set_msl_options(msl_opts); } else if (args.hlsl) compiler = unique_ptr(new CompilerHLSL(read_spirv_file(args.input))); @@ -851,14 +912,14 @@ static int main_inner(int argc, char *argv[]) if (!entry_point.empty()) compiler->set_entry_point(entry_point, model); - if (!args.set_version && !compiler->get_options().version) + if (!args.set_version && !compiler->get_common_options().version) { fprintf(stderr, "Didn't specify GLSL version and SPIR-V did not specify language.\n"); print_help(); return EXIT_FAILURE; } - CompilerGLSL::Options opts = compiler->get_options(); + CompilerGLSL::Options opts = compiler->get_common_options(); if (args.set_version) opts.version = args.version; if (args.set_es) @@ -870,13 +931,14 @@ static int main_inner(int argc, char *argv[]) opts.vulkan_semantics = args.vulkan_semantics; opts.vertex.fixup_clipspace = args.fixup; opts.vertex.flip_vert_y = args.yflip; - compiler->set_options(opts); + opts.vertex.support_nonzero_base_instance = args.support_nonzero_baseinstance; + compiler->set_common_options(opts); // Set HLSL specific options. if (args.hlsl) { auto *hlsl = static_cast(compiler.get()); - auto hlsl_opts = hlsl->get_options(); + auto hlsl_opts = hlsl->get_hlsl_options(); if (args.set_shader_model) { if (args.shader_model < 30) @@ -894,11 +956,19 @@ static int main_inner(int argc, char *argv[]) hlsl_opts.point_size_compat = true; hlsl_opts.point_coord_compat = true; } - hlsl->set_options(hlsl_opts); + hlsl->set_hlsl_options(hlsl_opts); } if (build_dummy_sampler) - compiler->build_dummy_sampler_for_combined_images(); + { + uint32_t sampler = compiler->build_dummy_sampler_for_combined_images(); + if (sampler != 0) + { + // Set some defaults to make validation happy. + compiler->set_decoration(sampler, DecorationDescriptorSet, 0); + compiler->set_decoration(sampler, DecorationBinding, 0); + } + } ShaderResources res; if (args.remove_unused) @@ -961,6 +1031,9 @@ static int main_inner(int argc, char *argv[]) if (combined_image_samplers) { compiler->build_combined_image_samplers(); + if (args.combined_samplers_inherit_bindings) + spirv_cross_util::inherit_combined_sampler_bindings(*compiler); + // Give the remapped combined samplers new names. for (auto &remap : compiler->get_combined_image_samplers()) { diff --git a/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj b/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj index 6040e2e116..d2287dcbe9 100644 --- a/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj +++ b/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj @@ -127,6 +127,7 @@ + @@ -138,6 +139,7 @@ + diff --git a/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj.filters b/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj.filters index f853c08b5b..3ff2c29a58 100644 --- a/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj.filters +++ b/deps/SPIRV-Cross/msvc/SPIRV-Cross.vcxproj.filters @@ -24,6 +24,9 @@ Source Files + + Source Files + Source Files @@ -50,6 +53,9 @@ Header Files + + Header Files + Header Files diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp new file mode 100644 index 0000000000..142ef5efa8 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/control-flow-hints.asm.comp @@ -0,0 +1,32 @@ +RWByteAddressBuffer bar : register(u0); +RWByteAddressBuffer foo : register(u1); + +void comp_main() +{ + [unroll] + for (int _135 = 0; _135 < 16; ) + { + bar.Store4(_135 * 16 + 0, asuint(asfloat(foo.Load4(_135 * 16 + 0)))); + _135++; + continue; + } + [loop] + for (int _136 = 0; _136 < 16; ) + { + bar.Store4((15 - _136) * 16 + 0, asuint(asfloat(foo.Load4(_136 * 16 + 0)))); + _136++; + continue; + } + [branch] + if (asfloat(bar.Load(160)) > 10.0f) + { + foo.Store4(320, asuint(5.0f.xxxx)); + } + foo.Store4(320, asuint(20.0f.xxxx)); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp similarity index 100% rename from deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp rename to deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag new file mode 100644 index 0000000000..3951fd511a --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag @@ -0,0 +1,30 @@ +Texture2D uTex : register(t1); +SamplerState uSampler : register(s0); + +static float4 FragColor; +static float2 vUV; + +struct SPIRV_Cross_Input +{ + float2 vUV : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = uTex.Sample(uSampler, vUV); + FragColor += uTex.Sample(uSampler, vUV, int2(1, 1)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vUV = stage_input.vUV; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..3b50282fe0 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/empty-struct.asm.frag @@ -0,0 +1,8 @@ +void frag_main() +{ +} + +void main() +{ + frag_main(); +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/function-overload-alias.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/function-overload-alias.asm.frag index 432915da36..93f8414e93 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/function-overload-alias.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/function-overload-alias.asm.frag @@ -7,7 +7,7 @@ struct SPIRV_Cross_Output void frag_main() { - FragColor = (((1.0f.xxxx + 1.0f.xxxx) + (1.0f.xxx.xyzz + 1.0f.xxxx)) + (1.0f.xxxx + 2.0f.xxxx)) + (1.0f.xx.xyxy + 2.0f.xxxx); + FragColor = 10.0f.xxxx; } SPIRV_Cross_Output main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..ed53720d94 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,31 @@ +Texture2D uTexture : register(t0); +SamplerState _uTexture_sampler : register(s0); + +static int2 Size; + +struct SPIRV_Cross_Output +{ + int2 Size : SV_Target0; +}; + +uint2 SPIRV_Cross_textureSize(Texture2D Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; +} + +void frag_main() +{ + uint _19_dummy_parameter; + uint _20_dummy_parameter; + Size = int2(SPIRV_Cross_textureSize(uTexture, uint(0), _19_dummy_parameter)) + int2(SPIRV_Cross_textureSize(uTexture, uint(1), _20_dummy_parameter)); +} + +SPIRV_Cross_Output main() +{ + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.Size = Size; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..67f14fccae --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,57 @@ +Texture2D uImage : register(t0); +SamplerState _uImage_sampler : register(s0); + +static float4 v0; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + float4 v0 : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + float phi; + float4 _36; + int _51; + _51 = 0; + phi = 1.0f; + _36 = float4(1.0f, 2.0f, 1.0f, 2.0f); + for (;;) + { + FragColor = _36; + if (_51 < 4) + { + if (v0[_51] > 0.0f) + { + float2 _48 = phi.xx; + _51++; + phi += 2.0f; + _36 = uImage.SampleLevel(_uImage_sampler, _48, 0.0f); + continue; + } + else + { + break; + } + } + else + { + break; + } + } +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v0 = stage_input.v0; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..5deae3a569 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,57 @@ +static const float _46[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f }; +static const float4 _76[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx }; +static const float4 _90[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx }; + +static float FragColor; +static int index; + +struct SPIRV_Cross_Input +{ + nointerpolation int index : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + float4 foobar[4] = _76; + float4 baz[4] = _76; + FragColor = _46[index]; + if (index < 10) + { + FragColor += _46[index ^ 1]; + } + else + { + FragColor += _46[index & 1]; + } + bool _99 = index > 30; + if (_99) + { + FragColor += _76[index & 3].y; + } + else + { + FragColor += _76[index & 1].x; + } + if (_99) + { + foobar[1].z = 20.0f; + } + int _37 = index & 3; + FragColor += foobar[_37].z; + baz = _90; + FragColor += baz[_37].z; +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + index = stage_input.index; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..db5e717457 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/srem.asm.frag @@ -0,0 +1,29 @@ +static float4 FragColor; +static int4 vA; +static int4 vB; + +struct SPIRV_Cross_Input +{ + nointerpolation int4 vA : TEXCOORD0; + nointerpolation int4 vB : TEXCOORD1; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = float4(vA - vB * (vA / vB)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vA = stage_input.vA; + vB = stage_input.vB; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..695d5fe9df --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,29 @@ +Texture2D uTexture : register(t0); +SamplerState _uTexture_sampler : register(s0); + +static float4 gl_FragCoord; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + float4 gl_FragCoord : SV_Position; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = uTexture.Load(int3(int2(gl_FragCoord.xy), 0)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + gl_FragCoord = stage_input.gl_FragCoord; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag new file mode 100644 index 0000000000..5b894de831 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag @@ -0,0 +1,31 @@ +Texture2D uShadow : register(t0); +SamplerComparisonState _uShadow_sampler : register(s0); +Texture2D uTexture : register(t1); +SamplerComparisonState uSampler : register(s2); + +static float3 vUV; +static float FragColor; + +struct SPIRV_Cross_Input +{ + float3 vUV : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = uShadow.SampleCmp(_uShadow_sampler, vUV.xy, vUV.z) + uTexture.SampleCmp(uSampler, vUV.xy, vUV.z); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vUV = stage_input.vUV; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unreachable.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unreachable.asm.frag index e7cb790205..ee3e467248 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unreachable.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/frag/unreachable.asm.frag @@ -11,25 +11,23 @@ struct SPIRV_Cross_Output float4 FragColor : SV_Target0; }; -float4 _21; - void frag_main() { - float4 _33; - do + bool _29; + for (;;) { - if (counter == 10) + _29 = counter == 10; + if (_29) { - _33 = 10.0f.xxxx; break; } else { - _33 = 30.0f.xxxx; break; } - } while (false); - FragColor = _33; + } + bool4 _35 = _29.xxxx; + FragColor = float4(_35.x ? 10.0f.xxxx.x : 30.0f.xxxx.x, _35.y ? 10.0f.xxxx.y : 30.0f.xxxx.y, _35.z ? 10.0f.xxxx.z : 30.0f.xxxx.z, _35.w ? 10.0f.xxxx.w : 30.0f.xxxx.w); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert deleted file mode 100644 index 103ff46a3f..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert +++ /dev/null @@ -1,8 +0,0 @@ -void vert_main() -{ -} - -void main() -{ - vert_main(); -} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert new file mode 100644 index 0000000000..c02f70c9ee --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert @@ -0,0 +1,37 @@ +static const int _7 = -10; +static const uint _8 = 100u; +static const int _20 = (_7 + 2); +static const uint _25 = (_8 % 5u); +static const int4 _30 = int4(20, 30, _20, _20); +static const int2 _32 = int2(_30.y, _30.x); +static const int _33 = _30.y; + +static float4 gl_Position; +static int _4; + +struct SPIRV_Cross_Output +{ + nointerpolation int _4 : TEXCOORD0; + float4 gl_Position : SV_Position; +}; + +void vert_main() +{ + float4 _64 = 0.0f.xxxx; + _64.y = float(_20); + float4 _68 = _64; + _68.z = float(_25); + float4 _52 = _68 + float4(_30); + float2 _56 = _52.xy + float2(_32); + gl_Position = float4(_56.x, _56.y, _52.z, _52.w); + _4 = _33; +} + +SPIRV_Cross_Output main() +{ + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output._4 = _4; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..0d1e8cc534 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -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(uint(gl_VertexIndex) + uint(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; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/builtins.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/builtins.comp index 990fc85337..7f88aa798f 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/builtins.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/builtins.comp @@ -1,3 +1,5 @@ +static const uint3 gl_WorkGroupSize = uint3(8u, 4u, 2u); + void comp_main() { } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/globallycoherent.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/globallycoherent.comp new file mode 100644 index 0000000000..1637727deb --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/globallycoherent.comp @@ -0,0 +1,16 @@ +globallycoherent RWByteAddressBuffer _29 : register(u3); +ByteAddressBuffer _33 : register(t2); +RWTexture2D uImageIn : register(u0); +globallycoherent RWTexture2D uImageOut : register(u1); + +void comp_main() +{ + uImageOut[int2(9, 7)] = uImageIn[int2(9, 7)].x; + _29.Store(0, asuint(asfloat(_33.Load(0)))); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/image.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/image.comp index a8fc137581..6c2b58cd29 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/image.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/image.comp @@ -34,24 +34,26 @@ struct SPIRV_Cross_Input 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; + int2 _23 = int2(gl_GlobalInvocationID.xy); + uImageOutF[_23] = uImageInF[_23].x; + uImageOutI[_23] = uImageInI[_23].x; + uImageOutU[_23] = uImageInU[_23].x; + int _74 = int(gl_GlobalInvocationID.x); + uImageOutBuffer[_74] = uImageInBuffer[_74].x; + uImageOutF2[_23] = uImageInF2[_23].xy; + uImageOutI2[_23] = uImageInI2[_23].xy; + uImageOutU2[_23] = uImageInU2[_23].xy; + float4 _135 = uImageInBuffer2[_74].xyyy; + uImageOutBuffer2[_74] = _135.xy; + uImageOutF4[_23] = uImageInF4[_23]; + int4 _165 = uImageInI4[_23]; + uImageOutI4[_23] = _165; + uint4 _180 = uImageInU4[_23]; + uImageOutU4[_23] = _180; + uImageOutBuffer4[_74] = uImageInBuffer4[_74]; + uImageNoFmtF[_23] = _135; + uImageNoFmtU[_23] = _180; + uImageNoFmtI[_23] = _165; } [numthreads(1, 1, 1)] diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rmw-matrix.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rmw-matrix.comp new file mode 100644 index 0000000000..ed66669358 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +RWByteAddressBuffer _11 : register(u0); + +void comp_main() +{ + _11.Store(0, asuint(asfloat(_11.Load(0)) * asfloat(_11.Load(96)))); + _11.Store4(16, asuint(asfloat(_11.Load4(16)) * asfloat(_11.Load4(112)))); + float4x4 _35 = asfloat(uint4x4(_11.Load4(128), _11.Load4(144), _11.Load4(160), _11.Load4(176))); + float4x4 _37 = asfloat(uint4x4(_11.Load4(32), _11.Load4(48), _11.Load4(64), _11.Load4(80))); + float4x4 _38 = mul(_35, _37); + _11.Store4(32, asuint(_38[0])); + _11.Store4(48, asuint(_38[1])); + _11.Store4(64, asuint(_38[2])); + _11.Store4(80, asuint(_38[3])); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/shared.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/shared.comp index 498241eaca..9831302afd 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/shared.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/shared.comp @@ -17,7 +17,7 @@ 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])); + _44.Store(gl_GlobalInvocationID.x * 4 + 0, asuint(sShared[3u - gl_LocalInvocationIndex])); } [numthreads(4, 1, 1)] diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp new file mode 100644 index 0000000000..dabc7df9e2 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp @@ -0,0 +1,67 @@ +RWByteAddressBuffer _9 : register(u0, space0); + +static uint4 gl_SubgroupEqMask; +static uint4 gl_SubgroupGeMask; +static uint4 gl_SubgroupGtMask; +static uint4 gl_SubgroupLeMask; +static uint4 gl_SubgroupLtMask; +void comp_main() +{ + _9.Store(0, asuint(float(WaveGetLaneCount()))); + _9.Store(0, asuint(float(WaveGetLaneIndex()))); + _9.Store(0, asuint(float4(gl_SubgroupEqMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupGeMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupGtMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupLeMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupLtMask).x)); + uint4 _75 = WaveActiveBallot(true); + float4 _88 = WaveActiveSum(20.0f.xxxx); + int4 _94 = WaveActiveSum(int4(20, 20, 20, 20)); + float4 _96 = WaveActiveProduct(20.0f.xxxx); + int4 _98 = WaveActiveProduct(int4(20, 20, 20, 20)); + float4 _127 = WavePrefixProduct(_96) * _96; + int4 _129 = WavePrefixProduct(_98) * _98; +} + +[numthreads(1, 1, 1)] +void main() +{ + gl_SubgroupEqMask = 1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96)); + if (WaveGetLaneIndex() >= 32) gl_SubgroupEqMask.x = 0; + if (WaveGetLaneIndex() >= 64 || WaveGetLaneIndex() < 32) gl_SubgroupEqMask.y = 0; + if (WaveGetLaneIndex() >= 96 || WaveGetLaneIndex() < 64) gl_SubgroupEqMask.z = 0; + if (WaveGetLaneIndex() < 96) gl_SubgroupEqMask.w = 0; + gl_SubgroupGeMask = ~((1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u); + if (WaveGetLaneIndex() >= 32) gl_SubgroupGeMask.x = 0u; + if (WaveGetLaneIndex() >= 64) gl_SubgroupGeMask.y = 0u; + if (WaveGetLaneIndex() >= 96) gl_SubgroupGeMask.z = 0u; + if (WaveGetLaneIndex() < 32) gl_SubgroupGeMask.y = ~0u; + if (WaveGetLaneIndex() < 64) gl_SubgroupGeMask.z = ~0u; + if (WaveGetLaneIndex() < 96) gl_SubgroupGeMask.w = ~0u; + uint gt_lane_index = WaveGetLaneIndex() + 1; + gl_SubgroupGtMask = ~((1u << (gt_lane_index - uint4(0, 32, 64, 96))) - 1u); + if (gt_lane_index >= 32) gl_SubgroupGtMask.x = 0u; + if (gt_lane_index >= 64) gl_SubgroupGtMask.y = 0u; + if (gt_lane_index >= 96) gl_SubgroupGtMask.z = 0u; + if (gt_lane_index >= 128) gl_SubgroupGtMask.w = 0u; + if (gt_lane_index < 32) gl_SubgroupGtMask.y = ~0u; + if (gt_lane_index < 64) gl_SubgroupGtMask.z = ~0u; + if (gt_lane_index < 96) gl_SubgroupGtMask.w = ~0u; + uint le_lane_index = WaveGetLaneIndex() + 1; + gl_SubgroupLeMask = (1u << (le_lane_index - uint4(0, 32, 64, 96))) - 1u; + if (le_lane_index >= 32) gl_SubgroupLeMask.x = ~0u; + if (le_lane_index >= 64) gl_SubgroupLeMask.y = ~0u; + if (le_lane_index >= 96) gl_SubgroupLeMask.z = ~0u; + if (le_lane_index >= 128) gl_SubgroupLeMask.w = ~0u; + if (le_lane_index < 32) gl_SubgroupLeMask.y = 0u; + if (le_lane_index < 64) gl_SubgroupLeMask.z = 0u; + if (le_lane_index < 96) gl_SubgroupLeMask.w = 0u; + gl_SubgroupLtMask = (1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u; + if (WaveGetLaneIndex() >= 32) gl_SubgroupLtMask.x = ~0u; + if (WaveGetLaneIndex() >= 64) gl_SubgroupLtMask.y = ~0u; + if (WaveGetLaneIndex() >= 96) gl_SubgroupLtMask.z = ~0u; + if (WaveGetLaneIndex() < 32) gl_SubgroupLtMask.y = 0u; + if (WaveGetLaneIndex() < 64) gl_SubgroupLtMask.z = 0u; + if (WaveGetLaneIndex() < 96) gl_SubgroupLtMask.w = 0u; + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..3adf7d9852 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,34 @@ +static const float _17[5] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f }; + +static float4 FragColor; +static float4 v0; + +struct SPIRV_Cross_Input +{ + float4 v0 : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + for (int _46 = 0; _46 < 4; ) + { + int _33 = _46 + 1; + FragColor += _17[_33].xxxx; + _46 = _33; + continue; + } +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v0 = stage_input.v0; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/constant-composites.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/constant-composites.frag index 0514eef1ee..2613e1c2c5 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/constant-composites.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/constant-composites.frag @@ -30,7 +30,7 @@ void frag_main() lut = _16; foos = _28; FragColor = lut[_line].xxxx; - FragColor += (foos[_line].a * (foos[1 - _line].a)).xxxx; + FragColor += (foos[_line].a * foos[1 - _line].a).xxxx; } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..b2899ea02c --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,54 @@ +Texture2D uSampler : register(t0); +SamplerState _uSampler_sampler : register(s0); + +static float4 FragColor; +static float4 vInput; + +struct SPIRV_Cross_Input +{ + float4 vInput : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = vInput; + float4 _23 = uSampler.Sample(_uSampler_sampler, vInput.xy); + float4 _26 = ddx(vInput); + float4 _29 = ddy(vInput); + float4 _32 = fwidth(vInput); + float4 _35 = ddx_coarse(vInput); + float4 _38 = ddy_coarse(vInput); + float4 _41 = fwidth(vInput); + float4 _44 = ddx_fine(vInput); + float4 _47 = ddy_fine(vInput); + float4 _50 = fwidth(vInput); + float _56_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vInput.zw); + if (vInput.y > 10.0f) + { + FragColor += _23; + FragColor += _26; + FragColor += _29; + FragColor += _32; + FragColor += _35; + FragColor += _38; + FragColor += _41; + FragColor += _44; + FragColor += _47; + FragColor += _50; + FragColor += float2(_56_tmp, _56_tmp).xyxy; + } +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vInput = stage_input.vInput; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16.desktop.frag new file mode 100644 index 0000000000..8ec30af16f --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/fp16.desktop.frag @@ -0,0 +1,45 @@ +static min16float4 v4; +static min16float3 v3; +static min16float v1; +static min16float2 v2; +static float o1; +static float2 o2; +static float3 o3; +static float4 o4; + +struct SPIRV_Cross_Input +{ + min16float v1 : TEXCOORD0; + min16float2 v2 : TEXCOORD1; + min16float3 v3 : TEXCOORD2; + min16float4 v4 : TEXCOORD3; +}; + +struct SPIRV_Cross_Output +{ + float o1 : SV_Target0; + float2 o2 : SV_Target1; + float3 o3 : SV_Target2; + float4 o4 : SV_Target3; +}; + +void frag_main() +{ + min16float4 _324; + min16float4 _387 = modf(v4, _324); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v4 = stage_input.v4; + v3 = stage_input.v3; + v1 = stage_input.v1; + v2 = stage_input.v2; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.o1 = o1; + stage_output.o2 = o2; + stage_output.o3 = o3; + stage_output.o4 = o4; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query-selective.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query-selective.frag index c73b742b5a..9194d0de1b 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query-selective.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query-selective.frag @@ -2,6 +2,30 @@ Texture1D uSampler1DUint : register(t0); SamplerState _uSampler1DUint_sampler : register(s0); Texture1D uSampler1DInt : register(t0); SamplerState _uSampler1DInt_sampler : register(s0); +Texture1D uSampler1DFloat : register(t0); +SamplerState _uSampler1DFloat_sampler : register(s0); +Texture2DArray uSampler2DArray : register(t2); +SamplerState _uSampler2DArray_sampler : register(s2); +Texture3D uSampler3D : register(t3); +SamplerState _uSampler3D_sampler : register(s3); +TextureCube uSamplerCube : register(t4); +SamplerState _uSamplerCube_sampler : register(s4); +TextureCubeArray uSamplerCubeArray : register(t5); +SamplerState _uSamplerCubeArray_sampler : register(s5); +Buffer uSamplerBuffer : register(t6); +Texture2DMS uSamplerMS : register(t7); +SamplerState _uSamplerMS_sampler : register(s7); +Texture2DMSArray uSamplerMSArray : register(t8); +SamplerState _uSamplerMSArray_sampler : register(s8); +Texture2D uSampler2D : register(t1); +SamplerState _uSampler2D_sampler : register(s1); + +uint SPIRV_Cross_textureSize(Texture1D Tex, uint Level, out uint Param) +{ + uint ret; + Tex.GetDimensions(Level, ret.x, Param); + return ret; +} uint SPIRV_Cross_textureSize(Texture1D Tex, uint Level, out uint Param) { @@ -17,10 +41,87 @@ uint SPIRV_Cross_textureSize(Texture1D Tex, uint Level, out uint Param) return ret; } +uint2 SPIRV_Cross_textureSize(Texture2D Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(Texture2DArray Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(Texture3D Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param); + return ret; +} + +uint SPIRV_Cross_textureSize(Buffer Tex, uint Level, out uint Param) +{ + uint ret; + Tex.GetDimensions(ret.x); + Param = 0u; + return ret; +} + +uint2 SPIRV_Cross_textureSize(TextureCube Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(TextureCubeArray Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param); + return ret; +} + +uint2 SPIRV_Cross_textureSize(Texture2DMS Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(ret.x, ret.y, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(Texture2DMSArray Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(ret.x, ret.y, ret.z, Param); + return ret; +} + void frag_main() { uint _17_dummy_parameter; uint _24_dummy_parameter; + uint _32_dummy_parameter; + uint _42_dummy_parameter; + uint _50_dummy_parameter; + uint _60_dummy_parameter; + uint _68_dummy_parameter; + uint _76_dummy_parameter; + uint _84_dummy_parameter; + uint _92_dummy_parameter; + int _100; + SPIRV_Cross_textureSize(uSampler2D, 0u, _100); + int _104; + SPIRV_Cross_textureSize(uSampler2DArray, 0u, _104); + int _108; + SPIRV_Cross_textureSize(uSampler3D, 0u, _108); + int _112; + SPIRV_Cross_textureSize(uSamplerCube, 0u, _112); + int _116; + SPIRV_Cross_textureSize(uSamplerMS, 0u, _116); + int _120; + SPIRV_Cross_textureSize(uSamplerMSArray, 0u, _120); } void main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query.frag index 3b50282fe0..20d8c1597c 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/image-query.frag @@ -1,5 +1,112 @@ +Texture1D uSampler1D : register(t0); +SamplerState _uSampler1D_sampler : register(s0); +Texture2D uSampler2D : register(t1); +SamplerState _uSampler2D_sampler : register(s1); +Texture2DArray uSampler2DArray : register(t2); +SamplerState _uSampler2DArray_sampler : register(s2); +Texture3D uSampler3D : register(t3); +SamplerState _uSampler3D_sampler : register(s3); +TextureCube uSamplerCube : register(t4); +SamplerState _uSamplerCube_sampler : register(s4); +TextureCubeArray uSamplerCubeArray : register(t5); +SamplerState _uSamplerCubeArray_sampler : register(s5); +Buffer uSamplerBuffer : register(t6); +Texture2DMS uSamplerMS : register(t7); +SamplerState _uSamplerMS_sampler : register(s7); +Texture2DMSArray uSamplerMSArray : register(t8); +SamplerState _uSamplerMSArray_sampler : register(s8); + +uint SPIRV_Cross_textureSize(Texture1D Tex, uint Level, out uint Param) +{ + uint ret; + Tex.GetDimensions(Level, ret.x, Param); + return ret; +} + +uint2 SPIRV_Cross_textureSize(Texture2D Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(Texture2DArray Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(Texture3D Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param); + return ret; +} + +uint SPIRV_Cross_textureSize(Buffer Tex, uint Level, out uint Param) +{ + uint ret; + Tex.GetDimensions(ret.x); + Param = 0u; + return ret; +} + +uint2 SPIRV_Cross_textureSize(TextureCube Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(TextureCubeArray Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(Level, ret.x, ret.y, ret.z, Param); + return ret; +} + +uint2 SPIRV_Cross_textureSize(Texture2DMS Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(ret.x, ret.y, Param); + return ret; +} + +uint3 SPIRV_Cross_textureSize(Texture2DMSArray Tex, uint Level, out uint Param) +{ + uint3 ret; + Tex.GetDimensions(ret.x, ret.y, ret.z, Param); + return ret; +} + void frag_main() { + uint _17_dummy_parameter; + uint _27_dummy_parameter; + uint _37_dummy_parameter; + uint _45_dummy_parameter; + uint _53_dummy_parameter; + uint _61_dummy_parameter; + uint _69_dummy_parameter; + uint _77_dummy_parameter; + uint _85_dummy_parameter; + int _89; + SPIRV_Cross_textureSize(uSampler1D, 0u, _89); + int _93; + SPIRV_Cross_textureSize(uSampler2D, 0u, _93); + int _97; + SPIRV_Cross_textureSize(uSampler2DArray, 0u, _97); + int _101; + SPIRV_Cross_textureSize(uSampler3D, 0u, _101); + int _105; + SPIRV_Cross_textureSize(uSamplerCube, 0u, _105); + int _109; + SPIRV_Cross_textureSize(uSamplerCubeArray, 0u, _109); + int _113; + SPIRV_Cross_textureSize(uSamplerMS, 0u, _113); + int _117; + SPIRV_Cross_textureSize(uSamplerMSArray, 0u, _117); } void main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/lut-promotion.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/lut-promotion.frag new file mode 100644 index 0000000000..aae0d39de2 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/lut-promotion.frag @@ -0,0 +1,57 @@ +static const float _16[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f }; +static const float4 _60[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx }; +static const float4 _104[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx }; + +static float FragColor; +static int index; + +struct SPIRV_Cross_Input +{ + nointerpolation int index : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = _16[index]; + if (index < 10) + { + FragColor += _16[index ^ 1]; + } + else + { + FragColor += _16[index & 1]; + } + bool _63 = index > 30; + if (_63) + { + FragColor += _60[index & 3].y; + } + else + { + FragColor += _60[index & 1].x; + } + float4 foobar[4] = _60; + if (_63) + { + foobar[1].z = 20.0f; + } + int _91 = index & 3; + FragColor += foobar[_91].z; + float4 baz[4] = _60; + baz = _104; + FragColor += baz[_91].z; +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + index = stage_input.index; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/partial-write-preserve.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/partial-write-preserve.frag index 20da99c336..3b50282fe0 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/partial-write-preserve.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/partial-write-preserve.frag @@ -1,9 +1,3 @@ -struct B -{ - float a; - float b; -}; - void frag_main() { } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/resources.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/resources.frag index 24b93c239c..c8558e2778 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/resources.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/resources.frag @@ -4,7 +4,7 @@ cbuffer cbuf : register(b3) }; cbuffer registers { - float4 registers_d : packoffset(c0); + float4 registers_a : packoffset(c0); }; Texture2D uSampledImage : register(t4); SamplerState _uSampledImage_sampler : register(s4); @@ -26,7 +26,7 @@ struct SPIRV_Cross_Output void frag_main() { - FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_d); + FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_a); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/row-major-layout-in-struct.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/row-major-layout-in-struct.frag new file mode 100644 index 0000000000..8576b0f9d3 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/row-major-layout-in-struct.frag @@ -0,0 +1,37 @@ +struct Foo +{ + row_major float4x4 v; + row_major float4x4 w; +}; + +cbuffer _17 : register(b0) +{ + Foo _17_foo : packoffset(c0); +}; + +static float4 FragColor; +static float4 vUV; + +struct SPIRV_Cross_Input +{ + float4 vUV : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = mul(mul(vUV, _17_foo.w), _17_foo.v); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vUV = stage_input.vUV; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag index 6f5ae7e38c..b6e91ce7b6 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sample-cmp-level-zero.frag @@ -41,9 +41,7 @@ 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)); + 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(_80.xyz), vDirRef.z, int2(1, 1)); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-array.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-array.frag index 5b8e492de6..1eced29be0 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-array.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-array.frag @@ -17,7 +17,8 @@ struct SPIRV_Cross_Input 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)); + int _72 = vIndex + 1; + uImage[vIndex][int2(gl_FragCoord.xy)] = ((uCombined[vIndex].Sample(_uCombined_sampler[vIndex], vTex) + uTex[vIndex].Sample(uSampler[vIndex], vTex)) + uCombined[_72].Sample(_uCombined_sampler[_72], vTex)) + uTex[_72].Sample(uSampler[_72], vTex); } void main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-image-arrays.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-image-arrays.frag new file mode 100644 index 0000000000..b6d0e9421c --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/sampler-image-arrays.frag @@ -0,0 +1,39 @@ +Texture2D uSampler[4] : register(t0); +SamplerState _uSampler_sampler[4] : register(s0); +Texture2D uTextures[4] : register(t8); +SamplerState uSamplers[4] : register(s4); + +static int vIndex; +static float2 vTex; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + nointerpolation float2 vTex : TEXCOORD0; + nointerpolation int vIndex : TEXCOORD1; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = 0.0f.xxxx; + FragColor += uTextures[2].Sample(uSamplers[1], vTex); + FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex); + FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex + 0.100000001490116119384765625f.xx); + FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex + 0.20000000298023223876953125f.xx); + FragColor += uSampler[3].Sample(_uSampler_sampler[3], vTex + 0.300000011920928955078125f.xx); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vIndex = stage_input.vIndex; + vTex = stage_input.vTex; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant-ternary.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant-ternary.frag new file mode 100644 index 0000000000..12e0f5bd79 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant-ternary.frag @@ -0,0 +1,23 @@ +static const uint s = 10u; +static const bool _13 = (s > 20u); +static const uint _16 = _13 ? 30u : 50u; + +static float FragColor; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = float(_16); +} + +SPIRV_Cross_Output main() +{ + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant.frag deleted file mode 100644 index 781e3f20b8..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/spec-constant.frag +++ /dev/null @@ -1,33 +0,0 @@ -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; -} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling-ms.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling-ms.frag new file mode 100644 index 0000000000..ca88cfaeb3 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling-ms.frag @@ -0,0 +1,33 @@ +Texture2DMS uTex : register(t0); +SamplerState _uTex_sampler : register(s0); + +static float4 gl_FragCoord; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + float4 gl_FragCoord : SV_Position; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + int2 _22 = int2(gl_FragCoord.xy); + FragColor = uTex.Load(_22, 0); + FragColor += uTex.Load(_22, 1); + FragColor += uTex.Load(_22, 2); + FragColor += uTex.Load(_22, 3); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + gl_FragCoord = stage_input.gl_FragCoord; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling.frag index 6ebca5d8d1..74e9c3ba4a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/tex-sampling.frag @@ -1,27 +1,27 @@ -Texture1D tex1d; -SamplerState _tex1d_sampler; -Texture2D tex2d; -SamplerState _tex2d_sampler; -Texture3D tex3d; -SamplerState _tex3d_sampler; -TextureCube texCube; -SamplerState _texCube_sampler; -Texture1D tex1dShadow; -SamplerComparisonState _tex1dShadow_sampler; -Texture2D tex2dShadow; -SamplerComparisonState _tex2dShadow_sampler; -TextureCube texCubeShadow; -SamplerComparisonState _texCubeShadow_sampler; -Texture1DArray tex1dArray; -SamplerState _tex1dArray_sampler; -Texture2DArray tex2dArray; -SamplerState _tex2dArray_sampler; -TextureCubeArray texCubeArray; -SamplerState _texCubeArray_sampler; -Texture2D separateTex2d; -SamplerState samplerNonDepth; -Texture2D separateTex2dDepth; -SamplerComparisonState samplerDepth; +Texture1D tex1d : register(t0); +SamplerState _tex1d_sampler : register(s0); +Texture2D tex2d : register(t1); +SamplerState _tex2d_sampler : register(s1); +Texture3D tex3d : register(t2); +SamplerState _tex3d_sampler : register(s2); +TextureCube texCube : register(t3); +SamplerState _texCube_sampler : register(s3); +Texture1D tex1dShadow : register(t4); +SamplerComparisonState _tex1dShadow_sampler : register(s4); +Texture2D tex2dShadow : register(t5); +SamplerComparisonState _tex2dShadow_sampler : register(s5); +TextureCube texCubeShadow : register(t6); +SamplerComparisonState _texCubeShadow_sampler : register(s6); +Texture1DArray tex1dArray : register(t7); +SamplerState _tex1dArray_sampler : register(s7); +Texture2DArray tex2dArray : register(t8); +SamplerState _tex2dArray_sampler : register(s8); +TextureCubeArray texCubeArray : register(t9); +SamplerState _texCubeArray_sampler : register(s9); +Texture2D separateTex2d : register(t12); +SamplerState samplerNonDepth : register(s11); +Texture2D separateTex2dDepth : register(t13); +SamplerComparisonState samplerDepth : register(s10); static float texCoord1d; static float2 texCoord2d; @@ -60,14 +60,8 @@ float3 SPIRV_Cross_projectTextureCoordinate(float4 coord) 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 _335 = _162; + _335.w = ((_162.w + tex1dShadow.SampleCmp(_tex1dShadow_sampler, float3(texCoord1d, 0.0f, 0.0f).x, 0.0f)) + tex2dShadow.SampleCmp(_tex2dShadow_sampler, float3(texCoord2d, 0.0f).xy, 0.0f)) + 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); diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unary-enclose.frag b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unary-enclose.frag index 76e98a66d0..348b91c172 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unary-enclose.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/frag/unary-enclose.frag @@ -15,7 +15,7 @@ struct SPIRV_Cross_Output void frag_main() { - FragColor = -(-vIn); + FragColor = vIn; } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/locations.vert b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/locations.vert index ba36c4ae39..b007582c2a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/locations.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/locations.vert @@ -5,6 +5,8 @@ struct Foo float3 c; }; +static const Foo _71 = { 1.0f.xxx, 1.0f.xxx, 1.0f.xxx }; + static float4 gl_Position; static float4 Input2; static float4 Input4; @@ -40,8 +42,6 @@ struct SPIRV_Cross_Output float4 gl_Position : SV_Position; }; -Foo _70; - void vert_main() { gl_Position = ((1.0f.xxxx + Input2) + Input4) + Input0; @@ -49,13 +49,7 @@ void vert_main() 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; + vLocation4 = _71; vLocation9 = 9.0f; vout.color = 2.0f.xxx; vout.foo = 4.0f.xxx; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..dde648e6d5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/read-from-row-major-array.vert @@ -0,0 +1,35 @@ +cbuffer _104 : register(b0) +{ + column_major float2x3 _104_var[3][4] : packoffset(c0); +}; + +static float4 gl_Position; +static float4 a_position; +static float v_vtxResult; + +struct SPIRV_Cross_Input +{ + float4 a_position : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float v_vtxResult : TEXCOORD0; + float4 gl_Position : SV_Position; +}; + +void vert_main() +{ + gl_Position = a_position; + v_vtxResult = ((float(abs(_104_var[0][0][0].x - 2.0f) < 0.0500000007450580596923828125f) * float(abs(_104_var[0][0][0].y - 6.0f) < 0.0500000007450580596923828125f)) * float(abs(_104_var[0][0][0].z - (-6.0f)) < 0.0500000007450580596923828125f)) * ((float(abs(_104_var[0][0][1].x) < 0.0500000007450580596923828125f) * float(abs(_104_var[0][0][1].y - 5.0f) < 0.0500000007450580596923828125f)) * float(abs(_104_var[0][0][1].z - 5.0f) < 0.0500000007450580596923828125f)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + a_position = stage_input.a_position; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.v_vtxResult = v_vtxResult; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/return-array.vert b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/return-array.vert index 902033b017..bd15755633 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/return-array.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-hlsl/vert/return-array.vert @@ -1,5 +1,3 @@ -static const float4 _20[2] = { 10.0f.xxxx, 20.0f.xxxx }; - static float4 gl_Position; static float4 vInput0; static float4 vInput1; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sar.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sar.asm.comp index 20d6fe9e9d..4176830588 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sar.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sar.asm.comp @@ -17,13 +17,15 @@ struct _4 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); + int4 _22 = _5._m0; + uint4 _23 = _5._m1; + _6._m0 = uint4(int4(_23) >> _22); + _6._m0 = uint4(_22 >> int4(_23)); + _6._m0 = uint4(int4(_23) >> int4(_23)); + _6._m0 = uint4(_22 >> _22); + _6._m1 = int4(_23) >> int4(_23); + _6._m1 = _22 >> _22; + _6._m1 = int4(_23) >> _22; + _6._m1 = _22 >> int4(_23); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sdiv.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sdiv.asm.comp index f18b318bbb..6b80dff310 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sdiv.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_sdiv.asm.comp @@ -17,13 +17,15 @@ struct _4 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); + int4 _22 = _5._m0; + uint4 _23 = _5._m1; + _6._m0 = uint4(int4(_23) / _22); + _6._m0 = uint4(_22 / int4(_23)); + _6._m0 = uint4(int4(_23) / int4(_23)); + _6._m0 = uint4(_22 / _22); + _6._m1 = int4(_23) / int4(_23); + _6._m1 = _22 / _22; + _6._m1 = int4(_23) / _22; + _6._m1 = _22 / int4(_23); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_slr.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_slr.asm.comp index 9fd60bef26..1dfca39181 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_slr.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/bitcast_slr.asm.comp @@ -17,13 +17,15 @@ struct _4 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); + int4 _22 = _5._m0; + uint4 _23 = _5._m1; + _6._m0 = _23 >> uint4(_22); + _6._m0 = uint4(_22) >> _23; + _6._m0 = _23 >> _23; + _6._m0 = uint4(_22) >> uint4(_22); + _6._m1 = int4(_23 >> _23); + _6._m1 = int4(uint4(_22) >> uint4(_22)); + _6._m1 = int4(_23 >> uint4(_22)); + _6._m1 = int4(uint4(_22) >> _23); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/storage-buffer-basic.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp similarity index 100% rename from deps/SPIRV-Cross/reference/shaders-msl/asm/comp/storage-buffer-basic.asm.comp rename to deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp index 9e37362dbd..2c9b038b20 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/storage-buffer-basic.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp @@ -16,7 +16,7 @@ struct _6 kernel void main0(device _6& _8 [[buffer(0)]], device _6& _9 [[buffer(1)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]]) { - uint3 _23 = gl_WorkGroupSize; _8._m0[gl_WorkGroupID.x] = _9._m0[gl_WorkGroupID.x] + _8._m0[gl_WorkGroupID.x]; + uint3 _23 = gl_WorkGroupSize; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag new file mode 100644 index 0000000000..e420153bf1 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vUV [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uTex [[texture(1)]], sampler uSampler [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = uTex.sample(uSampler, in.vUV); + out.FragColor += uTex.sample(uSampler, in.vUV, int2(1)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/default-member-names.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/default-member-names.asm.frag index 1c730c7bbc..e9573a019a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/default-member-names.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/default-member-names.asm.frag @@ -3,29 +3,7 @@ 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 = {}; +constant float _57 = {}; struct main0_out { @@ -35,7 +13,7 @@ struct main0_out fragment main0_out main0() { main0_out out = {}; - out.m_3 = float4(_51._m0, _51._m1, _51._m2, _51._m3); + out.m_3 = float4(_57); return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/empty-struct.asm.frag similarity index 77% rename from deps/SPIRV-Cross/reference/shaders-msl/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/empty-struct.asm.frag index 9e024c2095..92ac1d9f83 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/empty-struct-composite.asm.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/empty-struct.asm.frag @@ -3,7 +3,7 @@ using namespace metal; -vertex void main0() +fragment void main0() { } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/frem.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/frem.asm.frag index f7c1f2ce88..ebc73d52df 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/frem.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/frem.asm.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 vB [[user(locn1)]]; - float4 vA [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vA [[user(locn0)]]; + float4 vB [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/function-overload-alias.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/function-overload-alias.asm.frag index 624a3e4807..64edee8722 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/function-overload-alias.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/function-overload-alias.asm.frag @@ -11,7 +11,7 @@ struct main0_out fragment main0_out main0() { main0_out out = {}; - out.FragColor = (((float4(1.0) + float4(1.0)) + (float3(1.0).xyzz + float4(1.0))) + (float4(1.0) + float4(2.0))) + (float2(1.0).xyxy + float4(2.0)); + out.FragColor = float4(10.0); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..0d691b306d --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + int2 Size [[color(0)]]; +}; + +fragment main0_out main0(texture2d uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.Size = int2(uTexture.get_width(), uTexture.get_height()) + int2(uTexture.get_width(1), uTexture.get_height(1)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..dd977a99da --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,50 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float4 v0 [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uImage [[texture(0)]], sampler uImageSmplr [[sampler(0)]]) +{ + main0_out out = {}; + float phi; + float4 _36; + int _51; + _51 = 0; + phi = 1.0; + _36 = float4(1.0, 2.0, 1.0, 2.0); + for (;;) + { + out.FragColor = _36; + if (_51 < 4) + { + if (in.v0[_51] > 0.0) + { + float2 _48 = float2(phi); + _51++; + phi += 2.0; + _36 = uImage.sample(uImageSmplr, _48, level(0.0)); + continue; + } + else + { + break; + } + } + else + { + break; + } + } + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..9db6b5470d --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,69 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +constant float _46[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0}; +constant float4 _76[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; +constant float4 _90[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)}; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + int index [[user(locn0)]]; +}; + +// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. +template +void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +// An overload for constant arrays. +template +void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + main0_out out = {}; + out.FragColor = _46[in.index]; + if (in.index < 10) + { + out.FragColor += _46[in.index ^ 1]; + } + else + { + out.FragColor += _46[in.index & 1]; + } + bool _99 = in.index > 30; + if (_99) + { + out.FragColor += _76[in.index & 3].y; + } + else + { + out.FragColor += _76[in.index & 1].x; + } + if (_99) + { + foobar[1].z = 20.0; + } + int _37 = in.index & 3; + out.FragColor += foobar[_37].z; + spvArrayCopyConstant(baz, _90); + out.FragColor += baz[_37].z; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/op-constant-null.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/op-constant-null.asm.frag index 9472add395..e1badb517a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/op-constant-null.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/op-constant-null.asm.frag @@ -3,12 +3,6 @@ using namespace metal; -struct D -{ - float4 a; - float b; -}; - struct main0_out { float FragColor [[color(0)]]; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/phi-loop-variable.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/phi-loop-variable.asm.frag index 036774d661..92ac1d9f83 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/phi-loop-variable.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/phi-loop-variable.asm.frag @@ -5,8 +5,5 @@ using namespace metal; fragment void main0() { - for (int _22 = 35; _22 >= 0; _22--) - { - } } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/in_block_assign.noopt.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/srem.asm.frag similarity index 61% rename from deps/SPIRV-Cross/reference/shaders-msl/frag/in_block_assign.noopt.frag rename to deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/srem.asm.frag index d06863d99c..f0cdd574de 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/in_block_assign.noopt.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/srem.asm.frag @@ -3,28 +3,21 @@ using namespace metal; -struct VOUT -{ - float4 a; -}; - -struct main0_in -{ - float4 VOUT_a [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int4 vA [[user(locn0)]]; + int4 vB [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; - VOUT tmp; - tmp.a = in.VOUT_a; - tmp.a += float4(1.0); - out.FragColor = tmp.a; + out.FragColor = float4(in.vA - in.vB * (in.vA / in.vB)); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..dd308c32ad --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(texture2d uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]], float4 gl_FragCoord [[position]]) +{ + main0_out out = {}; + out.FragColor = uTexture.read(uint2(int2(gl_FragCoord.xy)), 0); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/undef-variable-store.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/undef-variable-store.asm.frag index fb39c46fbb..a5380c51dc 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/undef-variable-store.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/undef-variable-store.asm.frag @@ -3,9 +3,6 @@ using namespace metal; -constant float4 _38 = {}; -constant float4 _50 = {}; - struct main0_out { float4 _entryPointOutput [[color(0)]]; @@ -14,25 +11,7 @@ struct main0_out fragment main0_out main0() { main0_out out = {}; - float4 _51; - _51 = _50; - float4 _52; - for (;;) - { - if (0.0 != 0.0) - { - _52 = float4(1.0, 0.0, 0.0, 1.0); - break; - } - else - { - _52 = float4(1.0, 1.0, 0.0, 1.0); - break; - } - _52 = _38; - break; - } - out._entryPointOutput = _52; + out._entryPointOutput = float4(1.0, 1.0, 0.0, 1.0); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unknown-depth-state.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unknown-depth-state.asm.frag new file mode 100644 index 0000000000..e8a88623a2 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unknown-depth-state.asm.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vUV [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uShadow [[texture(0)]], depth2d uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(2)]]) +{ + main0_out out = {}; + out.FragColor = uShadow.sample_compare(uShadowSmplr, in.vUV.xy, in.vUV.z) + uTexture.sample_compare(uSampler, in.vUV.xy, in.vUV.z); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unreachable.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unreachable.asm.frag index 3e80051e6b..9a9baef57a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unreachable.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/unreachable.asm.frag @@ -3,36 +3,34 @@ using namespace metal; -constant float4 _21 = {}; - -struct main0_in -{ - int counter [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int counter [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; - float4 _33; - do + bool _29; + for (;;) { - if (in.counter == 10) + _29 = in.counter == 10; + if (_29) { - _33 = float4(10.0); break; } else { - _33 = float4(30.0); break; } - } while (false); - out.FragColor = _33; + } + bool4 _35 = bool4(_29); + out.FragColor = float4(_35.x ? float4(10.0).x : float4(30.0).x, _35.y ? float4(10.0).y : float4(30.0).y, _35.z ? float4(10.0).z : float4(30.0).z, _35.w ? float4(10.0).w : float4(30.0).w); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag index 97daea5d90..676fd82365 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag @@ -95,212 +95,212 @@ struct main0_out float4 m_5 [[color(0)]]; }; -fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buffer(1)]], constant _18& _19 [[buffer(2)]], texture2d _8 [[texture(0)]], texture2d _12 [[texture(1)]], texture2d _14 [[texture(2)]], sampler _9 [[sampler(0)]], sampler _13 [[sampler(1)]], sampler _15 [[sampler(2)]], float4 gl_FragCoord [[position]]) +fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _18& _19 [[buffer(1)]], constant _10& _11 [[buffer(2)]], texture2d _14 [[texture(4)]], texture2d _12 [[texture(13)]], texture2d _8 [[texture(14)]], sampler _15 [[sampler(3)]], sampler _13 [[sampler(5)]], sampler _9 [[sampler(6)]], float4 gl_FragCoord [[position]]) { main0_out out = {}; - _28 _77 = _74; - _77._m0 = float4(0.0); float2 _82 = gl_FragCoord.xy * _19._m23.xy; float4 _88 = _7._m2 * _7._m0.xyxy; - float2 _97 = clamp(_82 + (float3(0.0, -2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _109 = _11._m5 * clamp(_8.sample(_9, _97, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _95 = _88.xy; + float2 _96 = _88.zw; + float2 _97 = clamp(_82 + (float2(0.0, -2.0) * _7._m0.xy), _95, _96); + float3 _109 = float3(_11._m5) * clamp(_8.sample(_9, _97, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _113 = _12.sample(_13, _97, level(0.0)); + float _114 = _113.y; float3 _129; - if (_113.y > 0.0) + if (_114 > 0.0) { - _129 = _109 + (_14.sample(_15, _97, level(0.0)).xyz * clamp(_113.y * _113.z, 0.0, 1.0)); + _129 = _109 + (_14.sample(_15, _97, level(0.0)).xyz * clamp(_114 * _113.z, 0.0, 1.0)); } else { _129 = _109; } - float3 _133 = float4(0.0).xyz + (_129 * 0.5); - float4 _134 = float4(_133.x, _133.y, _133.z, float4(0.0).w); - _28 _135 = _77; - _135._m0 = _134; - float2 _144 = clamp(_82 + (float3(-1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _156 = _11._m5 * clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _130 = _129 * 0.5; + float4 _134 = float4(_130.x, _130.y, _130.z, float4(0.0).w); + float2 _144 = clamp(_82 + (float2(-1.0) * _7._m0.xy), _95, _96); + float3 _156 = float3(_11._m5) * clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _160 = _12.sample(_13, _144, level(0.0)); + float _161 = _160.y; float3 _176; - if (_160.y > 0.0) + if (_161 > 0.0) { - _176 = _156 + (_14.sample(_15, _144, level(0.0)).xyz * clamp(_160.y * _160.z, 0.0, 1.0)); + _176 = _156 + (_14.sample(_15, _144, level(0.0)).xyz * clamp(_161 * _160.z, 0.0, 1.0)); } else { _176 = _156; } - float3 _180 = _134.xyz + (_176 * 0.5); + float3 _177 = _176 * 0.5; + float3 _180 = _134.xyz + _177; float4 _181 = float4(_180.x, _180.y, _180.z, _134.w); - _28 _182 = _135; - _182._m0 = _181; - float2 _191 = clamp(_82 + (float3(0.0, -1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _203 = _11._m5 * clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _191 = clamp(_82 + (float2(0.0, -1.0) * _7._m0.xy), _95, _96); + float3 _203 = float3(_11._m5) * clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _207 = _12.sample(_13, _191, level(0.0)); + float _208 = _207.y; float3 _223; - if (_207.y > 0.0) + if (_208 > 0.0) { - _223 = _203 + (_14.sample(_15, _191, level(0.0)).xyz * clamp(_207.y * _207.z, 0.0, 1.0)); + _223 = _203 + (_14.sample(_15, _191, level(0.0)).xyz * clamp(_208 * _207.z, 0.0, 1.0)); } else { _223 = _203; } - float3 _227 = _181.xyz + (_223 * 0.75); + float3 _224 = _223 * 0.75; + float3 _227 = _181.xyz + _224; float4 _228 = float4(_227.x, _227.y, _227.z, _181.w); - _28 _229 = _182; - _229._m0 = _228; - float2 _238 = clamp(_82 + (float3(1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _250 = _11._m5 * clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _238 = clamp(_82 + (float2(1.0, -1.0) * _7._m0.xy), _95, _96); + float3 _250 = float3(_11._m5) * clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _254 = _12.sample(_13, _238, level(0.0)); + float _255 = _254.y; float3 _270; - if (_254.y > 0.0) + if (_255 > 0.0) { - _270 = _250 + (_14.sample(_15, _238, level(0.0)).xyz * clamp(_254.y * _254.z, 0.0, 1.0)); + _270 = _250 + (_14.sample(_15, _238, level(0.0)).xyz * clamp(_255 * _254.z, 0.0, 1.0)); } else { _270 = _250; } - float3 _274 = _228.xyz + (_270 * 0.5); + float3 _271 = _270 * 0.5; + float3 _274 = _228.xyz + _271; float4 _275 = float4(_274.x, _274.y, _274.z, _228.w); - _28 _276 = _229; - _276._m0 = _275; - float2 _285 = clamp(_82 + (float3(-2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _297 = _11._m5 * clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _285 = clamp(_82 + (float2(-2.0, 0.0) * _7._m0.xy), _95, _96); + float3 _297 = float3(_11._m5) * clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _301 = _12.sample(_13, _285, level(0.0)); + float _302 = _301.y; float3 _317; - if (_301.y > 0.0) + if (_302 > 0.0) { - _317 = _297 + (_14.sample(_15, _285, level(0.0)).xyz * clamp(_301.y * _301.z, 0.0, 1.0)); + _317 = _297 + (_14.sample(_15, _285, level(0.0)).xyz * clamp(_302 * _301.z, 0.0, 1.0)); } else { _317 = _297; } - float3 _321 = _275.xyz + (_317 * 0.5); + float3 _318 = _317 * 0.5; + float3 _321 = _275.xyz + _318; float4 _322 = float4(_321.x, _321.y, _321.z, _275.w); - _28 _323 = _276; - _323._m0 = _322; - float2 _332 = clamp(_82 + (float3(-1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _344 = _11._m5 * clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _332 = clamp(_82 + (float2(-1.0, 0.0) * _7._m0.xy), _95, _96); + float3 _344 = float3(_11._m5) * clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _348 = _12.sample(_13, _332, level(0.0)); + float _349 = _348.y; float3 _364; - if (_348.y > 0.0) + if (_349 > 0.0) { - _364 = _344 + (_14.sample(_15, _332, level(0.0)).xyz * clamp(_348.y * _348.z, 0.0, 1.0)); + _364 = _344 + (_14.sample(_15, _332, level(0.0)).xyz * clamp(_349 * _348.z, 0.0, 1.0)); } else { _364 = _344; } - float3 _368 = _322.xyz + (_364 * 0.75); + float3 _365 = _364 * 0.75; + float3 _368 = _322.xyz + _365; float4 _369 = float4(_368.x, _368.y, _368.z, _322.w); - _28 _370 = _323; - _370._m0 = _369; - float2 _379 = clamp(_82 + (float3(0.0, 0.0, 1.0).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _391 = _11._m5 * clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _379 = clamp(_82, _95, _96); + float3 _391 = float3(_11._m5) * clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _395 = _12.sample(_13, _379, level(0.0)); + float _396 = _395.y; float3 _411; - if (_395.y > 0.0) + if (_396 > 0.0) { - _411 = _391 + (_14.sample(_15, _379, level(0.0)).xyz * clamp(_395.y * _395.z, 0.0, 1.0)); + _411 = _391 + (_14.sample(_15, _379, level(0.0)).xyz * clamp(_396 * _395.z, 0.0, 1.0)); } else { _411 = _391; } - float3 _415 = _369.xyz + (_411 * 1.0); + float3 _412 = _411 * 1.0; + float3 _415 = _369.xyz + _412; float4 _416 = float4(_415.x, _415.y, _415.z, _369.w); - _28 _417 = _370; - _417._m0 = _416; - float2 _426 = clamp(_82 + (float3(1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _438 = _11._m5 * clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _426 = clamp(_82 + (float2(1.0, 0.0) * _7._m0.xy), _95, _96); + float3 _438 = float3(_11._m5) * clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _442 = _12.sample(_13, _426, level(0.0)); + float _443 = _442.y; float3 _458; - if (_442.y > 0.0) + if (_443 > 0.0) { - _458 = _438 + (_14.sample(_15, _426, level(0.0)).xyz * clamp(_442.y * _442.z, 0.0, 1.0)); + _458 = _438 + (_14.sample(_15, _426, level(0.0)).xyz * clamp(_443 * _442.z, 0.0, 1.0)); } else { _458 = _438; } - float3 _462 = _416.xyz + (_458 * 0.75); + float3 _459 = _458 * 0.75; + float3 _462 = _416.xyz + _459; float4 _463 = float4(_462.x, _462.y, _462.z, _416.w); - _28 _464 = _417; - _464._m0 = _463; - float2 _473 = clamp(_82 + (float3(2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _485 = _11._m5 * clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _473 = clamp(_82 + (float2(2.0, 0.0) * _7._m0.xy), _95, _96); + float3 _485 = float3(_11._m5) * clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _489 = _12.sample(_13, _473, level(0.0)); + float _490 = _489.y; float3 _505; - if (_489.y > 0.0) + if (_490 > 0.0) { - _505 = _485 + (_14.sample(_15, _473, level(0.0)).xyz * clamp(_489.y * _489.z, 0.0, 1.0)); + _505 = _485 + (_14.sample(_15, _473, level(0.0)).xyz * clamp(_490 * _489.z, 0.0, 1.0)); } else { _505 = _485; } - float3 _509 = _463.xyz + (_505 * 0.5); + float3 _506 = _505 * 0.5; + float3 _509 = _463.xyz + _506; float4 _510 = float4(_509.x, _509.y, _509.z, _463.w); - _28 _511 = _464; - _511._m0 = _510; - float2 _520 = clamp(_82 + (float3(-1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _532 = _11._m5 * clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _520 = clamp(_82 + (float2(-1.0, 1.0) * _7._m0.xy), _95, _96); + float3 _532 = float3(_11._m5) * clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _536 = _12.sample(_13, _520, level(0.0)); + float _537 = _536.y; float3 _552; - if (_536.y > 0.0) + if (_537 > 0.0) { - _552 = _532 + (_14.sample(_15, _520, level(0.0)).xyz * clamp(_536.y * _536.z, 0.0, 1.0)); + _552 = _532 + (_14.sample(_15, _520, level(0.0)).xyz * clamp(_537 * _536.z, 0.0, 1.0)); } else { _552 = _532; } - float3 _556 = _510.xyz + (_552 * 0.5); + float3 _553 = _552 * 0.5; + float3 _556 = _510.xyz + _553; float4 _557 = float4(_556.x, _556.y, _556.z, _510.w); - _28 _558 = _511; - _558._m0 = _557; - float2 _567 = clamp(_82 + (float3(0.0, 1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _579 = _11._m5 * clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _567 = clamp(_82 + (float2(0.0, 1.0) * _7._m0.xy), _95, _96); + float3 _579 = float3(_11._m5) * clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _583 = _12.sample(_13, _567, level(0.0)); + float _584 = _583.y; float3 _599; - if (_583.y > 0.0) + if (_584 > 0.0) { - _599 = _579 + (_14.sample(_15, _567, level(0.0)).xyz * clamp(_583.y * _583.z, 0.0, 1.0)); + _599 = _579 + (_14.sample(_15, _567, level(0.0)).xyz * clamp(_584 * _583.z, 0.0, 1.0)); } else { _599 = _579; } - float3 _603 = _557.xyz + (_599 * 0.75); + float3 _600 = _599 * 0.75; + float3 _603 = _557.xyz + _600; float4 _604 = float4(_603.x, _603.y, _603.z, _557.w); - _28 _605 = _558; - _605._m0 = _604; - float2 _614 = clamp(_82 + (float3(1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _626 = _11._m5 * clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _614 = clamp(_82 + _7._m0.xy, _95, _96); + float3 _626 = float3(_11._m5) * clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _630 = _12.sample(_13, _614, level(0.0)); + float _631 = _630.y; float3 _646; - if (_630.y > 0.0) + if (_631 > 0.0) { - _646 = _626 + (_14.sample(_15, _614, level(0.0)).xyz * clamp(_630.y * _630.z, 0.0, 1.0)); + _646 = _626 + (_14.sample(_15, _614, level(0.0)).xyz * clamp(_631 * _630.z, 0.0, 1.0)); } else { _646 = _626; } - float3 _650 = _604.xyz + (_646 * 0.5); + float3 _647 = _646 * 0.5; + float3 _650 = _604.xyz + _647; float4 _651 = float4(_650.x, _650.y, _650.z, _604.w); - _28 _652 = _605; - _652._m0 = _651; - float2 _661 = clamp(_82 + (float3(0.0, 2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _673 = _11._m5 * clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0); + float2 _661 = clamp(_82 + (float2(0.0, 2.0) * _7._m0.xy), _95, _96); + float3 _673 = float3(_11._m5) * clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _677 = _12.sample(_13, _661, level(0.0)); + float _678 = _677.y; float3 _693; - if (_677.y > 0.0) + if (_678 > 0.0) { - _693 = _673 + (_14.sample(_15, _661, level(0.0)).xyz * clamp(_677.y * _677.z, 0.0, 1.0)); + _693 = _673 + (_14.sample(_15, _661, level(0.0)).xyz * clamp(_678 * _677.z, 0.0, 1.0)); } else { @@ -308,10 +308,8 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff } float3 _697 = _651.xyz + (_693 * 0.5); float4 _698 = float4(_697.x, _697.y, _697.z, _651.w); - _28 _699 = _652; - _699._m0 = _698; - float3 _702 = _698.xyz / float3(((((((((((((0.0 + 0.5) + 0.5) + 0.75) + 0.5) + 0.5) + 0.75) + 1.0) + 0.75) + 0.5) + 0.5) + 0.75) + 0.5) + 0.5); - _28 _704 = _699; + float3 _702 = _698.xyz * float3(0.125); + _28 _704 = _74; _704._m0 = float4(_702.x, _702.y, _702.z, _698.w); _28 _705 = _704; _705._m0.w = 1.0; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/packing-test.asm.vert similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/packing-test.asm.vert diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert new file mode 100644 index 0000000000..a67634fbd8 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert @@ -0,0 +1,35 @@ +#include +#include + +using namespace metal; + +constant int _7_tmp [[function_constant(201)]]; +constant int _7 = is_function_constant_defined(_7_tmp) ? _7_tmp : -10; +constant uint _8_tmp [[function_constant(202)]]; +constant uint _8 = is_function_constant_defined(_8_tmp) ? _8_tmp : 100u; +constant int _20 = (_7 + 2); +constant uint _25 = (_8 % 5u); +constant int4 _30 = int4(20, 30, _20, _20); +constant int2 _32 = int2(_30.y, _30.x); +constant int _33 = _30.y; + +struct main0_out +{ + int m_4 [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + float4 _64 = float4(0.0); + _64.y = float(_20); + float4 _68 = _64; + _68.z = float(_25); + float4 _52 = _68 + float4(_30); + float2 _56 = _52.xy + float2(_32); + out.gl_Position = float4(_56.x, _56.y, _52.z, _52.w); + out.m_4 = _33; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..d453aadef0 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +vertex main0_out main0(uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]]) +{ + main0_out out = {}; + out.gl_Position = float4(float(gl_VertexIndex + gl_InstanceIndex)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/access-private-workgroup-in-function.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/access-private-workgroup-in-function.comp new file mode 100644 index 0000000000..44405126d3 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/access-private-workgroup-in-function.comp @@ -0,0 +1,18 @@ +#include +#include + +using namespace metal; + +kernel void main0(uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) +{ + threadgroup int u; + u = 50; + if (gl_LocalInvocationIndex == 0u) + { + } + else + { + u = 20; + } +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/atomic.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/atomic.comp index 90a39ec643..f77922aca0 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/atomic.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/atomic.comp @@ -12,25 +12,59 @@ struct SSBO int i32; }; -kernel void main0(device SSBO& ssbo [[buffer(0)]]) +kernel void main0(device SSBO& ssbo [[buffer(2)]]) { - uint _16 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _18 = atomic_fetch_or_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _20 = atomic_fetch_xor_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _22 = atomic_fetch_and_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _24 = atomic_fetch_min_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _26 = atomic_fetch_max_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _28 = atomic_exchange_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _30 = 10u; - uint _32 = atomic_compare_exchange_weak_explicit((volatile device atomic_uint*)&(ssbo.u32), &(_30), 2u, memory_order_relaxed, memory_order_relaxed); - int _36 = atomic_fetch_add_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _38 = atomic_fetch_or_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _40 = atomic_fetch_xor_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _42 = atomic_fetch_and_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _44 = atomic_fetch_min_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _46 = atomic_fetch_max_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _48 = atomic_exchange_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _50 = 10; - int _52 = atomic_compare_exchange_weak_explicit((volatile device atomic_int*)&(ssbo.i32), &(_50), 2, memory_order_relaxed, memory_order_relaxed); + threadgroup uint shared_u32; + threadgroup int shared_i32; + uint _16 = atomic_fetch_add_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _18 = atomic_fetch_or_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _20 = atomic_fetch_xor_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _22 = atomic_fetch_and_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _24 = atomic_fetch_min_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _26 = atomic_fetch_max_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _28 = atomic_exchange_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _32; + do + { + _32 = 10u; + } while (!atomic_compare_exchange_weak_explicit((volatile device atomic_uint*)&ssbo.u32, &_32, 2u, memory_order_relaxed, memory_order_relaxed)); + int _36 = atomic_fetch_add_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _38 = atomic_fetch_or_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _40 = atomic_fetch_xor_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _42 = atomic_fetch_and_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _44 = atomic_fetch_min_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _46 = atomic_fetch_max_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _48 = atomic_exchange_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _52; + do + { + _52 = 10; + } while (!atomic_compare_exchange_weak_explicit((volatile device atomic_int*)&ssbo.i32, &_52, 2, memory_order_relaxed, memory_order_relaxed)); + shared_u32 = 10u; + shared_i32 = 10; + uint _57 = atomic_fetch_add_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _58 = atomic_fetch_or_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _59 = atomic_fetch_xor_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _60 = atomic_fetch_and_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _61 = atomic_fetch_min_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _62 = atomic_fetch_max_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _63 = atomic_exchange_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _64; + do + { + _64 = 10u; + } while (!atomic_compare_exchange_weak_explicit((volatile threadgroup atomic_uint*)&shared_u32, &_64, 2u, memory_order_relaxed, memory_order_relaxed)); + int _65 = atomic_fetch_add_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _66 = atomic_fetch_or_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _67 = atomic_fetch_xor_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _68 = atomic_fetch_and_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _69 = atomic_fetch_min_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _70 = atomic_fetch_max_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _71 = atomic_exchange_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _72; + do + { + _72 = 10; + } while (!atomic_compare_exchange_weak_explicit((volatile threadgroup atomic_int*)&shared_i32, &_72, 2, memory_order_relaxed, memory_order_relaxed)); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/bake_gradient.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/bake_gradient.comp deleted file mode 100644 index fe7ac2b7d4..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/bake_gradient.comp +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include - -using namespace metal; - -constant uint3 gl_WorkGroupSize = uint3(8u, 8u, 1u); - -struct UBO -{ - float4 uInvSize; - float4 uScale; -}; - -kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], constant UBO& _46 [[buffer(0)]], texture2d uHeight [[texture(0)]], sampler uHeightSmplr [[sampler(0)]], texture2d uDisplacement [[texture(1)]], sampler uDisplacementSmplr [[sampler(1)]], texture2d iHeightDisplacement [[texture(2)]], texture2d iGradJacobian [[texture(3)]]) -{ - float4 _59 = (float2(gl_GlobalInvocationID.xy) * _46.uInvSize.xy).xyxy + (_46.uInvSize * 0.5); - float2 _157 = ((uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(1, 0)).xy - uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(-1, 0)).xy) * 0.60000002384185791015625) * _46.uScale.z; - float2 _161 = ((uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(0, 1)).xy - uDisplacement.sample(uDisplacementSmplr, _59.zw, level(0.0), int2(0, -1)).xy) * 0.60000002384185791015625) * _46.uScale.z; - iHeightDisplacement.write(float4(uHeight.sample(uHeightSmplr, _59.xy, level(0.0)).x, 0.0, 0.0, 0.0), uint2(int2(gl_GlobalInvocationID.xy))); - iGradJacobian.write(float4((_46.uScale.xy * 0.5) * float2(uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(1, 0)).x - uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(-1, 0)).x, uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(0, 1)).x - uHeight.sample(uHeightSmplr, _59.xy, level(0.0), int2(0, -1)).x), ((1.0 + _157.x) * (1.0 + _161.y)) - (_157.y * _161.x), 0.0), uint2(int2(gl_GlobalInvocationID.xy))); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/basic.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/basic.comp index c41f7c0acf..22ec741965 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/basic.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/basic.comp @@ -21,12 +21,12 @@ struct SSBO3 uint counter; }; -kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buffer(1)]], device SSBO3& _48 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buffer(1)]], device SSBO3& _48 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { float4 _29 = _23.in_data[gl_GlobalInvocationID.x]; if (dot(_29, float4(1.0, 5.0, 6.0, 2.0)) > 8.19999980926513671875) { - uint _52 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(_48.counter), 1u, memory_order_relaxed); + uint _52 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_48.counter, 1u, memory_order_relaxed); _45.out_data[_52] = _29; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/builtins.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/builtins.comp index 8278220225..189bb1b751 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/builtins.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/builtins.comp @@ -3,6 +3,8 @@ using namespace metal; +constant uint3 gl_WorkGroupSize = uint3(8u, 4u, 2u); + kernel void main0(uint3 gl_LocalInvocationID [[thread_position_in_threadgroup]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]], uint3 gl_NumWorkGroups [[threadgroups_per_grid]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]]) { } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-block.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-block.comp index bec9b218c7..963574acd6 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-block.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-block.comp @@ -8,7 +8,7 @@ struct SSBO float4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]]) +kernel void main0(device SSBO& _10 [[buffer(1)]]) { _10.value = float4(20.0); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-image.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-image.comp index 0fe044fb9a..827a247125 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-image.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/coherent-image.comp @@ -8,7 +8,7 @@ struct SSBO int4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d uImage [[texture(0)]]) +kernel void main0(device SSBO& _10 [[buffer(1)]], texture2d uImage [[texture(3)]]) { _10.value = uImage.read(uint2(int2(10))); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/composite-construct.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/composite-construct.comp new file mode 100644 index 0000000000..2d9fdccaa7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/composite-construct.comp @@ -0,0 +1,35 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct SSBO0 +{ + float4 as[1]; +}; + +// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. +template +void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +// An overload for constant arrays. +template +void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO0& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) +{ + float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.as[gl_GlobalInvocationID.x] }; + float4 values[2]; + spvArrayCopy(values, _37); + _16.as[0] = values[gl_LocalInvocationIndex]; + _32.as[1] = float4(40.0); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/culling.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/culling.comp index b20480bb45..9eac8c9ffb 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/culling.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/culling.comp @@ -23,12 +23,12 @@ struct SSBO3 uint count; }; -kernel void main0(device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { float _28 = _22.in_data[gl_GlobalInvocationID.x]; if (_28 > 12.0) { - uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(_41.count), 1u, memory_order_relaxed); + uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_41.count, 1u, memory_order_relaxed); _38.out_data[_45] = _28; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/defer-parens.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/defer-parens.comp index b9a742a13c..69a8aab92d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/defer-parens.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/defer-parens.comp @@ -12,10 +12,11 @@ struct SSBO kernel void main0(device SSBO& _13 [[buffer(0)]]) { float4 _17 = _13.data; - _13.data = float4(_17.x, _17.yz + float2(10.0), _17.w); + float2 _28 = _17.yz + float2(10.0); + _13.data = float4(_17.x, _28, _17.w); _13.data = (_17 + _17) + _17; - _13.data = (_17.yz + float2(10.0)).xxyy; - _13.data = float4((_17.yz + float2(10.0)).y); + _13.data = _28.xxyy; + _13.data = float4(_28.y); _13.data = float4((_17.zw + float2(10.0))[_13.index]); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/dowhile.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/dowhile.comp index d76ca819c4..5047a4854b 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/dowhile.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/dowhile.comp @@ -14,7 +14,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { int i = 0; float4 _56; @@ -27,7 +27,6 @@ kernel void main0(device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)] if (i < 16) { _56 = _42; - continue; } else { diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image-cube-array-load-store.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image-cube-array-load-store.comp new file mode 100644 index 0000000000..1eeaf87cf4 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image-cube-array-load-store.comp @@ -0,0 +1,10 @@ +#include +#include + +using namespace metal; + +kernel void main0(texturecube_array uImageIn [[texture(0)]], texturecube_array uImageOut [[texture(1)]]) +{ + uImageOut.write(uImageIn.read(uint2(int3(9, 7, 11).xy), uint(int3(9, 7, 11).z) % 6u, uint(int3(9, 7, 11).z) / 6u), uint2(int3(9, 7, 11).xy), uint(int3(9, 7, 11).z) % 6u, uint(int3(9, 7, 11).z) / 6u); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image.comp index d615fb2736..447732dd23 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/image.comp @@ -5,6 +5,7 @@ using namespace metal; kernel void main0(texture2d uImageIn [[texture(0)]], texture2d uImageOut [[texture(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uImageOut.write(uImageIn.read(uint2((int2(gl_GlobalInvocationID.xy) + int2(uImageIn.get_width(), uImageIn.get_height())))), uint2(int2(gl_GlobalInvocationID.xy))); + int2 _23 = int2(gl_GlobalInvocationID.xy); + uImageOut.write(uImageIn.read(uint2((_23 + int2(uImageIn.get_width(), uImageIn.get_height())))), uint2(_23)); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/inverse.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/inverse.comp index 567dba2c21..f2f499b91e 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/inverse.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/inverse.comp @@ -114,7 +114,7 @@ float2x2 spvInverse2x2(float2x2 m) return (det != 0.0f) ? (adj * (1.0f / det)) : m; } -kernel void main0(device MatrixOut& _15 [[buffer(0)]], device MatrixIn& _20 [[buffer(1)]]) +kernel void main0(device MatrixOut& _15 [[buffer(0)]], const device MatrixIn& _20 [[buffer(1)]]) { _15.m2out = spvInverse2x2(_20.m2in); _15.m3out = spvInverse3x3(_20.m3in); diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mat3.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mat3.comp index 72f08dd85e..adf7e9496b 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mat3.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mat3.comp @@ -8,7 +8,7 @@ struct SSBO2 float3x3 out_data[1]; }; -kernel void main0(device SSBO2& _22 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(device SSBO2& _22 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { _22.out_data[gl_GlobalInvocationID.x] = float3x3(float3(10.0), float3(20.0), float3(40.0)); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mod.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mod.comp index 86bde9c27d..8574f87b7e 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mod.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/mod.comp @@ -22,7 +22,7 @@ Tx mod(Tx x, Ty y) return x - y * floor(x / y); } -kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { _33.out_data[gl_GlobalInvocationID.x] = mod(_23.in_data[gl_GlobalInvocationID.x], _33.out_data[gl_GlobalInvocationID.x]); _33.out_data[gl_GlobalInvocationID.x] = as_type(as_type(_23.in_data[gl_GlobalInvocationID.x]) % as_type(_33.out_data[gl_GlobalInvocationID.x])); diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/modf.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/modf.comp index 40cbb40cea..39e402337f 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/modf.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/modf.comp @@ -13,7 +13,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _35 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _35 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { float4 i; float4 _31 = modf(_23.in_data[gl_GlobalInvocationID.x], i); diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-1.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-1.comp new file mode 100644 index 0000000000..44d2b2d74c --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-1.comp @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +constant uint3 gl_WorkGroupSize = uint3(32u, 1u, 1u); + +struct T1 +{ + packed_float3 a; + float b; +}; + +struct Buffer0 +{ + T1 buf0[1]; +}; + +struct Buffer1 +{ + float buf1[1]; +}; + +kernel void main0(device Buffer0& _15 [[buffer(1)]], device Buffer1& _34 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +{ + _34.buf1[gl_GlobalInvocationID.x] = _15.buf0[0].b; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-2.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-2.comp new file mode 100644 index 0000000000..4cc9c673ae --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/packing-test-2.comp @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +constant uint3 gl_WorkGroupSize = uint3(32u, 1u, 1u); + +struct T1 +{ + packed_float3 a; + float b; +}; + +struct Buffer0 +{ + T1 buf0[1]; +}; + +struct Buffer1 +{ + float buf1[1]; +}; + +kernel void main0(device Buffer0& _14 [[buffer(1)]], device Buffer1& _24 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +{ + _24.buf1[gl_GlobalInvocationID.x] = _14.buf0[0].b; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/read-write-only.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/read-write-only.comp index ba53b334ba..42c625092a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/read-write-only.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/read-write-only.comp @@ -21,7 +21,7 @@ struct SSBO1 float4 data3; }; -kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO0& _15 [[buffer(1)]], device SSBO1& _21 [[buffer(2)]]) +kernel void main0(const device SSBO0& _15 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], device SSBO2& _10 [[buffer(2)]]) { _10.data4 = _15.data0 + _21.data2; _10.data5 = _15.data1 + _21.data3; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/return.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/return.comp deleted file mode 100644 index 06ce8d7662..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/return.comp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -using namespace metal; - -struct SSBO2 -{ - float4 out_data[1]; -}; - -constant int _69 = {}; - -kernel void main0(device SSBO2& _27 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) -{ - if (gl_GlobalInvocationID.x == 2u) - { - _27.out_data[gl_GlobalInvocationID.x] = float4(20.0); - } - else - { - if (gl_GlobalInvocationID.x == 4u) - { - _27.out_data[gl_GlobalInvocationID.x] = float4(10.0); - return; - } - } - for (int _68 = 0; _68 < 20; _68 = _69 + 1) - { - return; - } - _27.out_data[gl_GlobalInvocationID.x] = float4(10.0); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-matrix.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-matrix.comp new file mode 100644 index 0000000000..150db7ede9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-matrix.comp @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct SSBO +{ + float a; + float4 b; + float4x4 c; + float a1; + float4 b1; + float4x4 c1; +}; + +kernel void main0(device SSBO& _11 [[buffer(0)]]) +{ + _11.a *= _11.a1; + _11.b *= _11.b1; + _11.c = _11.c * _11.c1; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-opt.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-opt.comp index 4bbd8b3c71..05e1f6f283 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-opt.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/rmw-opt.comp @@ -20,7 +20,6 @@ kernel void main0(device SSBO& _9 [[buffer(0)]]) _9.a ^= 10; _9.a %= 40; _9.a |= 1; - bool _65 = false && true; - _9.a = int(_65 && (true || _65)); + _9.a = 0; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared-array-of-arrays.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared-array-of-arrays.comp index db1ffebf2b..3884c22f5a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared-array-of-arrays.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared-array-of-arrays.comp @@ -15,6 +15,6 @@ kernel void main0(device SSBO& _67 [[buffer(0)]], uint3 gl_LocalInvocationID [[t threadgroup float foo[4][4]; foo[gl_LocalInvocationID.x][gl_LocalInvocationID.y] = float(gl_LocalInvocationIndex); threadgroup_barrier(mem_flags::mem_threadgroup); - _67.out_data[gl_GlobalInvocationID.x] = (((0.0 + foo[gl_LocalInvocationID.x][0]) + foo[gl_LocalInvocationID.x][1]) + foo[gl_LocalInvocationID.x][2]) + foo[gl_LocalInvocationID.x][3]; + _67.out_data[gl_GlobalInvocationID.x] = ((foo[gl_LocalInvocationID.x][0] + foo[gl_LocalInvocationID.x][1]) + foo[gl_LocalInvocationID.x][2]) + foo[gl_LocalInvocationID.x][3]; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared.comp index ef82961e2b..e58638b5cb 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/shared.comp @@ -15,11 +15,11 @@ struct SSBO2 float out_data[1]; }; -kernel void main0(device SSBO& _22 [[buffer(0)]], device SSBO2& _44 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) +kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _44 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) { threadgroup float sShared[4]; sShared[gl_LocalInvocationIndex] = _22.in_data[gl_GlobalInvocationID.x]; threadgroup_barrier(mem_flags::mem_threadgroup); - _44.out_data[gl_GlobalInvocationID.x] = sShared[(4u - gl_LocalInvocationIndex) - 1u]; + _44.out_data[gl_GlobalInvocationID.x] = sShared[3u - gl_LocalInvocationIndex]; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-layout.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-layout.comp index aa11cc966a..e7bb53ece6 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-layout.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-layout.comp @@ -18,7 +18,7 @@ struct SSBO Foo in_data[1]; }; -kernel void main0(device SSBO2& _23 [[buffer(0)]], device SSBO& _30 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _30 [[buffer(0)]], device SSBO2& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { _23.out_data[gl_GlobalInvocationID.x].m = _30.in_data[gl_GlobalInvocationID.x].m * _30.in_data[gl_GlobalInvocationID.x].m; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-nested.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-nested.comp index 0741b011c7..9abc498f4e 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-nested.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-nested.comp @@ -18,12 +18,8 @@ struct dstbuffer s2 test[1]; }; -constant s2 _31 = {}; - -kernel void main0(device dstbuffer& _19 [[buffer(0)]]) +kernel void main0(device dstbuffer& _19 [[buffer(1)]]) { - s2 _30 = _31; - _30.b.a = 0; - _19.test[0].b.a = _30.b.a; + _19.test[0].b.a = 0; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-packing.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-packing.comp index f59cba5b7d..a042f7aa28 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-packing.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/struct-packing.comp @@ -67,39 +67,60 @@ struct SSBO1 float array[1]; }; +struct S0_1 +{ + float2 a[1]; + float b; +}; + +struct Content_1 +{ + S0_1 m0s[1]; + S1 m1s[1]; + S2 m2s[1]; + S0_1 m0; + S1 m1; + S2 m2; + S3 m3; + char pad7[4]; + float m4; + S4 m3s[8]; +}; + struct SSBO0 { - Content content; - Content content1[2]; - Content content2; + Content_1 content; + Content_1 content1[2]; + Content_1 content2; float array[1]; }; -kernel void main0(device SSBO1& ssbo_430 [[buffer(0)]], device SSBO0& ssbo_140 [[buffer(1)]]) +kernel void main0(device SSBO0& ssbo_140 [[buffer(0)]], device SSBO1& ssbo_430 [[buffer(1)]]) { - ssbo_430.content.m0s[0].a[0] = ssbo_140.content.m0s[0].a[0]; - ssbo_430.content.m0s[0].b = ssbo_140.content.m0s[0].b; - ssbo_430.content.m1s[0].a = ssbo_140.content.m1s[0].a; - ssbo_430.content.m1s[0].b = ssbo_140.content.m1s[0].b; - ssbo_430.content.m2s[0].a[0] = ssbo_140.content.m2s[0].a[0]; - ssbo_430.content.m2s[0].b = ssbo_140.content.m2s[0].b; - ssbo_430.content.m0.a[0] = ssbo_140.content.m0.a[0]; - ssbo_430.content.m0.b = ssbo_140.content.m0.b; - ssbo_430.content.m1.a = ssbo_140.content.m1.a; - ssbo_430.content.m1.b = ssbo_140.content.m1.b; - ssbo_430.content.m2.a[0] = ssbo_140.content.m2.a[0]; - ssbo_430.content.m2.b = ssbo_140.content.m2.b; - ssbo_430.content.m3.a = ssbo_140.content.m3.a; - ssbo_430.content.m3.b = ssbo_140.content.m3.b; - ssbo_430.content.m4 = ssbo_140.content.m4; - ssbo_430.content.m3s[0].c = ssbo_140.content.m3s[0].c; - ssbo_430.content.m3s[1].c = ssbo_140.content.m3s[1].c; - ssbo_430.content.m3s[2].c = ssbo_140.content.m3s[2].c; - ssbo_430.content.m3s[3].c = ssbo_140.content.m3s[3].c; - ssbo_430.content.m3s[4].c = ssbo_140.content.m3s[4].c; - ssbo_430.content.m3s[5].c = ssbo_140.content.m3s[5].c; - ssbo_430.content.m3s[6].c = ssbo_140.content.m3s[6].c; - ssbo_430.content.m3s[7].c = ssbo_140.content.m3s[7].c; + Content_1 _60 = ssbo_140.content; + ssbo_430.content.m0s[0].a[0] = _60.m0s[0].a[0]; + ssbo_430.content.m0s[0].b = _60.m0s[0].b; + ssbo_430.content.m1s[0].a = _60.m1s[0].a; + ssbo_430.content.m1s[0].b = _60.m1s[0].b; + ssbo_430.content.m2s[0].a[0] = _60.m2s[0].a[0]; + ssbo_430.content.m2s[0].b = _60.m2s[0].b; + ssbo_430.content.m0.a[0] = _60.m0.a[0]; + ssbo_430.content.m0.b = _60.m0.b; + ssbo_430.content.m1.a = _60.m1.a; + ssbo_430.content.m1.b = _60.m1.b; + ssbo_430.content.m2.a[0] = _60.m2.a[0]; + ssbo_430.content.m2.b = _60.m2.b; + ssbo_430.content.m3.a = _60.m3.a; + ssbo_430.content.m3.b = _60.m3.b; + ssbo_430.content.m4 = _60.m4; + ssbo_430.content.m3s[0].c = _60.m3s[0].c; + ssbo_430.content.m3s[1].c = _60.m3s[1].c; + ssbo_430.content.m3s[2].c = _60.m3s[2].c; + ssbo_430.content.m3s[3].c = _60.m3s[3].c; + ssbo_430.content.m3s[4].c = _60.m3s[4].c; + ssbo_430.content.m3s[5].c = _60.m3s[5].c; + ssbo_430.content.m3s[6].c = _60.m3s[6].c; + ssbo_430.content.m3s[7].c = _60.m3s[7].c; ssbo_430.content.m1.a = ssbo_430.content.m3.a * ssbo_430.m6[1][1]; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/torture-loop.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/torture-loop.comp index 1b239550e1..4c367d3e6d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/torture-loop.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/torture-loop.comp @@ -14,66 +14,29 @@ struct SSBO2 float4 out_data[1]; }; -constant uint _98 = {}; - -kernel void main0(device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - float4 _93; - int _94; - _93 = _24.in_data[gl_GlobalInvocationID.x]; - _94 = 0; - int _40; - float4 _46; - int _48; - for (;;) + float4 _99; + _99 = _24.in_data[gl_GlobalInvocationID.x]; + for (int _93 = 0; (_93 + 1) < 10; ) { - _40 = _94 + 1; - if (_40 < 10) + _99 *= 2.0; + _93 += 2; + continue; + } + float4 _98; + _98 = _99; + float4 _103; + for (uint _94 = 0u; _94 < 16u; _98 = _103, _94++) + { + _103 = _98; + for (uint _100 = 0u; _100 < 30u; ) { - _46 = _93 * 2.0; - _48 = _40 + 1; - _93 = _46; - _94 = _48; + _103 = _24.mvp * _103; + _100++; continue; } - else - { - break; - } } - float4 _95; - int _96; - _95 = _93; - _96 = _40; - float4 _100; - uint _101; - uint _99; - for (uint _97 = 0u; _97 < 16u; _95 = _100, _96++, _97++, _99 = _101) - { - _100 = _95; - _101 = 0u; - float4 _71; - for (; _101 < 30u; _100 = _71, _101++) - { - _71 = _24.mvp * _100; - } - } - int _102; - _102 = _96; - int _83; - for (;;) - { - _83 = _102 + 1; - if (_83 > 10) - { - _102 = _83; - continue; - } - else - { - break; - } - } - _89.out_data[gl_GlobalInvocationID.x] = _95; + _89.out_data[gl_GlobalInvocationID.x] = _98; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/type-alias.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/type-alias.comp index 02e23e733e..9a2550a13d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/type-alias.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/type-alias.comp @@ -8,28 +8,18 @@ struct S0 float4 a; }; -struct S1 -{ - float4 a; -}; - struct SSBO0 { S0 s0s[1]; }; -struct SSBO1 -{ - S1 s1s[1]; -}; - struct SSBO2 { float4 outputs[1]; }; -kernel void main0(device SSBO0& _36 [[buffer(0)]], device SSBO1& _55 [[buffer(1)]], device SSBO2& _66 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(device SSBO0& _36 [[buffer(0)]], device SSBO0& _55 [[buffer(1)]], device SSBO2& _66 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - _66.outputs[gl_GlobalInvocationID.x] = _36.s0s[gl_GlobalInvocationID.x].a + _55.s1s[gl_GlobalInvocationID.x].a; + _66.outputs[gl_GlobalInvocationID.x] = _36.s0s[gl_GlobalInvocationID.x].a + _55.s0s[gl_GlobalInvocationID.x].a; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/udiv.comp b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/udiv.comp index 32874ad787..99ce26412d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/udiv.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/udiv.comp @@ -8,13 +8,8 @@ struct SSBO2 uint outputs[1]; }; -struct SSBO +kernel void main0(device SSBO2& _23 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { - uint inputs[1]; -}; - -kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) -{ - _10.outputs[gl_GlobalInvocationID.x] = _23.inputs[gl_GlobalInvocationID.x] / 29u; + _10.outputs[gl_GlobalInvocationID.x] = _23.outputs[gl_GlobalInvocationID.x] / 29u; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/frag/image-ms.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/frag/image-ms.desktop.frag index 4083e4ea16..3b461f0fef 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/frag/image-ms.desktop.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/frag/image-ms.desktop.frag @@ -3,7 +3,7 @@ using namespace metal; -fragment void main0(texture2d_ms uImageMS [[texture(0)]], texture2d_array uImageArray [[texture(1)]], texture2d uImage [[texture(2)]]) +fragment void main0(texture2d uImage [[texture(0)]], texture2d_array uImageArray [[texture(1)]], texture2d_ms uImageMS [[texture(2)]]) { uImage.write(uImageMS.read(uint2(int2(1, 2)), 2), uint2(int2(2, 3))); uImageArray.write(uImageArray.read(uint2(int3(1, 2, 4).xy), uint(int3(1, 2, 4).z)), uint2(int3(2, 3, 7).xy), uint(int3(2, 3, 7).z)); diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/vert/basic.desktop.sso.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/vert/basic.desktop.sso.vert index 1592b5c5cf..ffb4357126 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/vert/basic.desktop.sso.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/desktop-only/vert/basic.desktop.sso.vert @@ -8,18 +8,18 @@ struct UBO float4x4 uMVP; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/basic.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/basic.flatten.vert index 1592b5c5cf..ffb4357126 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/basic.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/basic.flatten.vert @@ -8,18 +8,18 @@ struct UBO float4x4 uMVP; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/multiindex.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/multiindex.flatten.vert index 84c4b408b2..f4549abab2 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/multiindex.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/multiindex.flatten.vert @@ -8,16 +8,16 @@ struct UBO float4 Data[3][5]; }; -struct main0_in -{ - int2 aIndex [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + int2 aIndex [[attribute(0)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _20 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/push-constant.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/push-constant.flatten.vert index 83def9c0bb..8f2e8c173f 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/push-constant.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/push-constant.flatten.vert @@ -10,18 +10,18 @@ struct PushMe float Arr[4]; }; -struct main0_in -{ - float4 Pos [[attribute(1)]]; - float2 Rot [[attribute(0)]]; -}; - struct main0_out { float2 vRot [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float2 Rot [[attribute(0)]]; + float4 Pos [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant PushMe& registers [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/rowmajor.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/rowmajor.flatten.vert index 3e0fcdbb75..387fe0a835 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/rowmajor.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/rowmajor.flatten.vert @@ -10,16 +10,16 @@ struct UBO float2x4 uMVP; }; -struct main0_in -{ - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/struct.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/struct.flatten.vert index 594d29fe57..10b64d9906 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/struct.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/struct.flatten.vert @@ -16,24 +16,24 @@ struct UBO Light light; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 vColor [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = _18.uMVP * in.aVertex; out.vColor = float4(0.0); - float3 _39 = in.aVertex.xyz - _18.light.Position; + float3 _39 = in.aVertex.xyz - float3(_18.light.Position); out.vColor += ((_18.light.Color * clamp(1.0 - (length(_39) / _18.light.Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(_39))); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/swizzle.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/swizzle.flatten.vert index 53fc21f99e..52940411bc 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/swizzle.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/swizzle.flatten.vert @@ -39,7 +39,7 @@ vertex main0_out main0(constant UBO& _22 [[buffer(0)]]) out.oA = _22.A; out.oB = float4(_22.B0, _22.B1); out.oC = float4(_22.C0, _22.C1) + float4(_22.C1.xy, _22.C1.z, _22.C0); - out.oD = float4(_22.D0, _22.D1) + float4(float3(_22.D0).xy, float3(_22.D0).z, _22.D1); + out.oD = float4(_22.D0[0], _22.D0[1], _22.D0[2], _22.D1) + float4(_22.D0[0], _22.D0[1], _22.D0[2u], _22.D1); out.oE = float4(_22.E0, _22.E1, _22.E2, _22.E3); out.oF = float4(_22.F0, _22.F1, _22.F2); return out; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/types.flatten.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/types.flatten.frag index cee53d9e58..540c5baeb1 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/types.flatten.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/flatten/types.flatten.frag @@ -26,7 +26,7 @@ struct main0_out float4 FragColor [[color(0)]]; }; -fragment main0_out main0(constant UBO1& _14 [[buffer(0)]], constant UBO2& _29 [[buffer(1)]], constant UBO0& _41 [[buffer(2)]]) +fragment main0_out main0(constant UBO0& _41 [[buffer(0)]], constant UBO1& _14 [[buffer(1)]], constant UBO2& _29 [[buffer(2)]]) { main0_out out = {}; out.FragColor = ((((float4(_14.c) + float4(_14.d)) + float4(_29.e)) + float4(_29.f)) + _41.a) + _41.b; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..60868acd87 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,25 @@ +#include +#include + +using namespace metal; + +constant float _17[5] = {1.0, 2.0, 3.0, 4.0, 5.0}; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + for (int _46 = 0; _46 < 4; ) + { + int _33 = _46 + 1; + out.FragColor += float4(_17[_33]); + _46 = _33; + continue; + } + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/basic.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/basic.frag index 4d33ee7bca..f33db61eba 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/basic.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/basic.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float2 vTex [[user(locn1)]]; - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; + float2 vTex [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/binary-func-unpack-pack-arguments.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/binary-func-unpack-pack-arguments.frag new file mode 100644 index 0000000000..134cfe1847 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/binary-func-unpack-pack-arguments.frag @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + packed_float3 color; + float v; +}; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vIn [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], constant UBO& _15 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = dot(in.vIn, float3(_15.color)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/binary-unpack-pack-arguments.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/binary-unpack-pack-arguments.frag new file mode 100644 index 0000000000..8bd538bec6 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/binary-unpack-pack-arguments.frag @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + packed_float3 color; + float v; +}; + +struct main0_out +{ + float3 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vIn [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], constant UBO& _15 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = cross(in.vIn, float3(_15.color) - in.vIn); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/bitcasting.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/bitcasting.frag index 659d320e9f..ae6d45e013 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/bitcasting.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/bitcasting.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 VertGeom [[user(locn0)]]; -}; - struct main0_out { float4 FragColor0 [[color(0)]]; float4 FragColor1 [[color(1)]]; }; +struct main0_in +{ + float4 VertGeom [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d TextureBase [[texture(0)]], texture2d TextureDetail [[texture(1)]], sampler TextureBaseSmplr [[sampler(0)]], sampler TextureDetailSmplr [[sampler(1)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/builtins.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/builtins.frag index 9283d1a66b..f9085252b3 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/builtins.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/builtins.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; float gl_FragDepth [[depth(any)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], float4 gl_FragCoord [[position]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/composite-extract-forced-temporary.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/composite-extract-forced-temporary.frag index 5539c2508f..6948e4d098 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/composite-extract-forced-temporary.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/composite-extract-forced-temporary.frag @@ -3,16 +3,16 @@ using namespace metal; -struct main0_in -{ - float2 vTexCoord [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d Texture [[texture(0)]], sampler TextureSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-array.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-array.frag index 9cdd52276b..bb55934c6d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-array.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-array.frag @@ -17,16 +17,16 @@ constant float4 _54[2] = {float4(8.0), float4(10.0)}; constant float4 _55[2][2] = {{float4(1.0), float4(2.0)}, {float4(8.0), float4(10.0)}}; constant Foobar _75[2] = {{10.0, 40.0}, {90.0, 70.0}}; -struct main0_in -{ - int index [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int index [[user(locn0)]]; +}; + // Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. template void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) @@ -44,10 +44,8 @@ void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; - float4 indexable[3] = {float4(1.0), float4(2.0), float4(3.0)}; - float4 indexable_1[2][2] = {{float4(1.0), float4(2.0)}, {float4(8.0), float4(10.0)}}; - Foobar indexable_2[2] = {{10.0, 40.0}, {90.0, 70.0}}; - out.FragColor = ((indexable[in.index] + (indexable_1[in.index][in.index + 1])) + float4(10.0 + 20.0)) + float4(indexable_2[in.index].a + indexable_2[in.index].b); + Foobar indexable[2] = {{10.0, 40.0}, {90.0, 70.0}}; + out.FragColor = ((_37[in.index] + _55[in.index][in.index + 1]) + float4(30.0)) + float4(indexable[in.index].a + indexable[in.index].b); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-composites.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-composites.frag index d216da6d13..cb3e592337 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-composites.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/constant-composites.frag @@ -14,16 +14,16 @@ struct Foo constant float _16[4] = {1.0, 4.0, 3.0, 2.0}; constant Foo _28[2] = {{10.0, 20.0}, {30.0, 40.0}}; -struct main0_in -{ - int line [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int line [[user(locn0)]]; +}; + // Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. template void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) @@ -44,7 +44,7 @@ fragment main0_out main0(main0_in in [[stage_in]]) float lut[4] = {1.0, 4.0, 3.0, 2.0}; Foo foos[2] = {{10.0, 20.0}, {30.0, 40.0}}; out.FragColor = float4(lut[in.line]); - out.FragColor += float4(foos[in.line].a * (foos[1 - in.line].a)); + out.FragColor += float4(foos[in.line].a * foos[1 - in.line].a); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..b75f86d23c --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,45 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float4 vInput [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = in.vInput; + float4 _23 = uSampler.sample(uSamplerSmplr, in.vInput.xy); + float4 _26 = dfdx(in.vInput); + float4 _29 = dfdy(in.vInput); + float4 _32 = fwidth(in.vInput); + float4 _35 = dfdx(in.vInput); + float4 _38 = dfdy(in.vInput); + float4 _41 = fwidth(in.vInput); + float4 _44 = dfdx(in.vInput); + float4 _47 = dfdy(in.vInput); + float4 _50 = fwidth(in.vInput); + if (in.vInput.y > 10.0) + { + out.FragColor += _23; + out.FragColor += _26; + out.FragColor += _29; + out.FragColor += _32; + out.FragColor += _35; + out.FragColor += _38; + out.FragColor += _41; + out.FragColor += _44; + out.FragColor += _47; + out.FragColor += _50; + } + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/dual-source-blending.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/dual-source-blending.frag new file mode 100644 index 0000000000..37938bf8ca --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/dual-source-blending.frag @@ -0,0 +1,19 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor0 [[color(0), index(0)]]; + float4 FragColor1 [[color(0), index(1)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + out.FragColor0 = float4(1.0); + out.FragColor1 = float4(2.0); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/false-loop-init.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/false-loop-init.frag index c67bb9d396..9233caa05d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/false-loop-init.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/false-loop-init.frag @@ -3,35 +3,25 @@ using namespace metal; -constant uint _49 = {}; - -struct main0_in -{ - float4 accum [[user(locn0)]]; -}; - struct main0_out { float4 result [[color(0)]]; }; +struct main0_in +{ + float4 accum [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; out.result = float4(0.0); - uint _51; - uint _50; - for (int _48 = 0; _48 < 4; _48 += int(_51), _50 = _51) + for (int _48 = 0; _48 < 4; ) { - if (in.accum.y > 10.0) - { - _51 = 40u; - } - else - { - _51 = 30u; - } out.result += in.accum; + _48 += int((in.accum.y > 10.0) ? 40u : 30u); + continue; } return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/flush_params.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/flush_params.frag index 059167fd4b..64edee8722 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/flush_params.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/flush_params.frag @@ -3,11 +3,6 @@ using namespace metal; -struct Structy -{ - float4 c; -}; - struct main0_out { float4 FragColor [[color(0)]]; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/for-loop-init.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/for-loop-init.frag index 0e5c92c7e5..71c156f8da 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/for-loop-init.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/for-loop-init.frag @@ -3,6 +3,9 @@ using namespace metal; +constant int2 _184 = {}; +constant int _199 = {}; + struct main0_out { int FragColor [[color(0)]]; @@ -12,46 +15,70 @@ fragment main0_out main0() { main0_out out = {}; out.FragColor = 16; - for (int _140 = 0; _140 < 25; _140++) + for (int _168 = 0; _168 < 25; ) { out.FragColor += 10; + _168++; + continue; } - for (int _141 = 1; _141 < 30; _141++) + for (int _169 = 1; _169 < 30; ) { out.FragColor += 11; + _169++; + continue; } - int _142; - _142 = 0; - for (; _142 < 20; _142++) + int _170; + _170 = 0; + for (; _170 < 20; ) { out.FragColor += 12; + _170++; + continue; } - int _62 = _142 + 3; + int _62 = _170 + 3; out.FragColor += _62; - if (_62 == 40) + bool _68 = _62 == 40; + if (_68) { - for (int _143 = 0; _143 < 40; _143++) + for (int _171 = 0; _171 < 40; ) { out.FragColor += 13; + _171++; + continue; } - return out; } else { out.FragColor += _62; } - int2 _144; - _144 = int2(0); - int2 _139; - for (; _144.x < 10; _139 = _144, _139.x = _144.x + 4, _144 = _139) + bool2 _211 = bool2(_68); + int2 _212 = int2(_211.x ? _184.x : _184.x, _211.y ? _184.y : _184.y); + bool _213 = _68 ? true : false; + bool2 _214 = bool2(_213); + if (!_213) { - out.FragColor += _144.y; + int2 _177; + _177 = int2(_214.x ? _212.x : int2(0).x, _214.y ? _212.y : int2(0).y); + for (; _177.x < 10; ) + { + out.FragColor += _177.y; + int2 _167 = _177; + _167.x = _177.x + 4; + _177 = _167; + continue; + } } - for (int _145 = _62; _145 < 40; _145++) + int _216 = _213 ? (_68 ? _199 : _199) : _62; + if (!_213) { - out.FragColor += _145; + for (int _191 = _216; _191 < 40; ) + { + out.FragColor += _191; + _191++; + continue; + } + out.FragColor += _216; } - out.FragColor += _62; return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/fp16-packing.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/fp16-packing.frag new file mode 100644 index 0000000000..358681f6dd --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/fp16-packing.frag @@ -0,0 +1,25 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 FP32Out [[color(0)]]; + uint FP16Out [[color(1)]]; +}; + +struct main0_in +{ + uint FP16 [[user(locn0)]]; + float2 FP32 [[user(locn1)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + out.FP32Out = float2(as_type(in.FP16)); + out.FP16Out = as_type(half2(in.FP32)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/fp16.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/fp16.desktop.frag new file mode 100644 index 0000000000..d9a0390e1f --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/fp16.desktop.frag @@ -0,0 +1,16 @@ +#include +#include + +using namespace metal; + +struct main0_in +{ + half4 v4 [[user(locn3)]]; +}; + +fragment void main0(main0_in in [[stage_in]]) +{ + half4 _491; + half4 _563 = modf(in.v4, _491); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/front-facing.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/front-facing.frag index 3856498943..2f83642492 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/front-facing.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/front-facing.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 vB [[user(locn1)]]; - float4 vA [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vA [[user(locn0)]]; + float4 vB [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], bool gl_FrontFacing [[front_facing]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/gather-dref.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/gather-dref.frag new file mode 100644 index 0000000000..c5c5ccf0bb --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/gather-dref.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vUV [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uT [[texture(0)]], sampler uTSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = uT.gather_compare(uTSmplr, in.vUV.xy, in.vUV.z); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/gather-offset.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/gather-offset.frag new file mode 100644 index 0000000000..02b80194b5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/gather-offset.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(texture2d uT [[texture(0)]], sampler uTSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = uT.gather(uTSmplr, float2(0.5), int2(0), component::w); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/illegal-name-test-0.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/illegal-name-test-0.frag new file mode 100644 index 0000000000..81cd3b5621 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/illegal-name-test-0.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + out.FragColor = float4(40.0); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block.frag index 43b4a05897..2af2024f52 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 VertexOut_color2 [[user(locn3)]]; - float4 VertexOut_color [[user(locn2)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 VertexOut_color [[user(locn2)]]; + float4 VertexOut_color2 [[user(locn3)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_mat.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_mat.frag new file mode 100644 index 0000000000..905a3a2759 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_mat.frag @@ -0,0 +1,37 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 outFragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 inPos [[user(locn0)]]; + float3 inNormal [[user(locn1)]]; + float4 inInvModelView_0 [[user(locn2)]]; + float4 inInvModelView_1 [[user(locn3)]]; + float4 inInvModelView_2 [[user(locn4)]]; + float4 inInvModelView_3 [[user(locn5)]]; + float inLodBias [[user(locn6)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texturecube samplerColor [[texture(1)]], sampler samplerColorSmplr [[sampler(1)]]) +{ + main0_out out = {}; + float4x4 inInvModelView = {}; + inInvModelView[0] = in.inInvModelView_0; + inInvModelView[1] = in.inInvModelView_1; + inInvModelView[2] = in.inInvModelView_2; + inInvModelView[3] = in.inInvModelView_3; + float4 _31 = inInvModelView * float4(reflect(normalize(in.inPos), normalize(in.inNormal)), 0.0); + float _33 = _31.x; + float3 _60 = float3(_33, _31.yz); + _60.x = _33 * (-1.0); + out.outFragColor = samplerColor.sample(samplerColorSmplr, _60, bias(in.inLodBias)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/lut-promotion.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/lut-promotion.frag new file mode 100644 index 0000000000..4efdf4a196 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/lut-promotion.frag @@ -0,0 +1,69 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +constant float _16[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0}; +constant float4 _60[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; +constant float4 _104[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)}; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + int index [[user(locn0)]]; +}; + +// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. +template +void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +// An overload for constant arrays. +template +void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + out.FragColor = _16[in.index]; + if (in.index < 10) + { + out.FragColor += _16[in.index ^ 1]; + } + else + { + out.FragColor += _16[in.index & 1]; + } + bool _63 = in.index > 30; + if (_63) + { + out.FragColor += _60[in.index & 3].y; + } + else + { + out.FragColor += _60[in.index & 1].x; + } + float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + if (_63) + { + foobar[1].z = 20.0; + } + int _91 = in.index & 3; + out.FragColor += foobar[_91].z; + float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + spvArrayCopyConstant(baz, _104); + out.FragColor += baz[_91].z; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mix.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mix.frag index 9c9b8398cf..5e385087bc 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mix.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mix.frag @@ -3,27 +3,26 @@ using namespace metal; -struct main0_in -{ - float vIn3 [[user(locn3)]]; - float vIn2 [[user(locn2)]]; - float4 vIn1 [[user(locn1)]]; - float4 vIn0 [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vIn0 [[user(locn0)]]; + float4 vIn1 [[user(locn1)]]; + float vIn2 [[user(locn2)]]; + float vIn3 [[user(locn3)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; - out.FragColor = float4(bool4(false, true, false, false).x ? in.vIn1.x : in.vIn0.x, bool4(false, true, false, false).y ? in.vIn1.y : in.vIn0.y, bool4(false, true, false, false).z ? in.vIn1.z : in.vIn0.z, bool4(false, true, false, false).w ? in.vIn1.w : in.vIn0.w); - out.FragColor = float4(true ? in.vIn3 : in.vIn2); - bool4 _37 = bool4(true); - out.FragColor = float4(_37.x ? in.vIn0.x : in.vIn1.x, _37.y ? in.vIn0.y : in.vIn1.y, _37.z ? in.vIn0.z : in.vIn1.z, _37.w ? in.vIn0.w : in.vIn1.w); - out.FragColor = float4(true ? in.vIn2 : in.vIn3); + out.FragColor = float4(in.vIn0.x, in.vIn1.y, in.vIn0.z, in.vIn0.w); + out.FragColor = float4(in.vIn3); + out.FragColor = in.vIn0.xyzw; + out.FragColor = float4(in.vIn2); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mrt-array.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mrt-array.frag new file mode 100644 index 0000000000..d7cea6baf9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/mrt-array.frag @@ -0,0 +1,43 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor_0 [[color(0)]]; + float4 FragColor_1 [[color(1)]]; + float4 FragColor_2 [[color(2)]]; + float4 FragColor_3 [[color(3)]]; +}; + +struct main0_in +{ + float4 vA [[user(locn0)]]; + float4 vB [[user(locn1)]]; +}; + +// Implementation of the GLSL mod() function, which is slightly different than Metal fmod() +template +Tx mod(Tx x, Ty y) +{ + return x - y * floor(x / y); +} + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + float4 FragColor[4] = {}; + FragColor[0] = mod(in.vA, in.vB); + FragColor[1] = in.vA + in.vB; + FragColor[2] = in.vA - in.vB; + FragColor[3] = in.vA * in.vB; + out.FragColor_0 = FragColor[0]; + out.FragColor_1 = FragColor[1]; + out.FragColor_2 = FragColor[2]; + out.FragColor_3 = FragColor[3]; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag new file mode 100644 index 0000000000..dd319af555 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/packed-expression-vector-shuffle.frag @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + packed_float3 color; + float v; +}; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(constant UBO& _15 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = float4(_15.color[0], _15.color[1], _15.color[2], float4(1.0).w); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/packing-test-3.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/packing-test-3.frag new file mode 100644 index 0000000000..436829e85c --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/packing-test-3.frag @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +struct TestStruct +{ + packed_float3 position; + float radius; +}; + +struct CB0 +{ + TestStruct CB0[16]; +}; + +struct main0_out +{ + float4 _entryPointOutput [[color(0)]]; +}; + +fragment main0_out main0(constant CB0& _26 [[buffer(0)]], float4 gl_FragCoord [[position]]) +{ + main0_out out = {}; + out._entryPointOutput = float4(_26.CB0[1].position[0], _26.CB0[1].position[1], _26.CB0[1].position[2], _26.CB0[1].radius); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/pls.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/pls.frag index 42b5d2bf59..ee774a04af 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/pls.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/pls.frag @@ -3,14 +3,6 @@ using namespace metal; -struct main0_in -{ - float4 PLSIn3 [[user(locn3)]]; - float4 PLSIn2 [[user(locn2)]]; - float4 PLSIn1 [[user(locn1)]]; - float4 PLSIn0 [[user(locn0)]]; -}; - struct main0_out { float4 PLSOut0 [[color(0)]]; @@ -19,6 +11,14 @@ struct main0_out float4 PLSOut3 [[color(3)]]; }; +struct main0_in +{ + float4 PLSIn0 [[user(locn0)]]; + float4 PLSIn1 [[user(locn1)]]; + float4 PLSIn2 [[user(locn2)]]; + float4 PLSIn3 [[user(locn3)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/readonly-ssbo.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/readonly-ssbo.frag new file mode 100644 index 0000000000..777fd65c8a --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/readonly-ssbo.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct SSBO +{ + float4 v; +}; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(const device SSBO& _13 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = _13.v + _13.v; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sample-depth-separate-image-sampler.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sample-depth-separate-image-sampler.frag index 6626946c45..17e1421a3d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sample-depth-separate-image-sampler.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sample-depth-separate-image-sampler.frag @@ -8,7 +8,7 @@ struct main0_out float FragColor [[color(0)]]; }; -fragment main0_out main0(depth2d uDepth [[texture(0)]], texture2d uColor [[texture(1)]], sampler uSamplerShadow [[sampler(0)]], sampler uSampler [[sampler(1)]]) +fragment main0_out main0(depth2d uDepth [[texture(0)]], texture2d uColor [[texture(1)]], sampler uSampler [[sampler(2)]], sampler uSamplerShadow [[sampler(3)]]) { main0_out out = {}; out.FragColor = uDepth.sample_compare(uSamplerShadow, float3(0.5).xy, 0.5) + uColor.sample(uSampler, float2(0.5)).x; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler-1d-lod.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler-1d-lod.frag new file mode 100644 index 0000000000..1da2036e3a --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler-1d-lod.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float vTex [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture1d uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor += ((uSampler.sample(uSamplerSmplr, in.vTex) + uSampler.sample(uSamplerSmplr, in.vTex)) + uSampler.sample(uSamplerSmplr, in.vTex)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler-image-arrays.msl2.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler-image-arrays.msl2.frag new file mode 100644 index 0000000000..5e9c488d5d --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler-image-arrays.msl2.frag @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTex [[user(locn0)]]; + int vIndex [[user(locn1)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], array, 4> uSampler [[texture(0)]], array, 4> uTextures [[texture(8)]], array uSamplerSmplr [[sampler(0)]], array uSamplers [[sampler(4)]]) +{ + main0_out out = {}; + out.FragColor = float4(0.0); + out.FragColor += uTextures[2].sample(uSamplers[1], in.vTex); + out.FragColor += uSampler[in.vIndex].sample(uSamplerSmplr[in.vIndex], in.vTex); + out.FragColor += uSampler[in.vIndex].sample(uSamplerSmplr[in.vIndex], (in.vTex + float2(0.100000001490116119384765625))); + out.FragColor += uSampler[in.vIndex].sample(uSamplerSmplr[in.vIndex], (in.vTex + float2(0.20000000298023223876953125))); + out.FragColor += uSampler[3].sample(uSamplerSmplr[3], (in.vTex + float2(0.300000011920928955078125))); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler.frag index 4d33ee7bca..f33db61eba 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/sampler.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float2 vTex [[user(locn1)]]; - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; + float2 vTex [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/separate-image-sampler-argument.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/separate-image-sampler-argument.frag index e576b49e7e..b1261f3722 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/separate-image-sampler-argument.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/separate-image-sampler-argument.frag @@ -8,7 +8,7 @@ struct main0_out float4 FragColor [[color(0)]]; }; -fragment main0_out main0(texture2d uDepth [[texture(0)]], sampler uSampler [[sampler(0)]]) +fragment main0_out main0(texture2d uDepth [[texture(1)]], sampler uSampler [[sampler(0)]]) { main0_out out = {}; out.FragColor = uDepth.sample(uSampler, float2(0.5)); diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/shadow-compare-global-alias.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/shadow-compare-global-alias.frag new file mode 100644 index 0000000000..926172577d --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/shadow-compare-global-alias.frag @@ -0,0 +1,27 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vUV [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uSampler [[texture(0)]], depth2d uTex [[texture(1)]], sampler uSamplerSmplr [[sampler(0)]], sampler uSamp [[sampler(2)]]) +{ + main0_out out = {}; + out.FragColor = uSampler.sample_compare(uSamplerSmplr, in.vUV.xy, in.vUV.z); + out.FragColor += uTex.sample_compare(uSamp, in.vUV.xy, in.vUV.z); + out.FragColor += uTex.sample_compare(uSamp, in.vUV.xy, in.vUV.z); + out.FragColor += uSampler.sample_compare(uSamplerSmplr, in.vUV.xy, in.vUV.z); + out.FragColor += uTex.sample_compare(uSamp, in.vUV.xy, in.vUV.z); + out.FragColor += uSampler.sample_compare(uSamplerSmplr, in.vUV.xy, in.vUV.z); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-block-size.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-block-size.frag index 4237d941fe..445f4362de 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-block-size.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-block-size.frag @@ -8,16 +8,16 @@ struct SpecConstArray float4 samples[2]; }; -struct main0_in -{ - int Index [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int Index [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], constant SpecConstArray& _15 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-ternary.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-ternary.frag new file mode 100644 index 0000000000..5ab6b4fcb1 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/spec-constant-ternary.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +constant uint s_tmp [[function_constant(0)]]; +constant uint s = is_function_constant_defined(s_tmp) ? s_tmp : 10u; +constant bool _13 = (s > 20u); +constant uint _16 = _13 ? 30u : 50u; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + out.FragColor = float(_16); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/swizzle.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/swizzle.frag index eb46111f00..7a0494e064 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/swizzle.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/swizzle.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float2 vUV [[user(locn2)]]; - float3 vNormal [[user(locn1)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float3 vNormal [[user(locn1)]]; + float2 vUV [[user(locn2)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d samp [[texture(0)]], sampler sampSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/texture-proj-shadow.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/texture-proj-shadow.frag index 8b9b03a59e..c5ab0ee007 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/texture-proj-shadow.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/texture-proj-shadow.frag @@ -3,19 +3,19 @@ using namespace metal; -struct main0_in -{ - float2 vClip2 [[user(locn2)]]; - float4 vClip4 [[user(locn1)]]; - float3 vClip3 [[user(locn0)]]; -}; - struct main0_out { float FragColor [[color(0)]]; }; -fragment main0_out main0(main0_in in [[stage_in]], depth2d uShadow2D [[texture(0)]], texture1d uSampler1D [[texture(1)]], texture2d uSampler2D [[texture(2)]], texture3d uSampler3D [[texture(3)]], sampler uShadow2DSmplr [[sampler(0)]], sampler uSampler1DSmplr [[sampler(1)]], sampler uSampler2DSmplr [[sampler(2)]], sampler uSampler3DSmplr [[sampler(3)]]) +struct main0_in +{ + float3 vClip3 [[user(locn0)]]; + float4 vClip4 [[user(locn1)]]; + float2 vClip2 [[user(locn2)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uShadow2D [[texture(1)]], texture1d uSampler1D [[texture(2)]], texture2d uSampler2D [[texture(3)]], texture3d uSampler3D [[texture(4)]], sampler uShadow2DSmplr [[sampler(1)]], sampler uSampler1DSmplr [[sampler(2)]], sampler uSampler2DSmplr [[sampler(3)]], sampler uSampler3DSmplr [[sampler(4)]]) { main0_out out = {}; float4 _20 = in.vClip4; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/ubo_layout.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/ubo_layout.frag index 8c03e33b39..0bc27462b2 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/ubo_layout.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/ubo_layout.frag @@ -13,9 +13,14 @@ struct UBO1 Str foo; }; +struct Str_1 +{ + float4x4 foo; +}; + struct UBO2 { - Str foo; + Str_1 foo; }; struct main0_out diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/unary-enclose.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/unary-enclose.frag index 7437f1dfe8..c8648f1e01 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/unary-enclose.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/unary-enclose.frag @@ -3,20 +3,20 @@ using namespace metal; -struct main0_in -{ - float4 vIn [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vIn [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; - out.FragColor = -(-in.vIn); + out.FragColor = in.vIn; return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/legacy/vert/transpose.legacy.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/legacy/vert/transpose.legacy.vert index b28067e589..abd884ca8f 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/legacy/vert/transpose.legacy.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/legacy/vert/transpose.legacy.vert @@ -10,16 +10,16 @@ struct Buffer float4x4 M; }; -struct main0_in -{ - float4 Position [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 Position [[attribute(0)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant Buffer& _13 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/basic.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/basic.vert index 1592b5c5cf..ffb4357126 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/basic.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/basic.vert @@ -8,18 +8,18 @@ struct UBO float4x4 uMVP; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/copy.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/copy.flatten.vert index dc87c849dc..4cc68e83f5 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/copy.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/copy.flatten.vert @@ -16,27 +16,29 @@ struct UBO Light lights[4]; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 vColor [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _21 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = _21.uMVP * in.aVertex; out.vColor = float4(0.0); - for (int _103 = 0; _103 < 4; _103++) + for (int _96 = 0; _96 < 4; ) { - float3 _68 = in.aVertex.xyz - _21.lights[_103].Position; - out.vColor += ((_21.lights[_103].Color * clamp(1.0 - (length(_68) / _21.lights[_103].Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(_68))); + float3 _68 = in.aVertex.xyz - _21.lights[_96].Position; + out.vColor += ((_21.lights[_96].Color * clamp(1.0 - (length(_68) / _21.lights[_96].Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(_68))); + _96++; + continue; } return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/dynamic.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/dynamic.flatten.vert index eb38ab4fd1..38354358e2 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/dynamic.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/dynamic.flatten.vert @@ -16,27 +16,29 @@ struct UBO Light lights[4]; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 vColor [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _21 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = _21.uMVP * in.aVertex; out.vColor = float4(0.0); - for (int _82 = 0; _82 < 4; _82++) + for (int _82 = 0; _82 < 4; ) { - float3 _54 = in.aVertex.xyz - _21.lights[_82].Position; + float3 _54 = in.aVertex.xyz - float3(_21.lights[_82].Position); out.vColor += ((_21.lights[_82].Color * clamp(1.0 - (length(_54) / _21.lights[_82].Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(_54))); + _82++; + continue; } return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/functions.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/functions.vert index 6e07667b69..f710225261 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/functions.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/functions.vert @@ -13,12 +13,6 @@ struct UBO int2 bits; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; @@ -29,18 +23,24 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + // Implementation of the GLSL radians() function template T radians(T d) { - return d * 0.01745329251; + return d * T(0.01745329251); } // Implementation of the GLSL degrees() function template T degrees(T r) { - return r * 57.2957795131; + return r * T(57.2957795131); } // Implementation of the GLSL findLSB() function diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert new file mode 100644 index 0000000000..0d6976e260 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/in_out_array_mat.vert @@ -0,0 +1,67 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + float4x4 projection; + float4x4 model; + float lodBias; +}; + +struct main0_out +{ + float3 outPos [[user(locn0)]]; + float3 outNormal [[user(locn1)]]; + float4 outTransModel_0 [[user(locn2)]]; + float4 outTransModel_1 [[user(locn3)]]; + float4 outTransModel_2 [[user(locn4)]]; + float4 outTransModel_3 [[user(locn5)]]; + float outLodBias [[user(locn6)]]; + float4 color [[user(locn7)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float3 inPos [[attribute(0)]]; + float4 colors_0 [[attribute(1)]]; + float4 colors_1 [[attribute(2)]]; + float4 colors_2 [[attribute(3)]]; + float3 inNormal [[attribute(4)]]; + float4 inViewMat_0 [[attribute(5)]]; + float4 inViewMat_1 [[attribute(6)]]; + float4 inViewMat_2 [[attribute(7)]]; + float4 inViewMat_3 [[attribute(8)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], constant UBO& ubo [[buffer(0)]]) +{ + main0_out out = {}; + float4x4 outTransModel = {}; + float4 colors[3] = {}; + float4x4 inViewMat = {}; + colors[0] = in.colors_0; + colors[1] = in.colors_1; + colors[2] = in.colors_2; + inViewMat[0] = in.inViewMat_0; + inViewMat[1] = in.inViewMat_1; + inViewMat[2] = in.inViewMat_2; + inViewMat[3] = in.inViewMat_3; + float4 _64 = float4(in.inPos, 1.0); + out.gl_Position = (ubo.projection * ubo.model) * _64; + out.outPos = float3((ubo.model * _64).xyz); + out.outNormal = float3x3(float3(ubo.model[0].x, ubo.model[0].y, ubo.model[0].z), float3(ubo.model[1].x, ubo.model[1].y, ubo.model[1].z), float3(ubo.model[2].x, ubo.model[2].y, ubo.model[2].z)) * in.inNormal; + out.outLodBias = ubo.lodBias; + outTransModel = transpose(ubo.model) * inViewMat; + outTransModel[2] = float4(in.inNormal, 1.0); + outTransModel[1].y = ubo.lodBias; + out.color = colors[2]; + out.outTransModel_0 = outTransModel[0]; + out.outTransModel_1 = outTransModel[1]; + out.outTransModel_2 = outTransModel[2]; + out.outTransModel_3 = outTransModel[3]; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/out_block.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/out_block.vert index 3ae18387a6..cf1334ec0b 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/out_block.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/out_block.vert @@ -8,12 +8,6 @@ struct Transform float4x4 transform; }; -struct main0_in -{ - float4 color [[attribute(1)]]; - float3 position [[attribute(0)]]; -}; - struct main0_out { float4 VertexOut_color [[user(locn2)]]; @@ -21,6 +15,12 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float3 position [[attribute(0)]]; + float4 color [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant Transform& block [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/packed_matrix.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/packed_matrix.vert index 53d7d164fa..4483ad79e7 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/packed_matrix.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/packed_matrix.vert @@ -26,28 +26,22 @@ struct _42 float2 _m9; }; -struct main0_in -{ - float4 m_25 [[attribute(0)]]; -}; - struct main0_out { float3 m_72 [[user(locn0)]]; float4 gl_Position [[position]]; }; -vertex main0_out main0(main0_in in [[stage_in]], constant _15& _17 [[buffer(0)]], constant _42& _44 [[buffer(1)]]) +struct main0_in +{ + float4 m_25 [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], constant _42& _44 [[buffer(12)]], constant _15& _17 [[buffer(13)]]) { main0_out out = {}; - float3 _34; - do - { - _34 = normalize(float4(in.m_25.xyz, 0.0) * _17._m1); - break; - } while (false); - float4 _70 = _44._m0 * float4(_44._m3 + (in.m_25.xyz * (_44._m6 + _44._m7)), 1.0); - out.m_72 = _34; + float4 _70 = _44._m0 * float4(float3(_44._m3) + (in.m_25.xyz * (_44._m6 + _44._m7)), 1.0); + out.m_72 = normalize(float4(in.m_25.xyz, 0.0) * _17._m1); float4 _95 = _70; _95.y = -_70.y; out.gl_Position = _95; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/pointsize.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/pointsize.vert index faf828b4d3..8e5782bde4 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/pointsize.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/pointsize.vert @@ -9,12 +9,6 @@ struct params float psize; }; -struct main0_in -{ - float4 color0 [[attribute(1)]]; - float4 position [[attribute(0)]]; -}; - struct main0_out { float4 color [[user(locn0)]]; @@ -22,6 +16,12 @@ struct main0_out float gl_PointSize [[point_size]]; }; +struct main0_in +{ + float4 position [[attribute(0)]]; + float4 color0 [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant params& _19 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..9b85a25956 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/read-from-row-major-array.vert @@ -0,0 +1,37 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct Block +{ + float2x3 var[3][4]; +}; + +struct main0_out +{ + float v_vtxResult [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float4 a_position [[attribute(0)]]; +}; + +// Implementation of a conversion of matrix content from RowMajor to ColumnMajor organization. +float2x3 spvConvertFromRowMajor2x3(float2x3 m) +{ + return float2x3(float3(m[0][0], m[0][2], m[1][1]), float3(m[0][1], m[1][0], m[1][2])); +} + +vertex main0_out main0(main0_in in [[stage_in]], constant Block& _104 [[buffer(0)]]) +{ + main0_out out = {}; + out.gl_Position = in.a_position; + out.v_vtxResult = ((float(abs(spvConvertFromRowMajor2x3(_104.var[0][0])[0].x - 2.0) < 0.0500000007450580596923828125) * float(abs(spvConvertFromRowMajor2x3(_104.var[0][0])[0].y - 6.0) < 0.0500000007450580596923828125)) * float(abs(spvConvertFromRowMajor2x3(_104.var[0][0])[0].z - (-6.0)) < 0.0500000007450580596923828125)) * ((float(abs(spvConvertFromRowMajor2x3(_104.var[0][0])[1].x) < 0.0500000007450580596923828125) * float(abs(spvConvertFromRowMajor2x3(_104.var[0][0])[1].y - 5.0) < 0.0500000007450580596923828125)) * float(abs(spvConvertFromRowMajor2x3(_104.var[0][0])[1].z - 5.0) < 0.0500000007450580596923828125)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/return-array.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/return-array.vert index 7804d2d94f..ce13349a0f 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/return-array.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/return-array.vert @@ -3,18 +3,16 @@ using namespace metal; -constant float4 _20[2] = {float4(10.0), float4(20.0)}; +struct main0_out +{ + float4 gl_Position [[position]]; +}; struct main0_in { float4 vInput1 [[attribute(1)]]; }; -struct main0_out -{ - float4 gl_Position [[position]]; -}; - vertex main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/set_builtin_in_func.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/set_builtin_in_func.vert new file mode 100644 index 0000000000..51a858af1e --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/set_builtin_in_func.vert @@ -0,0 +1,19 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; + float gl_PointSize [[point_size]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + out.gl_PointSize = 1.0; + out.gl_Position = float4(out.gl_PointSize); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/texture_buffer.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/texture_buffer.vert index 690757b830..c45d298134 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/texture_buffer.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/texture_buffer.vert @@ -1,3 +1,5 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + #include #include @@ -8,10 +10,16 @@ struct main0_out float4 gl_Position [[position]]; }; -vertex main0_out main0(texture2d uSamp [[texture(0)]], texture2d uSampo [[texture(1)]]) +// Returns 2D texture coords corresponding to 1D texel buffer coords +uint2 spvTexelBufferCoord(uint tc) +{ + return uint2(tc % 4096, tc / 4096); +} + +vertex main0_out main0(texture2d uSamp [[texture(4)]], texture2d uSampo [[texture(5)]]) { main0_out out = {}; - out.gl_Position = uSamp.read(uint2(10, 0)) + uSampo.read(uint2(100, 0)); + out.gl_Position = uSamp.read(spvTexelBufferCoord(10)) + uSampo.read(spvTexelBufferCoord(100)); return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.alignment.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.alignment.vert index 6e48ae0e42..9a7ea56c61 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.alignment.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.alignment.vert @@ -12,12 +12,6 @@ struct UBO float opacity; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; @@ -26,12 +20,18 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = _18.mvp * in.aVertex; out.vNormal = in.aNormal; - out.vColor = _18.color * _18.opacity; + out.vColor = float3(_18.color) * _18.opacity; out.vSize = _18.targSize * _18.opacity; return out; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.vert b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.vert index 4a1adcd7f6..86ba1e9687 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vert/ubo.vert @@ -8,18 +8,18 @@ struct UBO float4x4 mvp; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/vulkan/frag/push-constant.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders-msl/vulkan/frag/push-constant.vk.frag index bc97e3cc51..7b8c502b32 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/vulkan/frag/push-constant.vk.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders-msl/vulkan/frag/push-constant.vk.frag @@ -9,16 +9,16 @@ struct PushConstants float4 value1; }; -struct main0_in -{ - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], constant PushConstants& push [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/amd/fragmentMaskFetch_subpassInput.vk.nocompat.invalid.frag b/deps/SPIRV-Cross/reference/opt/shaders/amd/fragmentMaskFetch_subpassInput.vk.nocompat.invalid.frag deleted file mode 100644 index d670898481..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/amd/fragmentMaskFetch_subpassInput.vk.nocompat.invalid.frag +++ /dev/null @@ -1,11 +0,0 @@ -#version 450 -#extension GL_AMD_shader_fragment_mask : require - -layout(binding = 0) uniform sampler2DMS t; - -void main() -{ - vec4 test2 = fragmentFetchAMD(t, 4u); - uint testi2 = fragmentMaskFetchAMD(t); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/amd/fs.invalid.frag b/deps/SPIRV-Cross/reference/opt/shaders/amd/fs.invalid.frag index 97e7bcd180..aecf69eba7 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/amd/fs.invalid.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/amd/fs.invalid.frag @@ -2,9 +2,9 @@ #extension GL_AMD_shader_fragment_mask : require #extension GL_AMD_shader_explicit_vertex_parameter : require -uniform sampler2DMS texture1; +layout(binding = 0) uniform sampler2DMS texture1; -layout(location = 0) in vec4 vary; +layout(location = 0) __explicitInterpAMD in vec4 vary; void main() { diff --git a/deps/SPIRV-Cross/reference/opt/shaders/amd/gcn_shader.comp b/deps/SPIRV-Cross/reference/opt/shaders/amd/gcn_shader.comp index 85851de5f9..e4bb67e9ba 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/amd/gcn_shader.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/amd/gcn_shader.comp @@ -1,5 +1,6 @@ #version 450 #extension GL_ARB_gpu_shader_int64 : require +#extension GL_AMD_gcn_shader : require layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; void main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_ballot.comp b/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_ballot.comp index 8bdbfc9c0d..6c14bba422 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_ballot.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_ballot.comp @@ -9,18 +9,20 @@ layout(binding = 0, std430) buffer inputData float inputDataArray[]; } _12; -layout(binding = 1, std430) buffer outputData +layout(binding = 1, std430) buffer _10_74 { - float outputDataArray[]; + float inputDataArray[]; } _74; void main() { float _25 = _12.inputDataArray[gl_LocalInvocationID.x]; bool _31 = _25 > 0.0; + uvec4 _37 = uvec4(unpackUint2x32(ballotARB(_31)), 0u, 0u); + uint _44 = mbcntAMD(packUint2x32(uvec2(_37.xy))); if (_31) { - _74.outputDataArray[mbcntAMD(packUint2x32(uvec2(unpackUint2x32(ballotARB(_31)).xy)))] = _25; + _74.inputDataArray[_44] = _25; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_group_vote.comp b/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_group_vote.comp index 77ea03495f..266998177c 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_group_vote.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_group_vote.comp @@ -1,7 +1,14 @@ #version 450 +#extension GL_ARB_shader_group_vote : require layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; +layout(binding = 0, std430) buffer inputData +{ + float inputDataArray[]; +} _12; + void main() { + bool _31 = _12.inputDataArray[gl_LocalInvocationID.x] > 0.0; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_trinary_minmax.comp b/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_trinary_minmax.comp index 77ea03495f..2644551e4a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_trinary_minmax.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/amd/shader_trinary_minmax.comp @@ -1,4 +1,5 @@ #version 450 +#extension GL_AMD_shader_trinary_minmax : require layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; void main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_iequal.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_iequal.asm.comp index 79398b404b..bdb3eeb9af 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_iequal.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_iequal.asm.comp @@ -15,10 +15,12 @@ layout(binding = 1, std430) buffer _4_6 void main() { - bvec4 _34 = equal(ivec4(_5._m1), _5._m0); - bvec4 _35 = equal(_5._m0, ivec4(_5._m1)); - bvec4 _36 = equal(_5._m1, _5._m1); - bvec4 _37 = equal(_5._m0, _5._m0); + ivec4 _30 = _5._m0; + uvec4 _31 = _5._m1; + bvec4 _34 = equal(ivec4(_31), _30); + bvec4 _35 = equal(_30, ivec4(_31)); + bvec4 _36 = equal(_31, _31); + bvec4 _37 = equal(_30, _30); _6._m0 = mix(uvec4(0u), uvec4(1u), _34); _6._m0 = mix(uvec4(0u), uvec4(1u), _35); _6._m0 = mix(uvec4(0u), uvec4(1u), _36); diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sar.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sar.asm.comp index 42a4ed0233..283b444cce 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sar.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sar.asm.comp @@ -15,13 +15,15 @@ layout(binding = 1, std430) buffer _4_6 void main() { - _6._m0 = uvec4(ivec4(_5._m1) >> _5._m0); - _6._m0 = uvec4(_5._m0 >> ivec4(_5._m1)); - _6._m0 = uvec4(ivec4(_5._m1) >> ivec4(_5._m1)); - _6._m0 = uvec4(_5._m0 >> _5._m0); - _6._m1 = ivec4(_5._m1) >> ivec4(_5._m1); - _6._m1 = _5._m0 >> _5._m0; - _6._m1 = ivec4(_5._m1) >> _5._m0; - _6._m1 = _5._m0 >> ivec4(_5._m1); + ivec4 _22 = _5._m0; + uvec4 _23 = _5._m1; + _6._m0 = uvec4(ivec4(_23) >> _22); + _6._m0 = uvec4(_22 >> ivec4(_23)); + _6._m0 = uvec4(ivec4(_23) >> ivec4(_23)); + _6._m0 = uvec4(_22 >> _22); + _6._m1 = ivec4(_23) >> ivec4(_23); + _6._m1 = _22 >> _22; + _6._m1 = ivec4(_23) >> _22; + _6._m1 = _22 >> ivec4(_23); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sdiv.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sdiv.asm.comp index eeb97e14a2..e28c481d21 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sdiv.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_sdiv.asm.comp @@ -15,13 +15,15 @@ layout(binding = 1, std430) buffer _4_6 void main() { - _6._m0 = uvec4(ivec4(_5._m1) / _5._m0); - _6._m0 = uvec4(_5._m0 / ivec4(_5._m1)); - _6._m0 = uvec4(ivec4(_5._m1) / ivec4(_5._m1)); - _6._m0 = uvec4(_5._m0 / _5._m0); - _6._m1 = ivec4(_5._m1) / ivec4(_5._m1); - _6._m1 = _5._m0 / _5._m0; - _6._m1 = ivec4(_5._m1) / _5._m0; - _6._m1 = _5._m0 / ivec4(_5._m1); + ivec4 _22 = _5._m0; + uvec4 _23 = _5._m1; + _6._m0 = uvec4(ivec4(_23) / _22); + _6._m0 = uvec4(_22 / ivec4(_23)); + _6._m0 = uvec4(ivec4(_23) / ivec4(_23)); + _6._m0 = uvec4(_22 / _22); + _6._m1 = ivec4(_23) / ivec4(_23); + _6._m1 = _22 / _22; + _6._m1 = ivec4(_23) / _22; + _6._m1 = _22 / ivec4(_23); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_slr.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_slr.asm.comp index 25245e63eb..78efaf3852 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_slr.asm.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/bitcast_slr.asm.comp @@ -15,13 +15,15 @@ layout(binding = 1, std430) buffer _4_6 void main() { - _6._m0 = _5._m1 >> uvec4(_5._m0); - _6._m0 = uvec4(_5._m0) >> _5._m1; - _6._m0 = _5._m1 >> _5._m1; - _6._m0 = uvec4(_5._m0) >> uvec4(_5._m0); - _6._m1 = ivec4(_5._m1 >> _5._m1); - _6._m1 = ivec4(uvec4(_5._m0) >> uvec4(_5._m0)); - _6._m1 = ivec4(_5._m1 >> uvec4(_5._m0)); - _6._m1 = ivec4(uvec4(_5._m0) >> _5._m1); + ivec4 _22 = _5._m0; + uvec4 _23 = _5._m1; + _6._m0 = _23 >> uvec4(_22); + _6._m0 = uvec4(_22) >> _23; + _6._m0 = _23 >> _23; + _6._m0 = uvec4(_22) >> uvec4(_22); + _6._m1 = ivec4(_23 >> _23); + _6._m1 = ivec4(uvec4(_22) >> uvec4(_22)); + _6._m1 = ivec4(_23 >> uvec4(_22)); + _6._m1 = ivec4(uvec4(_22) >> _23); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/hlsl-functionality.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/hlsl-functionality.asm.comp new file mode 100644 index 0000000000..29bc02c693 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/hlsl-functionality.asm.comp @@ -0,0 +1,19 @@ +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(binding = 0, std430) buffer Buf +{ + vec4 _data[]; +} Buf_1; + +layout(std430) buffer Buf_count +{ + int _count; +} Buf_count_1; + +void main() +{ + int _32 = atomicAdd(Buf_count_1._count, 1); + Buf_1._data[_32] = vec4(1.0); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/name-alias.asm.invalid.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/name-alias.asm.invalid.comp deleted file mode 100644 index 870b1df98d..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/name-alias.asm.invalid.comp +++ /dev/null @@ -1,37 +0,0 @@ -#version 310 es -layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; - -struct alias -{ - vec3 alias[100]; -}; - -struct alias_1 -{ - vec4 alias; - vec2 alias_1[10]; - alias alias_2[2]; -}; - -struct alias_2 -{ - vec4 alias; - alias_1 alias_1; -}; - -layout(binding = 0, std430) buffer alias_3 -{ - alias_2 alias; -} alias_4; - -layout(binding = 1, std140) buffer alias_5 -{ - alias_2 alias; -} alias_6; - -void main() -{ - alias_2 alias_7 = alias_4.alias; - alias_6.alias = alias_7; -} - diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/storage-buffer-basic.asm.comp b/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp similarity index 100% rename from deps/SPIRV-Cross/reference/shaders/asm/comp/storage-buffer-basic.asm.comp rename to deps/SPIRV-Cross/reference/opt/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag new file mode 100644 index 0000000000..b5e59f88bb --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag @@ -0,0 +1,13 @@ +#version 450 + +uniform sampler2D SPIRV_Cross_CombineduTexuSampler; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vUV; + +void main() +{ + FragColor = texture(SPIRV_Cross_CombineduTexuSampler, vUV); + FragColor += textureOffset(SPIRV_Cross_CombineduTexuSampler, vUV, ivec2(1)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag.vk new file mode 100644 index 0000000000..bce9808950 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag.vk @@ -0,0 +1,14 @@ +#version 450 + +layout(set = 0, binding = 1) uniform texture2D uTex; +layout(set = 0, binding = 0) uniform sampler uSampler; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vUV; + +void main() +{ + FragColor = texture(sampler2D(uTex, uSampler), vUV); + FragColor += textureOffset(sampler2D(uTex, uSampler), vUV, ivec2(1)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/complex-name-workarounds.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/complex-name-workarounds.asm.frag new file mode 100644 index 0000000000..c07f1657f4 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/complex-name-workarounds.asm.frag @@ -0,0 +1,16 @@ +#version 450 + +layout(location = 0) in vec4 _; +layout(location = 1) in vec4 a; +layout(location = 0) out vec4 b; + +void main() +{ + vec4 _28 = (_ + a) + _; + vec4 _34 = (_ - a) + a; + b = _28; + b = _34; + b = _28; + b = _34; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/composite-construct-struct-no-swizzle.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/composite-construct-struct-no-swizzle.asm.frag index 23af17026c..45e83dbc18 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/composite-construct-struct-no-swizzle.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/composite-construct-struct-no-swizzle.asm.frag @@ -2,12 +2,6 @@ precision mediump float; precision highp int; -struct SwizzleTest -{ - float a; - float b; -}; - layout(location = 0) in vec2 foo; layout(location = 0) out float FooOut; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/default-member-names.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/default-member-names.asm.frag index 2cf68fd201..7203f2be6a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/default-member-names.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/default-member-names.asm.frag @@ -1,33 +1,11 @@ #version 450 -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; -}; - layout(location = 0) out vec4 _3; -_10 _51; +float _57; void main() { - _3 = vec4(_51._m0, _51._m1, _51._m2, _51._m3); + _3 = vec4(_57); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/empty-struct.asm.frag similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/reference/opt/shaders/asm/frag/empty-struct.asm.frag diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/function-overload-alias.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/function-overload-alias.asm.frag index f726fabb18..16b4994148 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/function-overload-alias.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/function-overload-alias.asm.frag @@ -6,6 +6,6 @@ layout(location = 0) out vec4 FragColor; void main() { - FragColor = (((vec4(1.0) + vec4(1.0)) + (vec3(1.0).xyzz + vec4(1.0))) + (vec4(1.0) + vec4(2.0))) + (vec2(1.0).xyxy + vec4(2.0)); + FragColor = vec4(10.0); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..ab2749b4df --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uTexture; + +layout(location = 0) out ivec2 Size; + +void main() +{ + Size = textureSize(uTexture, 0) + textureSize(uTexture, 1); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag index ebf8c1201c..452fd6fb95 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag @@ -7,7 +7,7 @@ layout(location = 0) out vec4 _entryPointOutput; void main() { - ivec3 _122 = ivec3(int(gl_FragCoord.x * 1280.0), int(gl_FragCoord.y * 720.0), 0); - _entryPointOutput = ((texelFetch(SPIRV_Cross_CombinedSampledImageSPIRV_Cross_DummySampler, _122.xy, 0) + texelFetch(SPIRV_Cross_CombinedSampledImageSPIRV_Cross_DummySampler, _122.xy, 0)) + texture(SPIRV_Cross_CombinedSampledImageSampler, gl_FragCoord.xy)) + texture(SPIRV_Cross_CombinedSampledImageSampler, gl_FragCoord.xy); + ivec2 _152 = ivec3(int(gl_FragCoord.x * 1280.0), int(gl_FragCoord.y * 720.0), 0).xy; + _entryPointOutput = ((texelFetch(SPIRV_Cross_CombinedSampledImageSPIRV_Cross_DummySampler, _152, 0) + texelFetch(SPIRV_Cross_CombinedSampledImageSPIRV_Cross_DummySampler, _152, 0)) + texture(SPIRV_Cross_CombinedSampledImageSampler, gl_FragCoord.xy)) + texture(SPIRV_Cross_CombinedSampledImageSampler, gl_FragCoord.xy); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk index 433f5bc273..23acab0b16 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk @@ -2,13 +2,13 @@ layout(set = 0, binding = 0) uniform sampler Sampler; layout(set = 0, binding = 0) uniform texture2D SampledImage; -uniform sampler SPIRV_Cross_DummySampler; +layout(set = 0, binding = 0) uniform sampler SPIRV_Cross_DummySampler; layout(location = 0) out vec4 _entryPointOutput; void main() { - ivec3 _122 = ivec3(int(gl_FragCoord.x * 1280.0), int(gl_FragCoord.y * 720.0), 0); - _entryPointOutput = ((texelFetch(sampler2D(SampledImage, SPIRV_Cross_DummySampler), _122.xy, 0) + texelFetch(sampler2D(SampledImage, SPIRV_Cross_DummySampler), _122.xy, 0)) + texture(sampler2D(SampledImage, Sampler), gl_FragCoord.xy)) + texture(sampler2D(SampledImage, Sampler), gl_FragCoord.xy); + ivec2 _152 = ivec3(int(gl_FragCoord.x * 1280.0), int(gl_FragCoord.y * 720.0), 0).xy; + _entryPointOutput = ((texelFetch(sampler2D(SampledImage, SPIRV_Cross_DummySampler), _152, 0) + texelFetch(sampler2D(SampledImage, SPIRV_Cross_DummySampler), _152, 0)) + texture(sampler2D(SampledImage, Sampler), gl_FragCoord.xy)) + texture(sampler2D(SampledImage, Sampler), gl_FragCoord.xy); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-query-no-sampler.vk.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-query-no-sampler.vk.asm.frag new file mode 100644 index 0000000000..4a20c87c74 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-query-no-sampler.vk.asm.frag @@ -0,0 +1,9 @@ +#version 450 + +uniform sampler2D SPIRV_Cross_CombineduSampler2DSPIRV_Cross_DummySampler; +uniform sampler2DMS SPIRV_Cross_CombineduSampler2DMSSPIRV_Cross_DummySampler; + +void main() +{ +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-query-no-sampler.vk.asm.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-query-no-sampler.vk.asm.frag.vk new file mode 100644 index 0000000000..d1526a6a92 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/image-query-no-sampler.vk.asm.frag.vk @@ -0,0 +1,10 @@ +#version 450 + +layout(set = 0, binding = 0) uniform texture2D uSampler2D; +layout(set = 0, binding = 0) uniform texture2DMS uSampler2DMS; +layout(set = 0, binding = 0) uniform sampler SPIRV_Cross_DummySampler; + +void main() +{ +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..8a7f64d7f7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,40 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uImage; + +layout(location = 0) in vec4 v0; +layout(location = 0) out vec4 FragColor; + +void main() +{ + float phi; + vec4 _36; + int _51; + _51 = 0; + phi = 1.0; + _36 = vec4(1.0, 2.0, 1.0, 2.0); + for (;;) + { + FragColor = _36; + if (_51 < 4) + { + if (v0[_51] > 0.0) + { + vec2 _48 = vec2(phi); + _51++; + phi += 2.0; + _36 = textureLod(uImage, _48, 0.0); + continue; + } + else + { + break; + } + } + else + { + break; + } + } +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-body-dominator-continue-access.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-body-dominator-continue-access.asm.frag index 4fb4b75740..9f7a1f8744 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-body-dominator-continue-access.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-body-dominator-continue-access.asm.frag @@ -10,43 +10,73 @@ layout(binding = 0, std140) uniform Foo layout(location = 0) in vec3 fragWorld; layout(location = 0) out int _entryPointOutput; -mat4 _152; -uint _155; - -int GetCascade(vec3 fragWorldPosition) -{ - mat4 _153; - _153 = _152; - uint _156; - mat4 _157; - for (uint _151 = 0u; _151 < _11.shadowCascadesNum; _151 = _156 + uint(1), _153 = _157) - { - mat4 _154; - _154 = _153; - for (;;) - { - if (_11.test == 0) - { - _156 = _151; - _157 = mat4(vec4(0.5, 0.0, 0.0, 0.0), vec4(0.0, 0.5, 0.0, 0.0), vec4(0.0, 0.0, 0.5, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); - break; - } - _156 = _151; - _157 = mat4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); - break; - } - vec4 _92 = (_157 * _11.lightVP[_156]) * vec4(fragWorldPosition, 1.0); - if ((((_92.z >= 0.0) && (_92.z <= 1.0)) && (max(_92.x, _92.y) <= 1.0)) && (min(_92.x, _92.y) >= 0.0)) - { - return int(_156); - } - } - return -1; -} +mat4 _235; +int _245; void main() { - vec3 _123 = fragWorld; - _entryPointOutput = GetCascade(_123); + uint _229; + bool _231; + mat4 _234; + _234 = _235; + _231 = false; + _229 = 0u; + bool _251; + mat4 _232; + int _243; + bool _158; + for (;;) + { + _158 = _229 < _11.shadowCascadesNum; + if (_158) + { + bool _209 = _11.test == 0; + mat4 _233; + if (_209) + { + _233 = mat4(vec4(0.5, 0.0, 0.0, 0.0), vec4(0.0, 0.5, 0.0, 0.0), vec4(0.0, 0.0, 0.5, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); + } + else + { + _233 = _234; + } + bool _250 = _209 ? true : _231; + if (!_250) + { + _232 = mat4(vec4(1.0, 0.0, 0.0, 0.0), vec4(0.0, 1.0, 0.0, 0.0), vec4(0.0, 0.0, 1.0, 0.0), vec4(0.0, 0.0, 0.0, 1.0)); + } + else + { + _232 = _233; + } + _251 = _250 ? _250 : true; + vec4 _171 = (_232 * _11.lightVP[_229]) * vec4(fragWorld, 1.0); + float _218 = _171.z; + float _222 = _171.x; + float _224 = _171.y; + if ((((_218 >= 0.0) && (_218 <= 1.0)) && (max(_222, _224) <= 1.0)) && (min(_222, _224) >= 0.0)) + { + _243 = int(_229); + break; + } + else + { + _234 = _232; + _231 = _251; + _229++; + continue; + } + _234 = _232; + _231 = _251; + _229++; + continue; + } + else + { + _243 = _245; + break; + } + } + _entryPointOutput = (_158 ? true : false) ? _243 : (-1); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-header-to-continue.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-header-to-continue.asm.frag index f3a6b4eceb..c2dba928df 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-header-to-continue.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-header-to-continue.asm.frag @@ -28,11 +28,15 @@ void main() float _58; _55 = 0.0; _58 = 0.0; - float _64; - vec4 _72; - float _78; - for (int _60 = -3; _60 <= 3; _64 = float(_60), _72 = texture(SPIRV_Cross_CombinedmapTexturemapSampler, IN_uv + (vec2(0.0, _8.CB1.TextureSize.w) * _64)), _78 = exp(((-_64) * _64) * 0.2222220003604888916015625) * float(abs(_72.y - _50) < clamp((_50 * 80.0) * 0.0007999999797903001308441162109375, 7.999999797903001308441162109375e-05, 0.008000000379979610443115234375)), _55 += (_72.x * _78), _58 += _78, _60++) + for (int _60 = -3; _60 <= 3; ) { + float _64 = float(_60); + vec4 _72 = texture(SPIRV_Cross_CombinedmapTexturemapSampler, IN_uv + (vec2(0.0, _8.CB1.TextureSize.w) * _64)); + float _78 = exp(((-_64) * _64) * 0.2222220003604888916015625) * float(abs(_72.y - _50) < clamp(_50 * 0.06399999558925628662109375, 7.999999797903001308441162109375e-05, 0.008000000379979610443115234375)); + _55 += (_72.x * _78); + _58 += _78; + _60++; + continue; } _entryPointOutput = vec4(_55 / _58, _50, 0.0, 1.0); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-merge-to-continue.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-merge-to-continue.asm.frag new file mode 100644 index 0000000000..faf32edcf4 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/loop-merge-to-continue.asm.frag @@ -0,0 +1,21 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + FragColor = vec4(1.0); + int _50; + _50 = 0; + for (; _50 < 4; _50++) + { + for (int _51 = 0; _51 < 4; ) + { + FragColor += vec4(v0[(_50 + _51) & 3]); + _51++; + continue; + } + } +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..d88c0e36d9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,42 @@ +#version 310 es +precision mediump float; +precision highp int; + +const float _46[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0); +const vec4 _76[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + +layout(location = 0) out float FragColor; +layout(location = 0) flat in mediump int index; + +void main() +{ + vec4 foobar[4] = _76; + vec4 baz[4] = _76; + FragColor = _46[index]; + if (index < 10) + { + FragColor += _46[index ^ 1]; + } + else + { + FragColor += _46[index & 1]; + } + bool _99 = index > 30; + if (_99) + { + FragColor += _76[index & 3].y; + } + else + { + FragColor += _76[index & 1].x; + } + if (_99) + { + foobar[1].z = 20.0; + } + mediump int _37 = index & 3; + FragColor += foobar[_37].z; + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[_37].z; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/multi-for-loop-init.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/multi-for-loop-init.asm.frag index c41c77c701..6a177288af 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/multi-for-loop-init.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/multi-for-loop-init.asm.frag @@ -10,10 +10,13 @@ void main() FragColor = vec4(0.0); int _53 = 0; uint _54 = 1u; - for (; (_53 < 10) && (int(_54) < int(20u)); _53 += counter, _54 += uint(counter)) + for (; (_53 < 10) && (int(_54) < int(20u)); ) { FragColor += vec4(float(_53)); FragColor += vec4(float(_54)); + _54 += uint(counter); + _53 += counter; + continue; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/op-constant-null.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/op-constant-null.asm.frag index cb882cd7b1..873a64cb41 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/op-constant-null.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/op-constant-null.asm.frag @@ -2,12 +2,6 @@ precision mediump float; precision highp int; -struct D -{ - vec4 a; - float b; -}; - layout(location = 0) out float FragColor; void main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/phi-loop-variable.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/phi-loop-variable.asm.frag index 786ac74de5..05ce10adfa 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/phi-loop-variable.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/phi-loop-variable.asm.frag @@ -2,8 +2,5 @@ void main() { - for (int _22 = 35; _22 >= 0; _22--) - { - } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag new file mode 100644 index 0000000000..bdda0d6293 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag @@ -0,0 +1,18 @@ +#version 450 + +struct Registers +{ + int index; +}; + +uniform Registers registers; + +uniform sampler2D SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[4]; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = (texelFetch(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[registers.index], ivec2(10), 0) + texelFetch(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[registers.index], ivec2(4), 0)) + texelFetch(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[registers.index], ivec2(4), 0); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag index 560a4e79b9..89058f1434 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag @@ -1,7 +1,7 @@ #version 450 -layout(rgba32f) uniform writeonly imageBuffer RWTex; -uniform samplerBuffer Tex; +layout(binding = 0, rgba32f) uniform writeonly imageBuffer RWTex; +layout(binding = 1) uniform samplerBuffer Tex; layout(location = 0) out vec4 _entryPointOutput; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/selection-merge-to-continue.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/selection-merge-to-continue.asm.frag new file mode 100644 index 0000000000..05c17c7a66 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/selection-merge-to-continue.asm.frag @@ -0,0 +1,24 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + FragColor = vec4(1.0); + for (int _54 = 0; _54 < 4; _54++) + { + if (v0.x == 20.0) + { + FragColor += vec4(v0[_54 & 3]); + continue; + } + else + { + FragColor += vec4(v0[_54 & 1]); + continue; + } + continue; + } +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..05a3d7554f --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/srem.asm.frag @@ -0,0 +1,13 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) flat in ivec4 vA; +layout(location = 1) flat in ivec4 vB; + +void main() +{ + FragColor = vec4(vA - vB * (vA / vB)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/switch-label-shared-block.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/switch-label-shared-block.asm.frag new file mode 100644 index 0000000000..ade9044e35 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/switch-label-shared-block.asm.frag @@ -0,0 +1,33 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(location = 0) flat in mediump int vIndex; +layout(location = 0) out float FragColor; + +void main() +{ + highp float _19; + switch (vIndex) + { + case 0: + case 2: + { + _19 = 1.0; + break; + } + case 1: + default: + { + _19 = 3.0; + break; + } + case 8: + { + _19 = 8.0; + break; + } + } + FragColor = _19; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/switch-merge-to-continue.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/switch-merge-to-continue.asm.frag new file mode 100644 index 0000000000..ea4a25995a --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/switch-merge-to-continue.asm.frag @@ -0,0 +1,31 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(1.0); + for (int _52 = 0; _52 < 4; _52++) + { + switch (_52) + { + case 0: + { + FragColor.x += 1.0; + break; + } + case 1: + { + FragColor.y += 3.0; + break; + } + default: + { + FragColor.z += 3.0; + break; + } + } + continue; + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/temporary-name-alias.asm.frag similarity index 100% rename from deps/SPIRV-Cross/reference/shaders/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/reference/opt/shaders/asm/frag/temporary-name-alias.asm.frag diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/temporary-phi-hoisting.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/temporary-phi-hoisting.asm.frag index 3917594d98..1ecd61d744 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/temporary-phi-hoisting.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/temporary-phi-hoisting.asm.frag @@ -16,10 +16,11 @@ void main() { vec3 _28; _28 = vec3(0.0); - vec3 _29; - for (int _31 = 0; _31 < 4; _28 = _29, _31++) + for (int _31 = 0; _31 < 4; ) { - _29 = _28 + _6.g_MyStruct[_31].color.xyz; + _28 += _6.g_MyStruct[_31].color.xyz; + _31++; + continue; } _entryPointOutput = vec4(_28, 1.0); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..6193de0da9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uTexture; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = texelFetch(uTexture, ivec2(gl_FragCoord.xy), 0); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/undef-variable-store.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/undef-variable-store.asm.frag index 23576ed850..84eb23a242 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/undef-variable-store.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/undef-variable-store.asm.frag @@ -2,29 +2,8 @@ layout(location = 0) out vec4 _entryPointOutput; -vec4 _38; -vec4 _50; - void main() { - vec4 _51; - _51 = _50; - vec4 _52; - for (;;) - { - if (0.0 != 0.0) - { - _52 = vec4(1.0, 0.0, 0.0, 1.0); - break; - } - else - { - _52 = vec4(1.0, 1.0, 0.0, 1.0); - break; - } - _52 = _38; - break; - } - _entryPointOutput = _52; + _entryPointOutput = vec4(1.0, 1.0, 0.0, 1.0); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unknown-depth-state.asm.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unknown-depth-state.asm.vk.frag new file mode 100644 index 0000000000..6953ec61d0 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unknown-depth-state.asm.vk.frag @@ -0,0 +1,13 @@ +#version 450 + +layout(binding = 0) uniform sampler2DShadow uShadow; +uniform sampler2DShadow SPIRV_Cross_CombineduTextureuSampler; + +layout(location = 0) in vec3 vUV; +layout(location = 0) out float FragColor; + +void main() +{ + FragColor = texture(uShadow, vec3(vUV.xy, vUV.z)) + texture(SPIRV_Cross_CombineduTextureuSampler, vec3(vUV.xy, vUV.z)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unknown-depth-state.asm.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unknown-depth-state.asm.vk.frag.vk new file mode 100644 index 0000000000..2f997036f5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unknown-depth-state.asm.vk.frag.vk @@ -0,0 +1,14 @@ +#version 450 + +layout(set = 0, binding = 0) uniform sampler2DShadow uShadow; +layout(set = 0, binding = 1) uniform texture2D uTexture; +layout(set = 0, binding = 2) uniform samplerShadow uSampler; + +layout(location = 0) in vec3 vUV; +layout(location = 0) out float FragColor; + +void main() +{ + FragColor = texture(uShadow, vec3(vUV.xy, vUV.z)) + texture(sampler2DShadow(uTexture, uSampler), vec3(vUV.xy, vUV.z)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unreachable.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unreachable.asm.frag index d8126d752e..eb7e8a912c 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unreachable.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/unreachable.asm.frag @@ -3,24 +3,21 @@ layout(location = 0) flat in int counter; layout(location = 0) out vec4 FragColor; -vec4 _21; - void main() { - vec4 _33; - do + bool _29; + for (;;) { - if (counter == 10) + _29 = counter == 10; + if (_29) { - _33 = vec4(10.0); break; } else { - _33 = vec4(30.0); break; } - } while (false); - FragColor = _33; + } + FragColor = mix(vec4(30.0), vec4(10.0), bvec4(_29)); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag index 1c211caa6d..e5408d533b 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/vector-shuffle-oom.asm.frag @@ -94,209 +94,209 @@ _28 _74; void main() { - _28 _77 = _74; - _77._m0 = vec4(0.0); vec2 _82 = gl_FragCoord.xy * _19._m23.xy; vec4 _88 = _7._m2 * _7._m0.xyxy; - vec2 _97 = clamp(_82 + (vec3(0.0, -2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _95 = _88.xy; + vec2 _96 = _88.zw; + vec2 _97 = clamp(_82 + (vec2(0.0, -2.0) * _7._m0.xy), _95, _96); vec3 _109 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _97, 0.0).w * _7._m1, 0.0, 1.0); vec4 _113 = textureLod(SPIRV_Cross_Combined_1, _97, 0.0); + float _114 = _113.y; vec3 _129; - if (_113.y > 0.0) + if (_114 > 0.0) { - _129 = _109 + (textureLod(SPIRV_Cross_Combined_2, _97, 0.0).xyz * clamp(_113.y * _113.z, 0.0, 1.0)); + _129 = _109 + (textureLod(SPIRV_Cross_Combined_2, _97, 0.0).xyz * clamp(_114 * _113.z, 0.0, 1.0)); } else { _129 = _109; } - vec3 _133 = vec4(0.0).xyz + (_129 * 0.5); - vec4 _134 = vec4(_133.x, _133.y, _133.z, vec4(0.0).w); - _28 _135 = _77; - _135._m0 = _134; - vec2 _144 = clamp(_82 + (vec3(-1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec3 _130 = _129 * 0.5; + vec4 _134 = vec4(_130.x, _130.y, _130.z, vec4(0.0).w); + vec2 _144 = clamp(_82 + (vec2(-1.0) * _7._m0.xy), _95, _96); vec3 _156 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _144, 0.0).w * _7._m1, 0.0, 1.0); vec4 _160 = textureLod(SPIRV_Cross_Combined_1, _144, 0.0); + float _161 = _160.y; vec3 _176; - if (_160.y > 0.0) + if (_161 > 0.0) { - _176 = _156 + (textureLod(SPIRV_Cross_Combined_2, _144, 0.0).xyz * clamp(_160.y * _160.z, 0.0, 1.0)); + _176 = _156 + (textureLod(SPIRV_Cross_Combined_2, _144, 0.0).xyz * clamp(_161 * _160.z, 0.0, 1.0)); } else { _176 = _156; } - vec3 _180 = _134.xyz + (_176 * 0.5); + vec3 _177 = _176 * 0.5; + vec3 _180 = _134.xyz + _177; vec4 _181 = vec4(_180.x, _180.y, _180.z, _134.w); - _28 _182 = _135; - _182._m0 = _181; - vec2 _191 = clamp(_82 + (vec3(0.0, -1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _191 = clamp(_82 + (vec2(0.0, -1.0) * _7._m0.xy), _95, _96); vec3 _203 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _191, 0.0).w * _7._m1, 0.0, 1.0); vec4 _207 = textureLod(SPIRV_Cross_Combined_1, _191, 0.0); + float _208 = _207.y; vec3 _223; - if (_207.y > 0.0) + if (_208 > 0.0) { - _223 = _203 + (textureLod(SPIRV_Cross_Combined_2, _191, 0.0).xyz * clamp(_207.y * _207.z, 0.0, 1.0)); + _223 = _203 + (textureLod(SPIRV_Cross_Combined_2, _191, 0.0).xyz * clamp(_208 * _207.z, 0.0, 1.0)); } else { _223 = _203; } - vec3 _227 = _181.xyz + (_223 * 0.75); + vec3 _224 = _223 * 0.75; + vec3 _227 = _181.xyz + _224; vec4 _228 = vec4(_227.x, _227.y, _227.z, _181.w); - _28 _229 = _182; - _229._m0 = _228; - vec2 _238 = clamp(_82 + (vec3(1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _238 = clamp(_82 + (vec2(1.0, -1.0) * _7._m0.xy), _95, _96); vec3 _250 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _238, 0.0).w * _7._m1, 0.0, 1.0); vec4 _254 = textureLod(SPIRV_Cross_Combined_1, _238, 0.0); + float _255 = _254.y; vec3 _270; - if (_254.y > 0.0) + if (_255 > 0.0) { - _270 = _250 + (textureLod(SPIRV_Cross_Combined_2, _238, 0.0).xyz * clamp(_254.y * _254.z, 0.0, 1.0)); + _270 = _250 + (textureLod(SPIRV_Cross_Combined_2, _238, 0.0).xyz * clamp(_255 * _254.z, 0.0, 1.0)); } else { _270 = _250; } - vec3 _274 = _228.xyz + (_270 * 0.5); + vec3 _271 = _270 * 0.5; + vec3 _274 = _228.xyz + _271; vec4 _275 = vec4(_274.x, _274.y, _274.z, _228.w); - _28 _276 = _229; - _276._m0 = _275; - vec2 _285 = clamp(_82 + (vec3(-2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _285 = clamp(_82 + (vec2(-2.0, 0.0) * _7._m0.xy), _95, _96); vec3 _297 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _285, 0.0).w * _7._m1, 0.0, 1.0); vec4 _301 = textureLod(SPIRV_Cross_Combined_1, _285, 0.0); + float _302 = _301.y; vec3 _317; - if (_301.y > 0.0) + if (_302 > 0.0) { - _317 = _297 + (textureLod(SPIRV_Cross_Combined_2, _285, 0.0).xyz * clamp(_301.y * _301.z, 0.0, 1.0)); + _317 = _297 + (textureLod(SPIRV_Cross_Combined_2, _285, 0.0).xyz * clamp(_302 * _301.z, 0.0, 1.0)); } else { _317 = _297; } - vec3 _321 = _275.xyz + (_317 * 0.5); + vec3 _318 = _317 * 0.5; + vec3 _321 = _275.xyz + _318; vec4 _322 = vec4(_321.x, _321.y, _321.z, _275.w); - _28 _323 = _276; - _323._m0 = _322; - vec2 _332 = clamp(_82 + (vec3(-1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _332 = clamp(_82 + (vec2(-1.0, 0.0) * _7._m0.xy), _95, _96); vec3 _344 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _332, 0.0).w * _7._m1, 0.0, 1.0); vec4 _348 = textureLod(SPIRV_Cross_Combined_1, _332, 0.0); + float _349 = _348.y; vec3 _364; - if (_348.y > 0.0) + if (_349 > 0.0) { - _364 = _344 + (textureLod(SPIRV_Cross_Combined_2, _332, 0.0).xyz * clamp(_348.y * _348.z, 0.0, 1.0)); + _364 = _344 + (textureLod(SPIRV_Cross_Combined_2, _332, 0.0).xyz * clamp(_349 * _348.z, 0.0, 1.0)); } else { _364 = _344; } - vec3 _368 = _322.xyz + (_364 * 0.75); + vec3 _365 = _364 * 0.75; + vec3 _368 = _322.xyz + _365; vec4 _369 = vec4(_368.x, _368.y, _368.z, _322.w); - _28 _370 = _323; - _370._m0 = _369; - vec2 _379 = clamp(_82 + (vec3(0.0, 0.0, 1.0).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _379 = clamp(_82, _95, _96); vec3 _391 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _379, 0.0).w * _7._m1, 0.0, 1.0); vec4 _395 = textureLod(SPIRV_Cross_Combined_1, _379, 0.0); + float _396 = _395.y; vec3 _411; - if (_395.y > 0.0) + if (_396 > 0.0) { - _411 = _391 + (textureLod(SPIRV_Cross_Combined_2, _379, 0.0).xyz * clamp(_395.y * _395.z, 0.0, 1.0)); + _411 = _391 + (textureLod(SPIRV_Cross_Combined_2, _379, 0.0).xyz * clamp(_396 * _395.z, 0.0, 1.0)); } else { _411 = _391; } - vec3 _415 = _369.xyz + (_411 * 1.0); + vec3 _412 = _411 * 1.0; + vec3 _415 = _369.xyz + _412; vec4 _416 = vec4(_415.x, _415.y, _415.z, _369.w); - _28 _417 = _370; - _417._m0 = _416; - vec2 _426 = clamp(_82 + (vec3(1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _426 = clamp(_82 + (vec2(1.0, 0.0) * _7._m0.xy), _95, _96); vec3 _438 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _426, 0.0).w * _7._m1, 0.0, 1.0); vec4 _442 = textureLod(SPIRV_Cross_Combined_1, _426, 0.0); + float _443 = _442.y; vec3 _458; - if (_442.y > 0.0) + if (_443 > 0.0) { - _458 = _438 + (textureLod(SPIRV_Cross_Combined_2, _426, 0.0).xyz * clamp(_442.y * _442.z, 0.0, 1.0)); + _458 = _438 + (textureLod(SPIRV_Cross_Combined_2, _426, 0.0).xyz * clamp(_443 * _442.z, 0.0, 1.0)); } else { _458 = _438; } - vec3 _462 = _416.xyz + (_458 * 0.75); + vec3 _459 = _458 * 0.75; + vec3 _462 = _416.xyz + _459; vec4 _463 = vec4(_462.x, _462.y, _462.z, _416.w); - _28 _464 = _417; - _464._m0 = _463; - vec2 _473 = clamp(_82 + (vec3(2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _473 = clamp(_82 + (vec2(2.0, 0.0) * _7._m0.xy), _95, _96); vec3 _485 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _473, 0.0).w * _7._m1, 0.0, 1.0); vec4 _489 = textureLod(SPIRV_Cross_Combined_1, _473, 0.0); + float _490 = _489.y; vec3 _505; - if (_489.y > 0.0) + if (_490 > 0.0) { - _505 = _485 + (textureLod(SPIRV_Cross_Combined_2, _473, 0.0).xyz * clamp(_489.y * _489.z, 0.0, 1.0)); + _505 = _485 + (textureLod(SPIRV_Cross_Combined_2, _473, 0.0).xyz * clamp(_490 * _489.z, 0.0, 1.0)); } else { _505 = _485; } - vec3 _509 = _463.xyz + (_505 * 0.5); + vec3 _506 = _505 * 0.5; + vec3 _509 = _463.xyz + _506; vec4 _510 = vec4(_509.x, _509.y, _509.z, _463.w); - _28 _511 = _464; - _511._m0 = _510; - vec2 _520 = clamp(_82 + (vec3(-1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _520 = clamp(_82 + (vec2(-1.0, 1.0) * _7._m0.xy), _95, _96); vec3 _532 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _520, 0.0).w * _7._m1, 0.0, 1.0); vec4 _536 = textureLod(SPIRV_Cross_Combined_1, _520, 0.0); + float _537 = _536.y; vec3 _552; - if (_536.y > 0.0) + if (_537 > 0.0) { - _552 = _532 + (textureLod(SPIRV_Cross_Combined_2, _520, 0.0).xyz * clamp(_536.y * _536.z, 0.0, 1.0)); + _552 = _532 + (textureLod(SPIRV_Cross_Combined_2, _520, 0.0).xyz * clamp(_537 * _536.z, 0.0, 1.0)); } else { _552 = _532; } - vec3 _556 = _510.xyz + (_552 * 0.5); + vec3 _553 = _552 * 0.5; + vec3 _556 = _510.xyz + _553; vec4 _557 = vec4(_556.x, _556.y, _556.z, _510.w); - _28 _558 = _511; - _558._m0 = _557; - vec2 _567 = clamp(_82 + (vec3(0.0, 1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _567 = clamp(_82 + (vec2(0.0, 1.0) * _7._m0.xy), _95, _96); vec3 _579 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _567, 0.0).w * _7._m1, 0.0, 1.0); vec4 _583 = textureLod(SPIRV_Cross_Combined_1, _567, 0.0); + float _584 = _583.y; vec3 _599; - if (_583.y > 0.0) + if (_584 > 0.0) { - _599 = _579 + (textureLod(SPIRV_Cross_Combined_2, _567, 0.0).xyz * clamp(_583.y * _583.z, 0.0, 1.0)); + _599 = _579 + (textureLod(SPIRV_Cross_Combined_2, _567, 0.0).xyz * clamp(_584 * _583.z, 0.0, 1.0)); } else { _599 = _579; } - vec3 _603 = _557.xyz + (_599 * 0.75); + vec3 _600 = _599 * 0.75; + vec3 _603 = _557.xyz + _600; vec4 _604 = vec4(_603.x, _603.y, _603.z, _557.w); - _28 _605 = _558; - _605._m0 = _604; - vec2 _614 = clamp(_82 + (vec3(1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _614 = clamp(_82 + _7._m0.xy, _95, _96); vec3 _626 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _614, 0.0).w * _7._m1, 0.0, 1.0); vec4 _630 = textureLod(SPIRV_Cross_Combined_1, _614, 0.0); + float _631 = _630.y; vec3 _646; - if (_630.y > 0.0) + if (_631 > 0.0) { - _646 = _626 + (textureLod(SPIRV_Cross_Combined_2, _614, 0.0).xyz * clamp(_630.y * _630.z, 0.0, 1.0)); + _646 = _626 + (textureLod(SPIRV_Cross_Combined_2, _614, 0.0).xyz * clamp(_631 * _630.z, 0.0, 1.0)); } else { _646 = _626; } - vec3 _650 = _604.xyz + (_646 * 0.5); + vec3 _647 = _646 * 0.5; + vec3 _650 = _604.xyz + _647; vec4 _651 = vec4(_650.x, _650.y, _650.z, _604.w); - _28 _652 = _605; - _652._m0 = _651; - vec2 _661 = clamp(_82 + (vec3(0.0, 2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); + vec2 _661 = clamp(_82 + (vec2(0.0, 2.0) * _7._m0.xy), _95, _96); vec3 _673 = _11._m5 * clamp(textureLod(SPIRV_Cross_Combined, _661, 0.0).w * _7._m1, 0.0, 1.0); vec4 _677 = textureLod(SPIRV_Cross_Combined_1, _661, 0.0); + float _678 = _677.y; vec3 _693; - if (_677.y > 0.0) + if (_678 > 0.0) { - _693 = _673 + (textureLod(SPIRV_Cross_Combined_2, _661, 0.0).xyz * clamp(_677.y * _677.z, 0.0, 1.0)); + _693 = _673 + (textureLod(SPIRV_Cross_Combined_2, _661, 0.0).xyz * clamp(_678 * _677.z, 0.0, 1.0)); } else { @@ -304,10 +304,8 @@ void main() } vec3 _697 = _651.xyz + (_693 * 0.5); vec4 _698 = vec4(_697.x, _697.y, _697.z, _651.w); - _28 _699 = _652; - _699._m0 = _698; - vec3 _702 = _698.xyz / vec3(((((((((((((0.0 + 0.5) + 0.5) + 0.75) + 0.5) + 0.5) + 0.75) + 1.0) + 0.75) + 0.5) + 0.5) + 0.75) + 0.5) + 0.5); - _28 _704 = _699; + vec3 _702 = _698.xyz * vec3(0.125); + _28 _704 = _74; _704._m0 = vec4(_702.x, _702.y, _702.z, _698.w); _28 _705 = _704; _705._m0.w = 1.0; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/inout-split-access-chain-handle.asm.geom b/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/inout-split-access-chain-handle.asm.geom new file mode 100644 index 0000000000..ca1381cff6 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/inout-split-access-chain-handle.asm.geom @@ -0,0 +1,9 @@ +#version 440 +layout(triangles) in; +layout(max_vertices = 5, triangle_strip) out; + +void main() +{ + gl_Position = gl_in[0].gl_Position; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/split-access-chain-input.asm.geom b/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/split-access-chain-input.asm.geom new file mode 100644 index 0000000000..511d87fcbe --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/split-access-chain-input.asm.geom @@ -0,0 +1,9 @@ +#version 440 +layout(triangles) in; +layout(max_vertices = 3, triangle_strip) out; + +void main() +{ + gl_Position = gl_in[0].gl_Position; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/store-uint-layer.invalid.asm.geom b/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/store-uint-layer.invalid.asm.geom new file mode 100644 index 0000000000..c768d5da86 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/geom/store-uint-layer.invalid.asm.geom @@ -0,0 +1,41 @@ +#version 450 +layout(triangles) in; +layout(max_vertices = 3, triangle_strip) out; + +struct VertexOutput +{ + vec4 pos; +}; + +struct GeometryOutput +{ + vec4 pos; + uint layer; +}; + +void _main(VertexOutput _input[3], GeometryOutput stream) +{ + GeometryOutput _output; + _output.layer = 1u; + for (int v = 0; v < 3; v++) + { + _output.pos = _input[v].pos; + gl_Position = _output.pos; + gl_Layer = int(_output.layer); + EmitVertex(); + } + EndPrimitive(); +} + +void main() +{ + VertexOutput _input[3]; + _input[0].pos = gl_in[0].gl_Position; + _input[1].pos = gl_in[1].gl_Position; + _input[2].pos = gl_in[2].gl_Position; + VertexOutput param[3] = _input; + GeometryOutput param_1; + _main(param, param_1); + GeometryOutput stream = param_1; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc b/deps/SPIRV-Cross/reference/opt/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc deleted file mode 100644 index dc43d91a9b..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc +++ /dev/null @@ -1,81 +0,0 @@ -#version 450 -layout(vertices = 3) out; - -struct VertexOutput -{ - vec4 pos; - vec2 uv; -}; - -struct HSOut -{ - vec4 pos; - vec2 uv; -}; - -struct HSConstantOut -{ - float EdgeTess[3]; - float InsideTess; -}; - -struct VertexOutput_1 -{ - vec2 uv; -}; - -struct HSOut_1 -{ - vec2 uv; -}; - -layout(location = 0) in VertexOutput_1 p[]; -layout(location = 0) out HSOut_1 _entryPointOutput[3]; - -void main() -{ - VertexOutput p_1[3]; - p_1[0].pos = gl_in[0].gl_Position; - p_1[0].uv = p[0].uv; - p_1[1].pos = gl_in[1].gl_Position; - p_1[1].uv = p[1].uv; - p_1[2].pos = gl_in[2].gl_Position; - p_1[2].uv = p[2].uv; - VertexOutput param[3] = p_1; - HSOut _158; - HSOut _197 = _158; - _197.pos = param[gl_InvocationID].pos; - HSOut _199 = _197; - _199.uv = param[gl_InvocationID].uv; - _158 = _199; - gl_out[gl_InvocationID].gl_Position = param[gl_InvocationID].pos; - _entryPointOutput[gl_InvocationID].uv = param[gl_InvocationID].uv; - barrier(); - if (int(gl_InvocationID) == 0) - { - VertexOutput param_1[3] = p_1; - vec2 _174 = vec2(1.0) + param_1[0].uv; - float _175 = _174.x; - HSConstantOut _169; - HSConstantOut _205 = _169; - _205.EdgeTess[0] = _175; - vec2 _180 = vec2(1.0) + param_1[0].uv; - float _181 = _180.x; - HSConstantOut _207 = _205; - _207.EdgeTess[1] = _181; - vec2 _186 = vec2(1.0) + param_1[0].uv; - float _187 = _186.x; - HSConstantOut _209 = _207; - _209.EdgeTess[2] = _187; - vec2 _192 = vec2(1.0) + param_1[0].uv; - float _193 = _192.x; - HSConstantOut _211 = _209; - _211.InsideTess = _193; - _169 = _211; - gl_TessLevelOuter[0] = _175; - gl_TessLevelOuter[1] = _181; - gl_TessLevelOuter[2] = _187; - gl_TessLevelInner[0] = _193; - } -} - diff --git a/deps/SPIRV-Cross/reference/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc b/deps/SPIRV-Cross/reference/opt/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc similarity index 100% rename from deps/SPIRV-Cross/reference/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc rename to deps/SPIRV-Cross/reference/opt/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/empty-io.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/empty-io.asm.vert index 5286269337..3819a71dd2 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/empty-io.asm.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/empty-io.asm.vert @@ -1,13 +1,8 @@ #version 450 -struct VSInput -{ - vec4 position; -}; - struct VSOutput { - vec4 position; + int empty_struct_member; }; layout(location = 0) in vec4 position; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/global-builtin.sso.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/global-builtin.sso.asm.vert index 2fc44c526e..20cb3b1704 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/global-builtin.sso.asm.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/global-builtin.sso.asm.vert @@ -8,15 +8,9 @@ out gl_PerVertex struct VSOut { float a; - vec4 pos; }; -struct VSOut_1 -{ - float a; -}; - -layout(location = 0) out VSOut_1 _entryPointOutput; +layout(location = 0) out VSOut _entryPointOutput; void main() { diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert new file mode 100644 index 0000000000..baadbf0216 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert @@ -0,0 +1,16 @@ +#version 450 + +layout(location = 0) flat out int _4; + +void main() +{ + vec4 _64 = vec4(0.0); + _64.y = float(((-10) + 2)); + vec4 _68 = _64; + _68.z = float((100u % 5u)); + vec4 _52 = _68 + vec4(ivec4(20, 30, 0, 0)); + vec2 _56 = _52.xy + vec2(ivec2(ivec4(20, 30, 0, 0).y, ivec4(20, 30, 0, 0).x)); + gl_Position = vec4(_56.x, _56.y, _52.z, _52.w); + _4 = ivec4(20, 30, 0, 0).y; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk new file mode 100644 index 0000000000..69daed106a --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk @@ -0,0 +1,24 @@ +#version 450 + +layout(constant_id = 201) const int _7 = -10; +layout(constant_id = 202) const uint _8 = 100u; +const int _20 = (_7 + 2); +const uint _25 = (_8 % 5u); +const ivec4 _30 = ivec4(20, 30, _20, _20); +const ivec2 _32 = ivec2(_30.y, _30.x); +const int _33 = _30.y; + +layout(location = 0) flat out int _4; + +void main() +{ + vec4 _64 = vec4(0.0); + _64.y = float(_20); + vec4 _68 = _64; + _68.z = float(_25); + vec4 _52 = _68 + vec4(_30); + vec2 _56 = _52.xy + vec2(_32); + gl_Position = vec4(_56.x, _56.y, _52.z, _52.w); + _4 = _33; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..c25e9bbe5b --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,9 @@ +#version 450 + +uniform int SPIRV_Cross_BaseInstance; + +void main() +{ + gl_Position = vec4(float(uint(gl_VertexID) + uint((gl_InstanceID + SPIRV_Cross_BaseInstance)))); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/bake_gradient.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/bake_gradient.comp index 0af4833926..69634d5d84 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/bake_gradient.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/bake_gradient.comp @@ -15,9 +15,12 @@ layout(binding = 3, rgba16f) uniform writeonly mediump image2D iGradJacobian; void main() { vec4 _59 = (vec2(gl_GlobalInvocationID.xy) * _46.uInvSize.xy).xyxy + (_46.uInvSize * 0.5); - vec2 _157 = ((textureLodOffset(uDisplacement, _59.zw, 0.0, ivec2(1, 0)).xy - textureLodOffset(uDisplacement, _59.zw, 0.0, ivec2(-1, 0)).xy) * 0.60000002384185791015625) * _46.uScale.z; - vec2 _161 = ((textureLodOffset(uDisplacement, _59.zw, 0.0, ivec2(0, 1)).xy - textureLodOffset(uDisplacement, _59.zw, 0.0, ivec2(0, -1)).xy) * 0.60000002384185791015625) * _46.uScale.z; - imageStore(iHeightDisplacement, ivec2(gl_GlobalInvocationID.xy), vec4(textureLod(uHeight, _59.xy, 0.0).x, 0.0, 0.0, 0.0)); - imageStore(iGradJacobian, ivec2(gl_GlobalInvocationID.xy), vec4((_46.uScale.xy * 0.5) * vec2(textureLodOffset(uHeight, _59.xy, 0.0, ivec2(1, 0)).x - textureLodOffset(uHeight, _59.xy, 0.0, ivec2(-1, 0)).x, textureLodOffset(uHeight, _59.xy, 0.0, ivec2(0, 1)).x - textureLodOffset(uHeight, _59.xy, 0.0, ivec2(0, -1)).x), ((1.0 + _157.x) * (1.0 + _161.y)) - (_157.y * _161.x), 0.0)); + vec2 _67 = _59.xy; + vec2 _128 = _59.zw; + vec2 _157 = ((textureLodOffset(uDisplacement, _128, 0.0, ivec2(1, 0)).xy - textureLodOffset(uDisplacement, _128, 0.0, ivec2(-1, 0)).xy) * 0.60000002384185791015625) * _46.uScale.z; + vec2 _161 = ((textureLodOffset(uDisplacement, _128, 0.0, ivec2(0, 1)).xy - textureLodOffset(uDisplacement, _128, 0.0, ivec2(0, -1)).xy) * 0.60000002384185791015625) * _46.uScale.z; + ivec2 _172 = ivec2(gl_GlobalInvocationID.xy); + imageStore(iHeightDisplacement, _172, vec4(textureLod(uHeight, _67, 0.0).x, 0.0, 0.0, 0.0)); + imageStore(iGradJacobian, _172, vec4((_46.uScale.xy * 0.5) * vec2(textureLodOffset(uHeight, _67, 0.0, ivec2(1, 0)).x - textureLodOffset(uHeight, _67, 0.0, ivec2(-1, 0)).x, textureLodOffset(uHeight, _67, 0.0, ivec2(0, 1)).x - textureLodOffset(uHeight, _67, 0.0, ivec2(0, -1)).x), ((1.0 + _157.x) * (1.0 + _161.y)) - (_157.y * _161.x), 0.0)); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/casts.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/casts.comp index 11ef36287b..43de6aa6a0 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/casts.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/casts.comp @@ -6,13 +6,13 @@ layout(binding = 1, std430) buffer SSBO1 ivec4 outputs[]; } _21; -layout(binding = 0, std430) buffer SSBO0 +layout(binding = 0, std430) buffer _19_27 { - ivec4 inputs[]; + ivec4 outputs[]; } _27; void main() { - _21.outputs[gl_GlobalInvocationID.x] = mix(ivec4(0), ivec4(1), notEqual((_27.inputs[gl_GlobalInvocationID.x] & ivec4(3)), ivec4(uvec4(0u)))); + _21.outputs[gl_GlobalInvocationID.x] = mix(ivec4(0), ivec4(1), notEqual((_27.outputs[gl_GlobalInvocationID.x] & ivec4(3)), ivec4(uvec4(0u)))); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/cfg.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/cfg.comp index c2c7136bbd..45b219ec50 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/cfg.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/cfg.comp @@ -6,7 +6,7 @@ layout(binding = 0, std430) buffer SSBO float data; } _11; -float _180; +float _183; void main() { @@ -31,26 +31,15 @@ void main() break; } } - switch (int(_11.data)) + float _180; + _180 = _183; + for (int _179 = 0; _179 < 20; ) { - case 0: - { - break; - } - case 1: - { - break; - } + _180 += 10.0; + _179++; + continue; } - float _181; - _181 = _180; - for (int _179 = 0; _179 < 20; _179++, _181 += 10.0) - { - } - _11.data = _181; - do - { - } while (_180 != 20.0); _11.data = _180; + _11.data = _183; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/composite-construct.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/composite-construct.comp index 5371f7e528..3e44af9905 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/composite-construct.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/composite-construct.comp @@ -1,26 +1,18 @@ #version 310 es layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; -struct Composite -{ - vec4 a[2]; - vec4 b[2]; -}; - layout(binding = 0, std430) buffer SSBO0 { vec4 as[]; } _41; -layout(binding = 1, std430) buffer SSBO1 +layout(binding = 1, std430) buffer _39_55 { - vec4 bs[]; + vec4 as[]; } _55; void main() { - vec4 _60[2] = vec4[](_41.as[gl_GlobalInvocationID.x], _55.bs[gl_GlobalInvocationID.x]); - vec4 param[3][2] = vec4[][](_60, vec4[](vec4(10.0), vec4(30.0)), _60); - _41.as[gl_GlobalInvocationID.x] = ((param[0][0] + param[2][1]) + param[0][1]) + param[1][0]; + _41.as[gl_GlobalInvocationID.x] = ((_41.as[gl_GlobalInvocationID.x] + _55.as[gl_GlobalInvocationID.x]) + _55.as[gl_GlobalInvocationID.x]) + vec4(10.0); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/defer-parens.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/defer-parens.comp index 51fa7f0abf..c48fb9e080 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/defer-parens.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/defer-parens.comp @@ -10,10 +10,11 @@ layout(binding = 0, std430) buffer SSBO void main() { vec4 _17 = _13.data; - _13.data = vec4(_17.x, _17.yz + vec2(10.0), _17.w); + vec2 _28 = _17.yz + vec2(10.0); + _13.data = vec4(_17.x, _28, _17.w); _13.data = (_17 + _17) + _17; - _13.data = (_17.yz + vec2(10.0)).xxyy; - _13.data = vec4((_17.yz + vec2(10.0)).y); + _13.data = _28.xxyy; + _13.data = vec4(_28.y); _13.data = vec4((_17.zw + vec2(10.0))[_13.index]); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/dowhile.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/dowhile.comp index 61a3735d13..c62a89e467 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/dowhile.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/dowhile.comp @@ -27,7 +27,6 @@ void main() if (i < 16) { _56 = _42; - continue; } else { diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/generate_height.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/generate_height.comp index 1b5e0c3dc1..ff96e7505a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/generate_height.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/generate_height.comp @@ -4,51 +4,52 @@ layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; layout(binding = 0, std430) readonly buffer Distribution { vec2 distribution[]; -} _136; +} _137; layout(binding = 2, std140) uniform UBO { vec4 uModTime; -} _165; +} _166; layout(binding = 1, std430) writeonly buffer HeightmapFFT { uint heights[]; -} _224; +} _225; void main() { - uvec2 _263 = uvec2(64u, 1u) * gl_NumWorkGroups.xy; - uvec2 _268 = _263 - gl_GlobalInvocationID.xy; - bvec2 _270 = equal(gl_GlobalInvocationID.xy, uvec2(0u)); - uint _470; - if (_270.x) + uvec2 _264 = uvec2(64u, 1u) * gl_NumWorkGroups.xy; + uvec2 _269 = _264 - gl_GlobalInvocationID.xy; + bvec2 _271 = equal(gl_GlobalInvocationID.xy, uvec2(0u)); + uint _475; + if (_271.x) { - _470 = 0u; + _475 = 0u; } else { - _470 = _268.x; + _475 = _269.x; } - uint _471; - if (_270.y) + uint _476; + if (_271.y) { - _471 = 0u; + _476 = 0u; } else { - _471 = _268.y; + _476 = _269.y; } - vec2 _296 = vec2(gl_GlobalInvocationID.xy); - vec2 _298 = vec2(_263); - float _308 = sqrt(9.81000041961669921875 * length(_165.uModTime.xy * mix(_296, _296 - _298, greaterThan(_296, _298 * 0.5)))) * _165.uModTime.z; - float _310 = cos(_308); - float _312 = sin(_308); - vec2 _315 = vec2(_310, _312); - vec2 _394 = _315.yy * (_136.distribution[(gl_GlobalInvocationID.xy.y * _263.x) + gl_GlobalInvocationID.xy.x]).yx; - vec2 _320 = vec2(_310, _312); - vec2 _420 = _320.yy * (_136.distribution[(_471 * _263.x) + _470]).yx; - vec2 _428 = ((_136.distribution[(_471 * _263.x) + _470]) * _320.xx) + vec2(-_420.x, _420.y); - _224.heights[(gl_GlobalInvocationID.xy.y * _263.x) + gl_GlobalInvocationID.xy.x] = packHalf2x16((((_136.distribution[(gl_GlobalInvocationID.xy.y * _263.x) + gl_GlobalInvocationID.xy.x]) * _315.xx) + vec2(-_394.x, _394.y)) + vec2(_428.x, -_428.y)); + uint _448 = _264.x; + uint _280 = (gl_GlobalInvocationID.y * _448) + gl_GlobalInvocationID.x; + vec2 _297 = vec2(gl_GlobalInvocationID.xy); + vec2 _299 = vec2(_264); + float _309 = sqrt(9.81000041961669921875 * length(_166.uModTime.xy * mix(_297, _297 - _299, greaterThan(_297, _299 * 0.5)))) * _166.uModTime.z; + vec2 _316 = vec2(cos(_309), sin(_309)); + vec2 _387 = _316.xx; + vec2 _392 = _316.yy; + vec2 _395 = _392 * _137.distribution[_280].yx; + vec2 _421 = _392 * _137.distribution[(_476 * _448) + _475].yx; + vec2 _429 = (_137.distribution[(_476 * _448) + _475] * _387) + vec2(-_421.x, _421.y); + _225.heights[_280] = packHalf2x16(((_137.distribution[_280] * _387) + vec2(-_395.x, _395.y)) + vec2(_429.x, -_429.y)); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/image.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/image.comp index 8bd7dd06ab..cdb57142c3 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/image.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/image.comp @@ -6,6 +6,7 @@ layout(binding = 1, rgba8) uniform writeonly mediump image2D uImageOut; void main() { - imageStore(uImageOut, ivec2(gl_GlobalInvocationID.xy), imageLoad(uImageIn, ivec2(gl_GlobalInvocationID.xy) + imageSize(uImageIn))); + ivec2 _23 = ivec2(gl_GlobalInvocationID.xy); + imageStore(uImageOut, _23, imageLoad(uImageIn, _23 + imageSize(uImageIn))); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/return.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/return.comp deleted file mode 100644 index ea41907a7b..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/return.comp +++ /dev/null @@ -1,31 +0,0 @@ -#version 310 es -layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; - -layout(binding = 1, std430) writeonly buffer SSBO2 -{ - vec4 out_data[]; -} _27; - -int _69; - -void main() -{ - if (gl_GlobalInvocationID.x == 2u) - { - _27.out_data[gl_GlobalInvocationID.x] = vec4(20.0); - } - else - { - if (gl_GlobalInvocationID.x == 4u) - { - _27.out_data[gl_GlobalInvocationID.x] = vec4(10.0); - return; - } - } - for (int _68 = 0; _68 < 20; _68 = _69 + 1) - { - return; - } - _27.out_data[gl_GlobalInvocationID.x] = vec4(10.0); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-matrix.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-matrix.comp new file mode 100644 index 0000000000..5c4ac94bc7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +#version 310 es +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(binding = 0, std430) buffer SSBO +{ + float a; + vec4 b; + mat4 c; + float a1; + vec4 b1; + mat4 c1; +} _11; + +void main() +{ + _11.a *= _11.a1; + _11.b *= _11.b1; + _11.c = _11.c * _11.c1; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-opt.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-opt.comp index 7d4d24b29f..342e6632db 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-opt.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/rmw-opt.comp @@ -18,7 +18,6 @@ void main() _9.a ^= 10; _9.a %= 40; _9.a |= 1; - bool _65 = false && true; - _9.a = int(_65 && (true || _65)); + _9.a = 0; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/shared.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/shared.comp index 66ec1c2cc7..f95cb2b8b9 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/shared.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/shared.comp @@ -18,6 +18,6 @@ void main() sShared[gl_LocalInvocationIndex] = _22.in_data[gl_GlobalInvocationID.x]; memoryBarrierShared(); barrier(); - _44.out_data[gl_GlobalInvocationID.x] = sShared[(4u - gl_LocalInvocationIndex) - 1u]; + _44.out_data[gl_GlobalInvocationID.x] = sShared[3u - gl_LocalInvocationIndex]; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/struct-packing.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/struct-packing.comp index 3c30aa6088..8a2ac76274 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/struct-packing.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/struct-packing.comp @@ -43,7 +43,26 @@ struct Content S4 m3s[8]; }; -layout(binding = 1, std430) buffer SSBO1 +struct S0_1 +{ + vec2 a[1]; + float b; +}; + +struct Content_1 +{ + S0_1 m0s[1]; + S1 m1s[1]; + S2 m2s[1]; + S0_1 m0; + S1 m1; + S2 m2; + S3 m3; + float m4; + S4 m3s[8]; +}; + +layout(binding = 1, std430) restrict buffer SSBO1 { Content content; Content content1[2]; @@ -59,11 +78,11 @@ layout(binding = 1, std430) buffer SSBO1 float array[]; } ssbo_430; -layout(binding = 0, std140) buffer SSBO0 +layout(binding = 0, std140) restrict buffer SSBO0 { - Content content; - Content content1[2]; - Content content2; + Content_1 content; + Content_1 content1[2]; + Content_1 content2; mat2 m0; mat2 m1; mat2x3 m2[4]; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/torture-loop.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/torture-loop.comp index 640142b30a..5943966c05 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/torture-loop.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/torture-loop.comp @@ -12,66 +12,29 @@ layout(binding = 1, std430) writeonly buffer SSBO2 vec4 out_data[]; } _89; -uint _98; - void main() { - vec4 _93; - int _94; - _93 = _24.in_data[gl_GlobalInvocationID.x]; - _94 = 0; - int _40; - vec4 _46; - int _48; - for (;;) + vec4 _99; + _99 = _24.in_data[gl_GlobalInvocationID.x]; + for (int _93 = 0; (_93 + 1) < 10; ) { - _40 = _94 + 1; - if (_40 < 10) + _99 *= 2.0; + _93 += 2; + continue; + } + vec4 _98; + _98 = _99; + vec4 _103; + for (uint _94 = 0u; _94 < 16u; _98 = _103, _94++) + { + _103 = _98; + for (uint _100 = 0u; _100 < 30u; ) { - _46 = _93 * 2.0; - _48 = _40 + 1; - _93 = _46; - _94 = _48; + _103 = _24.mvp * _103; + _100++; continue; } - else - { - break; - } } - vec4 _95; - int _96; - _95 = _93; - _96 = _40; - vec4 _100; - uint _101; - uint _99; - for (uint _97 = 0u; _97 < 16u; _95 = _100, _96++, _97++, _99 = _101) - { - _100 = _95; - _101 = 0u; - vec4 _71; - for (; _101 < 30u; _100 = _71, _101++) - { - _71 = _24.mvp * _100; - } - } - int _102; - _102 = _96; - int _83; - for (;;) - { - _83 = _102 + 1; - if (_83 > 10) - { - _102 = _83; - continue; - } - else - { - break; - } - } - _89.out_data[gl_GlobalInvocationID.x] = _95; + _89.out_data[gl_GlobalInvocationID.x] = _98; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/type-alias.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/type-alias.comp index c0f57f4bda..a6e13156fc 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/type-alias.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/type-alias.comp @@ -6,19 +6,14 @@ struct S0 vec4 a; }; -struct S1 -{ - vec4 a; -}; - layout(binding = 0, std430) buffer SSBO0 { S0 s0s[]; } _36; -layout(binding = 1, std430) buffer SSBO1 +layout(binding = 1, std430) buffer _34_55 { - S1 s1s[]; + S0 s0s[]; } _55; layout(binding = 2, std430) buffer SSBO2 @@ -28,6 +23,6 @@ layout(binding = 2, std430) buffer SSBO2 void main() { - _66.outputs[gl_GlobalInvocationID.x] = _36.s0s[gl_GlobalInvocationID.x].a + _55.s1s[gl_GlobalInvocationID.x].a; + _66.outputs[gl_GlobalInvocationID.x] = _36.s0s[gl_GlobalInvocationID.x].a + _55.s0s[gl_GlobalInvocationID.x].a; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/udiv.comp b/deps/SPIRV-Cross/reference/opt/shaders/comp/udiv.comp index 0c1f926ad0..80d1c7f532 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/comp/udiv.comp +++ b/deps/SPIRV-Cross/reference/opt/shaders/comp/udiv.comp @@ -6,13 +6,13 @@ layout(binding = 0, std430) buffer SSBO2 uint outputs[]; } _10; -layout(binding = 0, std430) buffer SSBO +layout(binding = 0, std430) buffer _8_23 { - uint inputs[]; + uint outputs[]; } _23; void main() { - _10.outputs[gl_GlobalInvocationID.x] = _23.inputs[gl_GlobalInvocationID.x] / 29u; + _10.outputs[gl_GlobalInvocationID.x] = _23.outputs[gl_GlobalInvocationID.x] / 29u; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..29c59012cc --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,37 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uSampler; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 vInput; + +void main() +{ + FragColor = vInput; + vec4 _23 = texture(uSampler, vInput.xy); + vec4 _26 = dFdx(vInput); + vec4 _29 = dFdy(vInput); + vec4 _32 = fwidth(vInput); + vec4 _35 = dFdxCoarse(vInput); + vec4 _38 = dFdyCoarse(vInput); + vec4 _41 = fwidthCoarse(vInput); + vec4 _44 = dFdxFine(vInput); + vec4 _47 = dFdyFine(vInput); + vec4 _50 = fwidthFine(vInput); + vec2 _56 = textureQueryLod(uSampler, vInput.zw); + if (vInput.y > 10.0) + { + FragColor += _23; + FragColor += _26; + FragColor += _29; + FragColor += _32; + FragColor += _35; + FragColor += _38; + FragColor += _41; + FragColor += _44; + FragColor += _47; + FragColor += _50; + FragColor += _56.xyxy; + } +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/dual-source-blending.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/dual-source-blending.desktop.frag new file mode 100644 index 0000000000..3d946b04a5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/dual-source-blending.desktop.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(location = 0, index = 0) out vec4 FragColor0; +layout(location = 0, index = 1) out vec4 FragColor1; + +void main() +{ + FragColor0 = vec4(1.0); + FragColor1 = vec4(2.0); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/fp16.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/fp16.desktop.frag new file mode 100644 index 0000000000..1761424e11 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/fp16.desktop.frag @@ -0,0 +1,11 @@ +#version 450 +#extension GL_AMD_gpu_shader_half_float : require + +layout(location = 3) in f16vec4 v4; + +void main() +{ + f16vec4 _505; + f16vec4 _577 = modf(v4, _505); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/image-query.desktop.frag b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/image-query.desktop.frag index fa1ac0abae..3eaaa8a445 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/image-query.desktop.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/frag/image-query.desktop.frag @@ -9,6 +9,15 @@ layout(binding = 5) uniform samplerCubeArray uSamplerCubeArray; layout(binding = 6) uniform samplerBuffer uSamplerBuffer; layout(binding = 7) uniform sampler2DMS uSamplerMS; layout(binding = 8) uniform sampler2DMSArray uSamplerMSArray; +layout(binding = 9, r32f) uniform readonly writeonly image1D uImage1D; +layout(binding = 10, r32f) uniform readonly writeonly image2D uImage2D; +layout(binding = 11, r32f) uniform readonly writeonly image2DArray uImage2DArray; +layout(binding = 12, r32f) uniform readonly writeonly image3D uImage3D; +layout(binding = 13, r32f) uniform readonly writeonly imageCube uImageCube; +layout(binding = 14, r32f) uniform readonly writeonly imageCubeArray uImageCubeArray; +layout(binding = 15, r32f) uniform readonly writeonly imageBuffer uImageBuffer; +layout(binding = 16, r32f) uniform readonly writeonly image2DMS uImageMS; +layout(binding = 17, r32f) uniform readonly writeonly image2DMSArray uImageMSArray; void main() { diff --git a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/geom/basic.desktop.sso.geom b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/geom/basic.desktop.sso.geom index f1afee69ec..8e51cfa36b 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/geom/basic.desktop.sso.geom +++ b/deps/SPIRV-Cross/reference/opt/shaders/desktop-only/geom/basic.desktop.sso.geom @@ -22,13 +22,14 @@ layout(location = 0) in VertexData void main() { gl_Position = gl_in[0].gl_Position; - vNormal = vin[0].normal + vec3(float(gl_InvocationID)); + float _37 = float(gl_InvocationID); + vNormal = vin[0].normal + vec3(_37); EmitVertex(); gl_Position = gl_in[1].gl_Position; - vNormal = vin[1].normal + vec3(4.0 * float(gl_InvocationID)); + vNormal = vin[1].normal + vec3(4.0 * _37); EmitVertex(); gl_Position = gl_in[2].gl_Position; - vNormal = vin[2].normal + vec3(2.0 * float(gl_InvocationID)); + vNormal = vin[2].normal + vec3(2.0 * _37); EmitVertex(); EndPrimitive(); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/flatten/copy.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders/flatten/copy.flatten.vert index 59f0dc1b42..33caec4f78 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/flatten/copy.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders/flatten/copy.flatten.vert @@ -16,10 +16,12 @@ void main() { gl_Position = mat4(UBO[0], UBO[1], UBO[2], UBO[3]) * aVertex; vColor = vec4(0.0); - for (int _103 = 0; _103 < 4; _103++) + for (int _96 = 0; _96 < 4; ) { - vec3 _68 = aVertex.xyz - Light(UBO[_103 * 2 + 4].xyz, UBO[_103 * 2 + 4].w, UBO[_103 * 2 + 5]).Position; - vColor += (((UBO[_103 * 2 + 5]) * clamp(1.0 - (length(_68) / Light(UBO[_103 * 2 + 4].xyz, UBO[_103 * 2 + 4].w, UBO[_103 * 2 + 5]).Radius), 0.0, 1.0)) * dot(aNormal, normalize(_68))); + vec3 _68 = aVertex.xyz - Light(UBO[_96 * 2 + 4].xyz, UBO[_96 * 2 + 4].w, UBO[_96 * 2 + 5]).Position; + vColor += ((UBO[_96 * 2 + 5] * clamp(1.0 - (length(_68) / Light(UBO[_96 * 2 + 4].xyz, UBO[_96 * 2 + 4].w, UBO[_96 * 2 + 5]).Radius), 0.0, 1.0)) * dot(aNormal, normalize(_68))); + _96++; + continue; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/flatten/dynamic.flatten.vert b/deps/SPIRV-Cross/reference/opt/shaders/flatten/dynamic.flatten.vert index c08f7445be..7129af2869 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/flatten/dynamic.flatten.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders/flatten/dynamic.flatten.vert @@ -16,10 +16,12 @@ void main() { gl_Position = mat4(UBO[0], UBO[1], UBO[2], UBO[3]) * aVertex; vColor = vec4(0.0); - for (int _82 = 0; _82 < 4; _82++) + for (int _82 = 0; _82 < 4; ) { - vec3 _54 = aVertex.xyz - (UBO[_82 * 2 + 4].xyz); - vColor += (((UBO[_82 * 2 + 5]) * clamp(1.0 - (length(_54) / (UBO[_82 * 2 + 4].w)), 0.0, 1.0)) * dot(aNormal, normalize(_54))); + vec3 _54 = aVertex.xyz - UBO[_82 * 2 + 4].xyz; + vColor += ((UBO[_82 * 2 + 5] * clamp(1.0 - (length(_54) / UBO[_82 * 2 + 4].w), 0.0, 1.0)) * dot(aNormal, normalize(_54))); + _82++; + continue; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag b/deps/SPIRV-Cross/reference/opt/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag index 6ccede21a9..2ecee89377 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag @@ -6,29 +6,25 @@ layout(location = 1) in vec2 vUV; layout(location = 0) out vec4 FragColor; layout(location = 0) flat in int vIndex; -int _93; - void main() { + int _92; + _92 = 0; vec4 values3[2 * 3 * 1]; - int _96; - int _97; - int _94; - int _95; - for (int _92 = 0; _92 < 2; _92++, _94 = _96, _95 = _97) + for (; _92 < 2; _92++) { - _96 = 0; - _97 = _95; - int _98; - for (; _96 < 3; _96++, _97 = _98) + int _93; + _93 = 0; + for (; _93 < 3; _93++) { - _98 = 0; - for (; _98 < 1; _98++) + for (int _95 = 0; _95 < 1; ) { - values3[_92 * 3 * 1 + _96 * 1 + _98] = texture(uTextures[_92 * 3 * 1 + _96 * 1 + _98], vUV); + values3[_92 * 3 * 1 + _93 * 1 + _95] = texture(uTextures[_92 * 3 * 1 + _93 * 1 + _95], vUV); + _95++; + continue; } } } - FragColor = ((values3[1 * 3 * 1 + 2 * 1 + 0]) + (values3[0 * 3 * 1 + 2 * 1 + 0])) + (values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex]); + FragColor = (values3[1 * 3 * 1 + 2 * 1 + 0] + values3[0 * 3 * 1 + 2 * 1 + 0]) + values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex]; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..869a76e4e7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; +precision highp int; + +const float _17[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0); + +layout(location = 0) out vec4 FragColor; + +void main() +{ + for (int _46 = 0; _46 < 4; ) + { + mediump int _33 = _46 + 1; + FragColor += vec4(_17[_33]); + _46 = _33; + continue; + } +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-array.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-array.frag index a6ffda0737..749fc80980 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-array.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-array.frag @@ -2,6 +2,9 @@ precision mediump float; precision highp int; +const vec4 _37[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0)); +const vec4 _55[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0))); + struct Foobar { float a; @@ -13,9 +16,7 @@ layout(location = 0) flat in mediump int index; void main() { - highp vec4 indexable[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0)); - highp vec4 indexable_1[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0))); - Foobar indexable_2[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0)); - FragColor = ((indexable[index] + (indexable_1[index][index + 1])) + vec4(10.0 + 20.0)) + vec4(indexable_2[index].a + indexable_2[index].b); + Foobar indexable[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0)); + FragColor = ((_37[index] + _55[index][index + 1]) + vec4(30.0)) + vec4(indexable[index].a + indexable[index].b); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-composites.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-composites.frag index ab0816c3d2..c65c60613d 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-composites.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/constant-composites.frag @@ -9,7 +9,7 @@ struct Foo }; layout(location = 0) out vec4 FragColor; -layout(location = 0) flat in mediump int _line; +layout(location = 0) flat in mediump int line; float lut[4]; Foo foos[2]; @@ -17,7 +17,7 @@ void main() { lut = float[](1.0, 4.0, 3.0, 2.0); foos = Foo[](Foo(10.0, 20.0), Foo(30.0, 40.0)); - FragColor = vec4(lut[_line]); - FragColor += vec4(foos[_line].a * (foos[1 - _line].a)); + FragColor = vec4(lut[line]); + FragColor += vec4(foos[line].a * foos[1 - line].a); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/eliminate-dead-variables.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/eliminate-dead-variables.frag deleted file mode 100644 index c97ae20f9a..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/eliminate-dead-variables.frag +++ /dev/null @@ -1,14 +0,0 @@ -#version 310 es -precision mediump float; -precision highp int; - -layout(binding = 0) uniform mediump sampler2D uSampler; - -layout(location = 0) out vec4 FragColor; -layout(location = 0) in vec2 vTexCoord; - -void main() -{ - FragColor = texture(uSampler, vTexCoord); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/false-loop-init.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/false-loop-init.frag index 1db46c1bd5..2d5902a399 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/false-loop-init.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/false-loop-init.frag @@ -5,24 +5,14 @@ precision highp int; layout(location = 0) out vec4 result; layout(location = 0) in vec4 accum; -uint _49; - void main() { result = vec4(0.0); - uint _51; - uint _50; - for (int _48 = 0; _48 < 4; _48 += int(_51), _50 = _51) + for (int _48 = 0; _48 < 4; ) { - if (accum.y > 10.0) - { - _51 = 40u; - } - else - { - _51 = 30u; - } result += accum; + _48 += int((accum.y > 10.0) ? 40u : 30u); + continue; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/flush_params.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/flush_params.frag index 5f386dffbb..16b4994148 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/flush_params.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/flush_params.frag @@ -2,11 +2,6 @@ precision mediump float; precision highp int; -struct Structy -{ - vec4 c; -}; - layout(location = 0) out vec4 FragColor; void main() diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/for-loop-init.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/for-loop-init.frag index 626d7c8d5e..6d13815d78 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/for-loop-init.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/for-loop-init.frag @@ -4,48 +4,72 @@ precision highp int; layout(location = 0) out mediump int FragColor; +ivec2 _184; +int _199; + void main() { FragColor = 16; - for (int _140 = 0; _140 < 25; _140++) + for (int _168 = 0; _168 < 25; ) { FragColor += 10; + _168++; + continue; } - for (int _141 = 1; _141 < 30; _141++) + for (int _169 = 1; _169 < 30; ) { FragColor += 11; + _169++; + continue; } - int _142; - _142 = 0; - for (; _142 < 20; _142++) + int _170; + _170 = 0; + for (; _170 < 20; ) { FragColor += 12; + _170++; + continue; } - mediump int _62 = _142 + 3; + mediump int _62 = _170 + 3; FragColor += _62; - if (_62 == 40) + bool _68 = _62 == 40; + if (_68) { - for (int _143 = 0; _143 < 40; _143++) + for (int _171 = 0; _171 < 40; ) { FragColor += 13; + _171++; + continue; } - return; } else { FragColor += _62; } - ivec2 _144; - _144 = ivec2(0); - ivec2 _139; - for (; _144.x < 10; _139 = _144, _139.x = _144.x + 4, _144 = _139) + bool _213 = _68 ? true : false; + if (!_213) { - FragColor += _144.y; + ivec2 _177; + _177 = mix(ivec2(0), mix(_184, _184, bvec2(_68)), bvec2(_213)); + for (; _177.x < 10; ) + { + FragColor += _177.y; + ivec2 _167 = _177; + _167.x = _177.x + 4; + _177 = _167; + continue; + } } - for (int _145 = _62; _145 < 40; _145++) + int _216 = _213 ? (_68 ? _199 : _199) : _62; + if (!_213) { - FragColor += _145; + for (int _191 = _216; _191 < 40; ) + { + FragColor += _191; + _191++; + continue; + } + FragColor += _216; } - FragColor += _62; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/gather-dref.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/gather-dref.frag new file mode 100644 index 0000000000..5416f79cb5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/gather-dref.frag @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(binding = 0) uniform mediump sampler2DShadow uT; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec3 vUV; + +void main() +{ + FragColor = textureGather(uT, vUV.xy, vUV.z); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/ground.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/ground.frag index aaca58c1cd..f59a402fe3 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/ground.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/ground.frag @@ -24,7 +24,7 @@ layout(location = 1) in vec3 EyeVec; void main() { vec3 _68 = normalize((texture(TexNormalmap, TexCoord).xyz * 2.0) - vec3(1.0)); - float _113 = smoothstep(0.0, 0.1500000059604644775390625, (_101.g_CamPos.y + EyeVec.y) / 200.0); + float _113 = smoothstep(0.0, 0.1500000059604644775390625, (_101.g_CamPos.y + EyeVec.y) * 0.004999999888241291046142578125); float _125 = smoothstep(0.699999988079071044921875, 0.75, _68.y); vec3 _130 = mix(vec3(0.100000001490116119384765625), mix(vec3(0.100000001490116119384765625, 0.300000011920928955078125, 0.100000001490116119384765625), vec3(0.800000011920928955078125), vec3(_113)), vec3(_125)); LightingOut = vec4(0.0); diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/hoisted-temporary-use-continue-block-as-value.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/hoisted-temporary-use-continue-block-as-value.frag index 1d8e023582..74db2bb8cb 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/hoisted-temporary-use-continue-block-as-value.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/hoisted-temporary-use-continue-block-as-value.frag @@ -9,29 +9,20 @@ layout(location = 1) flat in mediump int vB; void main() { FragColor = vec4(0.0); - mediump int _49; - int _60; - for (int _57 = 0, _58 = 0; _58 < vA; _57 = _60, _58 += _49) + int _58; + for (int _57 = 0, _60 = 0; _57 < vA; FragColor += vec4(1.0), _60 = _58, _57 += (_58 + 10)) { - if ((vA + _58) == 20) + if ((vA + _57) == 20) { - _60 = 50; + _58 = 50; + continue; } else { - int _59; - if ((vB + _58) == 40) - { - _59 = 60; - } - else - { - _59 = _57; - } - _60 = _59; + _58 = ((vB + _57) == 40) ? 60 : _60; + continue; } - _49 = _60 + 10; - FragColor += vec4(1.0); + continue; } } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/lut-promotion.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/lut-promotion.frag new file mode 100644 index 0000000000..21c925796e --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/lut-promotion.frag @@ -0,0 +1,42 @@ +#version 310 es +precision mediump float; +precision highp int; + +const float _16[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0); +const vec4 _60[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + +layout(location = 0) out float FragColor; +layout(location = 0) flat in mediump int index; + +void main() +{ + FragColor = _16[index]; + if (index < 10) + { + FragColor += _16[index ^ 1]; + } + else + { + FragColor += _16[index & 1]; + } + bool _63 = index > 30; + if (_63) + { + FragColor += _60[index & 3].y; + } + else + { + FragColor += _60[index & 1].x; + } + vec4 foobar[4] = _60; + if (_63) + { + foobar[1].z = 20.0; + } + mediump int _91 = index & 3; + FragColor += foobar[_91].z; + vec4 baz[4] = _60; + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[_91].z; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/mix.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/mix.frag index f1494e0775..f791d45ce3 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/mix.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/mix.frag @@ -10,9 +10,9 @@ layout(location = 3) in float vIn3; void main() { - FragColor = mix(vIn0, vIn1, bvec4(false, true, false, false)); - FragColor = vec4(true ? vIn3 : vIn2); - FragColor = mix(vIn1, vIn0, bvec4(true)); - FragColor = vec4(true ? vIn2 : vIn3); + FragColor = vec4(vIn0.x, vIn1.y, vIn0.z, vIn0.w); + FragColor = vec4(vIn3); + FragColor = vIn0.xyzw; + FragColor = vec4(vIn2); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/partial-write-preserve.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/partial-write-preserve.frag index 527b661bcc..d6c1fe8b44 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/partial-write-preserve.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/partial-write-preserve.frag @@ -2,12 +2,6 @@ precision mediump float; precision highp int; -struct B -{ - float a; - float b; -}; - void main() { } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/sampler-ms-query.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/sampler-ms-query.frag deleted file mode 100644 index 4c30ed1529..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/sampler-ms-query.frag +++ /dev/null @@ -1,14 +0,0 @@ -#version 450 - -layout(binding = 0) uniform sampler2DMS uSampler; -layout(binding = 1) uniform sampler2DMSArray uSamplerArray; -layout(binding = 2, rgba8) uniform readonly writeonly image2DMS uImage; -layout(binding = 3, rgba8) uniform readonly writeonly image2DMSArray uImageArray; - -layout(location = 0) out vec4 FragColor; - -void main() -{ - FragColor = vec4(float(((textureSamples(uSampler) + textureSamples(uSamplerArray)) + imageSamples(uImage)) + imageSamples(uImageArray))); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/swizzle.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/swizzle.frag index e619be2f48..a229e5b0d5 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/swizzle.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/swizzle.frag @@ -2,7 +2,7 @@ precision mediump float; precision highp int; -layout(location = 0) uniform mediump sampler2D samp; +layout(binding = 0) uniform mediump sampler2D samp; layout(location = 0) out vec4 FragColor; layout(location = 2) in vec2 vUV; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/temporary.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/temporary.frag deleted file mode 100644 index ec9d3e4958..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/temporary.frag +++ /dev/null @@ -1,14 +0,0 @@ -#version 310 es -precision mediump float; -precision highp int; - -uniform mediump sampler2D uTex; - -layout(location = 0) in vec2 vTex; -layout(location = 0) out vec4 FragColor; - -void main() -{ - FragColor = vec4(vTex.xxy, 1.0) + vec4(texture(uTex, vTex).xyz, 1.0); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/ubo_layout.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/ubo_layout.frag index bc0b01c065..4b66e1396a 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/ubo_layout.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/ubo_layout.frag @@ -7,6 +7,11 @@ struct Str mat4 foo; }; +struct Str_1 +{ + mat4 foo; +}; + layout(binding = 0, std140) uniform UBO1 { layout(row_major) Str foo; @@ -14,7 +19,7 @@ layout(binding = 0, std140) uniform UBO1 layout(binding = 1, std140) uniform UBO2 { - Str foo; + Str_1 foo; } ubo0; layout(location = 0) out vec4 FragColor; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/frag/unary-enclose.frag b/deps/SPIRV-Cross/reference/opt/shaders/frag/unary-enclose.frag index 118787bdf9..e7b0bf534c 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/frag/unary-enclose.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/frag/unary-enclose.frag @@ -7,6 +7,6 @@ layout(location = 0) in vec4 vIn; void main() { - FragColor = -(-vIn); + FragColor = vIn; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/geom/basic.geom b/deps/SPIRV-Cross/reference/opt/shaders/geom/basic.geom index 296ce5792c..f91136f609 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/geom/basic.geom +++ b/deps/SPIRV-Cross/reference/opt/shaders/geom/basic.geom @@ -13,13 +13,14 @@ layout(location = 0) in VertexData void main() { gl_Position = gl_in[0].gl_Position; - vNormal = vin[0].normal + vec3(float(gl_InvocationID)); + float _37 = float(gl_InvocationID); + vNormal = vin[0].normal + vec3(_37); EmitVertex(); gl_Position = gl_in[1].gl_Position; - vNormal = vin[1].normal + vec3(4.0 * float(gl_InvocationID)); + vNormal = vin[1].normal + vec3(4.0 * _37); EmitVertex(); gl_Position = gl_in[2].gl_Position; - vNormal = vin[2].normal + vec3(2.0 * float(gl_InvocationID)); + vNormal = vin[2].normal + vec3(2.0 * _37); EmitVertex(); EndPrimitive(); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/legacy/vert/struct-varying.legacy.vert b/deps/SPIRV-Cross/reference/opt/shaders/legacy/vert/struct-varying.legacy.vert index 8520e2d562..01a3d73535 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/legacy/vert/struct-varying.legacy.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders/legacy/vert/struct-varying.legacy.vert @@ -21,9 +21,8 @@ void main() vout_a = vout.a; vout_b = vout.b; } - Output _22 = Output(vout_a, vout_b); - vout_a = _22.a; - vout_b = _22.b; + vout_a = Output(vout_a, vout_b).a; + vout_b = Output(vout_a, vout_b).b; vout_a.x = 1.0; vout_b.y = 1.0; } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/tesc/water_tess.tesc b/deps/SPIRV-Cross/reference/opt/shaders/tesc/water_tess.tesc index 0320fff2ca..69307d3c9e 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/tesc/water_tess.tesc +++ b/deps/SPIRV-Cross/reference/opt/shaders/tesc/water_tess.tesc @@ -22,13 +22,13 @@ void main() vec2 _440 = ((vPatchPosBase[0] + _41.uPatchSize) + vec2(10.0)) * _41.uScale.xy; vec3 _445 = vec3(_430.x, -10.0, _430.y); vec3 _450 = vec3(_440.x, 10.0, _440.y); - vec3 _454 = (_445 + _450) * 0.5; - float _459 = 0.5 * length(_450 - _445); - bool _515 = any(lessThanEqual(vec3(dot(_41.uFrustum[0], vec4(_454, 1.0)), dot(_41.uFrustum[1], vec4(_454, 1.0)), dot(_41.uFrustum[2], vec4(_454, 1.0))), vec3(-_459))); + vec4 _466 = vec4((_445 + _450) * 0.5, 1.0); + vec3 _513 = vec3(length(_450 - _445) * (-0.5)); + bool _515 = any(lessThanEqual(vec3(dot(_41.uFrustum[0], _466), dot(_41.uFrustum[1], _466), dot(_41.uFrustum[2], _466)), _513)); bool _525; if (!_515) { - _525 = any(lessThanEqual(vec3(dot(_41.uFrustum[3], vec4(_454, 1.0)), dot(_41.uFrustum[4], vec4(_454, 1.0)), dot(_41.uFrustum[5], vec4(_454, 1.0))), vec3(-_459))); + _525 = any(lessThanEqual(vec3(dot(_41.uFrustum[3], _466), dot(_41.uFrustum[4], _466), dot(_41.uFrustum[5], _466)), _513)); } else { diff --git a/deps/SPIRV-Cross/reference/opt/shaders/tese/water_tess.tese b/deps/SPIRV-Cross/reference/opt/shaders/tese/water_tess.tese index 6efa9f0a69..a2aa104476 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/tese/water_tess.tese +++ b/deps/SPIRV-Cross/reference/opt/shaders/tese/water_tess.tese @@ -22,14 +22,13 @@ layout(location = 0) out vec3 vWorld; void main() { vec2 _201 = vOutPatchPosBase + (gl_TessCoord.xy * _31.uPatchSize); - vec2 _214 = mix(vPatchLods.yx, vPatchLods.zw, vec2(gl_TessCoord.xy.x)); - float _221 = mix(_214.x, _214.y, gl_TessCoord.xy.y); + vec2 _214 = mix(vPatchLods.yx, vPatchLods.zw, vec2(gl_TessCoord.x)); + float _221 = mix(_214.x, _214.y, gl_TessCoord.y); mediump float _223 = floor(_221); - mediump float _226 = _221 - _223; vec2 _125 = _201 * _31.uInvHeightmapSize; vec2 _141 = _31.uInvHeightmapSize * exp2(_223); vGradNormalTex = vec4(_125 + (_31.uInvHeightmapSize * 0.5), _125 * _31.uScale.zw); - mediump vec3 _253 = mix(textureLod(uHeightmapDisplacement, _125 + (_141 * 0.5), _223).xyz, textureLod(uHeightmapDisplacement, _125 + (_141 * 1.0), _223 + 1.0).xyz, vec3(_226)); + mediump vec3 _253 = mix(textureLod(uHeightmapDisplacement, _125 + (_141 * 0.5), _223).xyz, textureLod(uHeightmapDisplacement, _125 + (_141 * 1.0), _223 + 1.0).xyz, vec3(_221 - _223)); vec2 _171 = (_201 * _31.uScale.xy) + _253.yz; vWorld = vec3(_171.x, _253.x, _171.y); gl_Position = _31.uMVP * vec4(vWorld, 1.0); diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vert/ocean.vert b/deps/SPIRV-Cross/reference/opt/shaders/vert/ocean.vert index d37a0a8a4c..f1b12fa046 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/vert/ocean.vert +++ b/deps/SPIRV-Cross/reference/opt/shaders/vert/ocean.vert @@ -50,7 +50,7 @@ layout(location = 0) in vec4 Position; layout(location = 0) out vec3 EyeVec; layout(location = 1) out vec4 TexCoord; -uvec4 _483; +uvec4 _484; void main() { @@ -59,8 +59,9 @@ void main() uint _357 = uint(_352); uvec4 _359 = uvec4(Position); uvec2 _366 = (uvec2(1u) << uvec2(_357, _357 + 1u)) - uvec2(1u); + bool _369 = _359.x < 32u; uint _482; - if (_359.x < 32u) + if (_369) { _482 = _366.x; } @@ -68,41 +69,42 @@ void main() { _482 = 0u; } - uvec4 _445 = _483; + uvec4 _445 = _484; _445.x = _482; - uint _484; - if (_359.y < 32u) - { - _484 = _366.x; - } - else - { - _484 = 0u; - } - uvec4 _451 = _445; - _451.y = _484; + bool _379 = _359.y < 32u; uint _485; - if (_359.x < 32u) + if (_379) { - _485 = _366.y; + _485 = _366.x; } else { _485 = 0u; } - uvec4 _457 = _451; - _457.z = _485; - uint _486; - if (_359.y < 32u) + uvec4 _451 = _445; + _451.y = _485; + uint _487; + if (_369) { - _486 = _366.y; + _487 = _366.y; } else { - _486 = 0u; + _487 = 0u; + } + uvec4 _457 = _451; + _457.z = _487; + uint _489; + if (_379) + { + _489 = _366.y; + } + else + { + _489 = 0u; } uvec4 _463 = _457; - _463.w = _486; + _463.w = _489; vec4 _415 = vec4((_359.xyxy + _463) & (~_366).xxyy); vec2 _197 = ((_53.Patches[(gl_InstanceID + SPIRV_Cross_BaseInstance)].Position.xz * _180.InvOceanSize_PatchScale.zw) + mix(_415.xy, _415.zw, vec2(_350 - _352))) * _180.InvOceanSize_PatchScale.xy; vec2 _204 = _197 * _180.NormalTexCoordScale.zw; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/reference/opt/shaders/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..25fc9495d2 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vert/read-from-row-major-array.vert @@ -0,0 +1,16 @@ +#version 310 es + +layout(binding = 0, std140) uniform Block +{ + layout(row_major) mat2x3 var[3][4]; +} _104; + +layout(location = 0) in vec4 a_position; +layout(location = 0) out mediump float v_vtxResult; + +void main() +{ + gl_Position = a_position; + v_vtxResult = ((float(abs(_104.var[0][0][0].x - 2.0) < 0.0500000007450580596923828125) * float(abs(_104.var[0][0][0].y - 6.0) < 0.0500000007450580596923828125)) * float(abs(_104.var[0][0][0].z - (-6.0)) < 0.0500000007450580596923828125)) * ((float(abs(_104.var[0][0][1].x) < 0.0500000007450580596923828125) * float(abs(_104.var[0][0][1].y - 5.0) < 0.0500000007450580596923828125)) * float(abs(_104.var[0][0][1].z - 5.0) < 0.0500000007450580596923828125)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp.vk b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp.vk new file mode 100644 index 0000000000..6d288574f7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp.vk @@ -0,0 +1,110 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic : require +#extension GL_KHR_shader_subgroup_ballot : require +#extension GL_KHR_shader_subgroup_shuffle : require +#extension GL_KHR_shader_subgroup_shuffle_relative : require +#extension GL_KHR_shader_subgroup_vote : require +#extension GL_KHR_shader_subgroup_arithmetic : require +#extension GL_KHR_shader_subgroup_clustered : require +#extension GL_KHR_shader_subgroup_quad : require +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(set = 0, binding = 0, std430) buffer SSBO +{ + float FragColor; +} _9; + +void main() +{ + _9.FragColor = float(gl_NumSubgroups); + _9.FragColor = float(gl_SubgroupID); + _9.FragColor = float(gl_SubgroupSize); + _9.FragColor = float(gl_SubgroupInvocationID); + subgroupMemoryBarrier(); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); + bool elected = subgroupElect(); + _9.FragColor = vec4(gl_SubgroupEqMask).x; + _9.FragColor = vec4(gl_SubgroupGeMask).x; + _9.FragColor = vec4(gl_SubgroupGtMask).x; + _9.FragColor = vec4(gl_SubgroupLeMask).x; + _9.FragColor = vec4(gl_SubgroupLtMask).x; + vec4 broadcasted = subgroupBroadcast(vec4(10.0), 8u); + vec3 first = subgroupBroadcastFirst(vec3(20.0)); + uvec4 ballot_value = subgroupBallot(true); + bool inverse_ballot_value = subgroupInverseBallot(ballot_value); + bool bit_extracted = subgroupBallotBitExtract(uvec4(10u), 8u); + uint bit_count = subgroupBallotBitCount(ballot_value); + uint inclusive_bit_count = subgroupBallotInclusiveBitCount(ballot_value); + uint exclusive_bit_count = subgroupBallotExclusiveBitCount(ballot_value); + uint lsb = subgroupBallotFindLSB(ballot_value); + uint msb = subgroupBallotFindMSB(ballot_value); + uint shuffled = subgroupShuffle(10u, 8u); + uint shuffled_xor = subgroupShuffleXor(30u, 8u); + uint shuffled_up = subgroupShuffleUp(20u, 4u); + uint shuffled_down = subgroupShuffleDown(20u, 4u); + bool has_all = subgroupAll(true); + bool has_any = subgroupAny(true); + bool has_equal = subgroupAllEqual(true); + vec4 added = subgroupAdd(vec4(20.0)); + ivec4 iadded = subgroupAdd(ivec4(20)); + vec4 multiplied = subgroupMul(vec4(20.0)); + ivec4 imultiplied = subgroupMul(ivec4(20)); + vec4 lo = subgroupMin(vec4(20.0)); + vec4 hi = subgroupMax(vec4(20.0)); + ivec4 slo = subgroupMin(ivec4(20)); + ivec4 shi = subgroupMax(ivec4(20)); + uvec4 ulo = subgroupMin(uvec4(20u)); + uvec4 uhi = subgroupMax(uvec4(20u)); + uvec4 anded = subgroupAnd(ballot_value); + uvec4 ored = subgroupOr(ballot_value); + uvec4 xored = subgroupXor(ballot_value); + added = subgroupInclusiveAdd(added); + iadded = subgroupInclusiveAdd(iadded); + multiplied = subgroupInclusiveMul(multiplied); + imultiplied = subgroupInclusiveMul(imultiplied); + lo = subgroupInclusiveMin(lo); + hi = subgroupInclusiveMax(hi); + slo = subgroupInclusiveMin(slo); + shi = subgroupInclusiveMax(shi); + ulo = subgroupInclusiveMin(ulo); + uhi = subgroupInclusiveMax(uhi); + anded = subgroupInclusiveAnd(anded); + ored = subgroupInclusiveOr(ored); + xored = subgroupInclusiveXor(ored); + added = subgroupExclusiveAdd(lo); + added = subgroupExclusiveAdd(multiplied); + multiplied = subgroupExclusiveMul(multiplied); + iadded = subgroupExclusiveAdd(imultiplied); + imultiplied = subgroupExclusiveMul(imultiplied); + lo = subgroupExclusiveMin(lo); + hi = subgroupExclusiveMax(hi); + ulo = subgroupExclusiveMin(ulo); + uhi = subgroupExclusiveMax(uhi); + slo = subgroupExclusiveMin(slo); + shi = subgroupExclusiveMax(shi); + anded = subgroupExclusiveAnd(anded); + ored = subgroupExclusiveOr(ored); + xored = subgroupExclusiveXor(ored); + added = subgroupClusteredAdd(added, 4u); + multiplied = subgroupClusteredMul(multiplied, 4u); + iadded = subgroupClusteredAdd(iadded, 4u); + imultiplied = subgroupClusteredMul(imultiplied, 4u); + lo = subgroupClusteredMin(lo, 4u); + hi = subgroupClusteredMax(hi, 4u); + ulo = subgroupClusteredMin(ulo, 4u); + uhi = subgroupClusteredMax(uhi, 4u); + slo = subgroupClusteredMin(slo, 4u); + shi = subgroupClusteredMax(shi, 4u); + anded = subgroupClusteredAnd(anded, 4u); + ored = subgroupClusteredOr(ored, 4u); + xored = subgroupClusteredXor(xored, 4u); + vec4 swap_horiz = subgroupQuadSwapHorizontal(vec4(20.0)); + vec4 swap_vertical = subgroupQuadSwapVertical(vec4(20.0)); + vec4 swap_diagonal = subgroupQuadSwapDiagonal(vec4(20.0)); + vec4 quad_broadcast = subgroupQuadBroadcast(vec4(20.0), 3u); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag new file mode 100644 index 0000000000..c17c8e6d67 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag @@ -0,0 +1,12 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uSamp; +uniform sampler2D SPIRV_Cross_CombineduTuS; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = texture(uSamp, vec2(0.5)) + texture(SPIRV_Cross_CombineduTuS, vec2(0.5)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag.vk new file mode 100644 index 0000000000..5a5ec20298 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag.vk @@ -0,0 +1,13 @@ +#version 450 + +layout(set = 0, binding = 0) uniform sampler2D uSamp; +layout(set = 0, binding = 1) uniform texture2D uT; +layout(set = 0, binding = 2) uniform sampler uS; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = texture(uSamp, vec2(0.5)) + texture(sampler2D(uT, uS), vec2(0.5)); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag new file mode 100644 index 0000000000..df2994efb9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag @@ -0,0 +1,19 @@ +#version 310 es +precision mediump float; +precision highp int; + +uniform mediump sampler2D SPIRV_Cross_CombineduTextureuSampler[4]; +uniform mediump sampler2DArray SPIRV_Cross_CombineduTextureArrayuSampler[4]; +uniform mediump samplerCube SPIRV_Cross_CombineduTextureCubeuSampler[4]; +uniform mediump sampler3D SPIRV_Cross_CombineduTexture3DuSampler[4]; + +layout(location = 0) in vec2 vTex; +layout(location = 1) in vec3 vTex3; +layout(location = 0) out vec4 FragColor; + +void main() +{ + vec2 _95 = (vTex + (vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler[1], 0)))) + (vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler[2], 1))); + FragColor = ((((texture(SPIRV_Cross_CombineduTextureuSampler[2], _95) + texture(SPIRV_Cross_CombineduTextureuSampler[1], _95)) + texture(SPIRV_Cross_CombineduTextureuSampler[1], _95)) + texture(SPIRV_Cross_CombineduTextureArrayuSampler[3], vTex3)) + texture(SPIRV_Cross_CombineduTextureCubeuSampler[1], vTex3)) + texture(SPIRV_Cross_CombineduTexture3DuSampler[2], vTex3); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag.vk new file mode 100644 index 0000000000..d275a0f408 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag.vk @@ -0,0 +1,20 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(set = 0, binding = 1) uniform mediump texture2D uTexture[4]; +layout(set = 0, binding = 0) uniform mediump sampler uSampler; +layout(set = 0, binding = 4) uniform mediump texture2DArray uTextureArray[4]; +layout(set = 0, binding = 3) uniform mediump textureCube uTextureCube[4]; +layout(set = 0, binding = 2) uniform mediump texture3D uTexture3D[4]; + +layout(location = 0) in vec2 vTex; +layout(location = 1) in vec3 vTex3; +layout(location = 0) out vec4 FragColor; + +void main() +{ + vec2 _95 = (vTex + (vec2(1.0) / vec2(textureSize(sampler2D(uTexture[1], uSampler), 0)))) + (vec2(1.0) / vec2(textureSize(sampler2D(uTexture[2], uSampler), 1))); + FragColor = ((((texture(sampler2D(uTexture[2], uSampler), _95) + texture(sampler2D(uTexture[1], uSampler), _95)) + texture(sampler2D(uTexture[1], uSampler), _95)) + texture(sampler2DArray(uTextureArray[3], uSampler), vTex3)) + texture(samplerCube(uTextureCube[1], uSampler), vTex3)) + texture(sampler3D(uTexture3D[2], uSampler), vTex3); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag index a52d5bc77c..aad1e43662 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag @@ -13,8 +13,7 @@ layout(location = 0) out vec4 FragColor; void main() { - vec2 _54 = vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler, 0)); - vec2 _64 = vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler, 1)); - FragColor = (((texture(SPIRV_Cross_CombineduTextureuSampler, (vTex + _54) + _64) + texture(SPIRV_Cross_CombineduTextureuSampler, (vTex + _54) + _64)) + texture(SPIRV_Cross_CombineduTextureArrayuSampler, vTex3)) + texture(SPIRV_Cross_CombineduTextureCubeuSampler, vTex3)) + texture(SPIRV_Cross_CombineduTexture3DuSampler, vTex3); + vec2 _73 = (vTex + (vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler, 0)))) + (vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler, 1))); + FragColor = (((texture(SPIRV_Cross_CombineduTextureuSampler, _73) + texture(SPIRV_Cross_CombineduTextureuSampler, _73)) + texture(SPIRV_Cross_CombineduTextureArrayuSampler, vTex3)) + texture(SPIRV_Cross_CombineduTextureCubeuSampler, vTex3)) + texture(SPIRV_Cross_CombineduTexture3DuSampler, vTex3); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag.vk index 105ca76e44..b79374aba9 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag.vk +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/separate-sampler-texture.vk.frag.vk @@ -14,8 +14,7 @@ layout(location = 0) out vec4 FragColor; void main() { - vec2 _54 = vec2(1.0) / vec2(textureSize(sampler2D(uTexture, uSampler), 0)); - vec2 _64 = vec2(1.0) / vec2(textureSize(sampler2D(uTexture, uSampler), 1)); - FragColor = (((texture(sampler2D(uTexture, uSampler), (vTex + _54) + _64) + texture(sampler2D(uTexture, uSampler), (vTex + _54) + _64)) + texture(sampler2DArray(uTextureArray, uSampler), vTex3)) + texture(samplerCube(uTextureCube, uSampler), vTex3)) + texture(sampler3D(uTexture3D, uSampler), vTex3); + vec2 _73 = (vTex + (vec2(1.0) / vec2(textureSize(sampler2D(uTexture, uSampler), 0)))) + (vec2(1.0) / vec2(textureSize(sampler2D(uTexture, uSampler), 1))); + FragColor = (((texture(sampler2D(uTexture, uSampler), _73) + texture(sampler2D(uTexture, uSampler), _73)) + texture(sampler2DArray(uTextureArray, uSampler), vTex3)) + texture(samplerCube(uTextureCube, uSampler), vTex3)) + texture(sampler3D(uTexture3D, uSampler), vTex3); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant-ternary.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant-ternary.vk.frag new file mode 100644 index 0000000000..91b0331b79 --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant-ternary.vk.frag @@ -0,0 +1,9 @@ +#version 450 + +layout(location = 0) out float FragColor; + +void main() +{ + FragColor = float((10u > 20u) ? 30u : 50u); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant-ternary.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant-ternary.vk.frag.vk new file mode 100644 index 0000000000..59d3b99b9c --- /dev/null +++ b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant-ternary.vk.frag.vk @@ -0,0 +1,13 @@ +#version 450 + +layout(constant_id = 0) const uint s = 10u; +const bool _13 = (s > 20u); +const uint _16 = _13 ? 30u : 50u; + +layout(location = 0) out float FragColor; + +void main() +{ + FragColor = float(_16); +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant.vk.frag b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant.vk.frag deleted file mode 100644 index 4f9b6f515f..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant.vk.frag +++ /dev/null @@ -1,20 +0,0 @@ -#version 310 es -precision mediump float; -precision highp int; - -struct Foo -{ - float elems[(4 + 2)]; -}; - -layout(location = 0) out vec4 FragColor; - -float _146[(3 + 2)]; - -void main() -{ - float vec0[(3 + 3)][8]; - Foo foo; - FragColor = ((vec4(1.0 + 2.0) + vec4(vec0[0][0])) + vec4(_146[0])) + vec4(foo.elems[3]); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant.vk.frag.vk b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant.vk.frag.vk deleted file mode 100644 index 0b74896aef..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/frag/spec-constant.vk.frag.vk +++ /dev/null @@ -1,25 +0,0 @@ -#version 310 es -precision mediump float; -precision highp int; - -layout(constant_id = 1) const float a = 1.0; -layout(constant_id = 2) const float b = 2.0; -layout(constant_id = 3) const int c = 3; -layout(constant_id = 4) const int d = 4; - -struct Foo -{ - float elems[(d + 2)]; -}; - -layout(location = 0) out vec4 FragColor; - -float _146[(c + 2)]; - -void main() -{ - float vec0[(c + 3)][8]; - Foo foo; - FragColor = ((vec4(a + b) + vec4(vec0[0][0])) + vec4(_146[0])) + vec4(foo.elems[c]); -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/vert/multiview.nocompat.vk.vert b/deps/SPIRV-Cross/reference/opt/shaders/vulkan/vert/multiview.nocompat.vk.vert deleted file mode 100644 index 533738efc3..0000000000 --- a/deps/SPIRV-Cross/reference/opt/shaders/vulkan/vert/multiview.nocompat.vk.vert +++ /dev/null @@ -1,15 +0,0 @@ -#version 310 es -#extension GL_OVR_multiview2 : require - -layout(binding = 0, std140) uniform MVPs -{ - mat4 MVP[2]; -} _19; - -layout(location = 0) in vec4 Position; - -void main() -{ - gl_Position = _19.MVP[gl_ViewID_OVR] * Position; -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp b/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/asm/comp/specialization-constant-workgroup.nofxc.asm.comp similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp rename to deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/asm/comp/specialization-constant-workgroup.nofxc.asm.comp diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/asm/vert/empty-struct-composite.asm.vert new file mode 100644 index 0000000000..ba1f576748 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/asm/vert/empty-struct-composite.asm.vert @@ -0,0 +1,15 @@ +struct Test +{ + int empty_struct_member; +}; + +void vert_main() +{ + Test _14 = { 0 }; + Test t = _14; +} + +void main() +{ + vert_main(); +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/comp/bitfield.comp similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders-hlsl/comp/bitfield.noopt.comp rename to deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/comp/bitfield.comp diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/frag/spec-constant.frag b/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/frag/spec-constant.frag new file mode 100644 index 0000000000..c95ea97671 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl-no-opt/frag/spec-constant.frag @@ -0,0 +1,118 @@ +static const float a = 1.0f; +static const float b = 2.0f; +static const int c = 3; +static const uint _18 = (uint(c) + 0u); +static const int _21 = (-c); +static const int _23 = (~c); +static const int d = 4; +static const int _26 = (c + d); +static const int _28 = (c - d); +static const int _30 = (c * d); +static const int _32 = (c / d); +static const uint e = 5u; +static const uint f = 6u; +static const uint _36 = (e / f); +static const int _38 = (c % d); +static const uint _40 = (e % f); +static const int _42 = (c >> d); +static const uint _44 = (e >> f); +static const int _46 = (c << d); +static const int _48 = (c | d); +static const int _50 = (c ^ d); +static const int _52 = (c & d); +static const bool g = false; +static const bool h = true; +static const bool _58 = (g || h); +static const bool _60 = (g && h); +static const bool _62 = (!g); +static const bool _64 = (g == h); +static const bool _66 = (g != h); +static const bool _68 = (c == d); +static const bool _70 = (c != d); +static const bool _72 = (c < d); +static const bool _74 = (e < f); +static const bool _76 = (c > d); +static const bool _78 = (e > f); +static const bool _80 = (c <= d); +static const bool _82 = (e <= f); +static const bool _84 = (c >= d); +static const bool _86 = (e >= f); +static const int _92 = int(e + 0u); +static const bool _94 = (c != int(0u)); +static const bool _96 = (e != 0u); +static const int _100 = int(g); +static const uint _103 = uint(g); +static const int _111 = (c + 3); +static const int _118 = (c + 2); +static const int _124 = (d + 2); + +struct Foo +{ + float elems[_124]; +}; + +static float4 FragColor; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + float t0 = a; + float t1 = b; + uint c0 = _18; + int c1 = _21; + int c2 = _23; + int c3 = _26; + int c4 = _28; + int c5 = _30; + int c6 = _32; + uint c7 = _36; + int c8 = _38; + uint c9 = _40; + int c10 = _42; + uint c11 = _44; + int c12 = _46; + int c13 = _48; + int c14 = _50; + int c15 = _52; + bool c16 = _58; + bool c17 = _60; + bool c18 = _62; + bool c19 = _64; + bool c20 = _66; + bool c21 = _68; + bool c22 = _70; + bool c23 = _72; + bool c24 = _74; + bool c25 = _76; + bool c26 = _78; + bool c27 = _80; + bool c28 = _82; + bool c29 = _84; + bool c30 = _86; + int c31 = c8 + c3; + int c32 = _92; + bool c33 = _94; + bool c34 = _96; + int c35 = _100; + uint c36 = _103; + float c37 = float(g); + float vec0[_111][8]; + vec0[0][0] = 10.0f; + float vec1[_118]; + vec1[0] = 20.0f; + Foo foo; + foo.elems[c] = 10.0f; + FragColor = (((t0 + t1).xxxx + vec0[0][0].xxxx) + vec1[0].xxxx) + foo.elems[c].xxxx; +} + +SPIRV_Cross_Output main() +{ + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/control-flow-hints.asm.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/control-flow-hints.asm.comp new file mode 100644 index 0000000000..9700100348 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/control-flow-hints.asm.comp @@ -0,0 +1,41 @@ +RWByteAddressBuffer bar : register(u0); +RWByteAddressBuffer foo : register(u1); + +void _main() +{ + [unroll] + for (int i = 0; i < 16; i++) + { + bar.Store4(i * 16 + 0, asuint(asfloat(foo.Load4(i * 16 + 0)))); + } + [loop] + for (int i_1 = 0; i_1 < 16; i_1++) + { + bar.Store4((15 - i_1) * 16 + 0, asuint(asfloat(foo.Load4(i_1 * 16 + 0)))); + } + float v = asfloat(bar.Load(160)); + float w = asfloat(foo.Load(160)); + [branch] + if (v > 10.0f) + { + foo.Store4(320, asuint(5.0f.xxxx)); + } + float value = 20.0f; + [flatten] + if (w > 40.0f) + { + value = 20.0f; + } + foo.Store4(320, asuint(value.xxxx)); +} + +void comp_main() +{ + _main(); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp deleted file mode 100644 index 8243347bf6..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp +++ /dev/null @@ -1,16 +0,0 @@ -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(); -} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp similarity index 93% rename from deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp rename to deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp index 1bdb27d7fa..1887eaa88f 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp @@ -11,6 +11,8 @@ struct SPIRV_Cross_Input uint3 gl_WorkGroupID : SV_GroupID; }; +static uint3 _22 = gl_WorkGroupSize; + 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)))); diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag new file mode 100644 index 0000000000..3951fd511a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag @@ -0,0 +1,30 @@ +Texture2D uTex : register(t1); +SamplerState uSampler : register(s0); + +static float4 FragColor; +static float2 vUV; + +struct SPIRV_Cross_Input +{ + float2 vUV : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = uTex.Sample(uSampler, vUV); + FragColor += uTex.Sample(uSampler, vUV, int2(1, 1)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vUV = stage_input.vUV; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..38d12cd630 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/empty-struct.asm.frag @@ -0,0 +1,27 @@ +struct EmptyStructTest +{ + int empty_struct_member; +}; + +float GetValue(EmptyStructTest self) +{ + return 0.0f; +} + +float GetValue_1(EmptyStructTest self) +{ + return 0.0f; +} + +void frag_main() +{ + EmptyStructTest _23 = { 0 }; + EmptyStructTest emptyStruct; + float value = GetValue(emptyStruct); + value = GetValue_1(_23); +} + +void main() +{ + frag_main(); +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..ed53720d94 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,31 @@ +Texture2D uTexture : register(t0); +SamplerState _uTexture_sampler : register(s0); + +static int2 Size; + +struct SPIRV_Cross_Output +{ + int2 Size : SV_Target0; +}; + +uint2 SPIRV_Cross_textureSize(Texture2D Tex, uint Level, out uint Param) +{ + uint2 ret; + Tex.GetDimensions(Level, ret.x, ret.y, Param); + return ret; +} + +void frag_main() +{ + uint _19_dummy_parameter; + uint _20_dummy_parameter; + Size = int2(SPIRV_Cross_textureSize(uTexture, uint(0), _19_dummy_parameter)) + int2(SPIRV_Cross_textureSize(uTexture, uint(1), _20_dummy_parameter)); +} + +SPIRV_Cross_Output main() +{ + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.Size = Size; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..f668d63440 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,56 @@ +Texture2D uImage : register(t0); +SamplerState _uImage_sampler : register(s0); + +static float4 v0; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + float4 v0 : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + int i = 0; + float phi; + float4 _36; + phi = 1.0f; + _36 = float4(1.0f, 2.0f, 1.0f, 2.0f); + for (;;) + { + FragColor = _36; + if (i < 4) + { + if (v0[i] > 0.0f) + { + float2 _48 = phi.xx; + i++; + phi += 2.0f; + _36 = uImage.SampleLevel(_uImage_sampler, _48, 0.0f); + continue; + } + else + { + break; + } + } + else + { + break; + } + } +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v0 = stage_input.v0; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..a7aec01bad --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,55 @@ +static const float _46[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f }; +static const float4 _76[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx }; +static const float4 _90[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx }; + +static float FragColor; +static int index; + +struct SPIRV_Cross_Input +{ + nointerpolation int index : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + float4 foobar[4] = _76; + float4 baz[4] = _76; + FragColor = _46[index]; + if (index < 10) + { + FragColor += _46[index ^ 1]; + } + else + { + FragColor += _46[index & 1]; + } + if (index > 30) + { + FragColor += _76[index & 3].y; + } + else + { + FragColor += _76[index & 1].x; + } + if (index > 30) + { + foobar[1].z = 20.0f; + } + FragColor += foobar[index & 3].z; + baz = _90; + FragColor += baz[index & 3].z; +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + index = stage_input.index; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..db5e717457 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/srem.asm.frag @@ -0,0 +1,29 @@ +static float4 FragColor; +static int4 vA; +static int4 vB; + +struct SPIRV_Cross_Input +{ + nointerpolation int4 vA : TEXCOORD0; + nointerpolation int4 vB : TEXCOORD1; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = float4(vA - vB * (vA / vB)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vA = stage_input.vA; + vB = stage_input.vB; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..695d5fe9df --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,29 @@ +Texture2D uTexture : register(t0); +SamplerState _uTexture_sampler : register(s0); + +static float4 gl_FragCoord; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + float4 gl_FragCoord : SV_Position; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = uTexture.Load(int3(int2(gl_FragCoord.xy), 0)); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + gl_FragCoord = stage_input.gl_FragCoord; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag new file mode 100644 index 0000000000..027dd00c5a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag @@ -0,0 +1,41 @@ +Texture2D uShadow : register(t0); +SamplerComparisonState _uShadow_sampler : register(s0); +Texture2D uTexture : register(t1); +SamplerComparisonState uSampler : register(s2); + +static float3 vUV; +static float FragColor; + +struct SPIRV_Cross_Input +{ + float3 vUV : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +float sample_combined() +{ + return uShadow.SampleCmp(_uShadow_sampler, vUV.xy, vUV.z); +} + +float sample_separate() +{ + return uTexture.SampleCmp(uSampler, vUV.xy, vUV.z); +} + +void frag_main() +{ + FragColor = sample_combined() + sample_separate(); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vUV = stage_input.vUV; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert deleted file mode 100644 index 103ff46a3f..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert +++ /dev/null @@ -1,8 +0,0 @@ -void vert_main() -{ -} - -void main() -{ - vert_main(); -} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert new file mode 100644 index 0000000000..ac446417b3 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert @@ -0,0 +1,38 @@ +static const int _7 = -10; +static const uint _8 = 100u; +static const float _9 = 3.141590118408203125f; +static const int _20 = (_7 + 2); +static const uint _25 = (_8 % 5u); +static const int4 _30 = int4(20, 30, _20, _20); +static const int2 _32 = int2(_30.y, _30.x); +static const int _33 = _30.y; + +static float4 gl_Position; +static int _4; + +struct SPIRV_Cross_Output +{ + nointerpolation int _4 : TEXCOORD0; + float4 gl_Position : SV_Position; +}; + +void vert_main() +{ + float4 pos = 0.0f.xxxx; + pos.y += float(_20); + pos.z += float(_25); + pos += float4(_30); + float2 _56 = pos.xy + float2(_32); + pos = float4(_56.x, _56.y, pos.z, pos.w); + gl_Position = pos; + _4 = _33; +} + +SPIRV_Cross_Output main() +{ + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output._4 = _4; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..a18c6e7056 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,37 @@ +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; +}; + +float4 _main(uint vid, uint iid) +{ + return float(vid + iid).xxxx; +} + +void vert_main() +{ + uint vid = uint(gl_VertexIndex); + uint iid = uint(gl_InstanceIndex); + uint param = vid; + uint param_1 = iid; + gl_Position = _main(param, param_1); +} + +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; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/bitfield.noopt.comp deleted file mode 100644 index 6839d9569e..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-hlsl/comp/bitfield.noopt.comp +++ /dev/null @@ -1,113 +0,0 @@ -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(); -} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/comp/globallycoherent.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/globallycoherent.comp new file mode 100644 index 0000000000..69886256f8 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/globallycoherent.comp @@ -0,0 +1,18 @@ +globallycoherent RWByteAddressBuffer _29 : register(u3); +ByteAddressBuffer _33 : register(t2); +RWTexture2D uImageIn : register(u0); +globallycoherent RWTexture2D uImageOut : register(u1); + +void comp_main() +{ + int2 coord = int2(9, 7); + float4 indata = uImageIn[coord].xxxx; + uImageOut[coord] = indata.x; + _29.Store(0, asuint(asfloat(_33.Load(0)))); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/comp/rmw-matrix.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/rmw-matrix.comp new file mode 100644 index 0000000000..ed66669358 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +RWByteAddressBuffer _11 : register(u0); + +void comp_main() +{ + _11.Store(0, asuint(asfloat(_11.Load(0)) * asfloat(_11.Load(96)))); + _11.Store4(16, asuint(asfloat(_11.Load4(16)) * asfloat(_11.Load4(112)))); + float4x4 _35 = asfloat(uint4x4(_11.Load4(128), _11.Load4(144), _11.Load4(160), _11.Load4(176))); + float4x4 _37 = asfloat(uint4x4(_11.Load4(32), _11.Load4(48), _11.Load4(64), _11.Load4(80))); + float4x4 _38 = mul(_35, _37); + _11.Store4(32, asuint(_38[0])); + _11.Store4(48, asuint(_38[1])); + _11.Store4(64, asuint(_38[2])); + _11.Store4(80, asuint(_38[3])); +} + +[numthreads(1, 1, 1)] +void main() +{ + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp new file mode 100644 index 0000000000..b87574f1a7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp @@ -0,0 +1,93 @@ +RWByteAddressBuffer _9 : register(u0, space0); + +static uint4 gl_SubgroupEqMask; +static uint4 gl_SubgroupGeMask; +static uint4 gl_SubgroupGtMask; +static uint4 gl_SubgroupLeMask; +static uint4 gl_SubgroupLtMask; +void comp_main() +{ + _9.Store(0, asuint(float(WaveGetLaneCount()))); + _9.Store(0, asuint(float(WaveGetLaneIndex()))); + bool elected = WaveIsFirstLane(); + _9.Store(0, asuint(float4(gl_SubgroupEqMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupGeMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupGtMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupLeMask).x)); + _9.Store(0, asuint(float4(gl_SubgroupLtMask).x)); + float4 broadcasted = WaveReadLaneAt(10.0f.xxxx, 8u); + float3 first = WaveReadLaneFirst(20.0f.xxx); + uint4 ballot_value = WaveActiveBallot(true); + uint bit_count = countbits(ballot_value.x) + countbits(ballot_value.y) + countbits(ballot_value.z) + countbits(ballot_value.w); + bool has_all = WaveActiveAllTrue(true); + bool has_any = WaveActiveAnyTrue(true); + bool has_equal = WaveActiveAllEqualBool(true); + float4 added = WaveActiveSum(20.0f.xxxx); + int4 iadded = WaveActiveSum(int4(20, 20, 20, 20)); + float4 multiplied = WaveActiveProduct(20.0f.xxxx); + int4 imultiplied = WaveActiveProduct(int4(20, 20, 20, 20)); + float4 lo = WaveActiveMin(20.0f.xxxx); + float4 hi = WaveActiveMax(20.0f.xxxx); + int4 slo = WaveActiveMin(int4(20, 20, 20, 20)); + int4 shi = WaveActiveMax(int4(20, 20, 20, 20)); + uint4 ulo = WaveActiveMin(uint4(20u, 20u, 20u, 20u)); + uint4 uhi = WaveActiveMax(uint4(20u, 20u, 20u, 20u)); + uint4 anded = WaveActiveBitAnd(ballot_value); + uint4 ored = WaveActiveBitOr(ballot_value); + uint4 xored = WaveActiveBitXor(ballot_value); + added = WavePrefixSum(added) + added; + iadded = WavePrefixSum(iadded) + iadded; + multiplied = WavePrefixProduct(multiplied) * multiplied; + imultiplied = WavePrefixProduct(imultiplied) * imultiplied; + added = WavePrefixSum(multiplied); + multiplied = WavePrefixProduct(multiplied); + iadded = WavePrefixSum(imultiplied); + imultiplied = WavePrefixProduct(imultiplied); + float4 swap_horiz = QuadReadAcrossX(20.0f.xxxx); + float4 swap_vertical = QuadReadAcrossY(20.0f.xxxx); + float4 swap_diagonal = QuadReadAcrossDiagonal(20.0f.xxxx); + float4 quad_broadcast = QuadReadLaneAt(20.0f.xxxx, 3u); +} + +[numthreads(1, 1, 1)] +void main() +{ + gl_SubgroupEqMask = 1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96)); + if (WaveGetLaneIndex() >= 32) gl_SubgroupEqMask.x = 0; + if (WaveGetLaneIndex() >= 64 || WaveGetLaneIndex() < 32) gl_SubgroupEqMask.y = 0; + if (WaveGetLaneIndex() >= 96 || WaveGetLaneIndex() < 64) gl_SubgroupEqMask.z = 0; + if (WaveGetLaneIndex() < 96) gl_SubgroupEqMask.w = 0; + gl_SubgroupGeMask = ~((1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u); + if (WaveGetLaneIndex() >= 32) gl_SubgroupGeMask.x = 0u; + if (WaveGetLaneIndex() >= 64) gl_SubgroupGeMask.y = 0u; + if (WaveGetLaneIndex() >= 96) gl_SubgroupGeMask.z = 0u; + if (WaveGetLaneIndex() < 32) gl_SubgroupGeMask.y = ~0u; + if (WaveGetLaneIndex() < 64) gl_SubgroupGeMask.z = ~0u; + if (WaveGetLaneIndex() < 96) gl_SubgroupGeMask.w = ~0u; + uint gt_lane_index = WaveGetLaneIndex() + 1; + gl_SubgroupGtMask = ~((1u << (gt_lane_index - uint4(0, 32, 64, 96))) - 1u); + if (gt_lane_index >= 32) gl_SubgroupGtMask.x = 0u; + if (gt_lane_index >= 64) gl_SubgroupGtMask.y = 0u; + if (gt_lane_index >= 96) gl_SubgroupGtMask.z = 0u; + if (gt_lane_index >= 128) gl_SubgroupGtMask.w = 0u; + if (gt_lane_index < 32) gl_SubgroupGtMask.y = ~0u; + if (gt_lane_index < 64) gl_SubgroupGtMask.z = ~0u; + if (gt_lane_index < 96) gl_SubgroupGtMask.w = ~0u; + uint le_lane_index = WaveGetLaneIndex() + 1; + gl_SubgroupLeMask = (1u << (le_lane_index - uint4(0, 32, 64, 96))) - 1u; + if (le_lane_index >= 32) gl_SubgroupLeMask.x = ~0u; + if (le_lane_index >= 64) gl_SubgroupLeMask.y = ~0u; + if (le_lane_index >= 96) gl_SubgroupLeMask.z = ~0u; + if (le_lane_index >= 128) gl_SubgroupLeMask.w = ~0u; + if (le_lane_index < 32) gl_SubgroupLeMask.y = 0u; + if (le_lane_index < 64) gl_SubgroupLeMask.z = 0u; + if (le_lane_index < 96) gl_SubgroupLeMask.w = 0u; + gl_SubgroupLtMask = (1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u; + if (WaveGetLaneIndex() >= 32) gl_SubgroupLtMask.x = ~0u; + if (WaveGetLaneIndex() >= 64) gl_SubgroupLtMask.y = ~0u; + if (WaveGetLaneIndex() >= 96) gl_SubgroupLtMask.z = ~0u; + if (WaveGetLaneIndex() < 32) gl_SubgroupLtMask.y = 0u; + if (WaveGetLaneIndex() < 64) gl_SubgroupLtMask.z = 0u; + if (WaveGetLaneIndex() < 96) gl_SubgroupLtMask.w = 0u; + comp_main(); +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..407fa2bda4 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,30 @@ +static const float _17[5] = { 1.0f, 2.0f, 3.0f, 4.0f, 5.0f }; + +static float4 FragColor; +static float4 v0; + +struct SPIRV_Cross_Input +{ + float4 v0 : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + for (int i = 0; i < 4; i++, FragColor += _17[i].xxxx) + { + } +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v0 = stage_input.v0; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/constant-composites.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/constant-composites.frag index 0514eef1ee..2613e1c2c5 100644 --- a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/constant-composites.frag +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/constant-composites.frag @@ -30,7 +30,7 @@ void frag_main() lut = _16; foos = _28; FragColor = lut[_line].xxxx; - FragColor += (foos[_line].a * (foos[1 - _line].a)).xxxx; + FragColor += (foos[_line].a * foos[1 - _line].a).xxxx; } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..322102ce86 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,55 @@ +Texture2D uSampler : register(t0); +SamplerState _uSampler_sampler : register(s0); + +static float4 FragColor; +static float4 vInput; + +struct SPIRV_Cross_Input +{ + float4 vInput : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = vInput; + float4 t = uSampler.Sample(_uSampler_sampler, vInput.xy); + float4 d0 = ddx(vInput); + float4 d1 = ddy(vInput); + float4 d2 = fwidth(vInput); + float4 d3 = ddx_coarse(vInput); + float4 d4 = ddy_coarse(vInput); + float4 d5 = fwidth(vInput); + float4 d6 = ddx_fine(vInput); + float4 d7 = ddy_fine(vInput); + float4 d8 = fwidth(vInput); + float _56_tmp = uSampler.CalculateLevelOfDetail(_uSampler_sampler, vInput.zw); + float2 lod = float2(_56_tmp, _56_tmp); + if (vInput.y > 10.0f) + { + FragColor += t; + FragColor += d0; + FragColor += d1; + FragColor += d2; + FragColor += d3; + FragColor += d4; + FragColor += d5; + FragColor += d6; + FragColor += d7; + FragColor += d8; + FragColor += lod.xyxy; + } +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vInput = stage_input.vInput; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/fp16.desktop.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/fp16.desktop.frag new file mode 100644 index 0000000000..e10d6724e0 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/fp16.desktop.frag @@ -0,0 +1,179 @@ +static min16float4 v4; +static min16float3 v3; +static min16float v1; +static min16float2 v2; +static float o1; +static float2 o2; +static float3 o3; +static float4 o4; + +struct SPIRV_Cross_Input +{ + min16float v1 : TEXCOORD0; + min16float2 v2 : TEXCOORD1; + min16float3 v3 : TEXCOORD2; + min16float4 v4 : TEXCOORD3; +}; + +struct SPIRV_Cross_Output +{ + float o1 : SV_Target0; + float2 o2 : SV_Target1; + float3 o3 : SV_Target2; + float4 o4 : SV_Target3; +}; + +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); +} + +uint SPIRV_Cross_packFloat2x16(min16float2 value) +{ + uint2 Packed = f32tof16(value); + return Packed.x | (Packed.y << 16); +} + +min16float2 SPIRV_Cross_unpackFloat2x16(uint value) +{ + return min16float2(f16tof32(uint2(value & 0xffff, value >> 16))); +} + +void test_constants() +{ + min16float a = min16float(1.0); + min16float b = min16float(1.5); + min16float c = min16float(-1.5); + min16float d = min16float(0.0 / 0.0); + min16float e = min16float(1.0 / 0.0); + min16float f = min16float(-1.0 / 0.0); + min16float g = min16float(1014.0); + min16float h = min16float(9.5367431640625e-07); +} + +min16float test_result() +{ + return min16float(1.0); +} + +void test_conversions() +{ + min16float one = test_result(); + int a = int(one); + uint b = uint(one); + bool c = one != min16float(0.0); + float d = float(one); + double e = double(one); + min16float a2 = min16float(a); + min16float b2 = min16float(b); + min16float c2 = min16float(c); + min16float d2 = min16float(d); + min16float e2 = min16float(e); +} + +void test_builtins() +{ + min16float4 res = radians(v4); + res = degrees(v4); + res = sin(v4); + res = cos(v4); + res = tan(v4); + res = asin(v4); + res = atan2(v4, v3.xyzz); + res = atan(v4); + res = sinh(v4); + res = cosh(v4); + res = tanh(v4); + res = pow(v4, v4); + res = exp(v4); + res = log(v4); + res = exp2(v4); + res = log2(v4); + res = sqrt(v4); + res = rsqrt(v4); + res = abs(v4); + res = sign(v4); + res = floor(v4); + res = trunc(v4); + res = round(v4); + res = ceil(v4); + res = frac(v4); + res = mod(v4, v4); + min16float4 tmp; + min16float4 _144 = modf(v4, tmp); + res = _144; + res = min(v4, v4); + res = max(v4, v4); + res = clamp(v4, v4, v4); + res = lerp(v4, v4, v4); + bool4 _164 = bool4(v4.x < v4.x, v4.y < v4.y, v4.z < v4.z, v4.w < v4.w); + res = min16float4(_164.x ? v4.x : v4.x, _164.y ? v4.y : v4.y, _164.z ? v4.z : v4.z, _164.w ? v4.w : v4.w); + res = step(v4, v4); + res = smoothstep(v4, v4, v4); + bool4 btmp = isnan(v4); + btmp = isinf(v4); + res = mad(v4, v4, v4); + uint pack0 = SPIRV_Cross_packFloat2x16(v4.xy); + uint pack1 = SPIRV_Cross_packFloat2x16(v4.zw); + res = min16float4(SPIRV_Cross_unpackFloat2x16(pack0), SPIRV_Cross_unpackFloat2x16(pack1)); + min16float t0 = length(v4); + t0 = distance(v4, v4); + t0 = dot(v4, v4); + min16float3 res3 = cross(v3, v3); + res = normalize(v4); + res = faceforward(v4, v4, v4); + res = reflect(v4, v4); + res = refract(v4, v4, v1); + btmp = bool4(v4.x < v4.x, v4.y < v4.y, v4.z < v4.z, v4.w < v4.w); + btmp = bool4(v4.x <= v4.x, v4.y <= v4.y, v4.z <= v4.z, v4.w <= v4.w); + btmp = bool4(v4.x > v4.x, v4.y > v4.y, v4.z > v4.z, v4.w > v4.w); + btmp = bool4(v4.x >= v4.x, v4.y >= v4.y, v4.z >= v4.z, v4.w >= v4.w); + btmp = bool4(v4.x == v4.x, v4.y == v4.y, v4.z == v4.z, v4.w == v4.w); + btmp = bool4(v4.x != v4.x, v4.y != v4.y, v4.z != v4.z, v4.w != v4.w); + res = ddx(v4); + res = ddy(v4); + res = ddx_fine(v4); + res = ddy_fine(v4); + res = ddx_coarse(v4); + res = ddy_coarse(v4); + res = fwidth(v4); + res = fwidth(v4); + res = fwidth(v4); +} + +void frag_main() +{ + test_constants(); + test_conversions(); + test_builtins(); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + v4 = stage_input.v4; + v3 = stage_input.v3; + v1 = stage_input.v1; + v2 = stage_input.v2; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.o1 = o1; + stage_output.o2 = o2; + stage_output.o3 = o3; + stage_output.o4 = o4; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/lut-promotion.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/lut-promotion.frag new file mode 100644 index 0000000000..d148bc12cb --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/lut-promotion.frag @@ -0,0 +1,55 @@ +static const float _16[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f }; +static const float4 _60[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx }; +static const float4 _104[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx }; + +static float FragColor; +static int index; + +struct SPIRV_Cross_Input +{ + nointerpolation int index : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = _16[index]; + if (index < 10) + { + FragColor += _16[index ^ 1]; + } + else + { + FragColor += _16[index & 1]; + } + if (index > 30) + { + FragColor += _60[index & 3].y; + } + else + { + FragColor += _60[index & 1].x; + } + float4 foobar[4] = _60; + if (index > 30) + { + foobar[1].z = 20.0f; + } + FragColor += foobar[index & 3].z; + float4 baz[4] = _60; + baz = _104; + FragColor += baz[index & 3].z; +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + index = stage_input.index; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/row-major-layout-in-struct.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/row-major-layout-in-struct.frag new file mode 100644 index 0000000000..f97e2174ec --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/row-major-layout-in-struct.frag @@ -0,0 +1,46 @@ +struct NonFoo +{ + float4x4 v; + float4x4 w; +}; + +struct Foo +{ + row_major float4x4 v; + row_major float4x4 w; +}; + +cbuffer _17 : register(b0) +{ + Foo _17_foo : packoffset(c0); +}; + +static float4 FragColor; +static float4 vUV; + +struct SPIRV_Cross_Input +{ + float4 vUV : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + NonFoo f; + f.v = _17_foo.v; + f.w = _17_foo.w; + FragColor = mul(mul(vUV, f.w), f.v); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vUV = stage_input.vUV; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/sampler-image-arrays.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/sampler-image-arrays.frag new file mode 100644 index 0000000000..856f04cf47 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/sampler-image-arrays.frag @@ -0,0 +1,54 @@ +Texture2D uSampler[4] : register(t0); +SamplerState _uSampler_sampler[4] : register(s0); +Texture2D uTextures[4] : register(t8); +SamplerState uSamplers[4] : register(s4); + +static int vIndex; +static float2 vTex; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + nointerpolation float2 vTex : TEXCOORD0; + nointerpolation int vIndex : TEXCOORD1; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +float4 sample_from_global() +{ + return uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex + 0.100000001490116119384765625f.xx); +} + +float4 sample_from_argument(Texture2D samplers[4], SamplerState _samplers_sampler[4]) +{ + return samplers[vIndex].Sample(_samplers_sampler[vIndex], vTex + 0.20000000298023223876953125f.xx); +} + +float4 sample_single_from_argument(Texture2D samp, SamplerState _samp_sampler) +{ + return samp.Sample(_samp_sampler, vTex + 0.300000011920928955078125f.xx); +} + +void frag_main() +{ + FragColor = 0.0f.xxxx; + FragColor += uTextures[2].Sample(uSamplers[1], vTex); + FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex); + FragColor += sample_from_global(); + FragColor += sample_from_argument(uSampler, _uSampler_sampler); + FragColor += sample_single_from_argument(uSampler[3], _uSampler_sampler[3]); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + vIndex = stage_input.vIndex; + vTex = stage_input.vTex; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/spec-constant-ternary.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/spec-constant-ternary.frag new file mode 100644 index 0000000000..12e0f5bd79 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/spec-constant-ternary.frag @@ -0,0 +1,23 @@ +static const uint s = 10u; +static const bool _13 = (s > 20u); +static const uint _16 = _13 ? 30u : 50u; + +static float FragColor; + +struct SPIRV_Cross_Output +{ + float FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = float(_16); +} + +SPIRV_Cross_Output main() +{ + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/spec-constant.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/spec-constant.frag deleted file mode 100644 index 70b029dc68..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/spec-constant.frag +++ /dev/null @@ -1,79 +0,0 @@ -static const float a = 1.0f; -static const float b = 2.0f; -static const int c = 3; -static const int d = 4; -static const uint e = 5u; -static const uint f = 6u; -static const bool g = false; -static const bool h = true; - -struct Foo -{ - float elems[(d + 2)]; -}; - -static float4 FragColor; - -struct SPIRV_Cross_Output -{ - float4 FragColor : SV_Target0; -}; - -void frag_main() -{ - float t0 = a; - float t1 = b; - uint c0 = (uint(c) + 0u); - int c1 = (-c); - int c2 = (~c); - int c3 = (c + d); - int c4 = (c - d); - int c5 = (c * d); - int c6 = (c / d); - uint c7 = (e / f); - int c8 = (c % d); - uint c9 = (e % f); - int c10 = (c >> d); - uint c11 = (e >> f); - int c12 = (c << d); - int c13 = (c | d); - int c14 = (c ^ d); - int c15 = (c & d); - bool c16 = (g || h); - bool c17 = (g && h); - bool c18 = (!g); - bool c19 = (g == h); - bool c20 = (g != h); - bool c21 = (c == d); - bool c22 = (c != d); - bool c23 = (c < d); - bool c24 = (e < f); - bool c25 = (c > d); - bool c26 = (e > f); - bool c27 = (c <= d); - bool c28 = (e <= f); - bool c29 = (c >= d); - bool c30 = (e >= f); - int c31 = c8 + c3; - int c32 = int(e + 0u); - bool c33 = (c != int(0u)); - bool c34 = (e != 0u); - int c35 = int(g); - uint c36 = uint(g); - float c37 = float(g); - float vec0[(c + 3)][8]; - vec0[0][0] = 10.0f; - float vec1[(c + 2)]; - vec1[0] = 20.0f; - Foo foo; - foo.elems[c] = 10.0f; - FragColor = (((t0 + t1).xxxx + vec0[0][0].xxxx) + vec1[0].xxxx) + foo.elems[c].xxxx; -} - -SPIRV_Cross_Output main() -{ - frag_main(); - SPIRV_Cross_Output stage_output; - stage_output.FragColor = FragColor; - return stage_output; -} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling-ms.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling-ms.frag new file mode 100644 index 0000000000..1435315383 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling-ms.frag @@ -0,0 +1,32 @@ +Texture2DMS uTex : register(t0); +SamplerState _uTex_sampler : register(s0); + +static float4 gl_FragCoord; +static float4 FragColor; + +struct SPIRV_Cross_Input +{ + float4 gl_FragCoord : SV_Position; +}; + +struct SPIRV_Cross_Output +{ + float4 FragColor : SV_Target0; +}; + +void frag_main() +{ + FragColor = uTex.Load(int2(gl_FragCoord.xy), 0); + FragColor += uTex.Load(int2(gl_FragCoord.xy), 1); + FragColor += uTex.Load(int2(gl_FragCoord.xy), 2); + FragColor += uTex.Load(int2(gl_FragCoord.xy), 3); +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + gl_FragCoord = stage_input.gl_FragCoord; + frag_main(); + SPIRV_Cross_Output stage_output; + stage_output.FragColor = FragColor; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling.frag b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling.frag index 7e10bfdd24..7fa60957dc 100644 --- a/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling.frag +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/frag/tex-sampling.frag @@ -1,27 +1,27 @@ -Texture1D tex1d; -SamplerState _tex1d_sampler; -Texture2D tex2d; -SamplerState _tex2d_sampler; -Texture3D tex3d; -SamplerState _tex3d_sampler; -TextureCube texCube; -SamplerState _texCube_sampler; -Texture1D tex1dShadow; -SamplerComparisonState _tex1dShadow_sampler; -Texture2D tex2dShadow; -SamplerComparisonState _tex2dShadow_sampler; -TextureCube texCubeShadow; -SamplerComparisonState _texCubeShadow_sampler; -Texture1DArray tex1dArray; -SamplerState _tex1dArray_sampler; -Texture2DArray tex2dArray; -SamplerState _tex2dArray_sampler; -TextureCubeArray texCubeArray; -SamplerState _texCubeArray_sampler; -Texture2D separateTex2d; -SamplerState samplerNonDepth; -Texture2D separateTex2dDepth; -SamplerComparisonState samplerDepth; +Texture1D tex1d : register(t0); +SamplerState _tex1d_sampler : register(s0); +Texture2D tex2d : register(t1); +SamplerState _tex2d_sampler : register(s1); +Texture3D tex3d : register(t2); +SamplerState _tex3d_sampler : register(s2); +TextureCube texCube : register(t3); +SamplerState _texCube_sampler : register(s3); +Texture1D tex1dShadow : register(t4); +SamplerComparisonState _tex1dShadow_sampler : register(s4); +Texture2D tex2dShadow : register(t5); +SamplerComparisonState _tex2dShadow_sampler : register(s5); +TextureCube texCubeShadow : register(t6); +SamplerComparisonState _texCubeShadow_sampler : register(s6); +Texture1DArray tex1dArray : register(t7); +SamplerState _tex1dArray_sampler : register(s7); +Texture2DArray tex2dArray : register(t8); +SamplerState _tex2dArray_sampler : register(s8); +TextureCubeArray texCubeArray : register(t9); +SamplerState _texCubeArray_sampler : register(s9); +Texture2D separateTex2d : register(t12); +SamplerState samplerNonDepth : register(s11); +Texture2D separateTex2dDepth : register(t13); +SamplerComparisonState samplerDepth : register(s10); static float texCoord1d; static float2 texCoord2d; diff --git a/deps/SPIRV-Cross/reference/shaders-hlsl/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/reference/shaders-hlsl/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..79758a4697 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-hlsl/vert/read-from-row-major-array.vert @@ -0,0 +1,64 @@ +cbuffer _104 : register(b0) +{ + column_major float2x3 _104_var[3][4] : packoffset(c0); +}; + +static float4 gl_Position; +static float4 a_position; +static float v_vtxResult; + +struct SPIRV_Cross_Input +{ + float4 a_position : TEXCOORD0; +}; + +struct SPIRV_Cross_Output +{ + float v_vtxResult : TEXCOORD0; + float4 gl_Position : SV_Position; +}; + +float compare_float(float a, float b) +{ + return float(abs(a - b) < 0.0500000007450580596923828125f); +} + +float compare_vec3(float3 a, float3 b) +{ + float param = a.x; + float param_1 = b.x; + float param_2 = a.y; + float param_3 = b.y; + float param_4 = a.z; + float param_5 = b.z; + return (compare_float(param, param_1) * compare_float(param_2, param_3)) * compare_float(param_4, param_5); +} + +float compare_mat2x3(float2x3 a, float2x3 b) +{ + float3 param = a[0]; + float3 param_1 = b[0]; + float3 param_2 = a[1]; + float3 param_3 = b[1]; + return compare_vec3(param, param_1) * compare_vec3(param_2, param_3); +} + +void vert_main() +{ + gl_Position = a_position; + float result = 1.0f; + float2x3 param = _104_var[0][0]; + float2x3 param_1 = float2x3(float3(2.0f, 6.0f, -6.0f), float3(0.0f, 5.0f, 5.0f)); + result *= compare_mat2x3(param, param_1); + v_vtxResult = result; +} + +SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) +{ + a_position = stage_input.a_position; + vert_main(); + SPIRV_Cross_Output stage_output; + stage_output.gl_Position = gl_Position; + stage_output.v_vtxResult = v_vtxResult; + return stage_output; +} diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag similarity index 93% rename from deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag rename to deps/SPIRV-Cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag index 2ac8cbe015..ce44c564fd 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag @@ -83,25 +83,25 @@ 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]], constant CB0& _19 [[buffer(0)]], texture3d LightMapTexture [[texture(0)]], texture2d ShadowMapTexture [[texture(1)]], texturecube EnvironmentMapTexture [[texture(2)]], texture2d DiffuseMapTexture [[texture(3)]], texture2d NormalMapTexture [[texture(4)]], texture2d NormalDetailMapTexture [[texture(5)]], texture2d StudsMapTexture [[texture(6)]], texture2d SpecularMapTexture [[texture(7)]], sampler LightMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], sampler NormalMapSampler [[sampler(4)]], sampler NormalDetailMapSampler [[sampler(5)]], sampler StudsMapSampler [[sampler(6)]], sampler SpecularMapSampler [[sampler(7)]], float4 gl_FragCoord [[position]]) +struct main0_in +{ + float4 IN_Uv_EdgeDistance1 [[user(locn0)]]; + float4 IN_UvStuds_EdgeDistance2 [[user(locn1)]]; + float4 IN_Color [[user(locn2)]]; + float4 IN_LightPosition_Fog [[user(locn3)]]; + float4 IN_View_Depth [[user(locn4)]]; + float4 IN_Normal_SpecPower [[user(locn5)]]; + float3 IN_Tangent [[user(locn6)]]; + float4 IN_PosLightSpace_Reflectance [[user(locn7)]]; + float IN_studIndex [[user(locn8)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], constant CB0& _19 [[buffer(0)]], texture2d StudsMapTexture [[texture(0)]], texture2d ShadowMapTexture [[texture(1)]], texturecube EnvironmentMapTexture [[texture(2)]], texture2d DiffuseMapTexture [[texture(3)]], texture2d NormalMapTexture [[texture(4)]], texture2d SpecularMapTexture [[texture(5)]], texture3d LightMapTexture [[texture(6)]], texture2d NormalDetailMapTexture [[texture(8)]], sampler StudsMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], sampler NormalMapSampler [[sampler(4)]], sampler SpecularMapSampler [[sampler(5)]], sampler LightMapSampler [[sampler(6)]], sampler NormalDetailMapSampler [[sampler(8)]], float4 gl_FragCoord [[position]]) { main0_out out = {}; VertexOutput _128 = _121; @@ -154,6 +154,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant CB0& _19 [[buffer(0) _193 = _192; break; } while (false); + float4 _194 = _193 * 1.0; float4 _220; do { @@ -179,7 +180,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant CB0& _19 [[buffer(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); + float3 _271 = ((in.IN_Color.xyz * _194.xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (StudsMapTexture.sample(StudsMapSampler, _156.UvStuds).x * 2.0); float4 _298; do { diff --git a/deps/SPIRV-Cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert new file mode 100644 index 0000000000..e9cd6a540a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert @@ -0,0 +1,16 @@ +#include +#include + +using namespace metal; + +struct Test +{ + int empty_struct_member; +}; + +vertex void main0() +{ + Test _14 = Test{ 0 }; + Test t = _14; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/bitfield.comp similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders-msl/comp/bitfield.noopt.comp rename to deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/bitfield.comp diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/loop.noopt.comp b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/loop.comp similarity index 91% rename from deps/SPIRV-Cross/reference/opt/shaders-msl/comp/loop.noopt.comp rename to deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/loop.comp index 00ed570b31..d7677fb436 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/comp/loop.noopt.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/loop.comp @@ -14,7 +14,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO& _24 [[buffer(0)]], device SSBO2& _177 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _24 [[buffer(0)]], device SSBO2& _177 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; float4 idat = _24.in_data[ident]; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/return.comp b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/return.comp similarity index 90% rename from deps/SPIRV-Cross/reference/shaders-msl/comp/return.comp rename to deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/return.comp index 71fcfbe391..4015ddb37b 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/return.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/comp/return.comp @@ -8,7 +8,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO2& _27 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(device SSBO2& _27 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; if (ident == 2u) diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block_assign.noopt.frag b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/frag/in_block_assign.frag similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block_assign.noopt.frag rename to deps/SPIRV-Cross/reference/shaders-msl-no-opt/frag/in_block_assign.frag index d06863d99c..3449dcc077 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/frag/in_block_assign.noopt.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/frag/in_block_assign.frag @@ -8,16 +8,16 @@ struct VOUT float4 a; }; -struct main0_in -{ - float4 VOUT_a [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 VOUT_a [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl-no-opt/vert/functions_nested.vert b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/vert/functions_nested.vert index aa66304682..037ead3922 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl-no-opt/vert/functions_nested.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl-no-opt/vert/functions_nested.vert @@ -36,6 +36,12 @@ struct main0_out float4 gl_Position [[position]]; }; +// Returns 2D texture coords corresponding to 1D texel buffer coords +uint2 spvTexelBufferCoord(uint tc) +{ + return uint2(tc % 4096, tc / 4096); +} + attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227) { int attribute_flags = v_227.input_attributes[location].w; @@ -76,10 +82,10 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr { int _131 = first_byte; first_byte = _131 + 1; - tmp.x = input_stream.read(uint2(_131, 0)).x; + tmp.x = input_stream.read(spvTexelBufferCoord(_131)).x; int _138 = first_byte; first_byte = _138 + 1; - tmp.y = input_stream.read(uint2(_138, 0)).x; + tmp.y = input_stream.read(spvTexelBufferCoord(_138)).x; uint4 param = tmp; int param_1 = desc.swap_bytes; result[n] = float(get_bits(param, param_1)); @@ -89,16 +95,16 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr { int _156 = first_byte; first_byte = _156 + 1; - tmp.x = input_stream.read(uint2(_156, 0)).x; + tmp.x = input_stream.read(spvTexelBufferCoord(_156)).x; int _163 = first_byte; first_byte = _163 + 1; - tmp.y = input_stream.read(uint2(_163, 0)).x; + tmp.y = input_stream.read(spvTexelBufferCoord(_163)).x; int _170 = first_byte; first_byte = _170 + 1; - tmp.z = input_stream.read(uint2(_170, 0)).x; + tmp.z = input_stream.read(spvTexelBufferCoord(_170)).x; int _177 = first_byte; first_byte = _177 + 1; - tmp.w = input_stream.read(uint2(_177, 0)).x; + tmp.w = input_stream.read(spvTexelBufferCoord(_177)).x; uint4 param_2 = tmp; int param_3 = desc.swap_bytes; result[n] = as_type(get_bits(param_2, param_3)); @@ -108,22 +114,22 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr { int _195 = first_byte; first_byte = _195 + 1; - result[n] = float(input_stream.read(uint2(_195, 0)).x); + result[n] = float(input_stream.read(spvTexelBufferCoord(_195)).x); reverse_order = desc.swap_bytes != 0; break; } } } - float4 _209; + float4 _210; if (reverse_order) { - _209 = result.wzyx; + _210 = result.wzyx; } else { - _209 = result; + _210 = result; } - return _209; + return _210; } float4 read_location(thread const int& location, constant VertexBuffer& v_227, thread uint& gl_VertexIndex, thread texture2d buff_in_2, thread texture2d buff_in_1) @@ -167,7 +173,7 @@ void vs_adjust(thread float4& dst_reg0, thread float4& dst_reg1, thread float4& dst_reg0.x = float4(dot(float4(tmp0.xyz, 1.0), v_309.vc[0])).x; } -vertex main0_out main0(constant VertexBuffer& v_227 [[buffer(0)]], constant VertexConstantsBuffer& v_309 [[buffer(1)]], texture2d buff_in_2 [[texture(0)]], texture2d buff_in_1 [[texture(1)]], uint gl_VertexIndex [[vertex_id]]) +vertex main0_out main0(constant VertexBuffer& v_227 [[buffer(0)]], constant VertexConstantsBuffer& v_309 [[buffer(1)]], texture2d buff_in_1 [[texture(3)]], texture2d buff_in_2 [[texture(4)]], uint gl_VertexIndex [[vertex_id]]) { main0_out out = {}; float4 dst_reg0 = float4(0.0, 0.0, 0.0, 1.0); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sar.asm.comp b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sar.asm.comp index 20d6fe9e9d..4176830588 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sar.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sar.asm.comp @@ -17,13 +17,15 @@ struct _4 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); + int4 _22 = _5._m0; + uint4 _23 = _5._m1; + _6._m0 = uint4(int4(_23) >> _22); + _6._m0 = uint4(_22 >> int4(_23)); + _6._m0 = uint4(int4(_23) >> int4(_23)); + _6._m0 = uint4(_22 >> _22); + _6._m1 = int4(_23) >> int4(_23); + _6._m1 = _22 >> _22; + _6._m1 = int4(_23) >> _22; + _6._m1 = _22 >> int4(_23); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sdiv.asm.comp b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sdiv.asm.comp index f18b318bbb..6b80dff310 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sdiv.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_sdiv.asm.comp @@ -17,13 +17,15 @@ struct _4 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); + int4 _22 = _5._m0; + uint4 _23 = _5._m1; + _6._m0 = uint4(int4(_23) / _22); + _6._m0 = uint4(_22 / int4(_23)); + _6._m0 = uint4(int4(_23) / int4(_23)); + _6._m0 = uint4(_22 / _22); + _6._m1 = int4(_23) / int4(_23); + _6._m1 = _22 / _22; + _6._m1 = int4(_23) / _22; + _6._m1 = _22 / int4(_23); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_slr.asm.comp b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_slr.asm.comp index 9fd60bef26..1dfca39181 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_slr.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/bitcast_slr.asm.comp @@ -17,13 +17,15 @@ struct _4 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); + int4 _22 = _5._m0; + uint4 _23 = _5._m1; + _6._m0 = _23 >> uint4(_22); + _6._m0 = uint4(_22) >> _23; + _6._m0 = _23 >> _23; + _6._m0 = uint4(_22) >> uint4(_22); + _6._m1 = int4(_23 >> _23); + _6._m1 = int4(uint4(_22) >> uint4(_22)); + _6._m1 = int4(_23 >> uint4(_22)); + _6._m1 = int4(uint4(_22) >> _23); } diff --git a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.asm.comp b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp similarity index 94% rename from deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.asm.comp rename to deps/SPIRV-Cross/reference/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp index 3df6161fc2..2c9b038b20 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders-msl/asm/comp/storage-buffer-basic.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp @@ -17,5 +17,6 @@ struct _6 kernel void main0(device _6& _8 [[buffer(0)]], device _6& _9 [[buffer(1)]], uint3 gl_WorkGroupID [[threadgroup_position_in_grid]]) { _8._m0[gl_WorkGroupID.x] = _9._m0[gl_WorkGroupID.x] + _8._m0[gl_WorkGroupID.x]; + uint3 _23 = gl_WorkGroupSize; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag new file mode 100644 index 0000000000..e420153bf1 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vUV [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uTex [[texture(1)]], sampler uSampler [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = uTex.sample(uSampler, in.vUV); + out.FragColor += uTex.sample(uSampler, in.vUV, int2(1)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..366ab16577 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/empty-struct.asm.frag @@ -0,0 +1,30 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct EmptyStructTest +{ + int empty_struct_member; +}; + +float GetValue(thread const EmptyStructTest& self) +{ + return 0.0; +} + +float GetValue_1(thread const EmptyStructTest& self) +{ + return 0.0; +} + +fragment void main0() +{ + EmptyStructTest _23 = EmptyStructTest{ 0 }; + EmptyStructTest emptyStruct; + float value = GetValue(emptyStruct); + value = GetValue_1(_23); +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/frem.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/frem.asm.frag index f7c1f2ce88..ebc73d52df 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/frem.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/frem.asm.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 vB [[user(locn1)]]; - float4 vA [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vA [[user(locn0)]]; + float4 vB [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..0d691b306d --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + int2 Size [[color(0)]]; +}; + +fragment main0_out main0(texture2d uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.Size = int2(uTexture.get_width(), uTexture.get_height()) + int2(uTexture.get_width(1), uTexture.get_height(1)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..830df0c7e9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,49 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float4 v0 [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uImage [[texture(0)]], sampler uImageSmplr [[sampler(0)]]) +{ + main0_out out = {}; + int i = 0; + float phi; + float4 _36; + phi = 1.0; + _36 = float4(1.0, 2.0, 1.0, 2.0); + for (;;) + { + out.FragColor = _36; + if (i < 4) + { + if (in.v0[i] > 0.0) + { + float2 _48 = float2(phi); + i++; + phi += 2.0; + _36 = uImage.sample(uImageSmplr, _48, level(0.0)); + continue; + } + else + { + break; + } + } + else + { + break; + } + } + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag deleted file mode 100644 index 2ac8cbe015..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag +++ /dev/null @@ -1,235 +0,0 @@ -#include -#include - -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]], constant CB0& _19 [[buffer(0)]], texture3d LightMapTexture [[texture(0)]], texture2d ShadowMapTexture [[texture(1)]], texturecube EnvironmentMapTexture [[texture(2)]], texture2d DiffuseMapTexture [[texture(3)]], texture2d NormalMapTexture [[texture(4)]], texture2d NormalDetailMapTexture [[texture(5)]], texture2d StudsMapTexture [[texture(6)]], texture2d SpecularMapTexture [[texture(7)]], sampler LightMapSampler [[sampler(0)]], sampler ShadowMapSampler [[sampler(1)]], sampler EnvironmentMapSampler [[sampler(2)]], sampler DiffuseMapSampler [[sampler(3)]], sampler NormalMapSampler [[sampler(4)]], sampler NormalDetailMapSampler [[sampler(5)]], sampler StudsMapSampler [[sampler(6)]], sampler SpecularMapSampler [[sampler(7)]], float4 gl_FragCoord [[position]]) -{ - 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; -} - diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..72d41f3e70 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,67 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +constant float _46[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0}; +constant float4 _76[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; +constant float4 _90[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)}; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + int index [[user(locn0)]]; +}; + +// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. +template +void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +// An overload for constant arrays. +template +void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + main0_out out = {}; + out.FragColor = _46[in.index]; + if (in.index < 10) + { + out.FragColor += _46[in.index ^ 1]; + } + else + { + out.FragColor += _46[in.index & 1]; + } + if (in.index > 30) + { + out.FragColor += _76[in.index & 3].y; + } + else + { + out.FragColor += _76[in.index & 1].x; + } + if (in.index > 30) + { + foobar[1].z = 20.0; + } + out.FragColor += foobar[in.index & 3].z; + spvArrayCopyConstant(baz, _90); + out.FragColor += baz[in.index & 3].z; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag index 1d9d11c978..670cb5f371 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/op-constant-null.asm.frag @@ -1,5 +1,3 @@ -#pragma clang diagnostic ignored "-Wmissing-prototypes" - #include #include @@ -18,20 +16,6 @@ struct main0_out float FragColor [[color(0)]]; }; -// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. -template -void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) -{ - for (uint i = 0; i < N; dst[i] = src[i], i++); -} - -// An overload for constant arrays. -template -void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) -{ - for (uint i = 0; i < N; dst[i] = src[i], i++); -} - fragment main0_out main0() { main0_out out = {}; @@ -39,7 +23,6 @@ fragment main0_out main0() float4 b = float4(0.0); float2x3 c = float2x3(float3(0.0), float3(0.0)); D d = {float4(0.0), 0.0}; - float4 e[4] = {float4(0.0), float4(0.0), float4(0.0), float4(0.0)}; out.FragColor = a; return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..f0cdd574de --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/srem.asm.frag @@ -0,0 +1,23 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + int4 vA [[user(locn0)]]; + int4 vB [[user(locn1)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + out.FragColor = float4(in.vA - in.vB * (in.vA / in.vB)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..dd308c32ad --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(texture2d uTexture [[texture(0)]], sampler uTextureSmplr [[sampler(0)]], float4 gl_FragCoord [[position]]) +{ + main0_out out = {}; + out.FragColor = uTexture.read(uint2(int2(gl_FragCoord.xy)), 0); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag new file mode 100644 index 0000000000..005af22e3a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unknown-depth-state.asm.frag @@ -0,0 +1,34 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vUV [[user(locn0)]]; +}; + +float sample_combined(thread float3& vUV, thread depth2d uShadow, thread const sampler uShadowSmplr) +{ + return uShadow.sample_compare(uShadowSmplr, vUV.xy, vUV.z); +} + +float sample_separate(thread float3& vUV, thread depth2d uTexture, thread sampler uSampler) +{ + return uTexture.sample_compare(uSampler, vUV.xy, vUV.z); +} + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uShadow [[texture(0)]], depth2d uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(2)]]) +{ + main0_out out = {}; + out.FragColor = sample_combined(in.vUV, uShadow, uShadowSmplr) + sample_separate(in.vUV, uTexture, uSampler); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unreachable.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unreachable.asm.frag index 7a98487221..7ae4aa5e60 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unreachable.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/unreachable.asm.frag @@ -5,16 +5,16 @@ using namespace metal; constant float4 _21 = {}; -struct main0_in -{ - int counter [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int counter [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag index 97daea5d90..9f9b827ce3 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag @@ -95,7 +95,7 @@ struct main0_out float4 m_5 [[color(0)]]; }; -fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buffer(1)]], constant _18& _19 [[buffer(2)]], texture2d _8 [[texture(0)]], texture2d _12 [[texture(1)]], texture2d _14 [[texture(2)]], sampler _9 [[sampler(0)]], sampler _13 [[sampler(1)]], sampler _15 [[sampler(2)]], float4 gl_FragCoord [[position]]) +fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _18& _19 [[buffer(1)]], constant _10& _11 [[buffer(2)]], texture2d _14 [[texture(4)]], texture2d _12 [[texture(13)]], texture2d _8 [[texture(14)]], sampler _15 [[sampler(3)]], sampler _13 [[sampler(5)]], sampler _9 [[sampler(6)]], float4 gl_FragCoord [[position]]) { main0_out out = {}; _28 _77 = _74; @@ -103,7 +103,7 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff float2 _82 = gl_FragCoord.xy * _19._m23.xy; float4 _88 = _7._m2 * _7._m0.xyxy; float2 _97 = clamp(_82 + (float3(0.0, -2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _109 = _11._m5 * clamp(_8.sample(_9, _97, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _109 = float3(_11._m5) * clamp(_8.sample(_9, _97, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _113 = _12.sample(_13, _97, level(0.0)); float3 _129; if (_113.y > 0.0) @@ -114,12 +114,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _129 = _109; } - float3 _133 = float4(0.0).xyz + (_129 * 0.5); + float3 _130 = _129 * 0.5; + float3 _133 = float4(0.0).xyz + _130; float4 _134 = float4(_133.x, _133.y, _133.z, float4(0.0).w); _28 _135 = _77; _135._m0 = _134; float2 _144 = clamp(_82 + (float3(-1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _156 = _11._m5 * clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _156 = float3(_11._m5) * clamp(_8.sample(_9, _144, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _160 = _12.sample(_13, _144, level(0.0)); float3 _176; if (_160.y > 0.0) @@ -130,12 +131,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _176 = _156; } - float3 _180 = _134.xyz + (_176 * 0.5); + float3 _177 = _176 * 0.5; + float3 _180 = _134.xyz + _177; float4 _181 = float4(_180.x, _180.y, _180.z, _134.w); _28 _182 = _135; _182._m0 = _181; float2 _191 = clamp(_82 + (float3(0.0, -1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _203 = _11._m5 * clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _203 = float3(_11._m5) * clamp(_8.sample(_9, _191, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _207 = _12.sample(_13, _191, level(0.0)); float3 _223; if (_207.y > 0.0) @@ -146,12 +148,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _223 = _203; } - float3 _227 = _181.xyz + (_223 * 0.75); + float3 _224 = _223 * 0.75; + float3 _227 = _181.xyz + _224; float4 _228 = float4(_227.x, _227.y, _227.z, _181.w); _28 _229 = _182; _229._m0 = _228; float2 _238 = clamp(_82 + (float3(1.0, -1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _250 = _11._m5 * clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _250 = float3(_11._m5) * clamp(_8.sample(_9, _238, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _254 = _12.sample(_13, _238, level(0.0)); float3 _270; if (_254.y > 0.0) @@ -162,12 +165,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _270 = _250; } - float3 _274 = _228.xyz + (_270 * 0.5); + float3 _271 = _270 * 0.5; + float3 _274 = _228.xyz + _271; float4 _275 = float4(_274.x, _274.y, _274.z, _228.w); _28 _276 = _229; _276._m0 = _275; float2 _285 = clamp(_82 + (float3(-2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _297 = _11._m5 * clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _297 = float3(_11._m5) * clamp(_8.sample(_9, _285, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _301 = _12.sample(_13, _285, level(0.0)); float3 _317; if (_301.y > 0.0) @@ -178,12 +182,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _317 = _297; } - float3 _321 = _275.xyz + (_317 * 0.5); + float3 _318 = _317 * 0.5; + float3 _321 = _275.xyz + _318; float4 _322 = float4(_321.x, _321.y, _321.z, _275.w); _28 _323 = _276; _323._m0 = _322; float2 _332 = clamp(_82 + (float3(-1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _344 = _11._m5 * clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _344 = float3(_11._m5) * clamp(_8.sample(_9, _332, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _348 = _12.sample(_13, _332, level(0.0)); float3 _364; if (_348.y > 0.0) @@ -194,12 +199,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _364 = _344; } - float3 _368 = _322.xyz + (_364 * 0.75); + float3 _365 = _364 * 0.75; + float3 _368 = _322.xyz + _365; float4 _369 = float4(_368.x, _368.y, _368.z, _322.w); _28 _370 = _323; _370._m0 = _369; float2 _379 = clamp(_82 + (float3(0.0, 0.0, 1.0).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _391 = _11._m5 * clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _391 = float3(_11._m5) * clamp(_8.sample(_9, _379, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _395 = _12.sample(_13, _379, level(0.0)); float3 _411; if (_395.y > 0.0) @@ -210,12 +216,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _411 = _391; } - float3 _415 = _369.xyz + (_411 * 1.0); + float3 _412 = _411 * 1.0; + float3 _415 = _369.xyz + _412; float4 _416 = float4(_415.x, _415.y, _415.z, _369.w); _28 _417 = _370; _417._m0 = _416; float2 _426 = clamp(_82 + (float3(1.0, 0.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _438 = _11._m5 * clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _438 = float3(_11._m5) * clamp(_8.sample(_9, _426, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _442 = _12.sample(_13, _426, level(0.0)); float3 _458; if (_442.y > 0.0) @@ -226,12 +233,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _458 = _438; } - float3 _462 = _416.xyz + (_458 * 0.75); + float3 _459 = _458 * 0.75; + float3 _462 = _416.xyz + _459; float4 _463 = float4(_462.x, _462.y, _462.z, _416.w); _28 _464 = _417; _464._m0 = _463; float2 _473 = clamp(_82 + (float3(2.0, 0.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _485 = _11._m5 * clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _485 = float3(_11._m5) * clamp(_8.sample(_9, _473, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _489 = _12.sample(_13, _473, level(0.0)); float3 _505; if (_489.y > 0.0) @@ -242,12 +250,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _505 = _485; } - float3 _509 = _463.xyz + (_505 * 0.5); + float3 _506 = _505 * 0.5; + float3 _509 = _463.xyz + _506; float4 _510 = float4(_509.x, _509.y, _509.z, _463.w); _28 _511 = _464; _511._m0 = _510; float2 _520 = clamp(_82 + (float3(-1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _532 = _11._m5 * clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _532 = float3(_11._m5) * clamp(_8.sample(_9, _520, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _536 = _12.sample(_13, _520, level(0.0)); float3 _552; if (_536.y > 0.0) @@ -258,12 +267,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _552 = _532; } - float3 _556 = _510.xyz + (_552 * 0.5); + float3 _553 = _552 * 0.5; + float3 _556 = _510.xyz + _553; float4 _557 = float4(_556.x, _556.y, _556.z, _510.w); _28 _558 = _511; _558._m0 = _557; float2 _567 = clamp(_82 + (float3(0.0, 1.0, 0.75).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _579 = _11._m5 * clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _579 = float3(_11._m5) * clamp(_8.sample(_9, _567, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _583 = _12.sample(_13, _567, level(0.0)); float3 _599; if (_583.y > 0.0) @@ -274,12 +284,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _599 = _579; } - float3 _603 = _557.xyz + (_599 * 0.75); + float3 _600 = _599 * 0.75; + float3 _603 = _557.xyz + _600; float4 _604 = float4(_603.x, _603.y, _603.z, _557.w); _28 _605 = _558; _605._m0 = _604; float2 _614 = clamp(_82 + (float3(1.0, 1.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _626 = _11._m5 * clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _626 = float3(_11._m5) * clamp(_8.sample(_9, _614, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _630 = _12.sample(_13, _614, level(0.0)); float3 _646; if (_630.y > 0.0) @@ -290,12 +301,13 @@ fragment main0_out main0(constant _6& _7 [[buffer(0)]], constant _10& _11 [[buff { _646 = _626; } - float3 _650 = _604.xyz + (_646 * 0.5); + float3 _647 = _646 * 0.5; + float3 _650 = _604.xyz + _647; float4 _651 = float4(_650.x, _650.y, _650.z, _604.w); _28 _652 = _605; _652._m0 = _651; float2 _661 = clamp(_82 + (float3(0.0, 2.0, 0.5).xy * _7._m0.xy), _88.xy, _88.zw); - float3 _673 = _11._m5 * clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0); + float3 _673 = float3(_11._m5) * clamp(_8.sample(_9, _661, level(0.0)).w * _7._m1, 0.0, 1.0); float4 _677 = _12.sample(_13, _661, level(0.0)); float3 _693; if (_677.y > 0.0) diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/packing-test.asm.vert b/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/packing-test.asm.vert new file mode 100644 index 0000000000..ac2d30c8df --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/packing-test.asm.vert @@ -0,0 +1,19 @@ +#include +#include + +using namespace metal; + +struct TestStruct +{ + float4x4 transforms[6]; +}; + +struct CB0 +{ + TestStruct CB0[16]; +}; + +vertex void main0() +{ +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert b/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert new file mode 100644 index 0000000000..67485d7324 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert @@ -0,0 +1,37 @@ +#include +#include + +using namespace metal; + +constant int _7_tmp [[function_constant(201)]]; +constant int _7 = is_function_constant_defined(_7_tmp) ? _7_tmp : -10; +constant uint _8_tmp [[function_constant(202)]]; +constant uint _8 = is_function_constant_defined(_8_tmp) ? _8_tmp : 100u; +constant float _9_tmp [[function_constant(200)]]; +constant float _9 = is_function_constant_defined(_9_tmp) ? _9_tmp : 3.141590118408203125; +constant int _20 = (_7 + 2); +constant uint _25 = (_8 % 5u); +constant int4 _30 = int4(20, 30, _20, _20); +constant int2 _32 = int2(_30.y, _30.x); +constant int _33 = _30.y; + +struct main0_out +{ + int m_4 [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +vertex main0_out main0() +{ + main0_out out = {}; + float4 pos = float4(0.0); + pos.y += float(_20); + pos.z += float(_25); + pos += float4(_30); + float2 _56 = pos.xy + float2(_32); + pos = float4(_56.x, _56.y, pos.z, pos.w); + out.gl_Position = pos; + out.m_4 = _33; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..89ca17f98b --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,28 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; +}; + +float4 _main(thread const uint& vid, thread const uint& iid) +{ + return float4(float(vid + iid)); +} + +vertex main0_out main0(uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]]) +{ + main0_out out = {}; + uint vid = gl_VertexIndex; + uint iid = gl_InstanceIndex; + uint param = vid; + uint param_1 = iid; + out.gl_Position = _main(param, param_1); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp new file mode 100644 index 0000000000..17acda9678 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/access-private-workgroup-in-function.comp @@ -0,0 +1,34 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +void set_f(thread int& f) +{ + f = 40; +} + +void set_shared_u(threadgroup int& u) +{ + u = 50; +} + +kernel void main0(uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) +{ + threadgroup int u; + int f; + set_f(f); + set_shared_u(u); + if (gl_LocalInvocationIndex == 0u) + { + f = 10; + } + else + { + f = 30; + u = 20; + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/atomic.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/atomic.comp index 90a39ec643..f77922aca0 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/atomic.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/atomic.comp @@ -12,25 +12,59 @@ struct SSBO int i32; }; -kernel void main0(device SSBO& ssbo [[buffer(0)]]) +kernel void main0(device SSBO& ssbo [[buffer(2)]]) { - uint _16 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _18 = atomic_fetch_or_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _20 = atomic_fetch_xor_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _22 = atomic_fetch_and_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _24 = atomic_fetch_min_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _26 = atomic_fetch_max_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _28 = atomic_exchange_explicit((volatile device atomic_uint*)&(ssbo.u32), 1u, memory_order_relaxed); - uint _30 = 10u; - uint _32 = atomic_compare_exchange_weak_explicit((volatile device atomic_uint*)&(ssbo.u32), &(_30), 2u, memory_order_relaxed, memory_order_relaxed); - int _36 = atomic_fetch_add_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _38 = atomic_fetch_or_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _40 = atomic_fetch_xor_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _42 = atomic_fetch_and_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _44 = atomic_fetch_min_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _46 = atomic_fetch_max_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _48 = atomic_exchange_explicit((volatile device atomic_int*)&(ssbo.i32), 1, memory_order_relaxed); - int _50 = 10; - int _52 = atomic_compare_exchange_weak_explicit((volatile device atomic_int*)&(ssbo.i32), &(_50), 2, memory_order_relaxed, memory_order_relaxed); + threadgroup uint shared_u32; + threadgroup int shared_i32; + uint _16 = atomic_fetch_add_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _18 = atomic_fetch_or_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _20 = atomic_fetch_xor_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _22 = atomic_fetch_and_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _24 = atomic_fetch_min_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _26 = atomic_fetch_max_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _28 = atomic_exchange_explicit((volatile device atomic_uint*)&ssbo.u32, 1u, memory_order_relaxed); + uint _32; + do + { + _32 = 10u; + } while (!atomic_compare_exchange_weak_explicit((volatile device atomic_uint*)&ssbo.u32, &_32, 2u, memory_order_relaxed, memory_order_relaxed)); + int _36 = atomic_fetch_add_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _38 = atomic_fetch_or_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _40 = atomic_fetch_xor_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _42 = atomic_fetch_and_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _44 = atomic_fetch_min_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _46 = atomic_fetch_max_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _48 = atomic_exchange_explicit((volatile device atomic_int*)&ssbo.i32, 1, memory_order_relaxed); + int _52; + do + { + _52 = 10; + } while (!atomic_compare_exchange_weak_explicit((volatile device atomic_int*)&ssbo.i32, &_52, 2, memory_order_relaxed, memory_order_relaxed)); + shared_u32 = 10u; + shared_i32 = 10; + uint _57 = atomic_fetch_add_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _58 = atomic_fetch_or_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _59 = atomic_fetch_xor_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _60 = atomic_fetch_and_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _61 = atomic_fetch_min_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _62 = atomic_fetch_max_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _63 = atomic_exchange_explicit((volatile threadgroup atomic_uint*)&shared_u32, 1u, memory_order_relaxed); + uint _64; + do + { + _64 = 10u; + } while (!atomic_compare_exchange_weak_explicit((volatile threadgroup atomic_uint*)&shared_u32, &_64, 2u, memory_order_relaxed, memory_order_relaxed)); + int _65 = atomic_fetch_add_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _66 = atomic_fetch_or_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _67 = atomic_fetch_xor_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _68 = atomic_fetch_and_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _69 = atomic_fetch_min_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _70 = atomic_fetch_max_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _71 = atomic_exchange_explicit((volatile threadgroup atomic_int*)&shared_i32, 1, memory_order_relaxed); + int _72; + do + { + _72 = 10; + } while (!atomic_compare_exchange_weak_explicit((volatile threadgroup atomic_int*)&shared_i32, &_72, 2, memory_order_relaxed, memory_order_relaxed)); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/bake_gradient.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/bake_gradient.comp deleted file mode 100644 index 1118f18f8e..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/bake_gradient.comp +++ /dev/null @@ -1,40 +0,0 @@ -#pragma clang diagnostic ignored "-Wmissing-prototypes" - -#include -#include - -using namespace metal; - -constant uint3 gl_WorkGroupSize = uint3(8u, 8u, 1u); - -struct UBO -{ - float4 uInvSize; - float4 uScale; -}; - -float jacobian(thread const float2& dDdx, thread const float2& dDdy) -{ - return ((1.0 + dDdx.x) * (1.0 + dDdy.y)) - (dDdx.y * dDdy.x); -} - -kernel void main0(uint3 gl_GlobalInvocationID [[thread_position_in_grid]], constant UBO& _46 [[buffer(0)]], texture2d uHeight [[texture(0)]], sampler uHeightSmplr [[sampler(0)]], texture2d uDisplacement [[texture(1)]], sampler uDisplacementSmplr [[sampler(1)]], texture2d iHeightDisplacement [[texture(2)]], texture2d iGradJacobian [[texture(3)]]) -{ - float4 uv = (float2(gl_GlobalInvocationID.xy) * _46.uInvSize.xy).xyxy + (_46.uInvSize * 0.5); - float h = uHeight.sample(uHeightSmplr, uv.xy, level(0.0)).x; - float x0 = uHeight.sample(uHeightSmplr, uv.xy, level(0.0), int2(-1, 0)).x; - float x1 = uHeight.sample(uHeightSmplr, uv.xy, level(0.0), int2(1, 0)).x; - float y0 = uHeight.sample(uHeightSmplr, uv.xy, level(0.0), int2(0, -1)).x; - float y1 = uHeight.sample(uHeightSmplr, uv.xy, level(0.0), int2(0, 1)).x; - float2 grad = (_46.uScale.xy * 0.5) * float2(x1 - x0, y1 - y0); - float2 displacement = uDisplacement.sample(uDisplacementSmplr, uv.zw, level(0.0)).xy * 1.2000000476837158203125; - float2 dDdx = (uDisplacement.sample(uDisplacementSmplr, uv.zw, level(0.0), int2(1, 0)).xy - uDisplacement.sample(uDisplacementSmplr, uv.zw, level(0.0), int2(-1, 0)).xy) * 0.60000002384185791015625; - float2 dDdy = (uDisplacement.sample(uDisplacementSmplr, uv.zw, level(0.0), int2(0, 1)).xy - uDisplacement.sample(uDisplacementSmplr, uv.zw, level(0.0), int2(0, -1)).xy) * 0.60000002384185791015625; - float2 param = dDdx * _46.uScale.z; - float2 param_1 = dDdy * _46.uScale.z; - float j = jacobian(param, param_1); - displacement = float2(0.0); - iHeightDisplacement.write(float4(h, displacement, 0.0), uint2(int2(gl_GlobalInvocationID.xy))); - iGradJacobian.write(float4(grad, j, 0.0), uint2(int2(gl_GlobalInvocationID.xy))); -} - diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/basic.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/basic.comp index 732b1cb257..6410894ba0 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/basic.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/basic.comp @@ -21,13 +21,13 @@ struct SSBO3 uint counter; }; -kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buffer(1)]], device SSBO3& _48 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _45 [[buffer(1)]], device SSBO3& _48 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; float4 idata = _23.in_data[ident]; if (dot(idata, float4(1.0, 5.0, 6.0, 2.0)) > 8.19999980926513671875) { - uint _52 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(_48.counter), 1u, memory_order_relaxed); + uint _52 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_48.counter, 1u, memory_order_relaxed); _45.out_data[_52] = idata; } } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/bitfield.noopt.comp deleted file mode 100644 index 62ef02c997..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/bitfield.noopt.comp +++ /dev/null @@ -1,47 +0,0 @@ -#pragma clang diagnostic ignored "-Wmissing-prototypes" - -#include -#include - -using namespace metal; - -// Implementation of the GLSL findLSB() function -template -T findLSB(T x) -{ - return select(ctz(x), T(-1), x == T(0)); -} - -// Implementation of the signed GLSL findMSB() function -template -T findSMSB(T x) -{ - T v = select(x, T(-1) - x, x < T(0)); - return select(clz(T(0)) - (clz(v) + T(1)), T(-1), v == T(0)); -} - -// Implementation of the unsigned GLSL findMSB() function -template -T findUMSB(T x) -{ - return select(clz(T(0)) - (clz(x) + T(1)), T(-1), x == T(0)); -} - -kernel void main0() -{ - int signed_value = 0; - uint unsigned_value = 0u; - int s = extract_bits(signed_value, 5, 20); - uint u = extract_bits(unsigned_value, 6, 21); - s = insert_bits(s, 40, 5, 4); - u = insert_bits(u, 60u, 5, 4); - u = reverse_bits(u); - s = reverse_bits(s); - int v0 = popcount(u); - int v1 = popcount(s); - int v2 = findUMSB(u); - int v3 = findSMSB(s); - int v4 = findLSB(u); - int v5 = findLSB(s); -} - diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-block.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-block.comp index bec9b218c7..963574acd6 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-block.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-block.comp @@ -8,7 +8,7 @@ struct SSBO float4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]]) +kernel void main0(device SSBO& _10 [[buffer(1)]]) { _10.value = float4(20.0); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-image.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-image.comp index 0fe044fb9a..827a247125 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-image.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/coherent-image.comp @@ -8,7 +8,7 @@ struct SSBO int4 value; }; -kernel void main0(device SSBO& _10 [[buffer(0)]], texture2d uImage [[texture(0)]]) +kernel void main0(device SSBO& _10 [[buffer(1)]], texture2d uImage [[texture(3)]]) { _10.value = uImage.read(uint2(int2(10))); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/composite-construct.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/composite-construct.comp new file mode 100644 index 0000000000..ef0412b1dc --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/composite-construct.comp @@ -0,0 +1,49 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct SSBO0 +{ + float4 as[1]; +}; + +struct SSBO1 +{ + float4 bs[1]; +}; + +struct Composite +{ + float4 a; + float4 b; +}; + +constant float4 _43[2] = {float4(20.0), float4(40.0)}; + +// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. +template +void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +// An overload for constant arrays. +template +void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO1& _32 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) +{ + float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] }; + float4 values[2]; + spvArrayCopy(values, _37); + Composite c = Composite{ values[0], _43[1] }; + _16.as[0] = values[gl_LocalInvocationIndex]; + _32.bs[1] = c.b; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/culling.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/culling.comp index ef84f1d19d..1f6bdcbee6 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/culling.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/culling.comp @@ -23,13 +23,13 @@ struct SSBO3 uint count; }; -kernel void main0(device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _38 [[buffer(1)]], device SSBO3& _41 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; float idata = _22.in_data[ident]; if (idata > 12.0) { - uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&(_41.count), 1u, memory_order_relaxed); + uint _45 = atomic_fetch_add_explicit((volatile device atomic_uint*)&_41.count, 1u, memory_order_relaxed); _38.out_data[_45] = idata; } } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/dowhile.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/dowhile.comp index 5decd415ff..3482fb355b 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/dowhile.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/dowhile.comp @@ -14,7 +14,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _28 [[buffer(0)]], device SSBO2& _52 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; int i = 0; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/image-cube-array-load-store.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/image-cube-array-load-store.comp new file mode 100644 index 0000000000..ef67a326f5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/image-cube-array-load-store.comp @@ -0,0 +1,12 @@ +#include +#include + +using namespace metal; + +kernel void main0(texturecube_array uImageIn [[texture(0)]], texturecube_array uImageOut [[texture(1)]]) +{ + int3 coord = int3(9, 7, 11); + float4 indata = uImageIn.read(uint2(coord.xy), uint(coord.z) % 6u, uint(coord.z) / 6u); + uImageOut.write(indata, uint2(coord.xy), uint(coord.z) % 6u, uint(coord.z) / 6u); +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/inverse.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/inverse.comp index 567dba2c21..f2f499b91e 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/inverse.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/inverse.comp @@ -114,7 +114,7 @@ float2x2 spvInverse2x2(float2x2 m) return (det != 0.0f) ? (adj * (1.0f / det)) : m; } -kernel void main0(device MatrixOut& _15 [[buffer(0)]], device MatrixIn& _20 [[buffer(1)]]) +kernel void main0(device MatrixOut& _15 [[buffer(0)]], const device MatrixIn& _20 [[buffer(1)]]) { _15.m2out = spvInverse2x2(_20.m2in); _15.m3out = spvInverse3x3(_20.m3in); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/loop.noopt.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/loop.noopt.comp deleted file mode 100644 index 00ed570b31..0000000000 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/loop.noopt.comp +++ /dev/null @@ -1,107 +0,0 @@ -#include -#include - -using namespace metal; - -struct SSBO -{ - float4x4 mvp; - float4 in_data[1]; -}; - -struct SSBO2 -{ - float4 out_data[1]; -}; - -kernel void main0(device SSBO& _24 [[buffer(0)]], device SSBO2& _177 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) -{ - uint ident = gl_GlobalInvocationID.x; - float4 idat = _24.in_data[ident]; - int k = 0; - uint i = 0u; - if (idat.y == 20.0) - { - do - { - k *= 2; - i++; - } while (i < ident); - } - switch (k) - { - case 10: - { - for (;;) - { - i++; - if (i > 10u) - { - break; - } - continue; - } - break; - } - default: - { - for (;;) - { - i += 2u; - if (i > 20u) - { - break; - } - continue; - } - break; - } - } - while (k < 10) - { - idat *= 2.0; - k++; - } - for (uint i_1 = 0u; i_1 < 16u; i_1++, k++) - { - for (uint j = 0u; j < 30u; j++) - { - idat = _24.mvp * idat; - } - } - k = 0; - for (;;) - { - k++; - if (k > 10) - { - k += 2; - } - else - { - k += 3; - continue; - } - k += 10; - continue; - } - k = 0; - do - { - k++; - } while (k > 10); - int l = 0; - for (;;) - { - if (l == 5) - { - l++; - continue; - } - idat += float4(1.0); - l++; - continue; - } - _177.out_data[ident] = idat; -} - diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/mat3.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/mat3.comp index c2d9a7c838..475d163bd7 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/mat3.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/mat3.comp @@ -8,7 +8,7 @@ struct SSBO2 float3x3 out_data[1]; }; -kernel void main0(device SSBO2& _22 [[buffer(0)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(device SSBO2& _22 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; _22.out_data[ident] = float3x3(float3(10.0), float3(20.0), float3(40.0)); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/mod.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/mod.comp index 1a8c5c5fef..e0d290259c 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/mod.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/mod.comp @@ -22,7 +22,7 @@ Tx mod(Tx x, Ty y) return x - y * floor(x / y); } -kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _33 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; float4 v = mod(_23.in_data[ident], _33.out_data[ident]); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/modf.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/modf.comp index 9abd457cad..ef50a02135 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/modf.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/modf.comp @@ -13,7 +13,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _35 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _23 [[buffer(0)]], device SSBO2& _35 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; float4 i; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/packing-test-1.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/packing-test-1.comp new file mode 100644 index 0000000000..d98ad59aa7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/packing-test-1.comp @@ -0,0 +1,38 @@ +#include +#include + +using namespace metal; + +constant uint3 gl_WorkGroupSize = uint3(32u, 1u, 1u); + +struct T1 +{ + float3 a; + float b; +}; + +struct T1_1 +{ + packed_float3 a; + float b; +}; + +struct Buffer0 +{ + T1_1 buf0[1]; +}; + +struct Buffer1 +{ + float buf1[1]; +}; + +kernel void main0(device Buffer0& _15 [[buffer(1)]], device Buffer1& _34 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +{ + T1 v; + v.a = _15.buf0[0].a; + v.b = _15.buf0[0].b; + float x = v.b; + _34.buf1[gl_GlobalInvocationID.x] = x; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/packing-test-2.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/packing-test-2.comp new file mode 100644 index 0000000000..dfccbf863f --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/packing-test-2.comp @@ -0,0 +1,29 @@ +#include +#include + +using namespace metal; + +constant uint3 gl_WorkGroupSize = uint3(32u, 1u, 1u); + +struct T1 +{ + packed_float3 a; + float b; +}; + +struct Buffer0 +{ + T1 buf0[1]; +}; + +struct Buffer1 +{ + float buf1[1]; +}; + +kernel void main0(device Buffer0& _14 [[buffer(1)]], device Buffer1& _24 [[buffer(2)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +{ + float x = _14.buf0[0].b; + _24.buf1[gl_GlobalInvocationID.x] = x; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/read-write-only.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/read-write-only.comp index ba53b334ba..42c625092a 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/read-write-only.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/read-write-only.comp @@ -21,7 +21,7 @@ struct SSBO1 float4 data3; }; -kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO0& _15 [[buffer(1)]], device SSBO1& _21 [[buffer(2)]]) +kernel void main0(const device SSBO0& _15 [[buffer(0)]], device SSBO1& _21 [[buffer(1)]], device SSBO2& _10 [[buffer(2)]]) { _10.data4 = _15.data0 + _21.data2; _10.data5 = _15.data1 + _21.data3; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/rmw-matrix.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/rmw-matrix.comp new file mode 100644 index 0000000000..150db7ede9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/rmw-matrix.comp @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct SSBO +{ + float a; + float4 b; + float4x4 c; + float a1; + float4 b1; + float4x4 c1; +}; + +kernel void main0(device SSBO& _11 [[buffer(0)]]) +{ + _11.a *= _11.a1; + _11.b *= _11.b1; + _11.c = _11.c * _11.c1; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/shared.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/shared.comp index 5aeaa4f8c1..e296190bdf 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/shared.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/shared.comp @@ -15,11 +15,11 @@ struct SSBO2 float out_data[1]; }; -kernel void main0(device SSBO& _22 [[buffer(0)]], device SSBO2& _44 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) +kernel void main0(const device SSBO& _22 [[buffer(0)]], device SSBO2& _44 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]], uint gl_LocalInvocationIndex [[thread_index_in_threadgroup]]) { + threadgroup float sShared[4]; uint ident = gl_GlobalInvocationID.x; float idata = _22.in_data[ident]; - threadgroup float sShared[4]; sShared[gl_LocalInvocationIndex] = idata; threadgroup_barrier(mem_flags::mem_threadgroup); _44.out_data[ident] = sShared[(4u - gl_LocalInvocationIndex) - 1u]; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-layout.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-layout.comp index 6c0f929480..3c44fe5416 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-layout.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-layout.comp @@ -18,7 +18,7 @@ struct SSBO Foo in_data[1]; }; -kernel void main0(device SSBO2& _23 [[buffer(0)]], device SSBO& _30 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _30 [[buffer(0)]], device SSBO2& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; _23.out_data[ident].m = _30.in_data[ident].m * _30.in_data[ident].m; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-nested.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-nested.comp index 93694e31c2..117e492d66 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-nested.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-nested.comp @@ -13,12 +13,22 @@ struct s2 s1 b; }; -struct dstbuffer +struct s1_1 { - s2 test[1]; + int a; }; -kernel void main0(device dstbuffer& _19 [[buffer(0)]]) +struct s2_1 +{ + s1_1 b; +}; + +struct dstbuffer +{ + s2_1 test[1]; +}; + +kernel void main0(device dstbuffer& _19 [[buffer(1)]]) { s2 testVal; testVal.b.a = 0; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-packing.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-packing.comp index f59cba5b7d..2b37844fe7 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-packing.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/struct-packing.comp @@ -67,39 +67,83 @@ struct SSBO1 float array[1]; }; +struct S0_1 +{ + float2 a[1]; + float b; +}; + +struct S1_1 +{ + packed_float3 a; + float b; +}; + +struct S2_1 +{ + float3 a[1]; + float b; +}; + +struct S3_1 +{ + float2 a; + float b; +}; + +struct S4_1 +{ + float2 c; +}; + +struct Content_1 +{ + S0_1 m0s[1]; + S1_1 m1s[1]; + S2_1 m2s[1]; + S0_1 m0; + S1_1 m1; + S2_1 m2; + S3_1 m3; + char pad7[4]; + float m4; + S4_1 m3s[8]; +}; + struct SSBO0 { - Content content; - Content content1[2]; - Content content2; + Content_1 content; + Content_1 content1[2]; + Content_1 content2; float array[1]; }; -kernel void main0(device SSBO1& ssbo_430 [[buffer(0)]], device SSBO0& ssbo_140 [[buffer(1)]]) +kernel void main0(device SSBO0& ssbo_140 [[buffer(0)]], device SSBO1& ssbo_430 [[buffer(1)]]) { - ssbo_430.content.m0s[0].a[0] = ssbo_140.content.m0s[0].a[0]; - ssbo_430.content.m0s[0].b = ssbo_140.content.m0s[0].b; - ssbo_430.content.m1s[0].a = ssbo_140.content.m1s[0].a; - ssbo_430.content.m1s[0].b = ssbo_140.content.m1s[0].b; - ssbo_430.content.m2s[0].a[0] = ssbo_140.content.m2s[0].a[0]; - ssbo_430.content.m2s[0].b = ssbo_140.content.m2s[0].b; - ssbo_430.content.m0.a[0] = ssbo_140.content.m0.a[0]; - ssbo_430.content.m0.b = ssbo_140.content.m0.b; - ssbo_430.content.m1.a = ssbo_140.content.m1.a; - ssbo_430.content.m1.b = ssbo_140.content.m1.b; - ssbo_430.content.m2.a[0] = ssbo_140.content.m2.a[0]; - ssbo_430.content.m2.b = ssbo_140.content.m2.b; - ssbo_430.content.m3.a = ssbo_140.content.m3.a; - ssbo_430.content.m3.b = ssbo_140.content.m3.b; - ssbo_430.content.m4 = ssbo_140.content.m4; - ssbo_430.content.m3s[0].c = ssbo_140.content.m3s[0].c; - ssbo_430.content.m3s[1].c = ssbo_140.content.m3s[1].c; - ssbo_430.content.m3s[2].c = ssbo_140.content.m3s[2].c; - ssbo_430.content.m3s[3].c = ssbo_140.content.m3s[3].c; - ssbo_430.content.m3s[4].c = ssbo_140.content.m3s[4].c; - ssbo_430.content.m3s[5].c = ssbo_140.content.m3s[5].c; - ssbo_430.content.m3s[6].c = ssbo_140.content.m3s[6].c; - ssbo_430.content.m3s[7].c = ssbo_140.content.m3s[7].c; + Content_1 _60 = ssbo_140.content; + ssbo_430.content.m0s[0].a[0] = _60.m0s[0].a[0]; + ssbo_430.content.m0s[0].b = _60.m0s[0].b; + ssbo_430.content.m1s[0].a = _60.m1s[0].a; + ssbo_430.content.m1s[0].b = _60.m1s[0].b; + ssbo_430.content.m2s[0].a[0] = _60.m2s[0].a[0]; + ssbo_430.content.m2s[0].b = _60.m2s[0].b; + ssbo_430.content.m0.a[0] = _60.m0.a[0]; + ssbo_430.content.m0.b = _60.m0.b; + ssbo_430.content.m1.a = _60.m1.a; + ssbo_430.content.m1.b = _60.m1.b; + ssbo_430.content.m2.a[0] = _60.m2.a[0]; + ssbo_430.content.m2.b = _60.m2.b; + ssbo_430.content.m3.a = _60.m3.a; + ssbo_430.content.m3.b = _60.m3.b; + ssbo_430.content.m4 = _60.m4; + ssbo_430.content.m3s[0].c = _60.m3s[0].c; + ssbo_430.content.m3s[1].c = _60.m3s[1].c; + ssbo_430.content.m3s[2].c = _60.m3s[2].c; + ssbo_430.content.m3s[3].c = _60.m3s[3].c; + ssbo_430.content.m3s[4].c = _60.m3s[4].c; + ssbo_430.content.m3s[5].c = _60.m3s[5].c; + ssbo_430.content.m3s[6].c = _60.m3s[6].c; + ssbo_430.content.m3s[7].c = _60.m3s[7].c; ssbo_430.content.m1.a = ssbo_430.content.m3.a * ssbo_430.m6[1][1]; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/torture-loop.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/torture-loop.comp index 9257088161..1b65a3afab 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/torture-loop.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/torture-loop.comp @@ -14,7 +14,7 @@ struct SSBO2 float4 out_data[1]; }; -kernel void main0(device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(const device SSBO& _24 [[buffer(0)]], device SSBO2& _89 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { uint ident = gl_GlobalInvocationID.x; float4 idat = _24.in_data[ident]; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/type-alias.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/type-alias.comp index d842132995..25a49f59f0 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/type-alias.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/type-alias.comp @@ -15,14 +15,24 @@ struct S1 float4 a; }; +struct S0_1 +{ + float4 a; +}; + struct SSBO0 { - S0 s0s[1]; + S0_1 s0s[1]; +}; + +struct S1_1 +{ + float4 a; }; struct SSBO1 { - S1 s1s[1]; + S1_1 s1s[1]; }; struct SSBO2 diff --git a/deps/SPIRV-Cross/reference/shaders-msl/comp/udiv.comp b/deps/SPIRV-Cross/reference/shaders-msl/comp/udiv.comp index 32874ad787..a298ecdb7d 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/comp/udiv.comp +++ b/deps/SPIRV-Cross/reference/shaders-msl/comp/udiv.comp @@ -13,7 +13,7 @@ struct SSBO uint inputs[1]; }; -kernel void main0(device SSBO2& _10 [[buffer(0)]], device SSBO& _23 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) +kernel void main0(device SSBO& _23 [[buffer(0)]], device SSBO2& _10 [[buffer(1)]], uint3 gl_GlobalInvocationID [[thread_position_in_grid]]) { _10.outputs[gl_GlobalInvocationID.x] = _23.inputs[gl_GlobalInvocationID.x] / 29u; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/frag/image-ms.desktop.frag b/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/frag/image-ms.desktop.frag index 7957b209d6..b7b2cc1589 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/frag/image-ms.desktop.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/frag/image-ms.desktop.frag @@ -3,7 +3,7 @@ using namespace metal; -fragment void main0(texture2d_ms uImageMS [[texture(0)]], texture2d_array uImageArray [[texture(1)]], texture2d uImage [[texture(2)]]) +fragment void main0(texture2d uImage [[texture(0)]], texture2d_array uImageArray [[texture(1)]], texture2d_ms uImageMS [[texture(2)]]) { float4 a = uImageMS.read(uint2(int2(1, 2)), 2); float4 b = uImageArray.read(uint2(int3(1, 2, 4).xy), uint(int3(1, 2, 4).z)); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/vert/basic.desktop.sso.vert b/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/vert/basic.desktop.sso.vert index 1592b5c5cf..ffb4357126 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/vert/basic.desktop.sso.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/desktop-only/vert/basic.desktop.sso.vert @@ -8,18 +8,18 @@ struct UBO float4x4 uMVP; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/basic.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/flatten/basic.flatten.vert index 1592b5c5cf..ffb4357126 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/basic.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/basic.flatten.vert @@ -8,18 +8,18 @@ struct UBO float4x4 uMVP; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/multiindex.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/flatten/multiindex.flatten.vert index 84c4b408b2..f4549abab2 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/multiindex.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/multiindex.flatten.vert @@ -8,16 +8,16 @@ struct UBO float4 Data[3][5]; }; -struct main0_in -{ - int2 aIndex [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + int2 aIndex [[attribute(0)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _20 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/push-constant.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/flatten/push-constant.flatten.vert index 83def9c0bb..8f2e8c173f 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/push-constant.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/push-constant.flatten.vert @@ -10,18 +10,18 @@ struct PushMe float Arr[4]; }; -struct main0_in -{ - float4 Pos [[attribute(1)]]; - float2 Rot [[attribute(0)]]; -}; - struct main0_out { float2 vRot [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float2 Rot [[attribute(0)]]; + float4 Pos [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant PushMe& registers [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/rowmajor.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/flatten/rowmajor.flatten.vert index 3ea6d78b8a..b5df8b064f 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/rowmajor.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/rowmajor.flatten.vert @@ -12,16 +12,16 @@ struct UBO float2x4 uMVP; }; -struct main0_in -{ - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; +}; + // Implementation of a conversion of matrix content from RowMajor to ColumnMajor organization. float2x4 spvConvertFromRowMajor2x4(float2x4 m) { diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/struct.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/flatten/struct.flatten.vert index 75f58e1e29..291b1f7ac6 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/struct.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/struct.flatten.vert @@ -16,24 +16,24 @@ struct UBO Light light; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 vColor [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = _18.uMVP * in.aVertex; out.vColor = float4(0.0); - float3 L = in.aVertex.xyz - _18.light.Position; + float3 L = in.aVertex.xyz - float3(_18.light.Position); out.vColor += ((_18.light.Color * clamp(1.0 - (length(L) / _18.light.Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(L))); return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/swizzle.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/flatten/swizzle.flatten.vert index 53fc21f99e..05a6bbaeb3 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/swizzle.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/swizzle.flatten.vert @@ -39,7 +39,7 @@ vertex main0_out main0(constant UBO& _22 [[buffer(0)]]) out.oA = _22.A; out.oB = float4(_22.B0, _22.B1); out.oC = float4(_22.C0, _22.C1) + float4(_22.C1.xy, _22.C1.z, _22.C0); - out.oD = float4(_22.D0, _22.D1) + float4(float3(_22.D0).xy, float3(_22.D0).z, _22.D1); + out.oD = float4(_22.D0[0], _22.D0[1], _22.D0[2], _22.D1) + float4(float2(_22.D0[0], _22.D0[1]), _22.D0[2u], _22.D1); out.oE = float4(_22.E0, _22.E1, _22.E2, _22.E3); out.oF = float4(_22.F0, _22.F1, _22.F2); return out; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/flatten/types.flatten.frag b/deps/SPIRV-Cross/reference/shaders-msl/flatten/types.flatten.frag index cee53d9e58..540c5baeb1 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/flatten/types.flatten.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/flatten/types.flatten.frag @@ -26,7 +26,7 @@ struct main0_out float4 FragColor [[color(0)]]; }; -fragment main0_out main0(constant UBO1& _14 [[buffer(0)]], constant UBO2& _29 [[buffer(1)]], constant UBO0& _41 [[buffer(2)]]) +fragment main0_out main0(constant UBO0& _41 [[buffer(0)]], constant UBO1& _14 [[buffer(1)]], constant UBO2& _29 [[buffer(2)]]) { main0_out out = {}; out.FragColor = ((((float4(_14.c) + float4(_14.d)) + float4(_29.e)) + float4(_29.f)) + _41.a) + _41.b; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..37f83aae26 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,21 @@ +#include +#include + +using namespace metal; + +constant float _17[5] = {1.0, 2.0, 3.0, 4.0, 5.0}; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + for (int i = 0; i < 4; i++, out.FragColor += float4(_17[i])) + { + } + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/basic.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/basic.frag index 4d33ee7bca..f33db61eba 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/basic.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/basic.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float2 vTex [[user(locn1)]]; - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; + float2 vTex [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d uTex [[texture(0)]], sampler uTexSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/binary-func-unpack-pack-arguments.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/binary-func-unpack-pack-arguments.frag new file mode 100644 index 0000000000..134cfe1847 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/binary-func-unpack-pack-arguments.frag @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + packed_float3 color; + float v; +}; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vIn [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], constant UBO& _15 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = dot(in.vIn, float3(_15.color)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/binary-unpack-pack-arguments.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/binary-unpack-pack-arguments.frag new file mode 100644 index 0000000000..8bd538bec6 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/binary-unpack-pack-arguments.frag @@ -0,0 +1,28 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + packed_float3 color; + float v; +}; + +struct main0_out +{ + float3 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vIn [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], constant UBO& _15 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = cross(in.vIn, float3(_15.color) - in.vIn); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/bitcasting.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/bitcasting.frag index a2d624510f..475b573a23 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/bitcasting.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/bitcasting.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 VertGeom [[user(locn0)]]; -}; - struct main0_out { float4 FragColor0 [[color(0)]]; float4 FragColor1 [[color(1)]]; }; +struct main0_in +{ + float4 VertGeom [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d TextureBase [[texture(0)]], texture2d TextureDetail [[texture(1)]], sampler TextureBaseSmplr [[sampler(0)]], sampler TextureDetailSmplr [[sampler(1)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/builtins.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/builtins.frag index 9283d1a66b..f9085252b3 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/builtins.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/builtins.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; float gl_FragDepth [[depth(any)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], float4 gl_FragCoord [[position]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/composite-extract-forced-temporary.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/composite-extract-forced-temporary.frag index 2d68f01299..dfab4d26f0 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/composite-extract-forced-temporary.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/composite-extract-forced-temporary.frag @@ -3,16 +3,16 @@ using namespace metal; -struct main0_in -{ - float2 vTexCoord [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float2 vTexCoord [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d Texture [[texture(0)]], sampler TextureSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-array.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-array.frag index 773d59407c..212d4f0803 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-array.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-array.frag @@ -17,16 +17,16 @@ constant float4 _54[2] = {float4(8.0), float4(10.0)}; constant float4 _55[2][2] = {{float4(1.0), float4(2.0)}, {float4(8.0), float4(10.0)}}; constant Foobar _75[2] = {{10.0, 40.0}, {90.0, 70.0}}; -struct main0_in -{ - int index [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int index [[user(locn0)]]; +}; + // Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. template void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) @@ -49,12 +49,10 @@ float4 resolve(thread const Foobar& f) fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; - float4 indexable[3] = {float4(1.0), float4(2.0), float4(3.0)}; - float4 indexable_1[2][2] = {{float4(1.0), float4(2.0)}, {float4(8.0), float4(10.0)}}; Foobar param = {10.0, 20.0}; - Foobar indexable_2[2] = {{10.0, 40.0}, {90.0, 70.0}}; - Foobar param_1 = indexable_2[in.index]; - out.FragColor = ((indexable[in.index] + (indexable_1[in.index][in.index + 1])) + resolve(param)) + resolve(param_1); + Foobar indexable[2] = {{10.0, 40.0}, {90.0, 70.0}}; + Foobar param_1 = indexable[in.index]; + out.FragColor = ((_37[in.index] + _55[in.index][in.index + 1]) + resolve(param)) + resolve(param_1); return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-composites.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-composites.frag index d216da6d13..cb3e592337 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-composites.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/constant-composites.frag @@ -14,16 +14,16 @@ struct Foo constant float _16[4] = {1.0, 4.0, 3.0, 2.0}; constant Foo _28[2] = {{10.0, 20.0}, {30.0, 40.0}}; -struct main0_in -{ - int line [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int line [[user(locn0)]]; +}; + // Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. template void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) @@ -44,7 +44,7 @@ fragment main0_out main0(main0_in in [[stage_in]]) float lut[4] = {1.0, 4.0, 3.0, 2.0}; Foo foos[2] = {{10.0, 20.0}, {30.0, 40.0}}; out.FragColor = float4(lut[in.line]); - out.FragColor += float4(foos[in.line].a * (foos[1 - in.line].a)); + out.FragColor += float4(foos[in.line].a * foos[1 - in.line].a); return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..4d10167130 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,45 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float4 vInput [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture2d uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = in.vInput; + float4 t = uSampler.sample(uSamplerSmplr, in.vInput.xy); + float4 d0 = dfdx(in.vInput); + float4 d1 = dfdy(in.vInput); + float4 d2 = fwidth(in.vInput); + float4 d3 = dfdx(in.vInput); + float4 d4 = dfdy(in.vInput); + float4 d5 = fwidth(in.vInput); + float4 d6 = dfdx(in.vInput); + float4 d7 = dfdy(in.vInput); + float4 d8 = fwidth(in.vInput); + if (in.vInput.y > 10.0) + { + out.FragColor += t; + out.FragColor += d0; + out.FragColor += d1; + out.FragColor += d2; + out.FragColor += d3; + out.FragColor += d4; + out.FragColor += d5; + out.FragColor += d6; + out.FragColor += d7; + out.FragColor += d8; + } + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/dual-source-blending.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/dual-source-blending.frag new file mode 100644 index 0000000000..37938bf8ca --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/dual-source-blending.frag @@ -0,0 +1,19 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor0 [[color(0), index(0)]]; + float4 FragColor1 [[color(0), index(1)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + out.FragColor0 = float4(1.0); + out.FragColor1 = float4(2.0); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/false-loop-init.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/false-loop-init.frag index e0792474b5..7a4d6d5a3f 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/false-loop-init.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/false-loop-init.frag @@ -3,16 +3,16 @@ using namespace metal; -struct main0_in -{ - float4 accum [[user(locn0)]]; -}; - struct main0_out { float4 result [[color(0)]]; }; +struct main0_in +{ + float4 accum [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/fp16-packing.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/fp16-packing.frag new file mode 100644 index 0000000000..358681f6dd --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/fp16-packing.frag @@ -0,0 +1,25 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float2 FP32Out [[color(0)]]; + uint FP16Out [[color(1)]]; +}; + +struct main0_in +{ + uint FP16 [[user(locn0)]]; + float2 FP32 [[user(locn1)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + out.FP32Out = float2(as_type(in.FP16)); + out.FP16Out = as_type(half2(in.FP32)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/fp16.desktop.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/fp16.desktop.frag new file mode 100644 index 0000000000..b914e4b8fc --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/fp16.desktop.frag @@ -0,0 +1,180 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct ResType +{ + half4 _m0; + int4 _m1; +}; + +struct main0_in +{ + half v1 [[user(locn0)]]; + half2 v2 [[user(locn1)]]; + half3 v3 [[user(locn2)]]; + half4 v4 [[user(locn3)]]; +}; + +// Implementation of the GLSL mod() function, which is slightly different than Metal fmod() +template +Tx mod(Tx x, Ty y) +{ + return x - y * floor(x / y); +} + +// Implementation of the GLSL radians() function +template +T radians(T d) +{ + return d * T(0.01745329251); +} + +// Implementation of the GLSL degrees() function +template +T degrees(T r) +{ + return r * T(57.2957795131); +} + +half2x2 test_mat2(thread const half2& a, thread const half2& b, thread const half2& c, thread const half2& d) +{ + return half2x2(half2(a), half2(b)) * half2x2(half2(c), half2(d)); +} + +half3x3 test_mat3(thread const half3& a, thread const half3& b, thread const half3& c, thread const half3& d, thread const half3& e, thread const half3& f) +{ + return half3x3(half3(a), half3(b), half3(c)) * half3x3(half3(d), half3(e), half3(f)); +} + +void test_constants() +{ + half a = 1.0h; + half b = 1.5h; + half c = -1.5h; + half d = (0.0h / 0.0h); + half e = (1.0h / 0.0h); + half f = (-1.0h / 0.0h); + half g = 1014.0h; + half h = 9.5367431640625e-07h; +} + +half test_result() +{ + return 1.0h; +} + +void test_conversions() +{ + half one = test_result(); + int a = int(one); + uint b = uint(one); + bool c = one != 0.0h; + float d = float(one); + half a2 = half(a); + half b2 = half(b); + half c2 = half(c); + half d2 = half(d); +} + +void test_builtins(thread half4& v4, thread half3& v3, thread half& v1) +{ + half4 res = radians(v4); + res = degrees(v4); + res = sin(v4); + res = cos(v4); + res = tan(v4); + res = asin(v4); + res = atan2(v4, v3.xyzz); + res = atan(v4); + res = sinh(v4); + res = cosh(v4); + res = tanh(v4); + res = asinh(v4); + res = acosh(v4); + res = atanh(v4); + res = pow(v4, v4); + res = exp(v4); + res = log(v4); + res = exp2(v4); + res = log2(v4); + res = sqrt(v4); + res = rsqrt(v4); + res = abs(v4); + res = sign(v4); + res = floor(v4); + res = trunc(v4); + res = round(v4); + res = rint(v4); + res = ceil(v4); + res = fract(v4); + res = mod(v4, v4); + half4 tmp; + half4 _223 = modf(v4, tmp); + res = _223; + res = min(v4, v4); + res = max(v4, v4); + res = clamp(v4, v4, v4); + res = mix(v4, v4, v4); + bool4 _243 = v4 < v4; + res = half4(_243.x ? v4.x : v4.x, _243.y ? v4.y : v4.y, _243.z ? v4.z : v4.z, _243.w ? v4.w : v4.w); + res = step(v4, v4); + res = smoothstep(v4, v4, v4); + bool4 btmp = isnan(v4); + btmp = isinf(v4); + res = fma(v4, v4, v4); + ResType _267; + _267._m0 = frexp(v4, _267._m1); + int4 itmp = _267._m1; + res = _267._m0; + res = ldexp(res, itmp); + uint pack0 = as_type(v4.xy); + uint pack1 = as_type(v4.zw); + res = half4(as_type(pack0), as_type(pack1)); + half t0 = length(v4); + t0 = distance(v4, v4); + t0 = dot(v4, v4); + half3 res3 = cross(v3, v3); + res = normalize(v4); + res = faceforward(v4, v4, v4); + res = reflect(v4, v4); + res = refract(v4, v4, v1); + btmp = v4 < v4; + btmp = v4 <= v4; + btmp = v4 > v4; + btmp = v4 >= v4; + btmp = v4 == v4; + btmp = v4 != v4; + res = dfdx(v4); + res = dfdy(v4); + res = dfdx(v4); + res = dfdy(v4); + res = dfdx(v4); + res = dfdy(v4); + res = fwidth(v4); + res = fwidth(v4); + res = fwidth(v4); +} + +fragment void main0(main0_in in [[stage_in]]) +{ + half2 param = in.v2; + half2 param_1 = in.v2; + half2 param_2 = in.v3.xy; + half2 param_3 = in.v3.xy; + half2x2 m0 = test_mat2(param, param_1, param_2, param_3); + half3 param_4 = in.v3; + half3 param_5 = in.v3; + half3 param_6 = in.v3; + half3 param_7 = in.v4.xyz; + half3 param_8 = in.v4.xyz; + half3 param_9 = in.v4.yzw; + half3x3 m1 = test_mat3(param_4, param_5, param_6, param_7, param_8, param_9); + test_constants(); + test_conversions(); + test_builtins(in.v4, in.v3, in.v1); +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/front-facing.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/front-facing.frag index 3856498943..2f83642492 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/front-facing.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/front-facing.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 vB [[user(locn1)]]; - float4 vA [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vA [[user(locn0)]]; + float4 vB [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], bool gl_FrontFacing [[front_facing]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/gather-dref.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/gather-dref.frag new file mode 100644 index 0000000000..c5c5ccf0bb --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/gather-dref.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vUV [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uT [[texture(0)]], sampler uTSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = uT.gather_compare(uTSmplr, in.vUV.xy, in.vUV.z); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/gather-offset.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/gather-offset.frag new file mode 100644 index 0000000000..02b80194b5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/gather-offset.frag @@ -0,0 +1,17 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(texture2d uT [[texture(0)]], sampler uTSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor = uT.gather(uTSmplr, float2(0.5), int2(0), component::w); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/illegal-name-test-0.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/illegal-name-test-0.frag new file mode 100644 index 0000000000..6b209b49d5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/illegal-name-test-0.frag @@ -0,0 +1,21 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + float4 fragment0 = float4(10.0); + float4 compute0 = float4(10.0); + float4 kernel0 = float4(10.0); + float4 vertex0 = float4(10.0); + out.FragColor = ((fragment0 + compute0) + kernel0) + vertex0; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/in_block.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/in_block.frag index 43b4a05897..2af2024f52 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/in_block.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/in_block.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float4 VertexOut_color2 [[user(locn3)]]; - float4 VertexOut_color [[user(locn2)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 VertexOut_color [[user(locn2)]]; + float4 VertexOut_color2 [[user(locn3)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/in_mat.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/in_mat.frag new file mode 100644 index 0000000000..f0f4c4eeed --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/in_mat.frag @@ -0,0 +1,37 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 outFragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 inPos [[user(locn0)]]; + float3 inNormal [[user(locn1)]]; + float4 inInvModelView_0 [[user(locn2)]]; + float4 inInvModelView_1 [[user(locn3)]]; + float4 inInvModelView_2 [[user(locn4)]]; + float4 inInvModelView_3 [[user(locn5)]]; + float inLodBias [[user(locn6)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texturecube samplerColor [[texture(1)]], sampler samplerColorSmplr [[sampler(1)]]) +{ + main0_out out = {}; + float4x4 inInvModelView = {}; + inInvModelView[0] = in.inInvModelView_0; + inInvModelView[1] = in.inInvModelView_1; + inInvModelView[2] = in.inInvModelView_2; + inInvModelView[3] = in.inInvModelView_3; + float3 cI = normalize(in.inPos); + float3 cR = reflect(cI, normalize(in.inNormal)); + cR = float3((inInvModelView * float4(cR, 0.0)).xyz); + cR.x *= (-1.0); + out.outFragColor = samplerColor.sample(samplerColorSmplr, cR, bias(in.inLodBias)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/lut-promotion.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/lut-promotion.frag new file mode 100644 index 0000000000..a8eda3e13a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/lut-promotion.frag @@ -0,0 +1,67 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +constant float _16[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0}; +constant float4 _60[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; +constant float4 _104[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)}; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + int index [[user(locn0)]]; +}; + +// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. +template +void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +// An overload for constant arrays. +template +void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N]) +{ + for (uint i = 0; i < N; dst[i] = src[i], i++); +} + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + out.FragColor = _16[in.index]; + if (in.index < 10) + { + out.FragColor += _16[in.index ^ 1]; + } + else + { + out.FragColor += _16[in.index & 1]; + } + if (in.index > 30) + { + out.FragColor += _60[in.index & 3].y; + } + else + { + out.FragColor += _60[in.index & 1].x; + } + float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + if (in.index > 30) + { + foobar[1].z = 20.0; + } + out.FragColor += foobar[in.index & 3].z; + float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)}; + spvArrayCopyConstant(baz, _104); + out.FragColor += baz[in.index & 3].z; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/mix.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/mix.frag index 2d35766621..ad7c5adeeb 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/mix.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/mix.frag @@ -3,19 +3,19 @@ using namespace metal; -struct main0_in -{ - float vIn3 [[user(locn3)]]; - float vIn2 [[user(locn2)]]; - float4 vIn1 [[user(locn1)]]; - float4 vIn0 [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vIn0 [[user(locn0)]]; + float4 vIn1 [[user(locn1)]]; + float vIn2 [[user(locn2)]]; + float vIn3 [[user(locn3)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/mrt-array.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/mrt-array.frag new file mode 100644 index 0000000000..daf7edb4cc --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/mrt-array.frag @@ -0,0 +1,53 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor_0 [[color(0)]]; + float4 FragColor_1 [[color(1)]]; + float4 FragColor_2 [[color(2)]]; + float4 FragColor_3 [[color(3)]]; +}; + +struct main0_in +{ + float4 vA [[user(locn0)]]; + float4 vB [[user(locn1)]]; +}; + +// Implementation of the GLSL mod() function, which is slightly different than Metal fmod() +template +Tx mod(Tx x, Ty y) +{ + return x - y * floor(x / y); +} + +void write_deeper_in_function(thread float4 (&FragColor)[4], thread float4& vA, thread float4& vB) +{ + FragColor[3] = vA * vB; +} + +void write_in_function(thread float4 (&FragColor)[4], thread float4& vA, thread float4& vB) +{ + FragColor[2] = vA - vB; + write_deeper_in_function(FragColor, vA, vB); +} + +fragment main0_out main0(main0_in in [[stage_in]]) +{ + main0_out out = {}; + float4 FragColor[4] = {}; + FragColor[0] = mod(in.vA, in.vB); + FragColor[1] = in.vA + in.vB; + write_in_function(FragColor, in.vA, in.vB); + out.FragColor_0 = FragColor[0]; + out.FragColor_1 = FragColor[1]; + out.FragColor_2 = FragColor[2]; + out.FragColor_3 = FragColor[3]; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/packed-expression-vector-shuffle.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/packed-expression-vector-shuffle.frag new file mode 100644 index 0000000000..dc8947425a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/packed-expression-vector-shuffle.frag @@ -0,0 +1,25 @@ +#include +#include + +using namespace metal; + +struct UBO +{ + packed_float3 color; + float v; +}; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +fragment main0_out main0(constant UBO& _15 [[buffer(0)]]) +{ + main0_out out = {}; + float4 f = float4(1.0); + f = float4(_15.color[0], _15.color[1], _15.color[2], f.w); + out.FragColor = f; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/packing-test-3.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/packing-test-3.frag new file mode 100644 index 0000000000..9c59bc164e --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/packing-test-3.frag @@ -0,0 +1,54 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct VertexOutput +{ + float4 HPosition; +}; + +struct TestStruct +{ + float3 position; + float radius; +}; + +struct TestStruct_1 +{ + packed_float3 position; + float radius; +}; + +struct CB0 +{ + TestStruct_1 CB0[16]; +}; + +struct main0_out +{ + float4 _entryPointOutput [[color(0)]]; +}; + +float4 _main(thread const VertexOutput& IN, constant CB0& v_26) +{ + TestStruct st; + st.position = v_26.CB0[1].position; + st.radius = v_26.CB0[1].radius; + float4 col = float4(st.position, st.radius); + return col; +} + +fragment main0_out main0(constant CB0& v_26 [[buffer(0)]], float4 gl_FragCoord [[position]]) +{ + main0_out out = {}; + VertexOutput IN; + IN.HPosition = gl_FragCoord; + VertexOutput param = IN; + VertexOutput param_1 = param; + out._entryPointOutput = _main(param_1, v_26); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/pls.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/pls.frag index 42b5d2bf59..ee774a04af 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/pls.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/pls.frag @@ -3,14 +3,6 @@ using namespace metal; -struct main0_in -{ - float4 PLSIn3 [[user(locn3)]]; - float4 PLSIn2 [[user(locn2)]]; - float4 PLSIn1 [[user(locn1)]]; - float4 PLSIn0 [[user(locn0)]]; -}; - struct main0_out { float4 PLSOut0 [[color(0)]]; @@ -19,6 +11,14 @@ struct main0_out float4 PLSOut3 [[color(3)]]; }; +struct main0_in +{ + float4 PLSIn0 [[user(locn0)]]; + float4 PLSIn1 [[user(locn1)]]; + float4 PLSIn2 [[user(locn2)]]; + float4 PLSIn3 [[user(locn3)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/readonly-ssbo.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/readonly-ssbo.frag new file mode 100644 index 0000000000..771c225d6e --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/readonly-ssbo.frag @@ -0,0 +1,29 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct SSBO +{ + float4 v; +}; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +float4 read_from_function(const device SSBO& v_13) +{ + return v_13.v; +} + +fragment main0_out main0(const device SSBO& v_13 [[buffer(0)]]) +{ + main0_out out = {}; + out.FragColor = v_13.v + read_from_function(v_13); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag index a9c0f8b41b..ae84344748 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/sample-depth-separate-image-sampler.frag @@ -20,7 +20,7 @@ float sample_color_from_function(thread const texture2d uT, thread const return uT.sample(uS, float2(0.5)).x; } -fragment main0_out main0(depth2d uDepth [[texture(0)]], texture2d uColor [[texture(1)]], sampler uSamplerShadow [[sampler(0)]], sampler uSampler [[sampler(1)]]) +fragment main0_out main0(depth2d uDepth [[texture(0)]], texture2d uColor [[texture(1)]], sampler uSampler [[sampler(2)]], sampler uSamplerShadow [[sampler(3)]]) { main0_out out = {}; out.FragColor = sample_depth_from_function(uDepth, uSamplerShadow) + sample_color_from_function(uColor, uSampler); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler-1d-lod.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler-1d-lod.frag new file mode 100644 index 0000000000..1da2036e3a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler-1d-lod.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float vTex [[user(locn0)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], texture1d uSampler [[texture(0)]], sampler uSamplerSmplr [[sampler(0)]]) +{ + main0_out out = {}; + out.FragColor += ((uSampler.sample(uSamplerSmplr, in.vTex) + uSampler.sample(uSamplerSmplr, in.vTex)) + uSampler.sample(uSamplerSmplr, in.vTex)); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag new file mode 100644 index 0000000000..2aac733138 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler-image-arrays.msl2.frag @@ -0,0 +1,45 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 FragColor [[color(0)]]; +}; + +struct main0_in +{ + float2 vTex [[user(locn0)]]; + int vIndex [[user(locn1)]]; +}; + +float4 sample_from_global(thread int& vIndex, thread float2& vTex, thread const array, 4> uSampler, thread const array uSamplerSmplr) +{ + return uSampler[vIndex].sample(uSamplerSmplr[vIndex], (vTex + float2(0.100000001490116119384765625))); +} + +float4 sample_from_argument(thread const array, 4> samplers, thread const array samplersSmplr, thread int& vIndex, thread float2& vTex) +{ + return samplers[vIndex].sample(samplersSmplr[vIndex], (vTex + float2(0.20000000298023223876953125))); +} + +float4 sample_single_from_argument(thread const texture2d samp, thread const sampler sampSmplr, thread float2& vTex) +{ + return samp.sample(sampSmplr, (vTex + float2(0.300000011920928955078125))); +} + +fragment main0_out main0(main0_in in [[stage_in]], array, 4> uSampler [[texture(0)]], array, 4> uTextures [[texture(8)]], array uSamplerSmplr [[sampler(0)]], array uSamplers [[sampler(4)]]) +{ + main0_out out = {}; + out.FragColor = float4(0.0); + out.FragColor += uTextures[2].sample(uSamplers[1], in.vTex); + out.FragColor += uSampler[in.vIndex].sample(uSamplerSmplr[in.vIndex], in.vTex); + out.FragColor += sample_from_global(in.vIndex, in.vTex, uSampler, uSamplerSmplr); + out.FragColor += sample_from_argument(uSampler, uSamplerSmplr, in.vIndex, in.vTex); + out.FragColor += sample_single_from_argument(uSampler[3], uSamplerSmplr[3], in.vTex); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler.frag index 5d23492905..395854699e 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/sampler.frag @@ -5,18 +5,18 @@ using namespace metal; -struct main0_in -{ - float2 vTex [[user(locn1)]]; - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; -float4 sample_texture(thread const texture2d tex, thread const sampler& texSmplr, thread const float2& uv) +struct main0_in +{ + float4 vColor [[user(locn0)]]; + float2 vTex [[user(locn1)]]; +}; + +float4 sample_texture(thread const texture2d tex, thread const sampler texSmplr, thread const float2& uv) { return tex.sample(texSmplr, uv); } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag index 46c0524ab7..c0c2ea11e7 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/separate-image-sampler-argument.frag @@ -15,7 +15,7 @@ float4 samp(thread const texture2d t, thread const sampler s) return t.sample(s, float2(0.5)); } -fragment main0_out main0(texture2d uDepth [[texture(0)]], sampler uSampler [[sampler(0)]]) +fragment main0_out main0(texture2d uDepth [[texture(1)]], sampler uSampler [[sampler(0)]]) { main0_out out = {}; out.FragColor = samp(uDepth, uSampler); diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/shadow-compare-global-alias.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/shadow-compare-global-alias.frag new file mode 100644 index 0000000000..2dd2d32dfd --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/shadow-compare-global-alias.frag @@ -0,0 +1,53 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +struct main0_in +{ + float3 vUV [[user(locn0)]]; +}; + +float Samp(thread const float3& uv, thread depth2d uTex, thread sampler uSamp) +{ + return uTex.sample_compare(uSamp, uv.xy, uv.z); +} + +float Samp2(thread const float3& uv, thread depth2d uSampler, thread const sampler uSamplerSmplr, thread float3& vUV) +{ + return uSampler.sample_compare(uSamplerSmplr, vUV.xy, vUV.z); +} + +float Samp3(thread const depth2d uT, thread const sampler uS, thread const float3& uv, thread float3& vUV) +{ + return uT.sample_compare(uS, vUV.xy, vUV.z); +} + +float Samp4(thread const depth2d uS, thread const sampler uSSmplr, thread const float3& uv, thread float3& vUV) +{ + return uS.sample_compare(uSSmplr, vUV.xy, vUV.z); +} + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uSampler [[texture(0)]], depth2d uTex [[texture(1)]], sampler uSamplerSmplr [[sampler(0)]], sampler uSamp [[sampler(2)]]) +{ + main0_out out = {}; + out.FragColor = uSampler.sample_compare(uSamplerSmplr, in.vUV.xy, in.vUV.z); + out.FragColor += uTex.sample_compare(uSamp, in.vUV.xy, in.vUV.z); + float3 param = in.vUV; + out.FragColor += Samp(param, uTex, uSamp); + float3 param_1 = in.vUV; + out.FragColor += Samp2(param_1, uSampler, uSamplerSmplr, in.vUV); + float3 param_2 = in.vUV; + out.FragColor += Samp3(uTex, uSamp, param_2, in.vUV); + float3 param_3 = in.vUV; + out.FragColor += Samp4(uSampler, uSamplerSmplr, param_3, in.vUV); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-block-size.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-block-size.frag index 4237d941fe..445f4362de 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-block-size.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-block-size.frag @@ -8,16 +8,16 @@ struct SpecConstArray float4 samples[2]; }; -struct main0_in -{ - int Index [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + int Index [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], constant SpecConstArray& _15 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-ternary.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-ternary.frag new file mode 100644 index 0000000000..5ab6b4fcb1 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/spec-constant-ternary.frag @@ -0,0 +1,22 @@ +#include +#include + +using namespace metal; + +constant uint s_tmp [[function_constant(0)]]; +constant uint s = is_function_constant_defined(s_tmp) ? s_tmp : 10u; +constant bool _13 = (s > 20u); +constant uint _16 = _13 ? 30u : 50u; + +struct main0_out +{ + float FragColor [[color(0)]]; +}; + +fragment main0_out main0() +{ + main0_out out = {}; + out.FragColor = float(_16); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/swizzle.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/swizzle.frag index eb46111f00..7a0494e064 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/swizzle.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/swizzle.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - float2 vUV [[user(locn2)]]; - float3 vNormal [[user(locn1)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float3 vNormal [[user(locn1)]]; + float2 vUV [[user(locn2)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], texture2d samp [[texture(0)]], sampler sampSmplr [[sampler(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/texture-proj-shadow.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/texture-proj-shadow.frag index 8b9b03a59e..c5ab0ee007 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/texture-proj-shadow.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/texture-proj-shadow.frag @@ -3,19 +3,19 @@ using namespace metal; -struct main0_in -{ - float2 vClip2 [[user(locn2)]]; - float4 vClip4 [[user(locn1)]]; - float3 vClip3 [[user(locn0)]]; -}; - struct main0_out { float FragColor [[color(0)]]; }; -fragment main0_out main0(main0_in in [[stage_in]], depth2d uShadow2D [[texture(0)]], texture1d uSampler1D [[texture(1)]], texture2d uSampler2D [[texture(2)]], texture3d uSampler3D [[texture(3)]], sampler uShadow2DSmplr [[sampler(0)]], sampler uSampler1DSmplr [[sampler(1)]], sampler uSampler2DSmplr [[sampler(2)]], sampler uSampler3DSmplr [[sampler(3)]]) +struct main0_in +{ + float3 vClip3 [[user(locn0)]]; + float4 vClip4 [[user(locn1)]]; + float2 vClip2 [[user(locn2)]]; +}; + +fragment main0_out main0(main0_in in [[stage_in]], depth2d uShadow2D [[texture(1)]], texture1d uSampler1D [[texture(2)]], texture2d uSampler2D [[texture(3)]], texture3d uSampler3D [[texture(4)]], sampler uShadow2DSmplr [[sampler(1)]], sampler uSampler1DSmplr [[sampler(2)]], sampler uSampler2DSmplr [[sampler(3)]], sampler uSampler3DSmplr [[sampler(4)]]) { main0_out out = {}; float4 _20 = in.vClip4; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/ubo_layout.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/ubo_layout.frag index 8c03e33b39..0bc27462b2 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/ubo_layout.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/ubo_layout.frag @@ -13,9 +13,14 @@ struct UBO1 Str foo; }; +struct Str_1 +{ + float4x4 foo; +}; + struct UBO2 { - Str foo; + Str_1 foo; }; struct main0_out diff --git a/deps/SPIRV-Cross/reference/shaders-msl/frag/unary-enclose.frag b/deps/SPIRV-Cross/reference/shaders-msl/frag/unary-enclose.frag index 5a80f4d77c..c33269f2bf 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/frag/unary-enclose.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/frag/unary-enclose.frag @@ -3,17 +3,17 @@ using namespace metal; -struct main0_in -{ - int4 vIn1 [[user(locn1)]]; - float4 vIn [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vIn [[user(locn0)]]; + int4 vIn1 [[user(locn1)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/legacy/vert/transpose.legacy.vert b/deps/SPIRV-Cross/reference/shaders-msl/legacy/vert/transpose.legacy.vert index ad9ed8d7fd..3837c8bc04 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/legacy/vert/transpose.legacy.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/legacy/vert/transpose.legacy.vert @@ -10,16 +10,16 @@ struct Buffer float4x4 M; }; -struct main0_in -{ - float4 Position [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 Position [[attribute(0)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant Buffer& _13 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/basic.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/basic.vert index 1592b5c5cf..ffb4357126 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/basic.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/basic.vert @@ -8,18 +8,18 @@ struct UBO float4x4 uMVP; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/copy.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/copy.flatten.vert index 9ae5fcdb17..23e520478d 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/copy.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/copy.flatten.vert @@ -16,10 +16,11 @@ struct UBO Light lights[4]; }; -struct main0_in +struct Light_1 { - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; + float3 Position; + float Radius; + float4 Color; }; struct main0_out @@ -28,6 +29,12 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _21 [[buffer(0)]]) { main0_out out = {}; @@ -35,7 +42,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _21 [[buffer(0)]] out.vColor = float4(0.0); for (int i = 0; i < 4; i++) { - Light light; + Light_1 light; light.Position = _21.lights[i].Position; light.Radius = _21.lights[i].Radius; light.Color = _21.lights[i].Color; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/dynamic.flatten.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/dynamic.flatten.vert index 696966ca0b..de654a12b4 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/dynamic.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/dynamic.flatten.vert @@ -16,18 +16,18 @@ struct UBO Light lights[4]; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float4 vColor [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _21 [[buffer(0)]]) { main0_out out = {}; @@ -35,7 +35,7 @@ vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _21 [[buffer(0)]] out.vColor = float4(0.0); for (int i = 0; i < 4; i++) { - float3 L = in.aVertex.xyz - _21.lights[i].Position; + float3 L = in.aVertex.xyz - float3(_21.lights[i].Position); out.vColor += ((_21.lights[i].Color * clamp(1.0 - (length(L) / _21.lights[i].Radius), 0.0, 1.0)) * dot(in.aNormal, normalize(L))); } return out; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/functions.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/functions.vert index 6e07667b69..f710225261 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/functions.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/functions.vert @@ -13,12 +13,6 @@ struct UBO int2 bits; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; @@ -29,18 +23,24 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + // Implementation of the GLSL radians() function template T radians(T d) { - return d * 0.01745329251; + return d * T(0.01745329251); } // Implementation of the GLSL degrees() function template T degrees(T r) { - return r * 57.2957795131; + return r * T(57.2957795131); } // Implementation of the GLSL findLSB() function diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/in_out_array_mat.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/in_out_array_mat.vert new file mode 100644 index 0000000000..95be574a51 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/in_out_array_mat.vert @@ -0,0 +1,78 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct UBO +{ + float4x4 projection; + float4x4 model; + float lodBias; +}; + +struct main0_out +{ + float3 outPos [[user(locn0)]]; + float3 outNormal [[user(locn1)]]; + float4 outTransModel_0 [[user(locn2)]]; + float4 outTransModel_1 [[user(locn3)]]; + float4 outTransModel_2 [[user(locn4)]]; + float4 outTransModel_3 [[user(locn5)]]; + float outLodBias [[user(locn6)]]; + float4 color [[user(locn7)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float3 inPos [[attribute(0)]]; + float4 colors_0 [[attribute(1)]]; + float4 colors_1 [[attribute(2)]]; + float4 colors_2 [[attribute(3)]]; + float3 inNormal [[attribute(4)]]; + float4 inViewMat_0 [[attribute(5)]]; + float4 inViewMat_1 [[attribute(6)]]; + float4 inViewMat_2 [[attribute(7)]]; + float4 inViewMat_3 [[attribute(8)]]; +}; + +void write_deeper_in_function(thread float4x4& outTransModel, constant UBO& ubo, thread float4& color, thread float4 (&colors)[3]) +{ + outTransModel[1].y = ubo.lodBias; + color = colors[2]; +} + +void write_in_function(thread float4x4& outTransModel, constant UBO& ubo, thread float4& color, thread float4 (&colors)[3], thread float3& inNormal) +{ + outTransModel[2] = float4(inNormal, 1.0); + write_deeper_in_function(outTransModel, ubo, color, colors); +} + +vertex main0_out main0(main0_in in [[stage_in]], constant UBO& ubo [[buffer(0)]]) +{ + main0_out out = {}; + float4x4 outTransModel = {}; + float4 colors[3] = {}; + float4x4 inViewMat = {}; + colors[0] = in.colors_0; + colors[1] = in.colors_1; + colors[2] = in.colors_2; + inViewMat[0] = in.inViewMat_0; + inViewMat[1] = in.inViewMat_1; + inViewMat[2] = in.inViewMat_2; + inViewMat[3] = in.inViewMat_3; + out.gl_Position = (ubo.projection * ubo.model) * float4(in.inPos, 1.0); + out.outPos = float3((ubo.model * float4(in.inPos, 1.0)).xyz); + out.outNormal = float3x3(float3(float3(ubo.model[0].x, ubo.model[0].y, ubo.model[0].z)), float3(float3(ubo.model[1].x, ubo.model[1].y, ubo.model[1].z)), float3(float3(ubo.model[2].x, ubo.model[2].y, ubo.model[2].z))) * in.inNormal; + out.outLodBias = ubo.lodBias; + outTransModel = transpose(ubo.model) * inViewMat; + write_in_function(outTransModel, ubo, out.color, colors, in.inNormal); + out.outTransModel_0 = outTransModel[0]; + out.outTransModel_1 = outTransModel[1]; + out.outTransModel_2 = outTransModel[2]; + out.outTransModel_3 = outTransModel[3]; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/out_block.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/out_block.vert index 3ae18387a6..cf1334ec0b 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/out_block.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/out_block.vert @@ -8,12 +8,6 @@ struct Transform float4x4 transform; }; -struct main0_in -{ - float4 color [[attribute(1)]]; - float3 position [[attribute(0)]]; -}; - struct main0_out { float4 VertexOut_color [[user(locn2)]]; @@ -21,6 +15,12 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float3 position [[attribute(0)]]; + float4 color [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant Transform& block [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/packed_matrix.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/packed_matrix.vert index 5d025c4cde..89638511d6 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/packed_matrix.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/packed_matrix.vert @@ -26,27 +26,28 @@ struct _42 float2 _m9; }; -struct main0_in -{ - float4 m_25 [[attribute(0)]]; -}; - struct main0_out { float3 m_72 [[user(locn0)]]; float4 gl_Position [[position]]; }; -vertex main0_out main0(main0_in in [[stage_in]], constant _15& _17 [[buffer(0)]], constant _42& _44 [[buffer(1)]]) +struct main0_in +{ + float4 m_25 [[attribute(0)]]; +}; + +vertex main0_out main0(main0_in in [[stage_in]], constant _42& _44 [[buffer(12)]], constant _15& _17 [[buffer(13)]]) { main0_out out = {}; + float3 _91; float3 _13; do { _13 = normalize(float4(in.m_25.xyz, 0.0) * _17._m1); break; } while (false); - float4 _39 = _44._m0 * float4(_44._m3 + (in.m_25.xyz * (_44._m6 + _44._m7)), 1.0); + float4 _39 = _44._m0 * float4(float3(_44._m3) + (in.m_25.xyz * (_44._m6 + _44._m7)), 1.0); out.m_72 = _13; float4 _74 = _39; _74.y = -_39.y; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/pointsize.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/pointsize.vert index faf828b4d3..8e5782bde4 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/pointsize.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/pointsize.vert @@ -9,12 +9,6 @@ struct params float psize; }; -struct main0_in -{ - float4 color0 [[attribute(1)]]; - float4 position [[attribute(0)]]; -}; - struct main0_out { float4 color [[user(locn0)]]; @@ -22,6 +16,12 @@ struct main0_out float gl_PointSize [[point_size]]; }; +struct main0_in +{ + float4 position [[attribute(0)]]; + float4 color0 [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant params& _19 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..9a633c5fe6 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/read-from-row-major-array.vert @@ -0,0 +1,66 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct Block +{ + float2x3 var[3][4]; +}; + +struct main0_out +{ + float v_vtxResult [[user(locn0)]]; + float4 gl_Position [[position]]; +}; + +struct main0_in +{ + float4 a_position [[attribute(0)]]; +}; + +// Implementation of a conversion of matrix content from RowMajor to ColumnMajor organization. +float2x3 spvConvertFromRowMajor2x3(float2x3 m) +{ + return float2x3(float3(m[0][0], m[0][2], m[1][1]), float3(m[0][1], m[1][0], m[1][2])); +} + +float compare_float(thread const float& a, thread const float& b) +{ + return float(abs(a - b) < 0.0500000007450580596923828125); +} + +float compare_vec3(thread const float3& a, thread const float3& b) +{ + float param = a.x; + float param_1 = b.x; + float param_2 = a.y; + float param_3 = b.y; + float param_4 = a.z; + float param_5 = b.z; + return (compare_float(param, param_1) * compare_float(param_2, param_3)) * compare_float(param_4, param_5); +} + +float compare_mat2x3(thread const float2x3& a, thread const float2x3& b) +{ + float3 param = a[0]; + float3 param_1 = b[0]; + float3 param_2 = a[1]; + float3 param_3 = b[1]; + return compare_vec3(param, param_1) * compare_vec3(param_2, param_3); +} + +vertex main0_out main0(main0_in in [[stage_in]], constant Block& _104 [[buffer(0)]]) +{ + main0_out out = {}; + out.gl_Position = in.a_position; + float result = 1.0; + float2x3 param = spvConvertFromRowMajor2x3(_104.var[0][0]); + float2x3 param_1 = float2x3(float3(2.0, 6.0, -6.0), float3(0.0, 5.0, 5.0)); + result *= compare_mat2x3(param, param_1); + out.v_vtxResult = result; + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/return-array.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/return-array.vert index c3857b909a..b513a2fe57 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/return-array.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/return-array.vert @@ -7,17 +7,17 @@ using namespace metal; constant float4 _20[2] = {float4(10.0), float4(20.0)}; -struct main0_in -{ - float4 vInput1 [[attribute(1)]]; - float4 vInput0 [[attribute(0)]]; -}; - struct main0_out { float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 vInput0 [[attribute(0)]]; + float4 vInput1 [[attribute(1)]]; +}; + // Implementation of an array copy function to cover GLSL's ability to copy an array via assignment. template void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N]) diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/set_builtin_in_func.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/set_builtin_in_func.vert new file mode 100644 index 0000000000..2952748dc0 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/set_builtin_in_func.vert @@ -0,0 +1,26 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + +#include +#include + +using namespace metal; + +struct main0_out +{ + float4 gl_Position [[position]]; + float gl_PointSize [[point_size]]; +}; + +void write_outblock(thread float4& gl_Position, thread float& gl_PointSize) +{ + gl_PointSize = 1.0; + gl_Position = float4(gl_PointSize); +} + +vertex main0_out main0() +{ + main0_out out = {}; + write_outblock(out.gl_Position, out.gl_PointSize); + return out; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/texture_buffer.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/texture_buffer.vert index 690757b830..c45d298134 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/texture_buffer.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/texture_buffer.vert @@ -1,3 +1,5 @@ +#pragma clang diagnostic ignored "-Wmissing-prototypes" + #include #include @@ -8,10 +10,16 @@ struct main0_out float4 gl_Position [[position]]; }; -vertex main0_out main0(texture2d uSamp [[texture(0)]], texture2d uSampo [[texture(1)]]) +// Returns 2D texture coords corresponding to 1D texel buffer coords +uint2 spvTexelBufferCoord(uint tc) +{ + return uint2(tc % 4096, tc / 4096); +} + +vertex main0_out main0(texture2d uSamp [[texture(4)]], texture2d uSampo [[texture(5)]]) { main0_out out = {}; - out.gl_Position = uSamp.read(uint2(10, 0)) + uSampo.read(uint2(100, 0)); + out.gl_Position = uSamp.read(spvTexelBufferCoord(10)) + uSampo.read(spvTexelBufferCoord(100)); return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.alignment.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.alignment.vert index 6e48ae0e42..9a7ea56c61 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.alignment.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.alignment.vert @@ -12,12 +12,6 @@ struct UBO float opacity; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; @@ -26,12 +20,18 @@ struct main0_out float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _18 [[buffer(0)]]) { main0_out out = {}; out.gl_Position = _18.mvp * in.aVertex; out.vNormal = in.aNormal; - out.vColor = _18.color * _18.opacity; + out.vColor = float3(_18.color) * _18.opacity; out.vSize = _18.targSize * _18.opacity; return out; } diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.vert b/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.vert index 4a1adcd7f6..86ba1e9687 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.vert +++ b/deps/SPIRV-Cross/reference/shaders-msl/vert/ubo.vert @@ -8,18 +8,18 @@ struct UBO float4x4 mvp; }; -struct main0_in -{ - float3 aNormal [[attribute(1)]]; - float4 aVertex [[attribute(0)]]; -}; - struct main0_out { float3 vNormal [[user(locn0)]]; float4 gl_Position [[position]]; }; +struct main0_in +{ + float4 aVertex [[attribute(0)]]; + float3 aNormal [[attribute(1)]]; +}; + vertex main0_out main0(main0_in in [[stage_in]], constant UBO& _16 [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/push-constant.vk.frag b/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/push-constant.vk.frag index bc97e3cc51..7b8c502b32 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/push-constant.vk.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/push-constant.vk.frag @@ -9,16 +9,16 @@ struct PushConstants float4 value1; }; -struct main0_in -{ - float4 vColor [[user(locn0)]]; -}; - struct main0_out { float4 FragColor [[color(0)]]; }; +struct main0_in +{ + float4 vColor [[user(locn0)]]; +}; + fragment main0_out main0(main0_in in [[stage_in]], constant PushConstants& push [[buffer(0)]]) { main0_out out = {}; diff --git a/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/spec-constant.vk.frag b/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/spec-constant.vk.frag index 47dabb1771..aa10a501a6 100644 --- a/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/spec-constant.vk.frag +++ b/deps/SPIRV-Cross/reference/shaders-msl/vulkan/frag/spec-constant.vk.frag @@ -9,16 +9,52 @@ constant float b_tmp [[function_constant(2)]]; constant float b = is_function_constant_defined(b_tmp) ? b_tmp : 2.0; constant int c_tmp [[function_constant(3)]]; constant int c = is_function_constant_defined(c_tmp) ? c_tmp : 3; +constant uint _18 = (uint(c) + 0u); +constant int _21 = (-c); +constant int _23 = (~c); constant int d_tmp [[function_constant(4)]]; constant int d = is_function_constant_defined(d_tmp) ? d_tmp : 4; +constant int _26 = (c + d); +constant int _28 = (c - d); +constant int _30 = (c * d); +constant int _32 = (c / d); constant uint e_tmp [[function_constant(5)]]; constant uint e = is_function_constant_defined(e_tmp) ? e_tmp : 5u; constant uint f_tmp [[function_constant(6)]]; constant uint f = is_function_constant_defined(f_tmp) ? f_tmp : 6u; +constant uint _36 = (e / f); +constant int _38 = (c % d); +constant uint _40 = (e % f); +constant int _42 = (c >> d); +constant uint _44 = (e >> f); +constant int _46 = (c << d); +constant int _48 = (c | d); +constant int _50 = (c ^ d); +constant int _52 = (c & d); constant bool g_tmp [[function_constant(7)]]; constant bool g = is_function_constant_defined(g_tmp) ? g_tmp : false; constant bool h_tmp [[function_constant(8)]]; constant bool h = is_function_constant_defined(h_tmp) ? h_tmp : true; +constant bool _58 = (g || h); +constant bool _60 = (g && h); +constant bool _62 = (!g); +constant bool _64 = (g == h); +constant bool _66 = (g != h); +constant bool _68 = (c == d); +constant bool _70 = (c != d); +constant bool _72 = (c < d); +constant bool _74 = (e < f); +constant bool _76 = (c > d); +constant bool _78 = (e > f); +constant bool _80 = (c <= d); +constant bool _82 = (e <= f); +constant bool _84 = (c >= d); +constant bool _86 = (e >= f); +constant int _92 = int(e + 0u); +constant bool _94 = (c != int(0u)); +constant bool _96 = (e != 0u); +constant int _100 = int(g); +constant uint _103 = uint(g); struct main0_out { @@ -30,43 +66,43 @@ fragment main0_out main0() main0_out out = {}; float t0 = a; float t1 = b; - uint c0 = (uint(c) + 0u); - int c1 = (-c); - int c2 = (~c); - int c3 = (c + d); - int c4 = (c - d); - int c5 = (c * d); - int c6 = (c / d); - uint c7 = (e / f); - int c8 = (c % d); - uint c9 = (e % f); - int c10 = (c >> d); - uint c11 = (e >> f); - int c12 = (c << d); - int c13 = (c | d); - int c14 = (c ^ d); - int c15 = (c & d); - bool c16 = (g || h); - bool c17 = (g && h); - bool c18 = (!g); - bool c19 = (g == h); - bool c20 = (g != h); - bool c21 = (c == d); - bool c22 = (c != d); - bool c23 = (c < d); - bool c24 = (e < f); - bool c25 = (c > d); - bool c26 = (e > f); - bool c27 = (c <= d); - bool c28 = (e <= f); - bool c29 = (c >= d); - bool c30 = (e >= f); + uint c0 = _18; + int c1 = _21; + int c2 = _23; + int c3 = _26; + int c4 = _28; + int c5 = _30; + int c6 = _32; + uint c7 = _36; + int c8 = _38; + uint c9 = _40; + int c10 = _42; + uint c11 = _44; + int c12 = _46; + int c13 = _48; + int c14 = _50; + int c15 = _52; + bool c16 = _58; + bool c17 = _60; + bool c18 = _62; + bool c19 = _64; + bool c20 = _66; + bool c21 = _68; + bool c22 = _70; + bool c23 = _72; + bool c24 = _74; + bool c25 = _76; + bool c26 = _78; + bool c27 = _80; + bool c28 = _82; + bool c29 = _84; + bool c30 = _86; int c31 = c8 + c3; - int c32 = int(e + 0u); - bool c33 = (c != int(0u)); - bool c34 = (e != 0u); - int c35 = int(g); - uint c36 = uint(g); + int c32 = _92; + bool c33 = _94; + bool c34 = _96; + int c35 = _100; + uint c36 = _103; float c37 = float(g); out.FragColor = float4(t0 + t1); return out; diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag b/deps/SPIRV-Cross/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag similarity index 97% rename from deps/SPIRV-Cross/reference/opt/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag rename to deps/SPIRV-Cross/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag index 98116cfdc7..01797173f1 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag @@ -147,6 +147,7 @@ void main() _193 = _192; break; } while (false); + vec4 _194 = _193 * 1.0; vec4 _220; do { @@ -172,7 +173,7 @@ void main() vec3 _253 = vec3(_252.x, _252.y, _232.z); vec2 _255 = _253.xy * _165; vec3 _256 = vec3(_255.x, _255.y, _253.z); - vec3 _271 = ((IN_Color.xyz * (_193 * 1.0).xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (texture(SPIRV_Cross_CombinedStudsMapTextureStudsMapSampler, _156.UvStuds).x * 2.0); + vec3 _271 = ((IN_Color.xyz * _194.xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (texture(SPIRV_Cross_CombinedStudsMapTextureStudsMapSampler, _156.UvStuds).x * 2.0); vec4 _298; do { diff --git a/deps/SPIRV-Cross/reference/shaders-no-opt/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/reference/shaders-no-opt/asm/vert/empty-struct-composite.asm.vert new file mode 100644 index 0000000000..8f786d49e1 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-no-opt/asm/vert/empty-struct-composite.asm.vert @@ -0,0 +1,13 @@ +#version 450 + +struct Test +{ + int empty_struct_member; +}; + +void main() +{ + Test _14 = Test(0); + Test t = _14; +} + diff --git a/deps/SPIRV-Cross/reference/shaders-no-opt/asm/vert/semantic-decoration.asm.vert b/deps/SPIRV-Cross/reference/shaders-no-opt/asm/vert/semantic-decoration.asm.vert new file mode 100644 index 0000000000..9af0e241eb --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-no-opt/asm/vert/semantic-decoration.asm.vert @@ -0,0 +1,25 @@ +#version 450 + +struct VOut +{ + vec4 p; + vec4 c; +}; + +layout(location = 0) out vec4 _entryPointOutput_c; + +VOut _main() +{ + VOut v; + v.p = vec4(1.0); + v.c = vec4(2.0); + return v; +} + +void main() +{ + VOut flattenTemp = _main(); + gl_Position = flattenTemp.p; + _entryPointOutput_c = flattenTemp.c; +} + diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/reference/shaders-no-opt/comp/bitfield.comp similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders/comp/bitfield.noopt.comp rename to deps/SPIRV-Cross/reference/shaders-no-opt/comp/bitfield.comp diff --git a/deps/SPIRV-Cross/reference/opt/shaders/comp/loop.noopt.comp b/deps/SPIRV-Cross/reference/shaders-no-opt/comp/loop.comp similarity index 100% rename from deps/SPIRV-Cross/reference/opt/shaders/comp/loop.noopt.comp rename to deps/SPIRV-Cross/reference/shaders-no-opt/comp/loop.comp diff --git a/deps/SPIRV-Cross/reference/shaders/comp/return.comp b/deps/SPIRV-Cross/reference/shaders-no-opt/comp/return.comp similarity index 100% rename from deps/SPIRV-Cross/reference/shaders/comp/return.comp rename to deps/SPIRV-Cross/reference/shaders-no-opt/comp/return.comp diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant.vk.frag b/deps/SPIRV-Cross/reference/shaders-no-opt/vulkan/frag/spec-constant.vk.frag similarity index 100% rename from deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant.vk.frag rename to deps/SPIRV-Cross/reference/shaders-no-opt/vulkan/frag/spec-constant.vk.frag diff --git a/deps/SPIRV-Cross/reference/shaders-no-opt/vulkan/frag/spec-constant.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders-no-opt/vulkan/frag/spec-constant.vk.frag.vk new file mode 100644 index 0000000000..c5ae60b276 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-no-opt/vulkan/frag/spec-constant.vk.frag.vk @@ -0,0 +1,107 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(constant_id = 1) const float a = 1.0; +layout(constant_id = 2) const float b = 2.0; +layout(constant_id = 3) const int c = 3; +const uint _18 = (uint(c) + 0u); +const int _21 = (-c); +const int _23 = (~c); +layout(constant_id = 4) const int d = 4; +const int _26 = (c + d); +const int _28 = (c - d); +const int _30 = (c * d); +const int _32 = (c / d); +layout(constant_id = 5) const uint e = 5u; +layout(constant_id = 6) const uint f = 6u; +const uint _36 = (e / f); +const int _38 = (c % d); +const uint _40 = (e % f); +const int _42 = (c >> d); +const uint _44 = (e >> f); +const int _46 = (c << d); +const int _48 = (c | d); +const int _50 = (c ^ d); +const int _52 = (c & d); +layout(constant_id = 7) const bool g = false; +layout(constant_id = 8) const bool h = true; +const bool _58 = (g || h); +const bool _60 = (g && h); +const bool _62 = (!g); +const bool _64 = (g == h); +const bool _66 = (g != h); +const bool _68 = (c == d); +const bool _70 = (c != d); +const bool _72 = (c < d); +const bool _74 = (e < f); +const bool _76 = (c > d); +const bool _78 = (e > f); +const bool _80 = (c <= d); +const bool _82 = (e <= f); +const bool _84 = (c >= d); +const bool _86 = (e >= f); +const int _92 = int(e + 0u); +const bool _94 = (c != int(0u)); +const bool _96 = (e != 0u); +const int _100 = int(g); +const uint _103 = uint(g); +const int _118 = (c + 3); +const int _127 = (c + 2); +const int _135 = (d + 2); + +struct Foo +{ + float elems[_135]; +}; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + float t0 = a; + float t1 = b; + mediump uint c0 = _18; + mediump int c1 = _21; + mediump int c2 = _23; + mediump int c3 = _26; + mediump int c4 = _28; + mediump int c5 = _30; + mediump int c6 = _32; + mediump uint c7 = _36; + mediump int c8 = _38; + mediump uint c9 = _40; + mediump int c10 = _42; + mediump uint c11 = _44; + mediump int c12 = _46; + mediump int c13 = _48; + mediump int c14 = _50; + mediump int c15 = _52; + bool c16 = _58; + bool c17 = _60; + bool c18 = _62; + bool c19 = _64; + bool c20 = _66; + bool c21 = _68; + bool c22 = _70; + bool c23 = _72; + bool c24 = _74; + bool c25 = _76; + bool c26 = _78; + bool c27 = _80; + bool c28 = _82; + bool c29 = _84; + bool c30 = _86; + mediump int c31 = c8 + c3; + mediump int c32 = _92; + bool c33 = _94; + bool c34 = _96; + mediump int c35 = _100; + mediump uint c36 = _103; + float c37 = float(g); + float vec0[_118][8]; + float vec1[_127]; + Foo foo; + FragColor = ((vec4(t0 + t1) + vec4(vec0[0][0])) + vec4(vec1[0])) + vec4(foo.elems[c]); +} + diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json b/deps/SPIRV-Cross/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json new file mode 100644 index 0000000000..45adf50b14 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/asm/aliased-entry-point-names.asm.multi.json @@ -0,0 +1,49 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "vert" + }, + { + "name" : "main2", + "mode" : "vert" + }, + { + "name" : "main", + "mode" : "frag" + }, + { + "name" : "main2", + "mode" : "frag" + } + ], + "types" : { + "_8" : { + "name" : "_8", + "members" : [ + { + "name" : "_m0", + "type" : "vec4" + }, + { + "name" : "_m1", + "type" : "float" + }, + { + "name" : "_m2", + "type" : "float", + "array" : [ + 1 + ] + }, + { + "name" : "_m3", + "type" : "float", + "array" : [ + 1 + ] + } + ] + } + } +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/comp/struct-layout.comp.json b/deps/SPIRV-Cross/reference/shaders-reflection/comp/struct-layout.comp.json new file mode 100644 index 0000000000..3004454b80 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/comp/struct-layout.comp.json @@ -0,0 +1,64 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "comp" + } + ], + "types" : { + "_19" : { + "name" : "Foo", + "members" : [ + { + "name" : "m", + "type" : "mat4", + "offset" : 0 + } + ] + }, + "_21" : { + "name" : "SSBO2", + "members" : [ + { + "name" : "out_data", + "type" : "_19", + "array" : [ + 0 + ], + "offset" : 0 + } + ] + }, + "_28" : { + "name" : "SSBO", + "members" : [ + { + "name" : "in_data", + "type" : "_19", + "array" : [ + 0 + ], + "offset" : 0 + } + ] + } + }, + "ssbos" : [ + { + "type" : "_21", + "name" : "SSBO2", + "writeonly" : true, + "block_size" : 0, + "set" : 0, + "binding" : 1 + }, + { + "type" : "_28", + "name" : "SSBO", + "readonly" : true, + "block_size" : 0, + "set" : 0, + "binding" : 0 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/comp/struct-packing.comp.json b/deps/SPIRV-Cross/reference/shaders-reflection/comp/struct-packing.comp.json new file mode 100644 index 0000000000..22a41584d9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/comp/struct-packing.comp.json @@ -0,0 +1,474 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "comp" + } + ], + "types" : { + "_11" : { + "name" : "S0", + "members" : [ + { + "name" : "a", + "type" : "vec2", + "array" : [ + 1 + ], + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 8 + } + ] + }, + "_14" : { + "name" : "S1", + "members" : [ + { + "name" : "a", + "type" : "vec3", + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 12 + } + ] + }, + "_17" : { + "name" : "S2", + "members" : [ + { + "name" : "a", + "type" : "vec3", + "array" : [ + 1 + ], + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 16 + } + ] + }, + "_19" : { + "name" : "S3", + "members" : [ + { + "name" : "a", + "type" : "vec2", + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 8 + } + ] + }, + "_20" : { + "name" : "S4", + "members" : [ + { + "name" : "c", + "type" : "vec2", + "offset" : 0 + } + ] + }, + "_23" : { + "name" : "Content", + "members" : [ + { + "name" : "m0s", + "type" : "_11", + "array" : [ + 1 + ], + "offset" : 0 + }, + { + "name" : "m1s", + "type" : "_14", + "array" : [ + 1 + ], + "offset" : 16 + }, + { + "name" : "m2s", + "type" : "_17", + "array" : [ + 1 + ], + "offset" : 32 + }, + { + "name" : "m0", + "type" : "_11", + "offset" : 64 + }, + { + "name" : "m1", + "type" : "_14", + "offset" : 80 + }, + { + "name" : "m2", + "type" : "_17", + "offset" : 96 + }, + { + "name" : "m3", + "type" : "_19", + "offset" : 128 + }, + { + "name" : "m4", + "type" : "float", + "offset" : 144 + }, + { + "name" : "m3s", + "type" : "_20", + "array" : [ + 8 + ], + "offset" : 152 + } + ] + }, + "_36" : { + "name" : "SSBO1", + "members" : [ + { + "name" : "content", + "type" : "_23", + "offset" : 0 + }, + { + "name" : "content1", + "type" : "_23", + "array" : [ + 2 + ], + "offset" : 224 + }, + { + "name" : "content2", + "type" : "_23", + "offset" : 672 + }, + { + "name" : "m0", + "type" : "mat2", + "offset" : 896 + }, + { + "name" : "m1", + "type" : "mat2", + "offset" : 912 + }, + { + "name" : "m2", + "type" : "mat2x3", + "array" : [ + 4 + ], + "offset" : 928 + }, + { + "name" : "m3", + "type" : "mat3x2", + "offset" : 1056 + }, + { + "name" : "m4", + "type" : "mat2", + "row_major" : true, + "offset" : 1080 + }, + { + "name" : "m5", + "type" : "mat2", + "row_major" : true, + "array" : [ + 9 + ], + "offset" : 1096 + }, + { + "name" : "m6", + "type" : "mat2x3", + "row_major" : true, + "array" : [ + 2, + 4 + ], + "offset" : 1240 + }, + { + "name" : "m7", + "type" : "mat3x2", + "row_major" : true, + "offset" : 1440 + }, + { + "name" : "array", + "type" : "float", + "array" : [ + 0 + ], + "offset" : 1472 + } + ] + }, + "_42" : { + "name" : "S0", + "members" : [ + { + "name" : "a", + "type" : "vec2", + "array" : [ + 1 + ], + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 16 + } + ] + }, + "_44" : { + "name" : "S1", + "members" : [ + { + "name" : "a", + "type" : "vec3", + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 12 + } + ] + }, + "_47" : { + "name" : "S2", + "members" : [ + { + "name" : "a", + "type" : "vec3", + "array" : [ + 1 + ], + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 16 + } + ] + }, + "_49" : { + "name" : "S3", + "members" : [ + { + "name" : "a", + "type" : "vec2", + "offset" : 0 + }, + { + "name" : "b", + "type" : "float", + "offset" : 8 + } + ] + }, + "_50" : { + "name" : "S4", + "members" : [ + { + "name" : "c", + "type" : "vec2", + "offset" : 0 + } + ] + }, + "_52" : { + "name" : "Content", + "members" : [ + { + "name" : "m0s", + "type" : "_42", + "array" : [ + 1 + ], + "offset" : 0 + }, + { + "name" : "m1s", + "type" : "_44", + "array" : [ + 1 + ], + "offset" : 32 + }, + { + "name" : "m2s", + "type" : "_47", + "array" : [ + 1 + ], + "offset" : 48 + }, + { + "name" : "m0", + "type" : "_42", + "offset" : 80 + }, + { + "name" : "m1", + "type" : "_44", + "offset" : 112 + }, + { + "name" : "m2", + "type" : "_47", + "offset" : 128 + }, + { + "name" : "m3", + "type" : "_49", + "offset" : 160 + }, + { + "name" : "m4", + "type" : "float", + "offset" : 176 + }, + { + "name" : "m3s", + "type" : "_50", + "array" : [ + 8 + ], + "offset" : 192 + } + ] + }, + "_59" : { + "name" : "SSBO0", + "members" : [ + { + "name" : "content", + "type" : "_52", + "offset" : 0 + }, + { + "name" : "content1", + "type" : "_52", + "array" : [ + 2 + ], + "offset" : 320 + }, + { + "name" : "content2", + "type" : "_52", + "offset" : 960 + }, + { + "name" : "m0", + "type" : "mat2", + "offset" : 1280 + }, + { + "name" : "m1", + "type" : "mat2", + "offset" : 1312 + }, + { + "name" : "m2", + "type" : "mat2x3", + "array" : [ + 4 + ], + "offset" : 1344 + }, + { + "name" : "m3", + "type" : "mat3x2", + "offset" : 1472 + }, + { + "name" : "m4", + "type" : "mat2", + "row_major" : true, + "offset" : 1520 + }, + { + "name" : "m5", + "type" : "mat2", + "row_major" : true, + "array" : [ + 9 + ], + "offset" : 1552 + }, + { + "name" : "m6", + "type" : "mat2x3", + "row_major" : true, + "array" : [ + 2, + 4 + ], + "offset" : 1840 + }, + { + "name" : "m7", + "type" : "mat3x2", + "row_major" : true, + "offset" : 2224 + }, + { + "name" : "array", + "type" : "float", + "array" : [ + 0 + ], + "offset" : 2256 + } + ] + } + }, + "ssbos" : [ + { + "type" : "_36", + "name" : "SSBO1", + "restrict" : true, + "block_size" : 1472, + "set" : 0, + "binding" : 1 + }, + { + "type" : "_59", + "name" : "SSBO0", + "restrict" : true, + "block_size" : 2256, + "set" : 0, + "binding" : 0 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/combined-texture-sampler-shadow.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/combined-texture-sampler-shadow.vk.frag.json new file mode 100644 index 0000000000..5b4d3c6f7b --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/combined-texture-sampler-shadow.vk.frag.json @@ -0,0 +1,37 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "outputs" : [ + { + "type" : "float", + "name" : "FragColor", + "location" : 0 + } + ], + "separate_images" : [ + { + "type" : "texture2D", + "name" : "uDepth", + "set" : 0, + "binding" : 2 + } + ], + "separate_samplers" : [ + { + "type" : "sampler", + "name" : "uSampler", + "set" : 0, + "binding" : 0 + }, + { + "type" : "sampler", + "name" : "uSampler1", + "set" : 0, + "binding" : 1 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/combined-texture-sampler.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/combined-texture-sampler.vk.frag.json new file mode 100644 index 0000000000..8b6a184299 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/combined-texture-sampler.vk.frag.json @@ -0,0 +1,50 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "inputs" : [ + { + "type" : "vec2", + "name" : "vTex", + "location" : 0 + } + ], + "outputs" : [ + { + "type" : "vec4", + "name" : "FragColor", + "location" : 0 + } + ], + "separate_images" : [ + { + "type" : "texture2D", + "name" : "uTexture0", + "set" : 0, + "binding" : 2 + }, + { + "type" : "texture2D", + "name" : "uTexture1", + "set" : 0, + "binding" : 3 + } + ], + "separate_samplers" : [ + { + "type" : "sampler", + "name" : "uSampler0", + "set" : 0, + "binding" : 0 + }, + { + "type" : "sampler", + "name" : "uSampler1", + "set" : 0, + "binding" : 1 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/image-load-store-uint-coord.asm.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/image-load-store-uint-coord.asm.frag.json new file mode 100644 index 0000000000..527ea2bfee --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/image-load-store-uint-coord.asm.frag.json @@ -0,0 +1,47 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "outputs" : [ + { + "type" : "vec4", + "name" : "_entryPointOutput", + "location" : 0 + } + ], + "textures" : [ + { + "type" : "sampler2D", + "name" : "ROIm", + "set" : 0, + "binding" : 1 + } + ], + "separate_images" : [ + { + "type" : "samplerBuffer", + "name" : "ROBuf", + "set" : 0, + "binding" : 0 + } + ], + "images" : [ + { + "type" : "image2D", + "name" : "RWIm", + "set" : 0, + "binding" : 1, + "format" : "rgba32f" + }, + { + "type" : "imageBuffer", + "name" : "RWBuf", + "set" : 0, + "binding" : 0, + "format" : "rgba32f" + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/input-attachment-ms.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/input-attachment-ms.vk.frag.json new file mode 100644 index 0000000000..5f381911ac --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/input-attachment-ms.vk.frag.json @@ -0,0 +1,31 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "subpass_inputs" : [ + { + "type" : "subpassInputMS", + "name" : "uSubpass0", + "set" : 0, + "binding" : 0, + "input_attachment_index" : 0 + }, + { + "type" : "subpassInputMS", + "name" : "uSubpass1", + "set" : 0, + "binding" : 1, + "input_attachment_index" : 1 + } + ], + "outputs" : [ + { + "type" : "vec4", + "name" : "FragColor", + "location" : 0 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/input-attachment.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/input-attachment.vk.frag.json new file mode 100644 index 0000000000..16ae6a4683 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/input-attachment.vk.frag.json @@ -0,0 +1,31 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "subpass_inputs" : [ + { + "type" : "subpassInput", + "name" : "uSubpass0", + "set" : 0, + "binding" : 0, + "input_attachment_index" : 0 + }, + { + "type" : "subpassInput", + "name" : "uSubpass1", + "set" : 0, + "binding" : 1, + "input_attachment_index" : 1 + } + ], + "outputs" : [ + { + "type" : "vec4", + "name" : "FragColor", + "location" : 0 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/push-constant.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/push-constant.vk.frag.json new file mode 100644 index 0000000000..f72a8fd654 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/push-constant.vk.frag.json @@ -0,0 +1,46 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "types" : { + "_13" : { + "name" : "PushConstants", + "members" : [ + { + "name" : "value0", + "type" : "vec4", + "offset" : 0 + }, + { + "name" : "value1", + "type" : "vec4", + "offset" : 16 + } + ] + } + }, + "inputs" : [ + { + "type" : "vec4", + "name" : "vColor", + "location" : 0 + } + ], + "outputs" : [ + { + "type" : "vec4", + "name" : "FragColor", + "location" : 0 + } + ], + "push_constants" : [ + { + "type" : "_13", + "name" : "push", + "push_constant" : true + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/separate-sampler-texture-array.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/separate-sampler-texture-array.vk.frag.json new file mode 100644 index 0000000000..9216d93e5d --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/separate-sampler-texture-array.vk.frag.json @@ -0,0 +1,73 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "inputs" : [ + { + "type" : "vec2", + "name" : "vTex", + "location" : 0 + }, + { + "type" : "vec3", + "name" : "vTex3", + "location" : 1 + } + ], + "outputs" : [ + { + "type" : "vec4", + "name" : "FragColor", + "location" : 0 + } + ], + "separate_images" : [ + { + "type" : "texture2D", + "name" : "uTexture", + "array" : [ + 4 + ], + "set" : 0, + "binding" : 1 + }, + { + "type" : "texture2DArray", + "name" : "uTextureArray", + "array" : [ + 4 + ], + "set" : 0, + "binding" : 4 + }, + { + "type" : "textureCube", + "name" : "uTextureCube", + "array" : [ + 4 + ], + "set" : 0, + "binding" : 3 + }, + { + "type" : "texture3D", + "name" : "uTexture3D", + "array" : [ + 4 + ], + "set" : 0, + "binding" : 2 + } + ], + "separate_samplers" : [ + { + "type" : "sampler", + "name" : "uSampler", + "set" : 0, + "binding" : 0 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/frag/spec-constant.vk.frag.json b/deps/SPIRV-Cross/reference/shaders-reflection/frag/spec-constant.vk.frag.json new file mode 100644 index 0000000000..0add298666 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/frag/spec-constant.vk.frag.json @@ -0,0 +1,71 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "frag" + } + ], + "types" : { + "_137" : { + "name" : "Foo", + "members" : [ + { + "name" : "elems", + "type" : "float", + "array" : [ + 135 + ] + } + ] + } + }, + "outputs" : [ + { + "type" : "vec4", + "name" : "FragColor", + "location" : 0 + } + ], + "specialization_constants" : [ + { + "id" : 1, + "type" : "float", + "default_value" : 1.5 + }, + { + "id" : 2, + "type" : "float", + "default_value" : 2.5 + }, + { + "id" : 3, + "type" : "int", + "default_value" : 3 + }, + { + "id" : 4, + "type" : "int", + "default_value" : 4 + }, + { + "id" : 5, + "type" : "uint", + "default_value" : 5 + }, + { + "id" : 6, + "type" : "uint", + "default_value" : 6 + }, + { + "id" : 7, + "type" : "bool", + "default_value" : false + }, + { + "id" : 8, + "type" : "bool", + "default_value" : true + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/vert/read-from-row-major-array.vert.json b/deps/SPIRV-Cross/reference/shaders-reflection/vert/read-from-row-major-array.vert.json new file mode 100644 index 0000000000..d92fb67fb5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/vert/read-from-row-major-array.vert.json @@ -0,0 +1,61 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "vert" + } + ], + "types" : { + "_89" : { + "name" : "gl_PerVertex", + "members" : [ + { + "name" : "gl_Position", + "type" : "vec4" + }, + { + "name" : "gl_PointSize", + "type" : "float" + } + ] + }, + "_102" : { + "name" : "Block", + "members" : [ + { + "name" : "var", + "type" : "mat2x3", + "row_major" : true, + "array" : [ + 4, + 3 + ], + "offset" : 0 + } + ] + } + }, + "inputs" : [ + { + "type" : "vec4", + "name" : "a_position", + "location" : 0 + } + ], + "outputs" : [ + { + "type" : "float", + "name" : "v_vtxResult", + "location" : 0 + } + ], + "ubos" : [ + { + "type" : "_102", + "name" : "Block", + "block_size" : 576, + "set" : 0, + "binding" : 0 + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders-reflection/vert/texture_buffer.vert.json b/deps/SPIRV-Cross/reference/shaders-reflection/vert/texture_buffer.vert.json new file mode 100644 index 0000000000..3c69e24cbc --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders-reflection/vert/texture_buffer.vert.json @@ -0,0 +1,40 @@ +{ + "entryPoints" : [ + { + "name" : "main", + "mode" : "vert" + } + ], + "types" : { + "_8" : { + "name" : "gl_PerVertex", + "members" : [ + { + "name" : "gl_Position", + "type" : "vec4" + }, + { + "name" : "gl_PointSize", + "type" : "float" + } + ] + } + }, + "textures" : [ + { + "type" : "samplerBuffer", + "name" : "uSamp", + "set" : 0, + "binding" : 4 + } + ], + "images" : [ + { + "type" : "imageBuffer", + "name" : "uSampo", + "set" : 0, + "binding" : 5, + "format" : "rgba32f" + } + ] +} \ No newline at end of file diff --git a/deps/SPIRV-Cross/reference/shaders/amd/fragmentMaskFetch_subpassInput.vk.nocompat.invalid.frag b/deps/SPIRV-Cross/reference/shaders/amd/fragmentMaskFetch_subpassInput.vk.nocompat.invalid.frag deleted file mode 100644 index d670898481..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/amd/fragmentMaskFetch_subpassInput.vk.nocompat.invalid.frag +++ /dev/null @@ -1,11 +0,0 @@ -#version 450 -#extension GL_AMD_shader_fragment_mask : require - -layout(binding = 0) uniform sampler2DMS t; - -void main() -{ - vec4 test2 = fragmentFetchAMD(t, 4u); - uint testi2 = fragmentMaskFetchAMD(t); -} - diff --git a/deps/SPIRV-Cross/reference/shaders/amd/fs.invalid.frag b/deps/SPIRV-Cross/reference/shaders/amd/fs.invalid.frag index 97e7bcd180..aecf69eba7 100644 --- a/deps/SPIRV-Cross/reference/shaders/amd/fs.invalid.frag +++ b/deps/SPIRV-Cross/reference/shaders/amd/fs.invalid.frag @@ -2,9 +2,9 @@ #extension GL_AMD_shader_fragment_mask : require #extension GL_AMD_shader_explicit_vertex_parameter : require -uniform sampler2DMS texture1; +layout(binding = 0) uniform sampler2DMS texture1; -layout(location = 0) in vec4 vary; +layout(location = 0) __explicitInterpAMD in vec4 vary; void main() { diff --git a/deps/SPIRV-Cross/reference/shaders/amd/shader_ballot.comp b/deps/SPIRV-Cross/reference/shaders/amd/shader_ballot.comp index 64ac64d0d2..1fade727c6 100644 --- a/deps/SPIRV-Cross/reference/shaders/amd/shader_ballot.comp +++ b/deps/SPIRV-Cross/reference/shaders/amd/shader_ballot.comp @@ -18,7 +18,7 @@ void main() { float thisLaneData = _12.inputDataArray[gl_LocalInvocationID.x]; bool laneActive = thisLaneData > 0.0; - uint thisLaneOutputSlot = mbcntAMD(packUint2x32(uvec2(unpackUint2x32(ballotARB(laneActive)).xy))); + uint thisLaneOutputSlot = mbcntAMD(packUint2x32(uvec2(uvec4(unpackUint2x32(ballotARB(laneActive)), 0u, 0u).xy))); int firstInvocation = readFirstInvocationARB(1); int invocation = readInvocationARB(1, 0u); vec3 swizzleInvocations = swizzleInvocationsAMD(vec3(0.0, 2.0, 1.0), uvec4(3u)); diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_iequal.asm.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_iequal.asm.comp index 79398b404b..bdb3eeb9af 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_iequal.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_iequal.asm.comp @@ -15,10 +15,12 @@ layout(binding = 1, std430) buffer _4_6 void main() { - bvec4 _34 = equal(ivec4(_5._m1), _5._m0); - bvec4 _35 = equal(_5._m0, ivec4(_5._m1)); - bvec4 _36 = equal(_5._m1, _5._m1); - bvec4 _37 = equal(_5._m0, _5._m0); + ivec4 _30 = _5._m0; + uvec4 _31 = _5._m1; + bvec4 _34 = equal(ivec4(_31), _30); + bvec4 _35 = equal(_30, ivec4(_31)); + bvec4 _36 = equal(_31, _31); + bvec4 _37 = equal(_30, _30); _6._m0 = mix(uvec4(0u), uvec4(1u), _34); _6._m0 = mix(uvec4(0u), uvec4(1u), _35); _6._m0 = mix(uvec4(0u), uvec4(1u), _36); diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sar.asm.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sar.asm.comp index 42a4ed0233..283b444cce 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sar.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sar.asm.comp @@ -15,13 +15,15 @@ layout(binding = 1, std430) buffer _4_6 void main() { - _6._m0 = uvec4(ivec4(_5._m1) >> _5._m0); - _6._m0 = uvec4(_5._m0 >> ivec4(_5._m1)); - _6._m0 = uvec4(ivec4(_5._m1) >> ivec4(_5._m1)); - _6._m0 = uvec4(_5._m0 >> _5._m0); - _6._m1 = ivec4(_5._m1) >> ivec4(_5._m1); - _6._m1 = _5._m0 >> _5._m0; - _6._m1 = ivec4(_5._m1) >> _5._m0; - _6._m1 = _5._m0 >> ivec4(_5._m1); + ivec4 _22 = _5._m0; + uvec4 _23 = _5._m1; + _6._m0 = uvec4(ivec4(_23) >> _22); + _6._m0 = uvec4(_22 >> ivec4(_23)); + _6._m0 = uvec4(ivec4(_23) >> ivec4(_23)); + _6._m0 = uvec4(_22 >> _22); + _6._m1 = ivec4(_23) >> ivec4(_23); + _6._m1 = _22 >> _22; + _6._m1 = ivec4(_23) >> _22; + _6._m1 = _22 >> ivec4(_23); } diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sdiv.asm.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sdiv.asm.comp index eeb97e14a2..e28c481d21 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sdiv.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_sdiv.asm.comp @@ -15,13 +15,15 @@ layout(binding = 1, std430) buffer _4_6 void main() { - _6._m0 = uvec4(ivec4(_5._m1) / _5._m0); - _6._m0 = uvec4(_5._m0 / ivec4(_5._m1)); - _6._m0 = uvec4(ivec4(_5._m1) / ivec4(_5._m1)); - _6._m0 = uvec4(_5._m0 / _5._m0); - _6._m1 = ivec4(_5._m1) / ivec4(_5._m1); - _6._m1 = _5._m0 / _5._m0; - _6._m1 = ivec4(_5._m1) / _5._m0; - _6._m1 = _5._m0 / ivec4(_5._m1); + ivec4 _22 = _5._m0; + uvec4 _23 = _5._m1; + _6._m0 = uvec4(ivec4(_23) / _22); + _6._m0 = uvec4(_22 / ivec4(_23)); + _6._m0 = uvec4(ivec4(_23) / ivec4(_23)); + _6._m0 = uvec4(_22 / _22); + _6._m1 = ivec4(_23) / ivec4(_23); + _6._m1 = _22 / _22; + _6._m1 = ivec4(_23) / _22; + _6._m1 = _22 / ivec4(_23); } diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_slr.asm.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_slr.asm.comp index 25245e63eb..78efaf3852 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_slr.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders/asm/comp/bitcast_slr.asm.comp @@ -15,13 +15,15 @@ layout(binding = 1, std430) buffer _4_6 void main() { - _6._m0 = _5._m1 >> uvec4(_5._m0); - _6._m0 = uvec4(_5._m0) >> _5._m1; - _6._m0 = _5._m1 >> _5._m1; - _6._m0 = uvec4(_5._m0) >> uvec4(_5._m0); - _6._m1 = ivec4(_5._m1 >> _5._m1); - _6._m1 = ivec4(uvec4(_5._m0) >> uvec4(_5._m0)); - _6._m1 = ivec4(_5._m1 >> uvec4(_5._m0)); - _6._m1 = ivec4(uvec4(_5._m0) >> _5._m1); + ivec4 _22 = _5._m0; + uvec4 _23 = _5._m1; + _6._m0 = _23 >> uvec4(_22); + _6._m0 = uvec4(_22) >> _23; + _6._m0 = _23 >> _23; + _6._m0 = uvec4(_22) >> uvec4(_22); + _6._m1 = ivec4(_23 >> _23); + _6._m1 = ivec4(uvec4(_22) >> uvec4(_22)); + _6._m1 = ivec4(_23 >> uvec4(_22)); + _6._m1 = ivec4(uvec4(_22) >> _23); } diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/hlsl-functionality.asm.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/hlsl-functionality.asm.comp new file mode 100644 index 0000000000..ae3bb1f869 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/comp/hlsl-functionality.asm.comp @@ -0,0 +1,24 @@ +#version 450 +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(binding = 0, std430) buffer Buf +{ + vec4 _data[]; +} Buf_1; + +layout(std430) buffer Buf_count +{ + int _count; +} Buf_count_1; + +void _main() +{ + int _29 = atomicAdd(Buf_count_1._count, 1); + Buf_1._data[_29] = vec4(1.0); +} + +void main() +{ + _main(); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/comp/name-alias.asm.invalid.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/name-alias.asm.invalid.comp deleted file mode 100644 index 870b1df98d..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/asm/comp/name-alias.asm.invalid.comp +++ /dev/null @@ -1,37 +0,0 @@ -#version 310 es -layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; - -struct alias -{ - vec3 alias[100]; -}; - -struct alias_1 -{ - vec4 alias; - vec2 alias_1[10]; - alias alias_2[2]; -}; - -struct alias_2 -{ - vec4 alias; - alias_1 alias_1; -}; - -layout(binding = 0, std430) buffer alias_3 -{ - alias_2 alias; -} alias_4; - -layout(binding = 1, std140) buffer alias_5 -{ - alias_2 alias; -} alias_6; - -void main() -{ - alias_2 alias_7 = alias_4.alias; - alias_6.alias = alias_7; -} - diff --git a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/storage-buffer-basic.asm.comp b/deps/SPIRV-Cross/reference/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp similarity index 90% rename from deps/SPIRV-Cross/reference/opt/shaders/asm/comp/storage-buffer-basic.asm.comp rename to deps/SPIRV-Cross/reference/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp index 3de823fb10..a2210eb169 100644 --- a/deps/SPIRV-Cross/reference/opt/shaders/asm/comp/storage-buffer-basic.asm.comp +++ b/deps/SPIRV-Cross/reference/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp @@ -11,6 +11,8 @@ layout(binding = 1, std430) buffer _6_9 float _m0[]; } _9; +uvec3 _22 = gl_WorkGroupSize; + void main() { _8._m0[gl_WorkGroupID.x] = _9._m0[gl_WorkGroupID.x] + _8._m0[gl_WorkGroupID.x]; diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag new file mode 100644 index 0000000000..b5e59f88bb --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag @@ -0,0 +1,13 @@ +#version 450 + +uniform sampler2D SPIRV_Cross_CombineduTexuSampler; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vUV; + +void main() +{ + FragColor = texture(SPIRV_Cross_CombineduTexuSampler, vUV); + FragColor += textureOffset(SPIRV_Cross_CombineduTexuSampler, vUV, ivec2(1)); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag.vk b/deps/SPIRV-Cross/reference/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag.vk new file mode 100644 index 0000000000..bce9808950 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag.vk @@ -0,0 +1,14 @@ +#version 450 + +layout(set = 0, binding = 1) uniform texture2D uTex; +layout(set = 0, binding = 0) uniform sampler uSampler; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vUV; + +void main() +{ + FragColor = texture(sampler2D(uTex, uSampler), vUV); + FragColor += textureOffset(sampler2D(uTex, uSampler), vUV, ivec2(1)); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/complex-name-workarounds.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/complex-name-workarounds.asm.frag new file mode 100644 index 0000000000..7b120719e6 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/complex-name-workarounds.asm.frag @@ -0,0 +1,28 @@ +#version 450 + +layout(location = 0) in vec4 _; +layout(location = 1) in vec4 a; +layout(location = 0) out vec4 b; + +vec4 fu_nc_(vec4 a_) +{ + return a_; +} + +vec4 fu_nc_1(vec4 _0_1) +{ + return _0_1; +} + +void main() +{ + vec4 b_1 = _; + vec4 _0_1 = (_ + a) + fu_nc_(b_1); + vec4 b_3 = a; + vec4 b_2 = (_ - a) + fu_nc_1(b_3); + b = _0_1; + b = b_2; + b = _0_1; + b = b_2; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..7c9d39338e --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/empty-struct.asm.frag @@ -0,0 +1,25 @@ +#version 450 + +struct EmptyStructTest +{ + int empty_struct_member; +}; + +float GetValue(EmptyStructTest self) +{ + return 0.0; +} + +float GetValue_1(EmptyStructTest self) +{ + return 0.0; +} + +void main() +{ + EmptyStructTest _23 = EmptyStructTest(0); + EmptyStructTest emptyStruct; + float value = GetValue(emptyStruct); + value = GetValue_1(_23); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..ab2749b4df --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uTexture; + +layout(location = 0) out ivec2 Size; + +void main() +{ + Size = textureSize(uTexture, 0) + textureSize(uTexture, 1); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk index 3682eaee62..e4d9fc4543 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-fetch-no-sampler.asm.vk.frag.vk @@ -2,7 +2,7 @@ layout(set = 0, binding = 0) uniform sampler Sampler; layout(set = 0, binding = 0) uniform texture2D SampledImage; -uniform sampler SPIRV_Cross_DummySampler; +layout(set = 0, binding = 0) uniform sampler SPIRV_Cross_DummySampler; layout(location = 0) out vec4 _entryPointOutput; diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/image-query-no-sampler.vk.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-query-no-sampler.vk.asm.frag new file mode 100644 index 0000000000..2040dd1afb --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-query-no-sampler.vk.asm.frag @@ -0,0 +1,13 @@ +#version 450 + +uniform sampler2D SPIRV_Cross_CombineduSampler2DSPIRV_Cross_DummySampler; +uniform sampler2DMS SPIRV_Cross_CombineduSampler2DMSSPIRV_Cross_DummySampler; + +void main() +{ + ivec2 b = textureSize(SPIRV_Cross_CombineduSampler2DSPIRV_Cross_DummySampler, 0); + ivec2 c = textureSize(SPIRV_Cross_CombineduSampler2DMSSPIRV_Cross_DummySampler); + int l1 = textureQueryLevels(SPIRV_Cross_CombineduSampler2DSPIRV_Cross_DummySampler); + int s0 = textureSamples(SPIRV_Cross_CombineduSampler2DMSSPIRV_Cross_DummySampler); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/image-query-no-sampler.vk.asm.frag.vk b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-query-no-sampler.vk.asm.frag.vk new file mode 100644 index 0000000000..828d2a8727 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/image-query-no-sampler.vk.asm.frag.vk @@ -0,0 +1,14 @@ +#version 450 + +layout(set = 0, binding = 0) uniform texture2D uSampler2D; +layout(set = 0, binding = 0) uniform texture2DMS uSampler2DMS; +layout(set = 0, binding = 0) uniform sampler SPIRV_Cross_DummySampler; + +void main() +{ + ivec2 b = textureSize(sampler2D(uSampler2D, SPIRV_Cross_DummySampler), 0); + ivec2 c = textureSize(sampler2DMS(uSampler2DMS, SPIRV_Cross_DummySampler)); + int l1 = textureQueryLevels(sampler2D(uSampler2D, SPIRV_Cross_DummySampler)); + int s0 = textureSamples(sampler2DMS(uSampler2DMS, SPIRV_Cross_DummySampler)); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..6bc1be0d0f --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,39 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uImage; + +layout(location = 0) in vec4 v0; +layout(location = 0) out vec4 FragColor; + +void main() +{ + int i = 0; + float phi; + vec4 _36; + phi = 1.0; + _36 = vec4(1.0, 2.0, 1.0, 2.0); + for (;;) + { + FragColor = _36; + if (i < 4) + { + if (v0[i] > 0.0) + { + vec2 _48 = vec2(phi); + i++; + phi += 2.0; + _36 = textureLod(uImage, _48, 0.0); + continue; + } + else + { + break; + } + } + else + { + break; + } + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag deleted file mode 100644 index 98116cfdc7..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag +++ /dev/null @@ -1,227 +0,0 @@ -#version 450 - -struct VertexOutput -{ - vec4 HPosition; - vec4 Uv_EdgeDistance1; - vec4 UvStuds_EdgeDistance2; - vec4 Color; - vec4 LightPosition_Fog; - vec4 View_Depth; - vec4 Normal_SpecPower; - vec3 Tangent; - vec4 PosLightSpace_Reflectance; - float studIndex; -}; - -struct Surface -{ - vec3 albedo; - vec3 normal; - float specular; - float gloss; - float reflectance; - float opacity; -}; - -struct SurfaceInput -{ - vec4 Color; - vec2 Uv; - vec2 UvStuds; -}; - -struct Globals -{ - mat4 ViewProjection; - vec4 ViewRight; - vec4 ViewUp; - vec4 ViewDir; - vec3 CameraPosition; - vec3 AmbientColor; - vec3 Lamp0Color; - vec3 Lamp0Dir; - vec3 Lamp1Color; - vec4 FogParams; - vec3 FogColor; - vec4 LightBorder; - vec4 LightConfig0; - vec4 LightConfig1; - vec4 LightConfig2; - vec4 LightConfig3; - vec4 RefractionBias_FadeDistance_GlowFactor; - vec4 OutlineBrightness_ShadowInfo; - vec4 ShadowMatrix0; - vec4 ShadowMatrix1; - vec4 ShadowMatrix2; -}; - -struct Params -{ - vec4 LqmatFarTilingFactor; -}; - -layout(binding = 0, std140) uniform CB0 -{ - Globals CB0; -} _19; - -uniform sampler2D SPIRV_Cross_CombinedDiffuseMapTextureDiffuseMapSampler; -uniform sampler2D SPIRV_Cross_CombinedNormalMapTextureNormalMapSampler; -uniform sampler2D SPIRV_Cross_CombinedNormalDetailMapTextureNormalDetailMapSampler; -uniform sampler2D SPIRV_Cross_CombinedStudsMapTextureStudsMapSampler; -uniform sampler2D SPIRV_Cross_CombinedSpecularMapTextureSpecularMapSampler; -uniform sampler3D SPIRV_Cross_CombinedLightMapTextureLightMapSampler; -uniform sampler2D SPIRV_Cross_CombinedShadowMapTextureShadowMapSampler; -uniform samplerCube SPIRV_Cross_CombinedEnvironmentMapTextureEnvironmentMapSampler; - -layout(location = 0) in vec4 IN_Uv_EdgeDistance1; -layout(location = 1) in vec4 IN_UvStuds_EdgeDistance2; -layout(location = 2) in vec4 IN_Color; -layout(location = 3) in vec4 IN_LightPosition_Fog; -layout(location = 4) in vec4 IN_View_Depth; -layout(location = 5) in vec4 IN_Normal_SpecPower; -layout(location = 6) in vec3 IN_Tangent; -layout(location = 7) in vec4 IN_PosLightSpace_Reflectance; -layout(location = 8) in float IN_studIndex; -layout(location = 0) out vec4 _entryPointOutput; - -VertexOutput _121; -SurfaceInput _122; -vec2 _123; -vec4 _124; -Surface _125; -vec4 _192; -vec4 _219; -vec4 _297; - -void main() -{ - VertexOutput _128 = _121; - _128.HPosition = gl_FragCoord; - VertexOutput _130 = _128; - _130.Uv_EdgeDistance1 = IN_Uv_EdgeDistance1; - VertexOutput _132 = _130; - _132.UvStuds_EdgeDistance2 = IN_UvStuds_EdgeDistance2; - VertexOutput _134 = _132; - _134.Color = IN_Color; - VertexOutput _136 = _134; - _136.LightPosition_Fog = IN_LightPosition_Fog; - VertexOutput _138 = _136; - _138.View_Depth = IN_View_Depth; - VertexOutput _140 = _138; - _140.Normal_SpecPower = IN_Normal_SpecPower; - VertexOutput _142 = _140; - _142.Tangent = IN_Tangent; - VertexOutput _144 = _142; - _144.PosLightSpace_Reflectance = IN_PosLightSpace_Reflectance; - VertexOutput _146 = _144; - _146.studIndex = IN_studIndex; - SurfaceInput _147 = _122; - _147.Color = IN_Color; - SurfaceInput _149 = _147; - _149.Uv = IN_Uv_EdgeDistance1.xy; - SurfaceInput _151 = _149; - _151.UvStuds = IN_UvStuds_EdgeDistance2.xy; - SurfaceInput _156 = _151; - _156.UvStuds.y = (fract(_151.UvStuds.y) + 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); - vec2 _166 = IN_Uv_EdgeDistance1.xy * 1.0; - bool _173; - vec4 _193; - do - { - _173 = 0.0 == 0.0; - if (_173) - { - _193 = texture(SPIRV_Cross_CombinedDiffuseMapTextureDiffuseMapSampler, _166); - break; - } - else - { - float _180 = 1.0 / (1.0 - 0.0); - _193 = mix(texture(SPIRV_Cross_CombinedDiffuseMapTextureDiffuseMapSampler, _166 * 0.25), texture(SPIRV_Cross_CombinedDiffuseMapTextureDiffuseMapSampler, _166), vec4(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); - vec4 _220; - do - { - if (_173) - { - _220 = texture(SPIRV_Cross_CombinedNormalMapTextureNormalMapSampler, _166); - break; - } - else - { - float _207 = 1.0 / (1.0 - 0.0); - _220 = mix(texture(SPIRV_Cross_CombinedNormalMapTextureNormalMapSampler, _166 * 0.25), texture(SPIRV_Cross_CombinedNormalMapTextureNormalMapSampler, _166), vec4(clamp((_165 * _207) - (0.0 * _207), 0.0, 1.0))); - break; - } - _220 = _219; - break; - } while (false); - vec2 _223 = vec2(1.0); - vec2 _224 = (_220.wy * 2.0) - _223; - vec3 _232 = vec3(_224, sqrt(clamp(1.0 + dot(-_224, _224), 0.0, 1.0))); - vec2 _240 = (texture(SPIRV_Cross_CombinedNormalDetailMapTextureNormalDetailMapSampler, _166 * 0.0).wy * 2.0) - _223; - vec2 _252 = _232.xy + (vec3(_240, sqrt(clamp(1.0 + dot(-_240, _240), 0.0, 1.0))).xy * 0.0); - vec3 _253 = vec3(_252.x, _252.y, _232.z); - vec2 _255 = _253.xy * _165; - vec3 _256 = vec3(_255.x, _255.y, _253.z); - vec3 _271 = ((IN_Color.xyz * (_193 * 1.0).xyz) * (1.0 + (_256.x * 0.300000011920928955078125))) * (texture(SPIRV_Cross_CombinedStudsMapTextureStudsMapSampler, _156.UvStuds).x * 2.0); - vec4 _298; - do - { - if (0.75 == 0.0) - { - _298 = texture(SPIRV_Cross_CombinedSpecularMapTextureSpecularMapSampler, _166); - break; - } - else - { - float _285 = 1.0 / (1.0 - 0.75); - _298 = mix(texture(SPIRV_Cross_CombinedSpecularMapTextureSpecularMapSampler, _166 * 0.25), texture(SPIRV_Cross_CombinedSpecularMapTextureSpecularMapSampler, _166), vec4(clamp((_165 * _285) - (0.75 * _285), 0.0, 1.0))); - break; - } - _298 = _297; - break; - } while (false); - vec2 _303 = mix(vec2(0.800000011920928955078125, 120.0), (_298.xy * vec2(2.0, 256.0)) + vec2(0.0, 0.00999999977648258209228515625), vec2(_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; - vec4 _318 = vec4(_271, _146.Color.w); - vec3 _329 = normalize(((IN_Tangent * _313.normal.x) + (cross(IN_Normal_SpecPower.xyz, IN_Tangent) * _313.normal.y)) + (IN_Normal_SpecPower.xyz * _313.normal.z)); - vec3 _332 = -_19.CB0.Lamp0Dir; - float _333 = dot(_329, _332); - float _357 = clamp(dot(step(_19.CB0.LightConfig3.xyz, abs(IN_LightPosition_Fog.xyz - _19.CB0.LightConfig2.xyz)), vec3(1.0)), 0.0, 1.0); - vec4 _368 = mix(texture(SPIRV_Cross_CombinedLightMapTextureLightMapSampler, IN_LightPosition_Fog.xyz.yzx - (IN_LightPosition_Fog.xyz.yzx * _357)), _19.CB0.LightBorder, vec4(_357)); - vec2 _376 = texture(SPIRV_Cross_CombinedShadowMapTextureShadowMapSampler, IN_PosLightSpace_Reflectance.xyz.xy).xy; - float _392 = (1.0 - (((step(_376.x, IN_PosLightSpace_Reflectance.xyz.z) * clamp(9.0 - (20.0 * abs(IN_PosLightSpace_Reflectance.xyz.z - 0.5)), 0.0, 1.0)) * _376.y) * _19.CB0.OutlineBrightness_ShadowInfo.w)) * _368.w; - vec3 _403 = mix(_318.xyz, texture(SPIRV_Cross_CombinedEnvironmentMapTextureEnvironmentMapSampler, reflect(-IN_View_Depth.xyz, _329)).xyz, vec3(_312)); - vec4 _404 = vec4(_403.x, _403.y, _403.z, _318.w); - vec3 _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_View_Depth.xyz))), 0.0, 1.0), _308))); - vec4 _425 = vec4(_422.x, _422.y, _422.z, _124.w); - _425.w = _404.w; - vec2 _435 = min(IN_Uv_EdgeDistance1.wz, IN_UvStuds_EdgeDistance2.wz); - float _439 = min(_435.x, _435.y) / _163; - vec3 _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); - vec4 _446 = vec4(_445.x, _445.y, _445.z, _425.w); - vec3 _453 = mix(_19.CB0.FogColor, _446.xyz, vec3(clamp(_146.LightPosition_Fog.w, 0.0, 1.0))); - _entryPointOutput = vec4(_453.x, _453.y, _453.z, _446.w); -} - diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-header-to-continue.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-header-to-continue.asm.frag index f3a6b4eceb..a99322d67e 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-header-to-continue.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-header-to-continue.asm.frag @@ -28,11 +28,15 @@ void main() float _58; _55 = 0.0; _58 = 0.0; - float _64; - vec4 _72; - float _78; - for (int _60 = -3; _60 <= 3; _64 = float(_60), _72 = texture(SPIRV_Cross_CombinedmapTexturemapSampler, IN_uv + (vec2(0.0, _8.CB1.TextureSize.w) * _64)), _78 = exp(((-_64) * _64) * 0.2222220003604888916015625) * float(abs(_72.y - _50) < clamp((_50 * 80.0) * 0.0007999999797903001308441162109375, 7.999999797903001308441162109375e-05, 0.008000000379979610443115234375)), _55 += (_72.x * _78), _58 += _78, _60++) + for (int _60 = -3; _60 <= 3; ) { + float _64 = float(_60); + vec4 _72 = texture(SPIRV_Cross_CombinedmapTexturemapSampler, IN_uv + (vec2(0.0, _8.CB1.TextureSize.w) * _64)); + float _78 = exp(((-_64) * _64) * 0.2222220003604888916015625) * float(abs(_72.y - _50) < clamp((_50 * 80.0) * 0.0007999999797903001308441162109375, 7.999999797903001308441162109375e-05, 0.008000000379979610443115234375)); + _55 += (_72.x * _78); + _58 += _78; + _60++; + continue; } _entryPointOutput = vec4(_55 / _58, _50, 0.0, 1.0); } diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-merge-to-continue.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-merge-to-continue.asm.frag new file mode 100644 index 0000000000..55db70cf6f --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/loop-merge-to-continue.asm.frag @@ -0,0 +1,17 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + FragColor = vec4(1.0); + for (int i = 0; i < 4; i++) + { + for (int j = 0; j < 4; j++) + { + FragColor += vec4(v0[(i + j) & 3]); + } + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..c08bc2c781 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,40 @@ +#version 310 es +precision mediump float; +precision highp int; + +const float _46[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0); +const vec4 _76[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + +layout(location = 0) out float FragColor; +layout(location = 0) flat in mediump int index; + +void main() +{ + vec4 foobar[4] = _76; + vec4 baz[4] = _76; + FragColor = _46[index]; + if (index < 10) + { + FragColor += _46[index ^ 1]; + } + else + { + FragColor += _46[index & 1]; + } + if (index > 30) + { + FragColor += _76[index & 3].y; + } + else + { + FragColor += _76[index & 1].x; + } + if (index > 30) + { + foobar[1].z = 20.0; + } + FragColor += foobar[index & 3].z; + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[index & 3].z; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/op-constant-null.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/op-constant-null.asm.frag index c4ae981f64..970b4c4a66 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/frag/op-constant-null.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/op-constant-null.asm.frag @@ -2,6 +2,8 @@ precision mediump float; precision highp int; +const vec4 _14[4] = vec4[](vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); + struct D { vec4 a; @@ -16,7 +18,6 @@ void main() vec4 b = vec4(0.0); mat2x3 c = mat2x3(vec3(0.0), vec3(0.0)); D d = D(vec4(0.0), 0.0); - vec4 e[4] = vec4[](vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0)); FragColor = a; } diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag new file mode 100644 index 0000000000..3dc1839d6b --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag @@ -0,0 +1,28 @@ +#version 450 + +struct Registers +{ + int index; +}; + +uniform Registers registers; + +uniform sampler2D SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[4]; + +layout(location = 0) out vec4 FragColor; + +vec4 sample_from_func(sampler2D SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler_1[4]) +{ + return texelFetch(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler_1[registers.index], ivec2(4), 0); +} + +vec4 sample_one_from_func(sampler2D SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler_1) +{ + return texelFetch(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler_1, ivec2(4), 0); +} + +void main() +{ + FragColor = (texelFetch(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[registers.index], ivec2(10), 0) + sample_from_func(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler)) + sample_one_from_func(SPIRV_Cross_CombineduSamplerSPIRV_Cross_DummySampler[registers.index]); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag index a4cf078308..1ebf8fb96b 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag @@ -1,7 +1,7 @@ #version 450 -layout(rgba32f) uniform writeonly imageBuffer RWTex; -uniform samplerBuffer Tex; +layout(binding = 0, rgba32f) uniform writeonly imageBuffer RWTex; +layout(binding = 1) uniform samplerBuffer Tex; layout(location = 0) out vec4 _entryPointOutput; diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/selection-merge-to-continue.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/selection-merge-to-continue.asm.frag new file mode 100644 index 0000000000..82b5973f8a --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/selection-merge-to-continue.asm.frag @@ -0,0 +1,23 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + FragColor = vec4(1.0); + for (int i = 0; i < 4; i++) + { + if (v0.x == 20.0) + { + FragColor += vec4(v0[i & 3]); + continue; + } + else + { + FragColor += vec4(v0[i & 1]); + continue; + } + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..05a3d7554f --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/srem.asm.frag @@ -0,0 +1,13 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) flat in ivec4 vA; +layout(location = 1) flat in ivec4 vB; + +void main() +{ + FragColor = vec4(vA - vB * (vA / vB)); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/switch-label-shared-block.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/switch-label-shared-block.asm.frag new file mode 100644 index 0000000000..ade9044e35 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/switch-label-shared-block.asm.frag @@ -0,0 +1,33 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(location = 0) flat in mediump int vIndex; +layout(location = 0) out float FragColor; + +void main() +{ + highp float _19; + switch (vIndex) + { + case 0: + case 2: + { + _19 = 1.0; + break; + } + case 1: + default: + { + _19 = 3.0; + break; + } + case 8: + { + _19 = 8.0; + break; + } + } + FragColor = _19; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/switch-merge-to-continue.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/switch-merge-to-continue.asm.frag new file mode 100644 index 0000000000..88f76cf1d6 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/switch-merge-to-continue.asm.frag @@ -0,0 +1,30 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = vec4(1.0); + for (int i = 0; i < 4; i++) + { + switch (i) + { + case 0: + { + FragColor.x += 1.0; + break; + } + case 1: + { + FragColor.y += 3.0; + break; + } + default: + { + FragColor.z += 3.0; + break; + } + } + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/temporary-name-alias.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/temporary-name-alias.asm.frag new file mode 100644 index 0000000000..927c0434a8 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/temporary-name-alias.asm.frag @@ -0,0 +1,10 @@ +#version 450 + +void main() +{ + float constituent = float(0); + mat3 _mat3 = mat3(vec3(constituent), vec3(constituent), vec3(constituent)); + float constituent_1 = float(1); + _mat3 = mat3(vec3(constituent_1), vec3(constituent_1), vec3(constituent_1)); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..6193de0da9 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uTexture; + +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = texelFetch(uTexture, ivec2(gl_FragCoord.xy), 0); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/unknown-depth-state.asm.vk.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/unknown-depth-state.asm.vk.frag new file mode 100644 index 0000000000..7729d30c09 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/unknown-depth-state.asm.vk.frag @@ -0,0 +1,23 @@ +#version 450 + +layout(binding = 0) uniform sampler2DShadow uShadow; +uniform sampler2DShadow SPIRV_Cross_CombineduTextureuSampler; + +layout(location = 0) in vec3 vUV; +layout(location = 0) out float FragColor; + +float sample_combined() +{ + return texture(uShadow, vec3(vUV.xy, vUV.z)); +} + +float sample_separate() +{ + return texture(SPIRV_Cross_CombineduTextureuSampler, vec3(vUV.xy, vUV.z)); +} + +void main() +{ + FragColor = sample_combined() + sample_separate(); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/unknown-depth-state.asm.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders/asm/frag/unknown-depth-state.asm.vk.frag.vk new file mode 100644 index 0000000000..711fa27763 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/unknown-depth-state.asm.vk.frag.vk @@ -0,0 +1,24 @@ +#version 450 + +layout(set = 0, binding = 0) uniform sampler2DShadow uShadow; +layout(set = 0, binding = 1) uniform texture2D uTexture; +layout(set = 0, binding = 2) uniform samplerShadow uSampler; + +layout(location = 0) in vec3 vUV; +layout(location = 0) out float FragColor; + +float sample_combined() +{ + return texture(uShadow, vec3(vUV.xy, vUV.z)); +} + +float sample_separate() +{ + return texture(sampler2DShadow(uTexture, uSampler), vec3(vUV.xy, vUV.z)); +} + +void main() +{ + FragColor = sample_combined() + sample_separate(); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag b/deps/SPIRV-Cross/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag index 1c211caa6d..cdaf78727e 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag +++ b/deps/SPIRV-Cross/reference/shaders/asm/frag/vector-shuffle-oom.asm.frag @@ -110,7 +110,8 @@ void main() { _129 = _109; } - vec3 _133 = vec4(0.0).xyz + (_129 * 0.5); + vec3 _130 = _129 * 0.5; + vec3 _133 = vec4(0.0).xyz + _130; vec4 _134 = vec4(_133.x, _133.y, _133.z, vec4(0.0).w); _28 _135 = _77; _135._m0 = _134; @@ -126,7 +127,8 @@ void main() { _176 = _156; } - vec3 _180 = _134.xyz + (_176 * 0.5); + vec3 _177 = _176 * 0.5; + vec3 _180 = _134.xyz + _177; vec4 _181 = vec4(_180.x, _180.y, _180.z, _134.w); _28 _182 = _135; _182._m0 = _181; @@ -142,7 +144,8 @@ void main() { _223 = _203; } - vec3 _227 = _181.xyz + (_223 * 0.75); + vec3 _224 = _223 * 0.75; + vec3 _227 = _181.xyz + _224; vec4 _228 = vec4(_227.x, _227.y, _227.z, _181.w); _28 _229 = _182; _229._m0 = _228; @@ -158,7 +161,8 @@ void main() { _270 = _250; } - vec3 _274 = _228.xyz + (_270 * 0.5); + vec3 _271 = _270 * 0.5; + vec3 _274 = _228.xyz + _271; vec4 _275 = vec4(_274.x, _274.y, _274.z, _228.w); _28 _276 = _229; _276._m0 = _275; @@ -174,7 +178,8 @@ void main() { _317 = _297; } - vec3 _321 = _275.xyz + (_317 * 0.5); + vec3 _318 = _317 * 0.5; + vec3 _321 = _275.xyz + _318; vec4 _322 = vec4(_321.x, _321.y, _321.z, _275.w); _28 _323 = _276; _323._m0 = _322; @@ -190,7 +195,8 @@ void main() { _364 = _344; } - vec3 _368 = _322.xyz + (_364 * 0.75); + vec3 _365 = _364 * 0.75; + vec3 _368 = _322.xyz + _365; vec4 _369 = vec4(_368.x, _368.y, _368.z, _322.w); _28 _370 = _323; _370._m0 = _369; @@ -206,7 +212,8 @@ void main() { _411 = _391; } - vec3 _415 = _369.xyz + (_411 * 1.0); + vec3 _412 = _411 * 1.0; + vec3 _415 = _369.xyz + _412; vec4 _416 = vec4(_415.x, _415.y, _415.z, _369.w); _28 _417 = _370; _417._m0 = _416; @@ -222,7 +229,8 @@ void main() { _458 = _438; } - vec3 _462 = _416.xyz + (_458 * 0.75); + vec3 _459 = _458 * 0.75; + vec3 _462 = _416.xyz + _459; vec4 _463 = vec4(_462.x, _462.y, _462.z, _416.w); _28 _464 = _417; _464._m0 = _463; @@ -238,7 +246,8 @@ void main() { _505 = _485; } - vec3 _509 = _463.xyz + (_505 * 0.5); + vec3 _506 = _505 * 0.5; + vec3 _509 = _463.xyz + _506; vec4 _510 = vec4(_509.x, _509.y, _509.z, _463.w); _28 _511 = _464; _511._m0 = _510; @@ -254,7 +263,8 @@ void main() { _552 = _532; } - vec3 _556 = _510.xyz + (_552 * 0.5); + vec3 _553 = _552 * 0.5; + vec3 _556 = _510.xyz + _553; vec4 _557 = vec4(_556.x, _556.y, _556.z, _510.w); _28 _558 = _511; _558._m0 = _557; @@ -270,7 +280,8 @@ void main() { _599 = _579; } - vec3 _603 = _557.xyz + (_599 * 0.75); + vec3 _600 = _599 * 0.75; + vec3 _603 = _557.xyz + _600; vec4 _604 = vec4(_603.x, _603.y, _603.z, _557.w); _28 _605 = _558; _605._m0 = _604; @@ -286,7 +297,8 @@ void main() { _646 = _626; } - vec3 _650 = _604.xyz + (_646 * 0.5); + vec3 _647 = _646 * 0.5; + vec3 _650 = _604.xyz + _647; vec4 _651 = vec4(_650.x, _650.y, _650.z, _604.w); _28 _652 = _605; _652._m0 = _651; diff --git a/deps/SPIRV-Cross/reference/shaders/asm/geom/inout-split-access-chain-handle.asm.geom b/deps/SPIRV-Cross/reference/shaders/asm/geom/inout-split-access-chain-handle.asm.geom new file mode 100644 index 0000000000..71082099e7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/geom/inout-split-access-chain-handle.asm.geom @@ -0,0 +1,23 @@ +#version 440 +layout(triangles) in; +layout(max_vertices = 5, triangle_strip) out; + +struct Data +{ + vec4 ApiPerspectivePosition; +}; + +void Copy(inout Data inputStream[3]) +{ + inputStream[0].ApiPerspectivePosition = gl_in[0].gl_Position; +} + +void main() +{ + Data inputStream[3]; + Data param[3] = inputStream; + Copy(param); + inputStream = param; + gl_Position = inputStream[0].ApiPerspectivePosition; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/geom/split-access-chain-input.asm.geom b/deps/SPIRV-Cross/reference/shaders/asm/geom/split-access-chain-input.asm.geom new file mode 100644 index 0000000000..511d87fcbe --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/geom/split-access-chain-input.asm.geom @@ -0,0 +1,9 @@ +#version 440 +layout(triangles) in; +layout(max_vertices = 3, triangle_strip) out; + +void main() +{ + gl_Position = gl_in[0].gl_Position; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/geom/store-uint-layer.invalid.asm.geom b/deps/SPIRV-Cross/reference/shaders/asm/geom/store-uint-layer.invalid.asm.geom new file mode 100644 index 0000000000..c768d5da86 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/geom/store-uint-layer.invalid.asm.geom @@ -0,0 +1,41 @@ +#version 450 +layout(triangles) in; +layout(max_vertices = 3, triangle_strip) out; + +struct VertexOutput +{ + vec4 pos; +}; + +struct GeometryOutput +{ + vec4 pos; + uint layer; +}; + +void _main(VertexOutput _input[3], GeometryOutput stream) +{ + GeometryOutput _output; + _output.layer = 1u; + for (int v = 0; v < 3; v++) + { + _output.pos = _input[v].pos; + gl_Position = _output.pos; + gl_Layer = int(_output.layer); + EmitVertex(); + } + EndPrimitive(); +} + +void main() +{ + VertexOutput _input[3]; + _input[0].pos = gl_in[0].gl_Position; + _input[1].pos = gl_in[1].gl_Position; + _input[2].pos = gl_in[2].gl_Position; + VertexOutput param[3] = _input; + GeometryOutput param_1; + _main(param, param_1); + GeometryOutput stream = param_1; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc b/deps/SPIRV-Cross/reference/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc new file mode 100644 index 0000000000..8cb7a4e64c --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc @@ -0,0 +1,79 @@ +#version 450 +layout(vertices = 3) out; + +struct VertexOutput +{ + vec4 pos; + vec2 uv; +}; + +struct HSOut +{ + vec4 pos; + vec2 uv; +}; + +struct HSConstantOut +{ + float EdgeTess[3]; + float InsideTess; +}; + +struct VertexOutput_1 +{ + vec2 uv; +}; + +struct HSOut_1 +{ + vec2 uv; +}; + +layout(location = 0) in VertexOutput_1 p[]; +layout(location = 0) out HSOut_1 _entryPointOutput[3]; + +HSOut _hs_main(VertexOutput p_1[3], uint i) +{ + HSOut _output; + _output.pos = p_1[i].pos; + _output.uv = p_1[i].uv; + return _output; +} + +HSConstantOut PatchHS(VertexOutput _patch[3]) +{ + HSConstantOut _output; + _output.EdgeTess[0] = (vec2(1.0) + _patch[0].uv).x; + _output.EdgeTess[1] = (vec2(1.0) + _patch[0].uv).x; + _output.EdgeTess[2] = (vec2(1.0) + _patch[0].uv).x; + _output.InsideTess = (vec2(1.0) + _patch[0].uv).x; + return _output; +} + +void main() +{ + VertexOutput p_1[3]; + p_1[0].pos = gl_in[0].gl_Position; + p_1[0].uv = p[0].uv; + p_1[1].pos = gl_in[1].gl_Position; + p_1[1].uv = p[1].uv; + p_1[2].pos = gl_in[2].gl_Position; + p_1[2].uv = p[2].uv; + uint i = gl_InvocationID; + VertexOutput param[3] = p_1; + uint param_1 = i; + HSOut flattenTemp = _hs_main(param, param_1); + gl_out[gl_InvocationID].gl_Position = flattenTemp.pos; + _entryPointOutput[gl_InvocationID].uv = flattenTemp.uv; + barrier(); + if (int(gl_InvocationID) == 0) + { + VertexOutput param_2[3] = p_1; + HSConstantOut _patchConstantResult = PatchHS(param_2); + gl_TessLevelOuter[0] = _patchConstantResult.EdgeTess[0]; + gl_TessLevelOuter[1] = _patchConstantResult.EdgeTess[1]; + gl_TessLevelOuter[2] = _patchConstantResult.EdgeTess[2]; + gl_TessLevelInner[0] = _patchConstantResult.InsideTess; + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/vert/empty-io.asm.vert b/deps/SPIRV-Cross/reference/shaders/asm/vert/empty-io.asm.vert index e1a56d9d4c..cc432cb890 100644 --- a/deps/SPIRV-Cross/reference/shaders/asm/vert/empty-io.asm.vert +++ b/deps/SPIRV-Cross/reference/shaders/asm/vert/empty-io.asm.vert @@ -10,6 +10,11 @@ struct VSOutput vec4 position; }; +struct VSOutput_1 +{ + int empty_struct_member; +}; + layout(location = 0) in vec4 position; VSOutput _main(VSInput _input) diff --git a/deps/SPIRV-Cross/reference/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert b/deps/SPIRV-Cross/reference/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert new file mode 100644 index 0000000000..c297d94f28 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert @@ -0,0 +1,16 @@ +#version 450 + +layout(location = 0) flat out int _4; + +void main() +{ + vec4 pos = vec4(0.0); + pos.y += float(((-10) + 2)); + pos.z += float((100u % 5u)); + pos += vec4(ivec4(20, 30, 0, 0)); + vec2 _56 = pos.xy + vec2(ivec2(ivec4(20, 30, 0, 0).y, ivec4(20, 30, 0, 0).x)); + pos = vec4(_56.x, _56.y, pos.z, pos.w); + gl_Position = pos; + _4 = ivec4(20, 30, 0, 0).y; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk b/deps/SPIRV-Cross/reference/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk new file mode 100644 index 0000000000..d308693aac --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert.vk @@ -0,0 +1,25 @@ +#version 450 + +layout(constant_id = 201) const int _7 = -10; +layout(constant_id = 202) const uint _8 = 100u; +layout(constant_id = 200) const float _9 = 3.141590118408203125; +const int _20 = (_7 + 2); +const uint _25 = (_8 % 5u); +const ivec4 _30 = ivec4(20, 30, _20, _20); +const ivec2 _32 = ivec2(_30.y, _30.x); +const int _33 = _30.y; + +layout(location = 0) flat out int _4; + +void main() +{ + vec4 pos = vec4(0.0); + pos.y += float(_20); + pos.z += float(_25); + pos += vec4(_30); + vec2 _56 = pos.xy + vec2(_32); + pos = vec4(_56.x, _56.y, pos.z, pos.w); + gl_Position = pos; + _4 = _33; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/reference/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..31f13bd777 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,18 @@ +#version 450 + +uniform int SPIRV_Cross_BaseInstance; + +vec4 _main(uint vid, uint iid) +{ + return vec4(float(vid + iid)); +} + +void main() +{ + uint vid = uint(gl_VertexID); + uint iid = uint((gl_InstanceID + SPIRV_Cross_BaseInstance)); + uint param = vid; + uint param_1 = iid; + gl_Position = _main(param, param_1); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/reference/shaders/comp/bitfield.noopt.comp deleted file mode 100644 index 49bbddb0ab..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/comp/bitfield.noopt.comp +++ /dev/null @@ -1,19 +0,0 @@ -#version 310 es -layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; - -void main() -{ - int signed_value = 0; - uint unsigned_value = 0u; - int s = bitfieldExtract(signed_value, 5, 20); - uint u = bitfieldExtract(unsigned_value, 6, 21); - s = bitfieldInsert(s, 40, 5, 4); - u = bitfieldInsert(u, 60u, 5, 4); - u = bitfieldReverse(u); - s = bitfieldReverse(s); - int v0 = bitCount(u); - int v1 = bitCount(s); - int v2 = findMSB(u); - int v3 = findLSB(s); -} - diff --git a/deps/SPIRV-Cross/reference/shaders/comp/composite-construct.comp b/deps/SPIRV-Cross/reference/shaders/comp/composite-construct.comp index 91bb5348f5..3018be8f1b 100644 --- a/deps/SPIRV-Cross/reference/shaders/comp/composite-construct.comp +++ b/deps/SPIRV-Cross/reference/shaders/comp/composite-construct.comp @@ -1,6 +1,9 @@ #version 310 es layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; +const vec4 _66[2] = vec4[](vec4(10.0), vec4(30.0)); +const float _94[2][3] = float[][](float[](1.0, 1.0, 1.0), float[](2.0, 2.0, 2.0)); + struct Composite { vec4 a[2]; @@ -25,13 +28,11 @@ vec4 summe(vec4 values[3][2]) void main() { vec4 values[2] = vec4[](_41.as[gl_GlobalInvocationID.x], _55.bs[gl_GlobalInvocationID.x]); - vec4 const_values[2] = vec4[](vec4(10.0), vec4(30.0)); - vec4 copy_values[2] = const_values; + vec4 copy_values[2] = _66; vec4 copy_values2[2] = values; vec4 param[3][2] = vec4[][](values, copy_values, copy_values2); _41.as[gl_GlobalInvocationID.x] = summe(param); Composite c = Composite(values, copy_values); - float arrayofarray[2][3] = float[][](float[](1.0, 1.0, 1.0), float[](2.0, 2.0, 2.0)); float b = 10.0; float values_scalar[4] = float[](b, b, b, b); } diff --git a/deps/SPIRV-Cross/reference/shaders/comp/generate_height.comp b/deps/SPIRV-Cross/reference/shaders/comp/generate_height.comp index 30ec624cfb..fe733e2893 100644 --- a/deps/SPIRV-Cross/reference/shaders/comp/generate_height.comp +++ b/deps/SPIRV-Cross/reference/shaders/comp/generate_height.comp @@ -4,40 +4,40 @@ layout(local_size_x = 64, local_size_y = 1, local_size_z = 1) in; layout(binding = 0, std430) readonly buffer Distribution { vec2 distribution[]; -} _136; +} _137; layout(binding = 2, std140) uniform UBO { vec4 uModTime; -} _165; +} _166; layout(binding = 1, std430) writeonly buffer HeightmapFFT { uint heights[]; -} _224; +} _225; uvec2 workaround_mix(uvec2 a, uvec2 b, bvec2 sel) { - uint _83; + uint _86; if (sel.x) { - _83 = b.x; + _86 = b.x; } else { - _83 = a.x; + _86 = a.x; } - uint _93 = _83; - uint _94; + uint _94 = _86; + uint _97; if (sel.y) { - _94 = b.y; + _97 = b.y; } else { - _94 = a.y; + _97 = a.y; } - return uvec2(_93, _94); + return uvec2(_94, _97); } vec2 alias(vec2 i, vec2 N) @@ -68,13 +68,13 @@ void generate_heightmap() uvec2 param_1 = uvec2(0u); bvec2 param_2 = equal(i, uvec2(0u)); uvec2 wi = workaround_mix(param, param_1, param_2); - vec2 a = _136.distribution[(i.y * N.x) + i.x]; - vec2 b = _136.distribution[(wi.y * N.x) + wi.x]; + vec2 a = _137.distribution[(i.y * N.x) + i.x]; + vec2 b = _137.distribution[(wi.y * N.x) + wi.x]; vec2 param_3 = vec2(i); vec2 param_4 = vec2(N); - vec2 k = _165.uModTime.xy * alias(param_3, param_4); + vec2 k = _166.uModTime.xy * alias(param_3, param_4); float k_len = length(k); - float w = sqrt(9.81000041961669921875 * k_len) * _165.uModTime.z; + float w = sqrt(9.81000041961669921875 * k_len) * _166.uModTime.z; float cw = cos(w); float sw = sin(w); vec2 param_5 = a; @@ -86,7 +86,7 @@ void generate_heightmap() b = vec2(b.x, -b.y); vec2 res = a + b; vec2 param_9 = res; - _224.heights[(i.y * N.x) + i.x] = pack2(param_9); + _225.heights[(i.y * N.x) + i.x] = pack2(param_9); } void main() diff --git a/deps/SPIRV-Cross/reference/shaders/comp/loop.noopt.comp b/deps/SPIRV-Cross/reference/shaders/comp/loop.noopt.comp deleted file mode 100644 index 049a30669c..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/comp/loop.noopt.comp +++ /dev/null @@ -1,105 +0,0 @@ -#version 310 es -layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; - -layout(binding = 0, std430) readonly buffer SSBO -{ - mat4 mvp; - vec4 in_data[]; -} _24; - -layout(binding = 1, std430) writeonly buffer SSBO2 -{ - vec4 out_data[]; -} _177; - -void main() -{ - uint ident = gl_GlobalInvocationID.x; - vec4 idat = _24.in_data[ident]; - int k = 0; - uint i = 0u; - if (idat.y == 20.0) - { - do - { - k *= 2; - i++; - } while (i < ident); - } - switch (k) - { - case 10: - { - for (;;) - { - i++; - if (i > 10u) - { - break; - } - continue; - } - break; - } - default: - { - for (;;) - { - i += 2u; - if (i > 20u) - { - break; - } - continue; - } - break; - } - } - while (k < 10) - { - idat *= 2.0; - k++; - } - for (uint i_1 = 0u; i_1 < 16u; i_1++, k++) - { - for (uint j = 0u; j < 30u; j++) - { - idat = _24.mvp * idat; - } - } - k = 0; - for (;;) - { - k++; - if (k > 10) - { - k += 2; - } - else - { - k += 3; - continue; - } - k += 10; - continue; - } - k = 0; - do - { - k++; - } while (k > 10); - int l = 0; - for (;;) - { - if (l == 5) - { - l++; - continue; - } - idat += vec4(1.0); - l++; - continue; - } - _177.out_data[ident] = idat; -} - diff --git a/deps/SPIRV-Cross/reference/shaders/comp/rmw-matrix.comp b/deps/SPIRV-Cross/reference/shaders/comp/rmw-matrix.comp new file mode 100644 index 0000000000..5c4ac94bc7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +#version 310 es +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(binding = 0, std430) buffer SSBO +{ + float a; + vec4 b; + mat4 c; + float a1; + vec4 b1; + mat4 c1; +} _11; + +void main() +{ + _11.a *= _11.a1; + _11.b *= _11.b1; + _11.c = _11.c * _11.c1; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/comp/struct-packing.comp b/deps/SPIRV-Cross/reference/shaders/comp/struct-packing.comp index 3c30aa6088..cd1eda1b32 100644 --- a/deps/SPIRV-Cross/reference/shaders/comp/struct-packing.comp +++ b/deps/SPIRV-Cross/reference/shaders/comp/struct-packing.comp @@ -43,7 +43,49 @@ struct Content S4 m3s[8]; }; -layout(binding = 1, std430) buffer SSBO1 +struct S0_1 +{ + vec2 a[1]; + float b; +}; + +struct S1_1 +{ + vec3 a; + float b; +}; + +struct S2_1 +{ + vec3 a[1]; + float b; +}; + +struct S3_1 +{ + vec2 a; + float b; +}; + +struct S4_1 +{ + vec2 c; +}; + +struct Content_1 +{ + S0_1 m0s[1]; + S1_1 m1s[1]; + S2_1 m2s[1]; + S0_1 m0; + S1_1 m1; + S2_1 m2; + S3_1 m3; + float m4; + S4_1 m3s[8]; +}; + +layout(binding = 1, std430) restrict buffer SSBO1 { Content content; Content content1[2]; @@ -59,11 +101,11 @@ layout(binding = 1, std430) buffer SSBO1 float array[]; } ssbo_430; -layout(binding = 0, std140) buffer SSBO0 +layout(binding = 0, std140) restrict buffer SSBO0 { - Content content; - Content content1[2]; - Content content2; + Content_1 content; + Content_1 content1[2]; + Content_1 content2; mat2 m0; mat2 m1; mat2x3 m2[4]; diff --git a/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/enhanced-layouts.comp b/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/enhanced-layouts.comp index ba37ca237b..45b25064b6 100644 --- a/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/enhanced-layouts.comp +++ b/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/enhanced-layouts.comp @@ -8,6 +8,13 @@ struct Foo int c; }; +struct Foo_1 +{ + int a; + int b; + int c; +}; + layout(binding = 1, std140) buffer SSBO1 { layout(offset = 4) int a; @@ -20,7 +27,7 @@ layout(binding = 2, std430) buffer SSBO2 { layout(offset = 4) int a; layout(offset = 8) int b; - layout(offset = 16) Foo foo; + layout(offset = 16) Foo_1 foo; layout(offset = 48) int c[8]; } ssbo2; diff --git a/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/fp64.desktop.comp b/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/fp64.desktop.comp index 18869eda52..c9e5e84962 100644 --- a/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/fp64.desktop.comp +++ b/deps/SPIRV-Cross/reference/shaders/desktop-only/comp/fp64.desktop.comp @@ -67,7 +67,6 @@ void main() dvec3 e = cross(a.xyz, a.yzw); a = faceforward(a, a, a); a = reflect(a, a); - a = refract(a, a, a.x); dmat4 l = dmat4(amat[0] * amat[0], amat[1] * amat[1], amat[2] * amat[2], amat[3] * amat[3]); l = outerProduct(a, a); l = transpose(l); diff --git a/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..391b4de1c2 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,37 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uSampler; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 vInput; + +void main() +{ + FragColor = vInput; + vec4 t = texture(uSampler, vInput.xy); + vec4 d0 = dFdx(vInput); + vec4 d1 = dFdy(vInput); + vec4 d2 = fwidth(vInput); + vec4 d3 = dFdxCoarse(vInput); + vec4 d4 = dFdyCoarse(vInput); + vec4 d5 = fwidthCoarse(vInput); + vec4 d6 = dFdxFine(vInput); + vec4 d7 = dFdyFine(vInput); + vec4 d8 = fwidthFine(vInput); + vec2 lod = textureQueryLod(uSampler, vInput.zw); + if (vInput.y > 10.0) + { + FragColor += t; + FragColor += d0; + FragColor += d1; + FragColor += d2; + FragColor += d3; + FragColor += d4; + FragColor += d5; + FragColor += d6; + FragColor += d7; + FragColor += d8; + FragColor += lod.xyxy; + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/dual-source-blending.desktop.frag b/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/dual-source-blending.desktop.frag new file mode 100644 index 0000000000..3d946b04a5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/dual-source-blending.desktop.frag @@ -0,0 +1,11 @@ +#version 450 + +layout(location = 0, index = 0) out vec4 FragColor0; +layout(location = 0, index = 1) out vec4 FragColor1; + +void main() +{ + FragColor0 = vec4(1.0); + FragColor1 = vec4(2.0); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/fp16.desktop.frag b/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/fp16.desktop.frag new file mode 100644 index 0000000000..0c5203a102 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/desktop-only/frag/fp16.desktop.frag @@ -0,0 +1,153 @@ +#version 450 +#extension GL_AMD_gpu_shader_half_float : require + +struct ResType +{ + f16vec4 _m0; + ivec4 _m1; +}; + +layout(location = 3) in f16vec4 v4; +layout(location = 2) in f16vec3 v3; +layout(location = 0) in float16_t v1; +layout(location = 1) in f16vec2 v2; + +f16mat2 test_mat2(f16vec2 a, f16vec2 b, f16vec2 c, f16vec2 d) +{ + return f16mat2(f16vec2(a), f16vec2(b)) * f16mat2(f16vec2(c), f16vec2(d)); +} + +f16mat3 test_mat3(f16vec3 a, f16vec3 b, f16vec3 c, f16vec3 d, f16vec3 e, f16vec3 f) +{ + return f16mat3(f16vec3(a), f16vec3(b), f16vec3(c)) * f16mat3(f16vec3(d), f16vec3(e), f16vec3(f)); +} + +void test_constants() +{ + float16_t a = 1.0hf; + float16_t b = 1.5hf; + float16_t c = -1.5hf; + float16_t d = (0.0hf / 0.0hf); + float16_t e = (1.0hf / 0.0hf); + float16_t f = (-1.0hf / 0.0hf); + float16_t g = 1014.0hf; + float16_t h = 9.5367431640625e-07hf; +} + +float16_t test_result() +{ + return 1.0hf; +} + +void test_conversions() +{ + float16_t one = test_result(); + int a = int(one); + uint b = uint(one); + bool c = one != 0.0hf; + float d = float(one); + double e = double(one); + float16_t a2 = float16_t(a); + float16_t b2 = float16_t(b); + float16_t c2 = float16_t(c); + float16_t d2 = float16_t(d); + float16_t e2 = float16_t(e); +} + +void test_builtins() +{ + f16vec4 res = radians(v4); + res = degrees(v4); + res = sin(v4); + res = cos(v4); + res = tan(v4); + res = asin(v4); + res = atan(v4, v3.xyzz); + res = atan(v4); + res = sinh(v4); + res = cosh(v4); + res = tanh(v4); + res = asinh(v4); + res = acosh(v4); + res = atanh(v4); + res = pow(v4, v4); + res = exp(v4); + res = log(v4); + res = exp2(v4); + res = log2(v4); + res = sqrt(v4); + res = inversesqrt(v4); + res = abs(v4); + res = sign(v4); + res = floor(v4); + res = trunc(v4); + res = round(v4); + res = roundEven(v4); + res = ceil(v4); + res = fract(v4); + res = mod(v4, v4); + f16vec4 tmp; + f16vec4 _231 = modf(v4, tmp); + res = _231; + res = min(v4, v4); + res = max(v4, v4); + res = clamp(v4, v4, v4); + res = mix(v4, v4, v4); + res = mix(v4, v4, lessThan(v4, v4)); + res = step(v4, v4); + res = smoothstep(v4, v4, v4); + bvec4 btmp = isnan(v4); + btmp = isinf(v4); + res = fma(v4, v4, v4); + ResType _275; + _275._m0 = frexp(v4, _275._m1); + ivec4 itmp = _275._m1; + res = _275._m0; + res = ldexp(res, itmp); + uint pack0 = packFloat2x16(v4.xy); + uint pack1 = packFloat2x16(v4.zw); + res = f16vec4(unpackFloat2x16(pack0), unpackFloat2x16(pack1)); + float16_t t0 = length(v4); + t0 = distance(v4, v4); + t0 = dot(v4, v4); + f16vec3 res3 = cross(v3, v3); + res = normalize(v4); + res = faceforward(v4, v4, v4); + res = reflect(v4, v4); + res = refract(v4, v4, v1); + btmp = lessThan(v4, v4); + btmp = lessThanEqual(v4, v4); + btmp = greaterThan(v4, v4); + btmp = greaterThanEqual(v4, v4); + btmp = equal(v4, v4); + btmp = notEqual(v4, v4); + res = dFdx(v4); + res = dFdy(v4); + res = dFdxFine(v4); + res = dFdyFine(v4); + res = dFdxCoarse(v4); + res = dFdyCoarse(v4); + res = fwidth(v4); + res = fwidthFine(v4); + res = fwidthCoarse(v4); +} + +void main() +{ + f16vec2 param = v2; + f16vec2 param_1 = v2; + f16vec2 param_2 = v3.xy; + f16vec2 param_3 = v3.xy; + f16mat2 m0 = test_mat2(param, param_1, param_2, param_3); + f16vec3 param_4 = v3; + f16vec3 param_5 = v3; + f16vec3 param_6 = v3; + f16vec3 param_7 = v4.xyz; + f16vec3 param_8 = v4.xyz; + f16vec3 param_9 = v4.yzw; + f16mat3 m1 = test_mat3(param_4, param_5, param_6, param_7, param_8, param_9); + test_constants(); + test_conversions(); + test_builtins(); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/flatten/copy.flatten.vert b/deps/SPIRV-Cross/reference/shaders/flatten/copy.flatten.vert index 2bdd723886..6416a4f425 100644 --- a/deps/SPIRV-Cross/reference/shaders/flatten/copy.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders/flatten/copy.flatten.vert @@ -23,7 +23,7 @@ void main() light.Radius = Light(UBO[i * 2 + 4].xyz, UBO[i * 2 + 4].w, UBO[i * 2 + 5]).Radius; light.Color = Light(UBO[i * 2 + 4].xyz, UBO[i * 2 + 4].w, UBO[i * 2 + 5]).Color; vec3 L = aVertex.xyz - light.Position; - vColor += (((UBO[i * 2 + 5]) * clamp(1.0 - (length(L) / light.Radius), 0.0, 1.0)) * dot(aNormal, normalize(L))); + vColor += ((UBO[i * 2 + 5] * clamp(1.0 - (length(L) / light.Radius), 0.0, 1.0)) * dot(aNormal, normalize(L))); } } diff --git a/deps/SPIRV-Cross/reference/shaders/flatten/dynamic.flatten.vert b/deps/SPIRV-Cross/reference/shaders/flatten/dynamic.flatten.vert index 6214ca450a..8be397ea3f 100644 --- a/deps/SPIRV-Cross/reference/shaders/flatten/dynamic.flatten.vert +++ b/deps/SPIRV-Cross/reference/shaders/flatten/dynamic.flatten.vert @@ -18,8 +18,8 @@ void main() vColor = vec4(0.0); for (int i = 0; i < 4; i++) { - vec3 L = aVertex.xyz - (UBO[i * 2 + 4].xyz); - vColor += (((UBO[i * 2 + 5]) * clamp(1.0 - (length(L) / (UBO[i * 2 + 4].w)), 0.0, 1.0)) * dot(aNormal, normalize(L))); + vec3 L = aVertex.xyz - UBO[i * 2 + 4].xyz; + vColor += ((UBO[i * 2 + 5] * clamp(1.0 - (length(L) / UBO[i * 2 + 4].w), 0.0, 1.0)) * dot(aNormal, normalize(L))); } } diff --git a/deps/SPIRV-Cross/reference/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag b/deps/SPIRV-Cross/reference/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag index 21c3363ca6..ef6bb526ab 100644 --- a/deps/SPIRV-Cross/reference/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag +++ b/deps/SPIRV-Cross/reference/shaders/flatten/multi-dimensional.desktop.flatten_dim.frag @@ -19,6 +19,6 @@ void main() } } } - FragColor = ((values3[1 * 3 * 1 + 2 * 1 + 0]) + (values3[0 * 3 * 1 + 2 * 1 + 0])) + (values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex]); + FragColor = (values3[1 * 3 * 1 + 2 * 1 + 0] + values3[0 * 3 * 1 + 2 * 1 + 0]) + values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex]; } diff --git a/deps/SPIRV-Cross/reference/shaders/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/reference/shaders/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..baf2302519 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,15 @@ +#version 310 es +precision mediump float; +precision highp int; + +const float _17[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0); + +layout(location = 0) out vec4 FragColor; + +void main() +{ + for (mediump int i = 0; i < 4; i++, FragColor += vec4(_17[i])) + { + } +} + diff --git a/deps/SPIRV-Cross/reference/shaders/frag/constant-array.frag b/deps/SPIRV-Cross/reference/shaders/frag/constant-array.frag index 4da9b8948b..be033f3873 100644 --- a/deps/SPIRV-Cross/reference/shaders/frag/constant-array.frag +++ b/deps/SPIRV-Cross/reference/shaders/frag/constant-array.frag @@ -2,6 +2,9 @@ precision mediump float; precision highp int; +const vec4 _37[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0)); +const vec4 _55[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0))); + struct Foobar { float a; @@ -18,11 +21,9 @@ vec4 resolve(Foobar f) void main() { - highp vec4 indexable[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0)); - highp vec4 indexable_1[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0))); Foobar param = Foobar(10.0, 20.0); - Foobar indexable_2[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0)); - Foobar param_1 = indexable_2[index]; - FragColor = ((indexable[index] + (indexable_1[index][index + 1])) + resolve(param)) + resolve(param_1); + Foobar indexable[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0)); + Foobar param_1 = indexable[index]; + FragColor = ((_37[index] + _55[index][index + 1]) + resolve(param)) + resolve(param_1); } diff --git a/deps/SPIRV-Cross/reference/shaders/frag/constant-composites.frag b/deps/SPIRV-Cross/reference/shaders/frag/constant-composites.frag index ab0816c3d2..c65c60613d 100644 --- a/deps/SPIRV-Cross/reference/shaders/frag/constant-composites.frag +++ b/deps/SPIRV-Cross/reference/shaders/frag/constant-composites.frag @@ -9,7 +9,7 @@ struct Foo }; layout(location = 0) out vec4 FragColor; -layout(location = 0) flat in mediump int _line; +layout(location = 0) flat in mediump int line; float lut[4]; Foo foos[2]; @@ -17,7 +17,7 @@ void main() { lut = float[](1.0, 4.0, 3.0, 2.0); foos = Foo[](Foo(10.0, 20.0), Foo(30.0, 40.0)); - FragColor = vec4(lut[_line]); - FragColor += vec4(foos[_line].a * (foos[1 - _line].a)); + FragColor = vec4(lut[line]); + FragColor += vec4(foos[line].a * foos[1 - line].a); } diff --git a/deps/SPIRV-Cross/reference/shaders/frag/gather-dref.frag b/deps/SPIRV-Cross/reference/shaders/frag/gather-dref.frag new file mode 100644 index 0000000000..5416f79cb5 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/frag/gather-dref.frag @@ -0,0 +1,14 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(binding = 0) uniform mediump sampler2DShadow uT; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec3 vUV; + +void main() +{ + FragColor = textureGather(uT, vUV.xy, vUV.z); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/frag/lut-promotion.frag b/deps/SPIRV-Cross/reference/shaders/frag/lut-promotion.frag new file mode 100644 index 0000000000..019393f9f3 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/frag/lut-promotion.frag @@ -0,0 +1,40 @@ +#version 310 es +precision mediump float; +precision highp int; + +const float _16[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0); +const vec4 _60[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + +layout(location = 0) out float FragColor; +layout(location = 0) flat in mediump int index; + +void main() +{ + FragColor = _16[index]; + if (index < 10) + { + FragColor += _16[index ^ 1]; + } + else + { + FragColor += _16[index & 1]; + } + if (index > 30) + { + FragColor += _60[index & 3].y; + } + else + { + FragColor += _60[index & 1].x; + } + vec4 foobar[4] = _60; + if (index > 30) + { + foobar[1].z = 20.0; + } + FragColor += foobar[index & 3].z; + vec4 baz[4] = _60; + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[index & 3].z; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/frag/swizzle.frag b/deps/SPIRV-Cross/reference/shaders/frag/swizzle.frag index e619be2f48..a229e5b0d5 100644 --- a/deps/SPIRV-Cross/reference/shaders/frag/swizzle.frag +++ b/deps/SPIRV-Cross/reference/shaders/frag/swizzle.frag @@ -2,7 +2,7 @@ precision mediump float; precision highp int; -layout(location = 0) uniform mediump sampler2D samp; +layout(binding = 0) uniform mediump sampler2D samp; layout(location = 0) out vec4 FragColor; layout(location = 2) in vec2 vUV; diff --git a/deps/SPIRV-Cross/reference/shaders/frag/ubo_layout.frag b/deps/SPIRV-Cross/reference/shaders/frag/ubo_layout.frag index bc0b01c065..4b66e1396a 100644 --- a/deps/SPIRV-Cross/reference/shaders/frag/ubo_layout.frag +++ b/deps/SPIRV-Cross/reference/shaders/frag/ubo_layout.frag @@ -7,6 +7,11 @@ struct Str mat4 foo; }; +struct Str_1 +{ + mat4 foo; +}; + layout(binding = 0, std140) uniform UBO1 { layout(row_major) Str foo; @@ -14,7 +19,7 @@ layout(binding = 0, std140) uniform UBO1 layout(binding = 1, std140) uniform UBO2 { - Str foo; + Str_1 foo; } ubo0; layout(location = 0) out vec4 FragColor; diff --git a/deps/SPIRV-Cross/reference/shaders/tesc/water_tess.tesc b/deps/SPIRV-Cross/reference/shaders/tesc/water_tess.tesc index 26611b8b25..4daaa456e3 100644 --- a/deps/SPIRV-Cross/reference/shaders/tesc/water_tess.tesc +++ b/deps/SPIRV-Cross/reference/shaders/tesc/water_tess.tesc @@ -27,7 +27,8 @@ bool frustum_cull(vec2 p0) vec3 f0 = vec3(dot(_41.uFrustum[0], vec4(center, 1.0)), dot(_41.uFrustum[1], vec4(center, 1.0)), dot(_41.uFrustum[2], vec4(center, 1.0))); vec3 f1 = vec3(dot(_41.uFrustum[3], vec4(center, 1.0)), dot(_41.uFrustum[4], vec4(center, 1.0)), dot(_41.uFrustum[5], vec4(center, 1.0))); vec3 _199 = f0; - bool _205 = any(lessThanEqual(_199, vec3(-radius))); + float _200 = radius; + bool _205 = any(lessThanEqual(_199, vec3(-_200))); bool _215; if (!_205) { diff --git a/deps/SPIRV-Cross/reference/shaders/vert/ground.vert b/deps/SPIRV-Cross/reference/shaders/vert/ground.vert index b028cc34c6..69f92534cc 100644 --- a/deps/SPIRV-Cross/reference/shaders/vert/ground.vert +++ b/deps/SPIRV-Cross/reference/shaders/vert/ground.vert @@ -58,26 +58,26 @@ vec2 warp_position() uint ufloor_lod = uint(floor_lod); uvec2 uPosition = uvec2(Position); uvec2 mask = (uvec2(1u) << uvec2(ufloor_lod, ufloor_lod + 1u)) - uvec2(1u); - uint _106; + uint _110; if (uPosition.x < 32u) { - _106 = mask.x; + _110 = mask.x; } else { - _106 = 0u; + _110 = 0u; } - uint _116 = _106; - uint _117; + uint _116 = _110; + uint _120; if (uPosition.y < 32u) { - _117 = mask.y; + _120 = mask.y; } else { - _117 = 0u; + _120 = 0u; } - uvec2 rounding = uvec2(_116, _117); + uvec2 rounding = uvec2(_116, _120); vec4 lower_upper_snapped = vec4((uPosition + rounding).xyxy & (~mask).xxyy); return mix(lower_upper_snapped.xy, lower_upper_snapped.zw, vec2(fract_lod)); } diff --git a/deps/SPIRV-Cross/reference/shaders/vert/ocean.vert b/deps/SPIRV-Cross/reference/shaders/vert/ocean.vert index d77a29fcbf..720bd7d0de 100644 --- a/deps/SPIRV-Cross/reference/shaders/vert/ocean.vert +++ b/deps/SPIRV-Cross/reference/shaders/vert/ocean.vert @@ -59,47 +59,47 @@ vec2 warp_position() uint ufloor_lod = uint(floor_lod); uvec4 uPosition = uvec4(Position); uvec2 mask = (uvec2(1u) << uvec2(ufloor_lod, ufloor_lod + 1u)) - uvec2(1u); - uint _107; + uint _111; if (uPosition.x < 32u) { - _107 = mask.x; + _111 = mask.x; } else { - _107 = 0u; + _111 = 0u; } uvec4 rounding; - rounding.x = _107; - uint _119; + rounding.x = _111; + uint _122; if (uPosition.y < 32u) { - _119 = mask.x; + _122 = mask.x; } else { - _119 = 0u; + _122 = 0u; } - rounding.y = _119; - uint _130; + rounding.y = _122; + uint _133; if (uPosition.x < 32u) { - _130 = mask.y; + _133 = mask.y; } else { - _130 = 0u; + _133 = 0u; } - rounding.z = _130; - uint _142; + rounding.z = _133; + uint _145; if (uPosition.y < 32u) { - _142 = mask.y; + _145 = mask.y; } else { - _142 = 0u; + _145 = 0u; } - rounding.w = _142; + rounding.w = _145; vec4 lower_upper_snapped = vec4((uPosition.xyxy + rounding) & (~mask).xxyy); return mix(lower_upper_snapped.xy, lower_upper_snapped.zw, vec2(fract_lod)); } diff --git a/deps/SPIRV-Cross/reference/shaders/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/reference/shaders/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..1c950f3fa4 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vert/read-from-row-major-array.vert @@ -0,0 +1,45 @@ +#version 310 es + +layout(binding = 0, std140) uniform Block +{ + layout(row_major) mat2x3 var[3][4]; +} _104; + +layout(location = 0) in vec4 a_position; +layout(location = 0) out mediump float v_vtxResult; + +mediump float compare_float(float a, float b) +{ + return float(abs(a - b) < 0.0500000007450580596923828125); +} + +mediump float compare_vec3(vec3 a, vec3 b) +{ + float param = a.x; + float param_1 = b.x; + float param_2 = a.y; + float param_3 = b.y; + float param_4 = a.z; + float param_5 = b.z; + return (compare_float(param, param_1) * compare_float(param_2, param_3)) * compare_float(param_4, param_5); +} + +mediump float compare_mat2x3(mat2x3 a, mat2x3 b) +{ + vec3 param = a[0]; + vec3 param_1 = b[0]; + vec3 param_2 = a[1]; + vec3 param_3 = b[1]; + return compare_vec3(param, param_1) * compare_vec3(param_2, param_3); +} + +void main() +{ + gl_Position = a_position; + mediump float result = 1.0; + mat2x3 param = _104.var[0][0]; + mat2x3 param_1 = mat2x3(vec3(2.0, 6.0, -6.0), vec3(0.0, 5.0, 5.0)); + result *= compare_mat2x3(param, param_1); + v_vtxResult = result; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp.vk b/deps/SPIRV-Cross/reference/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp.vk new file mode 100644 index 0000000000..6d288574f7 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp.vk @@ -0,0 +1,110 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic : require +#extension GL_KHR_shader_subgroup_ballot : require +#extension GL_KHR_shader_subgroup_shuffle : require +#extension GL_KHR_shader_subgroup_shuffle_relative : require +#extension GL_KHR_shader_subgroup_vote : require +#extension GL_KHR_shader_subgroup_arithmetic : require +#extension GL_KHR_shader_subgroup_clustered : require +#extension GL_KHR_shader_subgroup_quad : require +layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in; + +layout(set = 0, binding = 0, std430) buffer SSBO +{ + float FragColor; +} _9; + +void main() +{ + _9.FragColor = float(gl_NumSubgroups); + _9.FragColor = float(gl_SubgroupID); + _9.FragColor = float(gl_SubgroupSize); + _9.FragColor = float(gl_SubgroupInvocationID); + subgroupMemoryBarrier(); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); + bool elected = subgroupElect(); + _9.FragColor = vec4(gl_SubgroupEqMask).x; + _9.FragColor = vec4(gl_SubgroupGeMask).x; + _9.FragColor = vec4(gl_SubgroupGtMask).x; + _9.FragColor = vec4(gl_SubgroupLeMask).x; + _9.FragColor = vec4(gl_SubgroupLtMask).x; + vec4 broadcasted = subgroupBroadcast(vec4(10.0), 8u); + vec3 first = subgroupBroadcastFirst(vec3(20.0)); + uvec4 ballot_value = subgroupBallot(true); + bool inverse_ballot_value = subgroupInverseBallot(ballot_value); + bool bit_extracted = subgroupBallotBitExtract(uvec4(10u), 8u); + uint bit_count = subgroupBallotBitCount(ballot_value); + uint inclusive_bit_count = subgroupBallotInclusiveBitCount(ballot_value); + uint exclusive_bit_count = subgroupBallotExclusiveBitCount(ballot_value); + uint lsb = subgroupBallotFindLSB(ballot_value); + uint msb = subgroupBallotFindMSB(ballot_value); + uint shuffled = subgroupShuffle(10u, 8u); + uint shuffled_xor = subgroupShuffleXor(30u, 8u); + uint shuffled_up = subgroupShuffleUp(20u, 4u); + uint shuffled_down = subgroupShuffleDown(20u, 4u); + bool has_all = subgroupAll(true); + bool has_any = subgroupAny(true); + bool has_equal = subgroupAllEqual(true); + vec4 added = subgroupAdd(vec4(20.0)); + ivec4 iadded = subgroupAdd(ivec4(20)); + vec4 multiplied = subgroupMul(vec4(20.0)); + ivec4 imultiplied = subgroupMul(ivec4(20)); + vec4 lo = subgroupMin(vec4(20.0)); + vec4 hi = subgroupMax(vec4(20.0)); + ivec4 slo = subgroupMin(ivec4(20)); + ivec4 shi = subgroupMax(ivec4(20)); + uvec4 ulo = subgroupMin(uvec4(20u)); + uvec4 uhi = subgroupMax(uvec4(20u)); + uvec4 anded = subgroupAnd(ballot_value); + uvec4 ored = subgroupOr(ballot_value); + uvec4 xored = subgroupXor(ballot_value); + added = subgroupInclusiveAdd(added); + iadded = subgroupInclusiveAdd(iadded); + multiplied = subgroupInclusiveMul(multiplied); + imultiplied = subgroupInclusiveMul(imultiplied); + lo = subgroupInclusiveMin(lo); + hi = subgroupInclusiveMax(hi); + slo = subgroupInclusiveMin(slo); + shi = subgroupInclusiveMax(shi); + ulo = subgroupInclusiveMin(ulo); + uhi = subgroupInclusiveMax(uhi); + anded = subgroupInclusiveAnd(anded); + ored = subgroupInclusiveOr(ored); + xored = subgroupInclusiveXor(ored); + added = subgroupExclusiveAdd(lo); + added = subgroupExclusiveAdd(multiplied); + multiplied = subgroupExclusiveMul(multiplied); + iadded = subgroupExclusiveAdd(imultiplied); + imultiplied = subgroupExclusiveMul(imultiplied); + lo = subgroupExclusiveMin(lo); + hi = subgroupExclusiveMax(hi); + ulo = subgroupExclusiveMin(ulo); + uhi = subgroupExclusiveMax(uhi); + slo = subgroupExclusiveMin(slo); + shi = subgroupExclusiveMax(shi); + anded = subgroupExclusiveAnd(anded); + ored = subgroupExclusiveOr(ored); + xored = subgroupExclusiveXor(ored); + added = subgroupClusteredAdd(added, 4u); + multiplied = subgroupClusteredMul(multiplied, 4u); + iadded = subgroupClusteredAdd(iadded, 4u); + imultiplied = subgroupClusteredMul(imultiplied, 4u); + lo = subgroupClusteredMin(lo, 4u); + hi = subgroupClusteredMax(hi, 4u); + ulo = subgroupClusteredMin(ulo, 4u); + uhi = subgroupClusteredMax(uhi, 4u); + slo = subgroupClusteredMin(slo, 4u); + shi = subgroupClusteredMax(shi, 4u); + anded = subgroupClusteredAnd(anded, 4u); + ored = subgroupClusteredOr(ored, 4u); + xored = subgroupClusteredXor(xored, 4u); + vec4 swap_horiz = subgroupQuadSwapHorizontal(vec4(20.0)); + vec4 swap_vertical = subgroupQuadSwapVertical(vec4(20.0)); + vec4 swap_diagonal = subgroupQuadSwapDiagonal(vec4(20.0)); + vec4 quad_broadcast = subgroupQuadBroadcast(vec4(20.0), 3u); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag new file mode 100644 index 0000000000..575c4187eb --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag @@ -0,0 +1,22 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uSamp; +uniform sampler2D SPIRV_Cross_CombineduTuS; + +layout(location = 0) out vec4 FragColor; + +vec4 samp(sampler2D uSamp_1) +{ + return texture(uSamp_1, vec2(0.5)); +} + +vec4 samp_1(sampler2D SPIRV_Cross_CombinedTS) +{ + return texture(SPIRV_Cross_CombinedTS, vec2(0.5)); +} + +void main() +{ + FragColor = samp(uSamp) + samp_1(SPIRV_Cross_CombineduTuS); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag.vk new file mode 100644 index 0000000000..222b659e40 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag.vk @@ -0,0 +1,23 @@ +#version 450 + +layout(set = 0, binding = 0) uniform sampler2D uSamp; +layout(set = 0, binding = 1) uniform texture2D uT; +layout(set = 0, binding = 2) uniform sampler uS; + +layout(location = 0) out vec4 FragColor; + +vec4 samp(sampler2D uSamp_1) +{ + return texture(uSamp_1, vec2(0.5)); +} + +vec4 samp(texture2D T, sampler S) +{ + return texture(sampler2D(T, S), vec2(0.5)); +} + +void main() +{ + FragColor = samp(uSamp) + samp(uT, uS); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag new file mode 100644 index 0000000000..43393f4e77 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag @@ -0,0 +1,44 @@ +#version 310 es +precision mediump float; +precision highp int; + +uniform mediump sampler2D SPIRV_Cross_CombineduTextureuSampler[4]; +uniform mediump sampler2DArray SPIRV_Cross_CombineduTextureArrayuSampler[4]; +uniform mediump samplerCube SPIRV_Cross_CombineduTextureCubeuSampler[4]; +uniform mediump sampler3D SPIRV_Cross_CombineduTexture3DuSampler[4]; + +layout(location = 0) in vec2 vTex; +layout(location = 1) in vec3 vTex3; +layout(location = 0) out vec4 FragColor; + +vec4 sample_func(vec2 uv, mediump sampler2D SPIRV_Cross_CombineduTexturesamp[4]) +{ + return texture(SPIRV_Cross_CombineduTexturesamp[2], uv); +} + +vec4 sample_func_dual(vec2 uv, mediump sampler2D SPIRV_Cross_Combinedtexsamp) +{ + return texture(SPIRV_Cross_Combinedtexsamp, uv); +} + +vec4 sample_func_dual_array(vec2 uv, mediump sampler2D SPIRV_Cross_Combinedtexsamp[4]) +{ + return texture(SPIRV_Cross_Combinedtexsamp[1], uv); +} + +void main() +{ + vec2 off = vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler[1], 0)); + vec2 off2 = vec2(1.0) / vec2(textureSize(SPIRV_Cross_CombineduTextureuSampler[2], 1)); + highp vec2 param = (vTex + off) + off2; + vec4 c0 = sample_func(param, SPIRV_Cross_CombineduTextureuSampler); + highp vec2 param_1 = (vTex + off) + off2; + vec4 c1 = sample_func_dual(param_1, SPIRV_Cross_CombineduTextureuSampler[1]); + highp vec2 param_2 = (vTex + off) + off2; + vec4 c2 = sample_func_dual_array(param_2, SPIRV_Cross_CombineduTextureuSampler); + vec4 c3 = texture(SPIRV_Cross_CombineduTextureArrayuSampler[3], vTex3); + vec4 c4 = texture(SPIRV_Cross_CombineduTextureCubeuSampler[1], vTex3); + vec4 c5 = texture(SPIRV_Cross_CombineduTexture3DuSampler[2], vTex3); + FragColor = ((((c0 + c1) + c2) + c3) + c4) + c5; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag.vk new file mode 100644 index 0000000000..495874ecc2 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag.vk @@ -0,0 +1,45 @@ +#version 310 es +precision mediump float; +precision highp int; + +layout(set = 0, binding = 1) uniform mediump texture2D uTexture[4]; +layout(set = 0, binding = 0) uniform mediump sampler uSampler; +layout(set = 0, binding = 4) uniform mediump texture2DArray uTextureArray[4]; +layout(set = 0, binding = 3) uniform mediump textureCube uTextureCube[4]; +layout(set = 0, binding = 2) uniform mediump texture3D uTexture3D[4]; + +layout(location = 0) in vec2 vTex; +layout(location = 1) in vec3 vTex3; +layout(location = 0) out vec4 FragColor; + +vec4 sample_func(mediump sampler samp, vec2 uv) +{ + return texture(sampler2D(uTexture[2], samp), uv); +} + +vec4 sample_func_dual(mediump sampler samp, mediump texture2D tex, vec2 uv) +{ + return texture(sampler2D(tex, samp), uv); +} + +vec4 sample_func_dual_array(mediump sampler samp, mediump texture2D tex[4], vec2 uv) +{ + return texture(sampler2D(tex[1], samp), uv); +} + +void main() +{ + vec2 off = vec2(1.0) / vec2(textureSize(sampler2D(uTexture[1], uSampler), 0)); + vec2 off2 = vec2(1.0) / vec2(textureSize(sampler2D(uTexture[2], uSampler), 1)); + highp vec2 param = (vTex + off) + off2; + vec4 c0 = sample_func(uSampler, param); + highp vec2 param_1 = (vTex + off) + off2; + vec4 c1 = sample_func_dual(uSampler, uTexture[1], param_1); + highp vec2 param_2 = (vTex + off) + off2; + vec4 c2 = sample_func_dual_array(uSampler, uTexture, param_2); + vec4 c3 = texture(sampler2DArray(uTextureArray[3], uSampler), vTex3); + vec4 c4 = texture(samplerCube(uTextureCube[1], uSampler), vTex3); + vec4 c5 = texture(sampler3D(uTexture3D[2], uSampler), vTex3); + FragColor = ((((c0 + c1) + c2) + c3) + c4) + c5; +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant-ternary.vk.frag b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant-ternary.vk.frag new file mode 100644 index 0000000000..91b0331b79 --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant-ternary.vk.frag @@ -0,0 +1,9 @@ +#version 450 + +layout(location = 0) out float FragColor; + +void main() +{ + FragColor = float((10u > 20u) ? 30u : 50u); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant-ternary.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant-ternary.vk.frag.vk new file mode 100644 index 0000000000..59d3b99b9c --- /dev/null +++ b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant-ternary.vk.frag.vk @@ -0,0 +1,13 @@ +#version 450 + +layout(constant_id = 0) const uint s = 10u; +const bool _13 = (s > 20u); +const uint _16 = _13 ? 30u : 50u; + +layout(location = 0) out float FragColor; + +void main() +{ + FragColor = float(_16); +} + diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant.vk.frag.vk b/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant.vk.frag.vk deleted file mode 100644 index d0765cc8bd..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/spec-constant.vk.frag.vk +++ /dev/null @@ -1,68 +0,0 @@ -#version 310 es -precision mediump float; -precision highp int; - -layout(constant_id = 1) const float a = 1.0; -layout(constant_id = 2) const float b = 2.0; -layout(constant_id = 3) const int c = 3; -layout(constant_id = 4) const int d = 4; -layout(constant_id = 5) const uint e = 5u; -layout(constant_id = 6) const uint f = 6u; -layout(constant_id = 7) const bool g = false; -layout(constant_id = 8) const bool h = true; - -struct Foo -{ - float elems[(d + 2)]; -}; - -layout(location = 0) out vec4 FragColor; - -void main() -{ - float t0 = a; - float t1 = b; - mediump uint c0 = (uint(c) + 0u); - mediump int c1 = (-c); - mediump int c2 = (~c); - mediump int c3 = (c + d); - mediump int c4 = (c - d); - mediump int c5 = (c * d); - mediump int c6 = (c / d); - mediump uint c7 = (e / f); - mediump int c8 = (c % d); - mediump uint c9 = (e % f); - mediump int c10 = (c >> d); - mediump uint c11 = (e >> f); - mediump int c12 = (c << d); - mediump int c13 = (c | d); - mediump int c14 = (c ^ d); - mediump int c15 = (c & d); - bool c16 = (g || h); - bool c17 = (g && h); - bool c18 = (!g); - bool c19 = (g == h); - bool c20 = (g != h); - bool c21 = (c == d); - bool c22 = (c != d); - bool c23 = (c < d); - bool c24 = (e < f); - bool c25 = (c > d); - bool c26 = (e > f); - bool c27 = (c <= d); - bool c28 = (e <= f); - bool c29 = (c >= d); - bool c30 = (e >= f); - mediump int c31 = c8 + c3; - mediump int c32 = int(e + 0u); - bool c33 = (c != int(0u)); - bool c34 = (e != 0u); - mediump int c35 = int(g); - mediump uint c36 = uint(g); - float c37 = float(g); - float vec0[(c + 3)][8]; - float vec1[(c + 2)]; - Foo foo; - FragColor = ((vec4(t0 + t1) + vec4(vec0[0][0])) + vec4(vec1[0])) + vec4(foo.elems[c]); -} - diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/vert/multiview.nocompat.vk.vert b/deps/SPIRV-Cross/reference/shaders/vulkan/vert/multiview.nocompat.vk.vert deleted file mode 100644 index 533738efc3..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/vulkan/vert/multiview.nocompat.vk.vert +++ /dev/null @@ -1,15 +0,0 @@ -#version 310 es -#extension GL_OVR_multiview2 : require - -layout(binding = 0, std140) uniform MVPs -{ - mat4 MVP[2]; -} _19; - -layout(location = 0) in vec4 Position; - -void main() -{ - gl_Position = _19.MVP[gl_ViewID_OVR] * Position; -} - diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/vert/vulkan-vertex.vert b/deps/SPIRV-Cross/reference/shaders/vulkan/vert/vulkan-vertex.vert deleted file mode 100644 index 8de2b111ef..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/vulkan/vert/vulkan-vertex.vert +++ /dev/null @@ -1,9 +0,0 @@ -#version 310 es - -uniform int SPIRV_Cross_BaseInstance; - -void main() -{ - gl_Position = (vec4(1.0, 2.0, 3.0, 4.0) * float((gl_VertexID + (gl_InstanceID + SPIRV_Cross_BaseInstance)))); -} - diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/vert/vulkan-vertex.vert.vk b/deps/SPIRV-Cross/reference/shaders/vulkan/vert/vulkan-vertex.vert.vk deleted file mode 100644 index 9ee3cc0997..0000000000 --- a/deps/SPIRV-Cross/reference/shaders/vulkan/vert/vulkan-vertex.vert.vk +++ /dev/null @@ -1,7 +0,0 @@ -#version 310 es - -void main() -{ - gl_Position = (vec4(1.0, 2.0, 3.0, 4.0) * float((gl_VertexIndex + gl_InstanceIndex))); -} - diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp b/deps/SPIRV-Cross/shaders-hlsl-no-opt/asm/comp/specialization-constant-workgroup.nofxc.asm.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-hlsl/asm/comp/specialization-constant-workgroup.nofxc.asm.comp rename to deps/SPIRV-Cross/shaders-hlsl-no-opt/asm/comp/specialization-constant-workgroup.nofxc.asm.comp diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/shaders-hlsl-no-opt/asm/vert/empty-struct-composite.asm.vert similarity index 100% rename from deps/SPIRV-Cross/shaders-hlsl/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/shaders-hlsl-no-opt/asm/vert/empty-struct-composite.asm.vert diff --git a/deps/SPIRV-Cross/shaders-hlsl/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/shaders-hlsl-no-opt/comp/bitfield.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-hlsl/comp/bitfield.noopt.comp rename to deps/SPIRV-Cross/shaders-hlsl-no-opt/comp/bitfield.comp diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/spec-constant.frag b/deps/SPIRV-Cross/shaders-hlsl-no-opt/frag/spec-constant.frag similarity index 100% rename from deps/SPIRV-Cross/shaders-hlsl/frag/spec-constant.frag rename to deps/SPIRV-Cross/shaders-hlsl-no-opt/frag/spec-constant.frag diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/comp/control-flow-hints.asm.comp b/deps/SPIRV-Cross/shaders-hlsl/asm/comp/control-flow-hints.asm.comp new file mode 100644 index 0000000000..74a15955c2 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/comp/control-flow-hints.asm.comp @@ -0,0 +1,146 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 85 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource HLSL 500 + OpName %main "main" + OpName %_main_ "@main(" + OpName %i "i" + OpName %bar "bar" + OpMemberName %bar 0 "@data" + OpName %bar_0 "bar" + OpName %foo "foo" + OpName %i_0 "i" + OpName %v "v" + OpName %w "w" + OpName %value "value" + OpDecorate %_runtimearr_v4float ArrayStride 16 + OpMemberDecorate %bar 0 Offset 0 + OpDecorate %bar BufferBlock + OpDecorate %bar_0 DescriptorSet 0 + OpDecorate %bar_0 Binding 0 + OpDecorate %foo DescriptorSet 0 + OpDecorate %foo Binding 1 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_16 = OpConstant %int 16 + %bool = OpTypeBool + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_runtimearr_v4float = OpTypeRuntimeArray %v4float + %bar = OpTypeStruct %_runtimearr_v4float +%_ptr_Uniform_bar = OpTypePointer Uniform %bar + %bar_0 = OpVariable %_ptr_Uniform_bar Uniform + %foo = OpVariable %_ptr_Uniform_bar Uniform +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float + %int_1 = OpConstant %int 1 + %int_15 = OpConstant %int 15 +%_ptr_Function_float = OpTypePointer Function %float + %int_10 = OpConstant %int 10 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Uniform_float = OpTypePointer Uniform %float + %float_10 = OpConstant %float 10 + %int_20 = OpConstant %int 20 + %float_5 = OpConstant %float 5 + %72 = OpConstantComposite %v4float %float_5 %float_5 %float_5 %float_5 + %float_20 = OpConstant %float 20 + %float_40 = OpConstant %float 40 + %main = OpFunction %void None %3 + %5 = OpLabel + %84 = OpFunctionCall %void %_main_ + OpReturn + OpFunctionEnd + %_main_ = OpFunction %void None %3 + %7 = OpLabel + %i = OpVariable %_ptr_Function_int Function + %i_0 = OpVariable %_ptr_Function_int Function + %v = OpVariable %_ptr_Function_float Function + %w = OpVariable %_ptr_Function_float Function + %value = OpVariable %_ptr_Function_float Function + OpStore %i %int_0 + OpBranch %12 + %12 = OpLabel + OpLoopMerge %14 %15 Unroll + OpBranch %16 + %16 = OpLabel + %17 = OpLoad %int %i + %20 = OpSLessThan %bool %17 %int_16 + OpBranchConditional %20 %13 %14 + %13 = OpLabel + %27 = OpLoad %int %i + %29 = OpLoad %int %i + %31 = OpAccessChain %_ptr_Uniform_v4float %foo %int_0 %29 + %32 = OpLoad %v4float %31 + %33 = OpAccessChain %_ptr_Uniform_v4float %bar_0 %int_0 %27 + OpStore %33 %32 + OpBranch %15 + %15 = OpLabel + %34 = OpLoad %int %i + %36 = OpIAdd %int %34 %int_1 + OpStore %i %36 + OpBranch %12 + %14 = OpLabel + OpStore %i_0 %int_0 + OpBranch %38 + %38 = OpLabel + OpLoopMerge %40 %41 DontUnroll + OpBranch %42 + %42 = OpLabel + %43 = OpLoad %int %i_0 + %44 = OpSLessThan %bool %43 %int_16 + OpBranchConditional %44 %39 %40 + %39 = OpLabel + %46 = OpLoad %int %i_0 + %47 = OpISub %int %int_15 %46 + %48 = OpLoad %int %i_0 + %49 = OpAccessChain %_ptr_Uniform_v4float %foo %int_0 %48 + %50 = OpLoad %v4float %49 + %51 = OpAccessChain %_ptr_Uniform_v4float %bar_0 %int_0 %47 + OpStore %51 %50 + OpBranch %41 + %41 = OpLabel + %52 = OpLoad %int %i_0 + %53 = OpIAdd %int %52 %int_1 + OpStore %i_0 %53 + OpBranch %38 + %40 = OpLabel + %60 = OpAccessChain %_ptr_Uniform_float %bar_0 %int_0 %int_10 %uint_0 + %61 = OpLoad %float %60 + OpStore %v %61 + %63 = OpAccessChain %_ptr_Uniform_float %foo %int_0 %int_10 %uint_0 + %64 = OpLoad %float %63 + OpStore %w %64 + %65 = OpLoad %float %v + %67 = OpFOrdGreaterThan %bool %65 %float_10 + OpSelectionMerge %69 DontFlatten + OpBranchConditional %67 %68 %69 + %68 = OpLabel + %73 = OpAccessChain %_ptr_Uniform_v4float %foo %int_0 %int_20 + OpStore %73 %72 + OpBranch %69 + %69 = OpLabel + OpStore %value %float_20 + %76 = OpLoad %float %w + %78 = OpFOrdGreaterThan %bool %76 %float_40 + OpSelectionMerge %80 Flatten + OpBranchConditional %78 %79 %80 + %79 = OpLabel + OpStore %value %float_20 + OpBranch %80 + %80 = OpLabel + %81 = OpLoad %float %value + %82 = OpCompositeConstruct %v4float %81 %81 %81 %81 + %83 = OpAccessChain %_ptr_Uniform_v4float %foo %int_0 %int_20 + OpStore %83 %82 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp b/deps/SPIRV-Cross/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-hlsl/asm/comp/storage-buffer-basic.nofxc.asm.comp rename to deps/SPIRV-Cross/shaders-hlsl/asm/comp/storage-buffer-basic.invalid.nofxc.asm.comp diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag new file mode 100644 index 0000000000..ba2f95b234 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/combined-sampler-reuse.asm.frag @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %vUV + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %uTex "uTex" + OpName %uSampler "uSampler" + OpName %vUV "vUV" + OpDecorate %FragColor Location 0 + OpDecorate %uTex DescriptorSet 0 + OpDecorate %uTex Binding 1 + OpDecorate %uSampler DescriptorSet 0 + OpDecorate %uSampler Binding 0 + OpDecorate %vUV Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %uTex = OpVariable %_ptr_UniformConstant_10 UniformConstant + %14 = OpTypeSampler +%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14 + %uSampler = OpVariable %_ptr_UniformConstant_14 UniformConstant + %18 = OpTypeSampledImage %10 + %v2float = OpTypeVector %float 2 +%_ptr_Input_v2float = OpTypePointer Input %v2float + %vUV = OpVariable %_ptr_Input_v2float Input + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_1 = OpConstant %int 1 + %32 = OpConstantComposite %v2int %int_1 %int_1 + %main = OpFunction %void None %3 + %5 = OpLabel + %13 = OpLoad %10 %uTex + %17 = OpLoad %14 %uSampler + %19 = OpSampledImage %18 %13 %17 + %23 = OpLoad %v2float %vUV + %24 = OpImageSampleImplicitLod %v4float %19 %23 + OpStore %FragColor %24 + %28 = OpLoad %v2float %vUV + %33 = OpImageSampleImplicitLod %v4float %19 %28 ConstOffset %32 + %34 = OpLoad %v4float %FragColor + %35 = OpFAdd %v4float %34 %33 + OpStore %FragColor %35 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..701f9f2a1e --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/empty-struct.asm.frag @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.2 +; Generator: Khronos; 0 +; Bound: 43 +; Schema: 0 + OpCapability Linkage + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %EntryPoint_Main "main" + OpExecutionMode %EntryPoint_Main OriginUpperLeft + OpSource Unknown 100 + OpName %EmptyStructTest "EmptyStructTest" + OpName %GetValue "GetValue" + OpName %GetValue2 "GetValue" + OpName %self "self" + OpName %self2 "self" + OpName %emptyStruct "emptyStruct" + OpName %value "value" + OpName %EntryPoint_Main "EntryPoint_Main" + +%EmptyStructTest = OpTypeStruct +%_ptr_Function_EmptyStructTest = OpTypePointer Function %EmptyStructTest + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %5 = OpTypeFunction %float %_ptr_Function_EmptyStructTest + %6 = OpTypeFunction %float %EmptyStructTest + %void = OpTypeVoid +%_ptr_Function_void = OpTypePointer Function %void + %8 = OpTypeFunction %void %_ptr_Function_EmptyStructTest + %9 = OpTypeFunction %void + %float_0 = OpConstant %float 0 + + %GetValue = OpFunction %float None %5 + %self = OpFunctionParameter %_ptr_Function_EmptyStructTest + %13 = OpLabel + OpReturnValue %float_0 + OpFunctionEnd + + %GetValue2 = OpFunction %float None %6 + %self2 = OpFunctionParameter %EmptyStructTest + %14 = OpLabel + OpReturnValue %float_0 + OpFunctionEnd + +%EntryPoint_Main = OpFunction %void None %9 + %37 = OpLabel + %emptyStruct = OpVariable %_ptr_Function_EmptyStructTest Function + %18 = OpVariable %_ptr_Function_EmptyStructTest Function + %value = OpVariable %_ptr_Function_float Function + %value2 = OpCompositeConstruct %EmptyStructTest + %22 = OpFunctionCall %float %GetValue %emptyStruct + %23 = OpFunctionCall %float %GetValue2 %value2 + OpStore %value %22 + OpStore %value %23 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..63c8ab57a5 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 19 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %Size + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %Size "Size" + OpName %uTexture "uTexture" + OpDecorate %Size Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 +%_ptr_Output_v2int = OpTypePointer Output %v2int + %Size = OpVariable %_ptr_Output_v2int Output + %float = OpTypeFloat 32 + %11 = OpTypeImage %float 2D 0 0 0 1 Unknown + %12 = OpTypeSampledImage %11 +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %uTexture = OpVariable %_ptr_UniformConstant_12 UniformConstant + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %15 = OpLoad %12 %uTexture + %17 = OpImage %11 %15 + %18 = OpImageQuerySizeLod %v2int %17 %int_0 + %19 = OpImageQuerySizeLod %v2int %17 %int_1 + %20 = OpIAdd %v2int %18 %19 + OpStore %Size %20 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..ccdfeef58d --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 60 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %v0 %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %phi "phi" + OpName %i "i" + OpName %v0 "v0" + OpName %FragColor "FragColor" + OpName %uImage "uImage" + OpDecorate %v0 Location 0 + OpDecorate %FragColor Location 0 + OpDecorate %uImage DescriptorSet 0 + OpDecorate %uImage Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %v0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %36 = OpTypeImage %float 2D 0 0 0 1 Unknown + %37 = OpTypeSampledImage %36 +%_ptr_UniformConstant_37 = OpTypePointer UniformConstant %37 + %uImage = OpVariable %_ptr_UniformConstant_37 UniformConstant + %v2float = OpTypeVector %float 2 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %float_2 = OpConstant %float 2 + %int_1 = OpConstant %int 1 + %float_1_vec = OpConstantComposite %v4float %float_1 %float_2 %float_1 %float_2 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + OpStore %i %int_0 + OpBranch %loop_header + %loop_header = OpLabel + %phi = OpPhi %float %float_1 %5 %phi_plus_2 %continue_block + %tex_phi = OpPhi %v4float %float_1_vec %5 %texture_load_result %continue_block + OpLoopMerge %merge_block %continue_block None + OpBranch %loop_body + %loop_body = OpLabel + OpStore %FragColor %tex_phi + %19 = OpLoad %int %i + %22 = OpSLessThan %bool %19 %int_4 + OpBranchConditional %22 %15 %merge_block + %15 = OpLabel + %26 = OpLoad %int %i + %28 = OpAccessChain %_ptr_Input_float %v0 %26 + %29 = OpLoad %float %28 + %31 = OpFOrdGreaterThan %bool %29 %float_0 + OpBranchConditional %31 %continue_block %merge_block + %continue_block = OpLabel + %40 = OpLoad %37 %uImage + %43 = OpCompositeConstruct %v2float %phi %phi + %texture_load_result = OpImageSampleExplicitLod %v4float %40 %43 Lod %float_0 + %phi_plus_2 = OpFAdd %float %phi %float_2 + %54 = OpLoad %int %i + %56 = OpIAdd %int %54 %int_1 + OpStore %i %56 + OpBranch %loop_header + %merge_block = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..320e5ebfbd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,195 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 111 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %index + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %index "index" + OpName %indexable "indexable" + OpName %indexable_0 "indexable" + OpName %indexable_1 "indexable" + OpName %foo "foo" + OpName %foobar "foobar" + OpName %baz "baz" + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + OpDecorate %index RelaxedPrecision + OpDecorate %index Flat + OpDecorate %index Location 0 + OpDecorate %20 RelaxedPrecision + OpDecorate %25 RelaxedPrecision + OpDecorate %26 RelaxedPrecision + OpDecorate %32 RelaxedPrecision + OpDecorate %34 RelaxedPrecision + OpDecorate %37 RelaxedPrecision + OpDecorate %38 RelaxedPrecision + OpDecorate %39 RelaxedPrecision + OpDecorate %41 RelaxedPrecision + OpDecorate %42 RelaxedPrecision + OpDecorate %45 RelaxedPrecision + OpDecorate %46 RelaxedPrecision + OpDecorate %47 RelaxedPrecision + OpDecorate %foo RelaxedPrecision + OpDecorate %61 RelaxedPrecision + OpDecorate %66 RelaxedPrecision + OpDecorate %68 RelaxedPrecision + OpDecorate %71 RelaxedPrecision + OpDecorate %72 RelaxedPrecision + OpDecorate %73 RelaxedPrecision + OpDecorate %75 RelaxedPrecision + OpDecorate %76 RelaxedPrecision + OpDecorate %79 RelaxedPrecision + OpDecorate %80 RelaxedPrecision + OpDecorate %81 RelaxedPrecision + OpDecorate %foobar RelaxedPrecision + OpDecorate %83 RelaxedPrecision + OpDecorate %90 RelaxedPrecision + OpDecorate %91 RelaxedPrecision + OpDecorate %93 RelaxedPrecision + OpDecorate %94 RelaxedPrecision + OpDecorate %95 RelaxedPrecision + OpDecorate %baz RelaxedPrecision + OpDecorate %105 RelaxedPrecision + OpDecorate %106 RelaxedPrecision + OpDecorate %108 RelaxedPrecision + OpDecorate %109 RelaxedPrecision + OpDecorate %110 RelaxedPrecision + OpDecorate %16 RelaxedPrecision + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %uint = OpTypeInt 32 0 + %uint_16 = OpConstant %uint 16 +%_arr_float_uint_16 = OpTypeArray %float %uint_16 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %16 = OpConstantComposite %_arr_float_uint_16 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %index = OpVariable %_ptr_Input_int Input +%_ptr_Function__arr_float_uint_16 = OpTypePointer Function %_arr_float_uint_16 +%_ptr_Function_float = OpTypePointer Function %float + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %uint_4 = OpConstant %uint 4 +%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4 +%_ptr_Function__arr_v4float_uint_4 = OpTypePointer Function %_arr_v4float_uint_4 + %float_0 = OpConstant %float 0 + %54 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 + %55 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %float_8 = OpConstant %float 8 + %57 = OpConstantComposite %v4float %float_8 %float_8 %float_8 %float_8 + %float_5 = OpConstant %float 5 + %59 = OpConstantComposite %v4float %float_5 %float_5 %float_5 %float_5 + %60 = OpConstantComposite %_arr_v4float_uint_4 %54 %55 %57 %59 + %int_30 = OpConstant %int 30 + %int_3 = OpConstant %int 3 + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 + %float_20 = OpConstant %float 20 + %uint_2 = OpConstant %uint 2 + %97 = OpConstantComposite %v4float %float_20 %float_20 %float_20 %float_20 + %float_30 = OpConstant %float 30 + %99 = OpConstantComposite %v4float %float_30 %float_30 %float_30 %float_30 + %float_50 = OpConstant %float 50 + %101 = OpConstantComposite %v4float %float_50 %float_50 %float_50 %float_50 + %float_60 = OpConstant %float 60 + %103 = OpConstantComposite %v4float %float_60 %float_60 %float_60 %float_60 + %104 = OpConstantComposite %_arr_v4float_uint_4 %97 %99 %101 %103 + %main = OpFunction %void None %3 + %5 = OpLabel + %indexable = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 +%indexable_0 = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 +%indexable_1 = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 + %foo = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %foobar = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %baz = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %20 = OpLoad %int %index + %24 = OpAccessChain %_ptr_Function_float %indexable %20 + %25 = OpLoad %float %24 + OpStore %FragColor %25 + %26 = OpLoad %int %index + %29 = OpSLessThan %bool %26 %int_10 + OpSelectionMerge %31 None + OpBranchConditional %29 %30 %40 + %30 = OpLabel + %32 = OpLoad %int %index + %34 = OpBitwiseXor %int %32 %int_1 + %36 = OpAccessChain %_ptr_Function_float %indexable_0 %34 + %37 = OpLoad %float %36 + %38 = OpLoad %float %FragColor + %39 = OpFAdd %float %38 %37 + OpStore %FragColor %39 + OpBranch %31 + %40 = OpLabel + %41 = OpLoad %int %index + %42 = OpBitwiseAnd %int %41 %int_1 + %44 = OpAccessChain %_ptr_Function_float %indexable_1 %42 + %45 = OpLoad %float %44 + %46 = OpLoad %float %FragColor + %47 = OpFAdd %float %46 %45 + OpStore %FragColor %47 + OpBranch %31 + %31 = OpLabel + %61 = OpLoad %int %index + %63 = OpSGreaterThan %bool %61 %int_30 + OpSelectionMerge %65 None + OpBranchConditional %63 %64 %74 + %64 = OpLabel + %66 = OpLoad %int %index + %68 = OpBitwiseAnd %int %66 %int_3 + %70 = OpAccessChain %_ptr_Function_float %foo %68 %uint_1 + %71 = OpLoad %float %70 + %72 = OpLoad %float %FragColor + %73 = OpFAdd %float %72 %71 + OpStore %FragColor %73 + OpBranch %65 + %74 = OpLabel + %75 = OpLoad %int %index + %76 = OpBitwiseAnd %int %75 %int_1 + %78 = OpAccessChain %_ptr_Function_float %foo %76 %uint_0 + %79 = OpLoad %float %78 + %80 = OpLoad %float %FragColor + %81 = OpFAdd %float %80 %79 + OpStore %FragColor %81 + OpBranch %65 + %65 = OpLabel + %83 = OpLoad %int %index + %84 = OpSGreaterThan %bool %83 %int_30 + OpSelectionMerge %86 None + OpBranchConditional %84 %85 %86 + %85 = OpLabel + %89 = OpAccessChain %_ptr_Function_float %foobar %int_1 %uint_2 + OpStore %89 %float_20 + OpBranch %86 + %86 = OpLabel + %90 = OpLoad %int %index + %91 = OpBitwiseAnd %int %90 %int_3 + %92 = OpAccessChain %_ptr_Function_float %foobar %91 %uint_2 + %93 = OpLoad %float %92 + %94 = OpLoad %float %FragColor + %95 = OpFAdd %float %94 %93 + OpStore %FragColor %95 + OpStore %baz %104 + %105 = OpLoad %int %index + %106 = OpBitwiseAnd %int %105 %int_3 + %107 = OpAccessChain %_ptr_Function_float %baz %106 %uint_2 + %108 = OpLoad %float %107 + %109 = OpLoad %float %FragColor + %110 = OpFAdd %float %109 %108 + OpStore %FragColor %110 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..c6f8e27cbd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/srem.asm.frag @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 2 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %vA %vB + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %vA "vA" + OpName %vB "vB" + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + OpDecorate %vA Flat + OpDecorate %vA Location 0 + OpDecorate %vB Flat + OpDecorate %vB Location 1 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 +%_ptr_Input_v4int = OpTypePointer Input %v4int + %vA = OpVariable %_ptr_Input_v4int Input + %vB = OpVariable %_ptr_Input_v4int Input + %main = OpFunction %void None %3 + %5 = OpLabel + %14 = OpLoad %v4int %vA + %16 = OpLoad %v4int %vB + %17 = OpLoad %v4int %vA + %18 = OpLoad %v4int %vB + %19 = OpSRem %v4int %17 %18 + %20 = OpConvertSToF %v4float %19 + OpStore %FragColor %20 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..53dc63809c --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %gl_FragCoord + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %uTexture "uTexture" + OpName %gl_FragCoord "gl_FragCoord" + OpDecorate %FragColor Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 0 + OpDecorate %gl_FragCoord BuiltIn FragCoord + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown + %11 = OpTypeSampledImage %10 +%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11 + %uTexture = OpVariable %_ptr_UniformConstant_11 UniformConstant +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input + %v2float = OpTypeVector %float 2 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_0 = OpConstant %int 0 + %main = OpFunction %void None %3 + %5 = OpLabel + %14 = OpLoad %11 %uTexture + %18 = OpLoad %v4float %gl_FragCoord + %19 = OpVectorShuffle %v2float %18 %18 0 1 + %22 = OpConvertFToS %v2int %19 + %24 = OpImage %10 %14 + %25 = OpImageFetch %v4float %24 %22 + OpStore %FragColor %25 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag new file mode 100644 index 0000000000..89036f0eb2 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/frag/unknown-depth-state.asm.frag @@ -0,0 +1,71 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 44 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %vUV %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %sample_combined_ "sample_combined(" + OpName %sample_separate_ "sample_separate(" + OpName %uShadow "uShadow" + OpName %vUV "vUV" + OpName %uTexture "uTexture" + OpName %uSampler "uSampler" + OpName %FragColor "FragColor" + OpDecorate %uShadow DescriptorSet 0 + OpDecorate %uShadow Binding 0 + OpDecorate %vUV Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 1 + OpDecorate %uSampler DescriptorSet 0 + OpDecorate %uSampler Binding 2 + OpDecorate %FragColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %7 = OpTypeFunction %float + %12 = OpTypeImage %float 2D 2 0 0 1 Unknown + %13 = OpTypeSampledImage %12 +%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 + %uShadow = OpVariable %_ptr_UniformConstant_13 UniformConstant + %v3float = OpTypeVector %float 3 +%_ptr_Input_v3float = OpTypePointer Input %v3float + %vUV = OpVariable %_ptr_Input_v3float Input +%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %12 + %uTexture = OpVariable %_ptr_UniformConstant_25 UniformConstant + %29 = OpTypeSampler +%_ptr_UniformConstant_29 = OpTypePointer UniformConstant %29 + %uSampler = OpVariable %_ptr_UniformConstant_29 UniformConstant +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %41 = OpFunctionCall %float %sample_combined_ + %42 = OpFunctionCall %float %sample_separate_ + %43 = OpFAdd %float %41 %42 + OpStore %FragColor %43 + OpReturn + OpFunctionEnd +%sample_combined_ = OpFunction %float None %7 + %9 = OpLabel + %16 = OpLoad %13 %uShadow + %20 = OpLoad %v3float %vUV + %21 = OpCompositeExtract %float %20 2 + %22 = OpImageSampleDrefImplicitLod %float %16 %20 %21 + OpReturnValue %22 + OpFunctionEnd +%sample_separate_ = OpFunction %float None %7 + %11 = OpLabel + %28 = OpLoad %12 %uTexture + %32 = OpLoad %29 %uSampler + %33 = OpSampledImage %13 %28 %32 + %34 = OpLoad %v3float %vUV + %35 = OpCompositeExtract %float %34 2 + %36 = OpImageSampleDrefImplicitLod %float %33 %34 %35 + OpReturnValue %36 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert b/deps/SPIRV-Cross/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert new file mode 100644 index 0000000000..b566a3d1a0 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/vert/spec-constant-op-composite.asm.vert @@ -0,0 +1,98 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 1 +; Bound: 58 +; Schema: 0 + OpCapability Shader + OpCapability ClipDistance + OpCapability CullDistance + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %4 "main" %52 %output + OpSource GLSL 450 + OpName %4 "main" + OpName %9 "pos" + OpName %50 "gl_PerVertex" + OpMemberName %50 0 "gl_Position" + OpMemberName %50 1 "gl_PointSize" + OpMemberName %50 2 "gl_ClipDistance" + OpMemberName %50 3 "gl_CullDistance" + OpName %52 "" + OpDecorate %13 SpecId 201 + OpDecorate %24 SpecId 202 + OpMemberDecorate %50 0 BuiltIn Position + OpMemberDecorate %50 1 BuiltIn PointSize + OpMemberDecorate %50 2 BuiltIn ClipDistance + OpMemberDecorate %50 3 BuiltIn CullDistance + OpDecorate %50 Block + OpDecorate %57 SpecId 200 + OpDecorate %output Flat + OpDecorate %output Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypePointer Function %7 + %10 = OpConstant %6 0 + %11 = OpConstantComposite %7 %10 %10 %10 %10 + %12 = OpTypeInt 32 1 + %int_ptr = OpTypePointer Output %12 + %13 = OpSpecConstant %12 -10 + %14 = OpConstant %12 2 + %15 = OpSpecConstantOp %12 IAdd %13 %14 + %17 = OpTypeInt 32 0 + %18 = OpConstant %17 1 + %19 = OpTypePointer Function %6 + %24 = OpSpecConstant %17 100 + %25 = OpConstant %17 5 + %26 = OpSpecConstantOp %17 UMod %24 %25 + %28 = OpConstant %17 2 + %33 = OpConstant %12 20 + %34 = OpConstant %12 30 + %35 = OpTypeVector %12 4 + %36 = OpSpecConstantComposite %35 %33 %34 %15 %15 + %40 = OpTypeVector %12 2 + %41 = OpSpecConstantOp %40 VectorShuffle %36 %36 1 0 + %foo = OpSpecConstantOp %12 CompositeExtract %36 1 + %42 = OpTypeVector %6 2 + %49 = OpTypeArray %6 %18 + %50 = OpTypeStruct %7 %6 %49 %49 + %51 = OpTypePointer Output %50 + %52 = OpVariable %51 Output + %output = OpVariable %int_ptr Output + %53 = OpConstant %12 0 + %55 = OpTypePointer Output %7 + %57 = OpSpecConstant %6 3.14159 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %9 = OpVariable %8 Function + OpStore %9 %11 + %16 = OpConvertSToF %6 %15 + %20 = OpAccessChain %19 %9 %18 + %21 = OpLoad %6 %20 + %22 = OpFAdd %6 %21 %16 + %23 = OpAccessChain %19 %9 %18 + OpStore %23 %22 + %27 = OpConvertUToF %6 %26 + %29 = OpAccessChain %19 %9 %28 + %30 = OpLoad %6 %29 + %31 = OpFAdd %6 %30 %27 + %32 = OpAccessChain %19 %9 %28 + OpStore %32 %31 + %37 = OpConvertSToF %7 %36 + %38 = OpLoad %7 %9 + %39 = OpFAdd %7 %38 %37 + OpStore %9 %39 + %43 = OpConvertSToF %42 %41 + %44 = OpLoad %7 %9 + %45 = OpVectorShuffle %42 %44 %44 0 1 + %46 = OpFAdd %42 %45 %43 + %47 = OpLoad %7 %9 + %48 = OpVectorShuffle %7 %47 %46 4 5 2 3 + OpStore %9 %48 + %54 = OpLoad %7 %9 + %56 = OpAccessChain %55 %52 %53 + OpStore %56 %54 + OpStore %output %foo + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..29b0076a1e --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %vid_1 %iid_1 %_entryPointOutput + OpSource HLSL 500 + OpName %main "main" + OpName %_main_u1_u1_ "@main(u1;u1;" + OpName %vid "vid" + OpName %iid "iid" + OpName %vid_0 "vid" + OpName %vid_1 "vid" + OpName %iid_0 "iid" + OpName %iid_1 "iid" + OpName %_entryPointOutput "@entryPointOutput" + OpName %param "param" + OpName %param_0 "param" + OpDecorate %vid_1 BuiltIn VertexIndex + OpDecorate %iid_1 BuiltIn InstanceIndex + OpDecorate %_entryPointOutput BuiltIn Position + %void = OpTypeVoid + %3 = OpTypeFunction %void + %uint = OpTypeInt 32 0 +%_ptr_Function_uint = OpTypePointer Function %uint + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %10 = OpTypeFunction %v4float %_ptr_Function_uint %_ptr_Function_uint +%_ptr_Input_uint = OpTypePointer Input %uint + %vid_1 = OpVariable %_ptr_Input_uint Input + %iid_1 = OpVariable %_ptr_Input_uint Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %vid_0 = OpVariable %_ptr_Function_uint Function + %iid_0 = OpVariable %_ptr_Function_uint Function + %param = OpVariable %_ptr_Function_uint Function + %param_0 = OpVariable %_ptr_Function_uint Function + %25 = OpLoad %uint %vid_1 + OpStore %vid_0 %25 + %28 = OpLoad %uint %iid_1 + OpStore %iid_0 %28 + %32 = OpLoad %uint %vid_0 + OpStore %param %32 + %34 = OpLoad %uint %iid_0 + OpStore %param_0 %34 + %35 = OpFunctionCall %v4float %_main_u1_u1_ %param %param_0 + OpStore %_entryPointOutput %35 + OpReturn + OpFunctionEnd +%_main_u1_u1_ = OpFunction %v4float None %10 + %vid = OpFunctionParameter %_ptr_Function_uint + %iid = OpFunctionParameter %_ptr_Function_uint + %14 = OpLabel + %15 = OpLoad %uint %vid + %16 = OpLoad %uint %iid + %17 = OpIAdd %uint %15 %16 + %18 = OpConvertUToF %float %17 + %19 = OpCompositeConstruct %v4float %18 %18 %18 %18 + OpReturnValue %19 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-hlsl/comp/globallycoherent.comp b/deps/SPIRV-Cross/shaders-hlsl/comp/globallycoherent.comp new file mode 100644 index 0000000000..168b9404ea --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/comp/globallycoherent.comp @@ -0,0 +1,25 @@ +#version 450 +layout(local_size_x = 1) in; + +layout(r32f, binding = 0) uniform readonly image2D uImageIn; +layout(r32f, binding = 1) uniform coherent writeonly image2D uImageOut; + +layout(set = 0, binding = 2) readonly buffer Foo +{ + float foo; +}; + +layout(set = 0, binding = 3) coherent writeonly buffer Bar +{ + float bar; +}; + +void main() +{ + ivec2 coord = ivec2(9, 7); + vec4 indata = imageLoad(uImageIn, coord); + imageStore(uImageOut, coord, indata); + + bar = foo; +} + diff --git a/deps/SPIRV-Cross/shaders-hlsl/comp/rmw-matrix.comp b/deps/SPIRV-Cross/shaders-hlsl/comp/rmw-matrix.comp new file mode 100644 index 0000000000..c158ab4ddd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +#version 310 es +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer SSBO +{ + float a; + vec4 b; + mat4 c; + + float a1; + vec4 b1; + mat4 c1; +}; + +void main() +{ + a *= a1; + b *= b1; + c *= c1; +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp b/deps/SPIRV-Cross/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp new file mode 100644 index 0000000000..81135e2a93 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/comp/subgroups.invalid.nofxc.sm60.comp @@ -0,0 +1,131 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic : require +#extension GL_KHR_shader_subgroup_ballot : require +#extension GL_KHR_shader_subgroup_vote : require +#extension GL_KHR_shader_subgroup_shuffle : require +#extension GL_KHR_shader_subgroup_shuffle_relative : require +#extension GL_KHR_shader_subgroup_arithmetic : require +#extension GL_KHR_shader_subgroup_clustered : require +#extension GL_KHR_shader_subgroup_quad : require +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer SSBO +{ + float FragColor; +}; + +void main() +{ + // basic + //FragColor = float(gl_NumSubgroups); + //FragColor = float(gl_SubgroupID); + FragColor = float(gl_SubgroupSize); + FragColor = float(gl_SubgroupInvocationID); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); + bool elected = subgroupElect(); + + // ballot + FragColor = float(gl_SubgroupEqMask); + FragColor = float(gl_SubgroupGeMask); + FragColor = float(gl_SubgroupGtMask); + FragColor = float(gl_SubgroupLeMask); + FragColor = float(gl_SubgroupLtMask); + vec4 broadcasted = subgroupBroadcast(vec4(10.0), 8u); + vec3 first = subgroupBroadcastFirst(vec3(20.0)); + uvec4 ballot_value = subgroupBallot(true); + //bool inverse_ballot_value = subgroupInverseBallot(ballot_value); + //bool bit_extracted = subgroupBallotBitExtract(uvec4(10u), 8u); + uint bit_count = subgroupBallotBitCount(ballot_value); + //uint inclusive_bit_count = subgroupBallotInclusiveBitCount(ballot_value); + //uint exclusive_bit_count = subgroupBallotExclusiveBitCount(ballot_value); + //uint lsb = subgroupBallotFindLSB(ballot_value); + //uint msb = subgroupBallotFindMSB(ballot_value); + + // shuffle + //uint shuffled = subgroupShuffle(10u, 8u); + //uint shuffled_xor = subgroupShuffleXor(30u, 8u); + + // shuffle relative + //uint shuffled_up = subgroupShuffleUp(20u, 4u); + //uint shuffled_down = subgroupShuffleDown(20u, 4u); + + // vote + bool has_all = subgroupAll(true); + bool has_any = subgroupAny(true); + bool has_equal = subgroupAllEqual(true); + + // arithmetic + vec4 added = subgroupAdd(vec4(20.0)); + ivec4 iadded = subgroupAdd(ivec4(20)); + vec4 multiplied = subgroupMul(vec4(20.0)); + ivec4 imultiplied = subgroupMul(ivec4(20)); + vec4 lo = subgroupMin(vec4(20.0)); + vec4 hi = subgroupMax(vec4(20.0)); + ivec4 slo = subgroupMin(ivec4(20)); + ivec4 shi = subgroupMax(ivec4(20)); + uvec4 ulo = subgroupMin(uvec4(20)); + uvec4 uhi = subgroupMax(uvec4(20)); + uvec4 anded = subgroupAnd(ballot_value); + uvec4 ored = subgroupOr(ballot_value); + uvec4 xored = subgroupXor(ballot_value); + + added = subgroupInclusiveAdd(added); + iadded = subgroupInclusiveAdd(iadded); + multiplied = subgroupInclusiveMul(multiplied); + imultiplied = subgroupInclusiveMul(imultiplied); +#if 0 + lo = subgroupInclusiveMin(lo); + hi = subgroupInclusiveMax(hi); + slo = subgroupInclusiveMin(slo); + shi = subgroupInclusiveMax(shi); + ulo = subgroupInclusiveMin(ulo); + uhi = subgroupInclusiveMax(uhi); + anded = subgroupInclusiveAnd(anded); + ored = subgroupInclusiveOr(ored); + xored = subgroupInclusiveXor(ored); + added = subgroupExclusiveAdd(lo); +#endif + + added = subgroupExclusiveAdd(multiplied); + multiplied = subgroupExclusiveMul(multiplied); + iadded = subgroupExclusiveAdd(imultiplied); + imultiplied = subgroupExclusiveMul(imultiplied); +#if 0 + lo = subgroupExclusiveMin(lo); + hi = subgroupExclusiveMax(hi); + ulo = subgroupExclusiveMin(ulo); + uhi = subgroupExclusiveMax(uhi); + slo = subgroupExclusiveMin(slo); + shi = subgroupExclusiveMax(shi); + anded = subgroupExclusiveAnd(anded); + ored = subgroupExclusiveOr(ored); + xored = subgroupExclusiveXor(ored); +#endif + +#if 0 + // clustered + added = subgroupClusteredAdd(added, 4u); + multiplied = subgroupClusteredMul(multiplied, 4u); + iadded = subgroupClusteredAdd(iadded, 4u); + imultiplied = subgroupClusteredMul(imultiplied, 4u); + lo = subgroupClusteredMin(lo, 4u); + hi = subgroupClusteredMax(hi, 4u); + ulo = subgroupClusteredMin(ulo, 4u); + uhi = subgroupClusteredMax(uhi, 4u); + slo = subgroupClusteredMin(slo, 4u); + shi = subgroupClusteredMax(shi, 4u); + anded = subgroupClusteredAnd(anded, 4u); + ored = subgroupClusteredOr(ored, 4u); + xored = subgroupClusteredXor(xored, 4u); +#endif + + // quad + vec4 swap_horiz = subgroupQuadSwapHorizontal(vec4(20.0)); + vec4 swap_vertical = subgroupQuadSwapVertical(vec4(20.0)); + vec4 swap_diagonal = subgroupQuadSwapDiagonal(vec4(20.0)); + vec4 quad_broadcast = subgroupQuadBroadcast(vec4(20.0), 3u); +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..3493e0cccc --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,13 @@ +#version 310 es +precision mediump float; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + float lut[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0); + for (int i = 0; i < 4; i++, FragColor += lut[i]) + { + } +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..7c75ffe1bd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,36 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(binding = 0) uniform sampler2D uSampler; +layout(location = 0) in vec4 vInput; + +void main() +{ + FragColor = vInput; + vec4 t = texture(uSampler, vInput.xy); + vec4 d0 = dFdx(vInput); + vec4 d1 = dFdy(vInput); + vec4 d2 = fwidth(vInput); + vec4 d3 = dFdxCoarse(vInput); + vec4 d4 = dFdyCoarse(vInput); + vec4 d5 = fwidthCoarse(vInput); + vec4 d6 = dFdxFine(vInput); + vec4 d7 = dFdyFine(vInput); + vec4 d8 = fwidthFine(vInput); + vec2 lod = textureQueryLod(uSampler, vInput.zw); + if (vInput.y > 10.0) + { + FragColor += t; + FragColor += d0; + FragColor += d1; + FragColor += d2; + FragColor += d3; + FragColor += d4; + FragColor += d5; + FragColor += d6; + FragColor += d7; + FragColor += d8; + FragColor += lod.xyxy; + } +} + diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/fp16.desktop.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/fp16.desktop.frag new file mode 100644 index 0000000000..4f92e20359 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/fp16.desktop.frag @@ -0,0 +1,156 @@ +#version 450 +#extension GL_AMD_gpu_shader_half_float : require + +layout(location = 0) in float16_t v1; +layout(location = 1) in f16vec2 v2; +layout(location = 2) in f16vec3 v3; +layout(location = 3) in f16vec4 v4; + +layout(location = 0) out float o1; +layout(location = 1) out vec2 o2; +layout(location = 2) out vec3 o3; +layout(location = 3) out vec4 o4; + +#if 0 +// Doesn't work on glslang yet. +f16mat2 test_mat2(f16vec2 a, f16vec2 b, f16vec2 c, f16vec2 d) +{ + return f16mat2(a, b) * f16mat2(c, d); +} + +f16mat3 test_mat3(f16vec3 a, f16vec3 b, f16vec3 c, f16vec3 d, f16vec3 e, f16vec3 f) +{ + return f16mat3(a, b, c) * f16mat3(d, e, f); +} +#endif + +void test_constants() +{ + float16_t a = 1.0hf; + float16_t b = 1.5hf; + float16_t c = -1.5hf; // Negatives + float16_t d = (0.0hf / 0.0hf); // NaN + float16_t e = (1.0hf / 0.0hf); // +Inf + float16_t f = (-1.0hf / 0.0hf); // -Inf + float16_t g = 1014.0hf; // Large. + float16_t h = 0.000001hf; // Denormal +} + +float16_t test_result() +{ + return 1.0hf; +} + +void test_conversions() +{ + float16_t one = test_result(); + int a = int(one); + uint b = uint(one); + bool c = bool(one); + float d = float(one); + double e = double(one); + float16_t a2 = float16_t(a); + float16_t b2 = float16_t(b); + float16_t c2 = float16_t(c); + float16_t d2 = float16_t(d); + float16_t e2 = float16_t(e); +} + +void test_builtins() +{ + f16vec4 res; + res = radians(v4); + res = degrees(v4); + res = sin(v4); + res = cos(v4); + res = tan(v4); + res = asin(v4); + res = atan(v4, v3.xyzz); + res = atan(v4); + res = sinh(v4); + res = cosh(v4); + res = tanh(v4); + //res = asinh(v4); + //res = acosh(v4); + //res = atanh(v4); + res = pow(v4, v4); + res = exp(v4); + res = log(v4); + res = exp2(v4); + res = log2(v4); + res = sqrt(v4); + res = inversesqrt(v4); + res = abs(v4); + res = sign(v4); + res = floor(v4); + res = trunc(v4); + res = round(v4); + //res = roundEven(v4); + res = ceil(v4); + res = fract(v4); + res = mod(v4, v4); + f16vec4 tmp; + res = modf(v4, tmp); + res = min(v4, v4); + res = max(v4, v4); + res = clamp(v4, v4, v4); + res = mix(v4, v4, v4); + res = mix(v4, v4, lessThan(v4, v4)); + res = step(v4, v4); + res = smoothstep(v4, v4, v4); + + bvec4 btmp = isnan(v4); + btmp = isinf(v4); + res = fma(v4, v4, v4); + + //ivec4 itmp; + //res = frexp(v4, itmp); + //res = ldexp(res, itmp); + + uint pack0 = packFloat2x16(v4.xy); + uint pack1 = packFloat2x16(v4.zw); + res = f16vec4(unpackFloat2x16(pack0), unpackFloat2x16(pack1)); + + float16_t t0 = length(v4); + t0 = distance(v4, v4); + t0 = dot(v4, v4); + f16vec3 res3 = cross(v3, v3); + res = normalize(v4); + res = faceforward(v4, v4, v4); + res = reflect(v4, v4); + res = refract(v4, v4, v1); + + btmp = lessThan(v4, v4); + btmp = lessThanEqual(v4, v4); + btmp = greaterThan(v4, v4); + btmp = greaterThanEqual(v4, v4); + btmp = equal(v4, v4); + btmp = notEqual(v4, v4); + + res = dFdx(v4); + res = dFdy(v4); + res = dFdxFine(v4); + res = dFdyFine(v4); + res = dFdxCoarse(v4); + res = dFdyCoarse(v4); + res = fwidth(v4); + res = fwidthFine(v4); + res = fwidthCoarse(v4); + + //res = interpolateAtCentroid(v4); + //res = interpolateAtSample(v4, 0); + //res = interpolateAtOffset(v4, f16vec2(0.1hf)); +} + +void main() +{ + // Basic matrix tests. +#if 0 + f16mat2 m0 = test_mat2(v2, v2, v3.xy, v3.xy); + f16mat3 m1 = test_mat3(v3, v3, v3, v4.xyz, v4.xyz, v4.yzw); +#endif + + test_constants(); + test_conversions(); + test_builtins(); +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/lut-promotion.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/lut-promotion.frag new file mode 100644 index 0000000000..0cdc8148f9 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/lut-promotion.frag @@ -0,0 +1,44 @@ +#version 310 es +precision mediump float; +layout(location = 0) out float FragColor; +layout(location = 0) flat in int index; + +const float LUT[16] = float[]( + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0); + +void main() +{ + // Try reading LUTs, both in branches and not branch. + FragColor = LUT[index]; + if (index < 10) + FragColor += LUT[index ^ 1]; + else + FragColor += LUT[index & 1]; + + // Not declared as a LUT, but can be promoted to one. + vec4 foo[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + if (index > 30) + { + FragColor += foo[index & 3].y; + } + else + { + FragColor += foo[index & 1].x; + } + + // Not declared as a LUT, but this cannot be promoted, because we have a partial write. + vec4 foobar[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + if (index > 30) + { + foobar[1].z = 20.0; + } + FragColor += foobar[index & 3].z; + + // Not declared as a LUT, but this cannot be promoted, because we have two complete writes. + vec4 baz[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[index & 3].z; +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/row-major-layout-in-struct.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/row-major-layout-in-struct.frag new file mode 100644 index 0000000000..3e93bb2b43 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/row-major-layout-in-struct.frag @@ -0,0 +1,29 @@ +#version 450 + +struct Foo +{ + mat4 v; + mat4 w; +}; + +struct NonFoo +{ + mat4 v; + mat4 w; +}; + +layout(std140, binding = 0) uniform UBO +{ + layout(column_major) Foo foo; +}; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 vUV; + +void main() +{ + NonFoo f; + f.v = foo.v; + f.w = foo.w; + FragColor = f.v * (f.w * vUV); +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/sampler-image-arrays.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/sampler-image-arrays.frag new file mode 100644 index 0000000000..42370d9728 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/sampler-image-arrays.frag @@ -0,0 +1,33 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) flat in vec2 vTex; +layout(location = 1) flat in int vIndex; +layout(binding = 0) uniform sampler2D uSampler[4]; +layout(binding = 4) uniform sampler uSamplers[4]; +layout(binding = 8) uniform texture2D uTextures[4]; + +vec4 sample_from_argument(sampler2D samplers[4]) +{ + return texture(samplers[vIndex], vTex + 0.2); +} + +vec4 sample_single_from_argument(sampler2D samp) +{ + return texture(samp, vTex + 0.3); +} + +vec4 sample_from_global() +{ + return texture(uSampler[vIndex], vTex + 0.1); +} + +void main() +{ + FragColor = vec4(0.0); + FragColor += texture(sampler2D(uTextures[2], uSamplers[1]), vTex); + FragColor += texture(uSampler[vIndex], vTex); + FragColor += sample_from_global(); + FragColor += sample_from_argument(uSampler); + FragColor += sample_single_from_argument(uSampler[3]); +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/spec-constant-ternary.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/spec-constant-ternary.frag new file mode 100644 index 0000000000..78dccbf044 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/spec-constant-ternary.frag @@ -0,0 +1,9 @@ +#version 450 +layout(location = 0) out float FragColor; +layout(constant_id = 0) const uint s = 10u; +const uint f = s > 20u ? 30u : 50u; + +void main() +{ + FragColor = float(f); +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling-ms.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling-ms.frag new file mode 100644 index 0000000000..7badbb1a35 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling-ms.frag @@ -0,0 +1,16 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(binding = 0) uniform sampler2DMS uTex; + +void main() +{ + FragColor = + texelFetch(uTex, ivec2(gl_FragCoord.xy), 0); + FragColor += + texelFetch(uTex, ivec2(gl_FragCoord.xy), 1); + FragColor += + texelFetch(uTex, ivec2(gl_FragCoord.xy), 2); + FragColor += + texelFetch(uTex, ivec2(gl_FragCoord.xy), 3); +} diff --git a/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling.frag b/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling.frag index 4a386c0d33..762c60ac6e 100644 --- a/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling.frag +++ b/deps/SPIRV-Cross/shaders-hlsl/frag/tex-sampling.frag @@ -1,22 +1,22 @@ #version 450 -uniform sampler1D tex1d; -uniform sampler2D tex2d; -uniform sampler3D tex3d; -uniform samplerCube texCube; +layout(binding = 0) uniform sampler1D tex1d; +layout(binding = 1) uniform sampler2D tex2d; +layout(binding = 2) uniform sampler3D tex3d; +layout(binding = 3) uniform samplerCube texCube; -uniform sampler1DShadow tex1dShadow; -uniform sampler2DShadow tex2dShadow; -uniform samplerCubeShadow texCubeShadow; +layout(binding = 4) uniform sampler1DShadow tex1dShadow; +layout(binding = 5) uniform sampler2DShadow tex2dShadow; +layout(binding = 6) uniform samplerCubeShadow texCubeShadow; -uniform sampler1DArray tex1dArray; -uniform sampler2DArray tex2dArray; -uniform samplerCubeArray texCubeArray; +layout(binding = 7) uniform sampler1DArray tex1dArray; +layout(binding = 8) uniform sampler2DArray tex2dArray; +layout(binding = 9) uniform samplerCubeArray texCubeArray; -uniform samplerShadow samplerDepth; -uniform sampler samplerNonDepth; -uniform texture2D separateTex2d; -uniform texture2D separateTex2dDepth; +layout(binding = 10) uniform samplerShadow samplerDepth; +layout(binding = 11) uniform sampler samplerNonDepth; +layout(binding = 12) uniform texture2D separateTex2d; +layout(binding = 13) uniform texture2D separateTex2dDepth; layout(location = 0) in float texCoord1d; layout(location = 1) in vec2 texCoord2d; diff --git a/deps/SPIRV-Cross/shaders-hlsl/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/shaders-hlsl/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..792fb8e36c --- /dev/null +++ b/deps/SPIRV-Cross/shaders-hlsl/vert/read-from-row-major-array.vert @@ -0,0 +1,20 @@ +#version 310 es +layout(location = 0) in highp vec4 a_position; +layout(location = 0) out mediump float v_vtxResult; + +layout(set = 0, binding = 0, std140, row_major) uniform Block +{ + highp mat2x3 var[3][4]; +}; + +mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; } +mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); } +mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); } + +void main (void) +{ + gl_Position = a_position; + mediump float result = 1.0; + result *= compare_mat2x3(var[0][0], mat2x3(2.0, 6.0, -6.0, 0.0, 5.0, 5.0)); + v_vtxResult = result; +} diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag b/deps/SPIRV-Cross/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/asm/frag/inliner-dominator-inside-loop.asm.frag rename to deps/SPIRV-Cross/shaders-msl-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag diff --git a/deps/SPIRV-Cross/shaders-msl/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/shaders-msl-no-opt/asm/vert/empty-struct-composite.asm.vert diff --git a/deps/SPIRV-Cross/shaders-msl/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/shaders-msl-no-opt/comp/bitfield.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/comp/bitfield.noopt.comp rename to deps/SPIRV-Cross/shaders-msl-no-opt/comp/bitfield.comp diff --git a/deps/SPIRV-Cross/shaders-msl/comp/loop.noopt.comp b/deps/SPIRV-Cross/shaders-msl-no-opt/comp/loop.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/comp/loop.noopt.comp rename to deps/SPIRV-Cross/shaders-msl-no-opt/comp/loop.comp diff --git a/deps/SPIRV-Cross/shaders-msl/comp/return.comp b/deps/SPIRV-Cross/shaders-msl-no-opt/comp/return.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/comp/return.comp rename to deps/SPIRV-Cross/shaders-msl-no-opt/comp/return.comp diff --git a/deps/SPIRV-Cross/shaders-msl/frag/in_block_assign.noopt.frag b/deps/SPIRV-Cross/shaders-msl-no-opt/frag/in_block_assign.frag similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/frag/in_block_assign.noopt.frag rename to deps/SPIRV-Cross/shaders-msl-no-opt/frag/in_block_assign.frag diff --git a/deps/SPIRV-Cross/shaders-msl/asm/comp/storage-buffer-basic.asm.comp b/deps/SPIRV-Cross/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp similarity index 100% rename from deps/SPIRV-Cross/shaders-msl/asm/comp/storage-buffer-basic.asm.comp rename to deps/SPIRV-Cross/shaders-msl/asm/comp/storage-buffer-basic.invalid.asm.comp diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag new file mode 100644 index 0000000000..ba2f95b234 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/combined-sampler-reuse.asm.frag @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %vUV + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %uTex "uTex" + OpName %uSampler "uSampler" + OpName %vUV "vUV" + OpDecorate %FragColor Location 0 + OpDecorate %uTex DescriptorSet 0 + OpDecorate %uTex Binding 1 + OpDecorate %uSampler DescriptorSet 0 + OpDecorate %uSampler Binding 0 + OpDecorate %vUV Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %uTex = OpVariable %_ptr_UniformConstant_10 UniformConstant + %14 = OpTypeSampler +%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14 + %uSampler = OpVariable %_ptr_UniformConstant_14 UniformConstant + %18 = OpTypeSampledImage %10 + %v2float = OpTypeVector %float 2 +%_ptr_Input_v2float = OpTypePointer Input %v2float + %vUV = OpVariable %_ptr_Input_v2float Input + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_1 = OpConstant %int 1 + %32 = OpConstantComposite %v2int %int_1 %int_1 + %main = OpFunction %void None %3 + %5 = OpLabel + %13 = OpLoad %10 %uTex + %17 = OpLoad %14 %uSampler + %19 = OpSampledImage %18 %13 %17 + %23 = OpLoad %v2float %vUV + %24 = OpImageSampleImplicitLod %v4float %19 %23 + OpStore %FragColor %24 + %28 = OpLoad %v2float %vUV + %33 = OpImageSampleImplicitLod %v4float %19 %28 ConstOffset %32 + %34 = OpLoad %v4float %FragColor + %35 = OpFAdd %v4float %34 %33 + OpStore %FragColor %35 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..701f9f2a1e --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/empty-struct.asm.frag @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.2 +; Generator: Khronos; 0 +; Bound: 43 +; Schema: 0 + OpCapability Linkage + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %EntryPoint_Main "main" + OpExecutionMode %EntryPoint_Main OriginUpperLeft + OpSource Unknown 100 + OpName %EmptyStructTest "EmptyStructTest" + OpName %GetValue "GetValue" + OpName %GetValue2 "GetValue" + OpName %self "self" + OpName %self2 "self" + OpName %emptyStruct "emptyStruct" + OpName %value "value" + OpName %EntryPoint_Main "EntryPoint_Main" + +%EmptyStructTest = OpTypeStruct +%_ptr_Function_EmptyStructTest = OpTypePointer Function %EmptyStructTest + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %5 = OpTypeFunction %float %_ptr_Function_EmptyStructTest + %6 = OpTypeFunction %float %EmptyStructTest + %void = OpTypeVoid +%_ptr_Function_void = OpTypePointer Function %void + %8 = OpTypeFunction %void %_ptr_Function_EmptyStructTest + %9 = OpTypeFunction %void + %float_0 = OpConstant %float 0 + + %GetValue = OpFunction %float None %5 + %self = OpFunctionParameter %_ptr_Function_EmptyStructTest + %13 = OpLabel + OpReturnValue %float_0 + OpFunctionEnd + + %GetValue2 = OpFunction %float None %6 + %self2 = OpFunctionParameter %EmptyStructTest + %14 = OpLabel + OpReturnValue %float_0 + OpFunctionEnd + +%EntryPoint_Main = OpFunction %void None %9 + %37 = OpLabel + %emptyStruct = OpVariable %_ptr_Function_EmptyStructTest Function + %18 = OpVariable %_ptr_Function_EmptyStructTest Function + %value = OpVariable %_ptr_Function_float Function + %value2 = OpCompositeConstruct %EmptyStructTest + %22 = OpFunctionCall %float %GetValue %emptyStruct + %23 = OpFunctionCall %float %GetValue2 %value2 + OpStore %value %22 + OpStore %value %23 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..63c8ab57a5 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 19 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %Size + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %Size "Size" + OpName %uTexture "uTexture" + OpDecorate %Size Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 +%_ptr_Output_v2int = OpTypePointer Output %v2int + %Size = OpVariable %_ptr_Output_v2int Output + %float = OpTypeFloat 32 + %11 = OpTypeImage %float 2D 0 0 0 1 Unknown + %12 = OpTypeSampledImage %11 +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %uTexture = OpVariable %_ptr_UniformConstant_12 UniformConstant + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %15 = OpLoad %12 %uTexture + %17 = OpImage %11 %15 + %18 = OpImageQuerySizeLod %v2int %17 %int_0 + %19 = OpImageQuerySizeLod %v2int %17 %int_1 + %20 = OpIAdd %v2int %18 %19 + OpStore %Size %20 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..ccdfeef58d --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 60 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %v0 %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %phi "phi" + OpName %i "i" + OpName %v0 "v0" + OpName %FragColor "FragColor" + OpName %uImage "uImage" + OpDecorate %v0 Location 0 + OpDecorate %FragColor Location 0 + OpDecorate %uImage DescriptorSet 0 + OpDecorate %uImage Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %v0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %36 = OpTypeImage %float 2D 0 0 0 1 Unknown + %37 = OpTypeSampledImage %36 +%_ptr_UniformConstant_37 = OpTypePointer UniformConstant %37 + %uImage = OpVariable %_ptr_UniformConstant_37 UniformConstant + %v2float = OpTypeVector %float 2 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %float_2 = OpConstant %float 2 + %int_1 = OpConstant %int 1 + %float_1_vec = OpConstantComposite %v4float %float_1 %float_2 %float_1 %float_2 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + OpStore %i %int_0 + OpBranch %loop_header + %loop_header = OpLabel + %phi = OpPhi %float %float_1 %5 %phi_plus_2 %continue_block + %tex_phi = OpPhi %v4float %float_1_vec %5 %texture_load_result %continue_block + OpLoopMerge %merge_block %continue_block None + OpBranch %loop_body + %loop_body = OpLabel + OpStore %FragColor %tex_phi + %19 = OpLoad %int %i + %22 = OpSLessThan %bool %19 %int_4 + OpBranchConditional %22 %15 %merge_block + %15 = OpLabel + %26 = OpLoad %int %i + %28 = OpAccessChain %_ptr_Input_float %v0 %26 + %29 = OpLoad %float %28 + %31 = OpFOrdGreaterThan %bool %29 %float_0 + OpBranchConditional %31 %continue_block %merge_block + %continue_block = OpLabel + %40 = OpLoad %37 %uImage + %43 = OpCompositeConstruct %v2float %phi %phi + %texture_load_result = OpImageSampleExplicitLod %v4float %40 %43 Lod %float_0 + %phi_plus_2 = OpFAdd %float %phi %float_2 + %54 = OpLoad %int %i + %56 = OpIAdd %int %54 %int_1 + OpStore %i %56 + OpBranch %loop_header + %merge_block = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..320e5ebfbd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,195 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 111 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %index + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %index "index" + OpName %indexable "indexable" + OpName %indexable_0 "indexable" + OpName %indexable_1 "indexable" + OpName %foo "foo" + OpName %foobar "foobar" + OpName %baz "baz" + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + OpDecorate %index RelaxedPrecision + OpDecorate %index Flat + OpDecorate %index Location 0 + OpDecorate %20 RelaxedPrecision + OpDecorate %25 RelaxedPrecision + OpDecorate %26 RelaxedPrecision + OpDecorate %32 RelaxedPrecision + OpDecorate %34 RelaxedPrecision + OpDecorate %37 RelaxedPrecision + OpDecorate %38 RelaxedPrecision + OpDecorate %39 RelaxedPrecision + OpDecorate %41 RelaxedPrecision + OpDecorate %42 RelaxedPrecision + OpDecorate %45 RelaxedPrecision + OpDecorate %46 RelaxedPrecision + OpDecorate %47 RelaxedPrecision + OpDecorate %foo RelaxedPrecision + OpDecorate %61 RelaxedPrecision + OpDecorate %66 RelaxedPrecision + OpDecorate %68 RelaxedPrecision + OpDecorate %71 RelaxedPrecision + OpDecorate %72 RelaxedPrecision + OpDecorate %73 RelaxedPrecision + OpDecorate %75 RelaxedPrecision + OpDecorate %76 RelaxedPrecision + OpDecorate %79 RelaxedPrecision + OpDecorate %80 RelaxedPrecision + OpDecorate %81 RelaxedPrecision + OpDecorate %foobar RelaxedPrecision + OpDecorate %83 RelaxedPrecision + OpDecorate %90 RelaxedPrecision + OpDecorate %91 RelaxedPrecision + OpDecorate %93 RelaxedPrecision + OpDecorate %94 RelaxedPrecision + OpDecorate %95 RelaxedPrecision + OpDecorate %baz RelaxedPrecision + OpDecorate %105 RelaxedPrecision + OpDecorate %106 RelaxedPrecision + OpDecorate %108 RelaxedPrecision + OpDecorate %109 RelaxedPrecision + OpDecorate %110 RelaxedPrecision + OpDecorate %16 RelaxedPrecision + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %uint = OpTypeInt 32 0 + %uint_16 = OpConstant %uint 16 +%_arr_float_uint_16 = OpTypeArray %float %uint_16 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %16 = OpConstantComposite %_arr_float_uint_16 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %index = OpVariable %_ptr_Input_int Input +%_ptr_Function__arr_float_uint_16 = OpTypePointer Function %_arr_float_uint_16 +%_ptr_Function_float = OpTypePointer Function %float + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %uint_4 = OpConstant %uint 4 +%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4 +%_ptr_Function__arr_v4float_uint_4 = OpTypePointer Function %_arr_v4float_uint_4 + %float_0 = OpConstant %float 0 + %54 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 + %55 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %float_8 = OpConstant %float 8 + %57 = OpConstantComposite %v4float %float_8 %float_8 %float_8 %float_8 + %float_5 = OpConstant %float 5 + %59 = OpConstantComposite %v4float %float_5 %float_5 %float_5 %float_5 + %60 = OpConstantComposite %_arr_v4float_uint_4 %54 %55 %57 %59 + %int_30 = OpConstant %int 30 + %int_3 = OpConstant %int 3 + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 + %float_20 = OpConstant %float 20 + %uint_2 = OpConstant %uint 2 + %97 = OpConstantComposite %v4float %float_20 %float_20 %float_20 %float_20 + %float_30 = OpConstant %float 30 + %99 = OpConstantComposite %v4float %float_30 %float_30 %float_30 %float_30 + %float_50 = OpConstant %float 50 + %101 = OpConstantComposite %v4float %float_50 %float_50 %float_50 %float_50 + %float_60 = OpConstant %float 60 + %103 = OpConstantComposite %v4float %float_60 %float_60 %float_60 %float_60 + %104 = OpConstantComposite %_arr_v4float_uint_4 %97 %99 %101 %103 + %main = OpFunction %void None %3 + %5 = OpLabel + %indexable = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 +%indexable_0 = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 +%indexable_1 = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 + %foo = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %foobar = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %baz = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %20 = OpLoad %int %index + %24 = OpAccessChain %_ptr_Function_float %indexable %20 + %25 = OpLoad %float %24 + OpStore %FragColor %25 + %26 = OpLoad %int %index + %29 = OpSLessThan %bool %26 %int_10 + OpSelectionMerge %31 None + OpBranchConditional %29 %30 %40 + %30 = OpLabel + %32 = OpLoad %int %index + %34 = OpBitwiseXor %int %32 %int_1 + %36 = OpAccessChain %_ptr_Function_float %indexable_0 %34 + %37 = OpLoad %float %36 + %38 = OpLoad %float %FragColor + %39 = OpFAdd %float %38 %37 + OpStore %FragColor %39 + OpBranch %31 + %40 = OpLabel + %41 = OpLoad %int %index + %42 = OpBitwiseAnd %int %41 %int_1 + %44 = OpAccessChain %_ptr_Function_float %indexable_1 %42 + %45 = OpLoad %float %44 + %46 = OpLoad %float %FragColor + %47 = OpFAdd %float %46 %45 + OpStore %FragColor %47 + OpBranch %31 + %31 = OpLabel + %61 = OpLoad %int %index + %63 = OpSGreaterThan %bool %61 %int_30 + OpSelectionMerge %65 None + OpBranchConditional %63 %64 %74 + %64 = OpLabel + %66 = OpLoad %int %index + %68 = OpBitwiseAnd %int %66 %int_3 + %70 = OpAccessChain %_ptr_Function_float %foo %68 %uint_1 + %71 = OpLoad %float %70 + %72 = OpLoad %float %FragColor + %73 = OpFAdd %float %72 %71 + OpStore %FragColor %73 + OpBranch %65 + %74 = OpLabel + %75 = OpLoad %int %index + %76 = OpBitwiseAnd %int %75 %int_1 + %78 = OpAccessChain %_ptr_Function_float %foo %76 %uint_0 + %79 = OpLoad %float %78 + %80 = OpLoad %float %FragColor + %81 = OpFAdd %float %80 %79 + OpStore %FragColor %81 + OpBranch %65 + %65 = OpLabel + %83 = OpLoad %int %index + %84 = OpSGreaterThan %bool %83 %int_30 + OpSelectionMerge %86 None + OpBranchConditional %84 %85 %86 + %85 = OpLabel + %89 = OpAccessChain %_ptr_Function_float %foobar %int_1 %uint_2 + OpStore %89 %float_20 + OpBranch %86 + %86 = OpLabel + %90 = OpLoad %int %index + %91 = OpBitwiseAnd %int %90 %int_3 + %92 = OpAccessChain %_ptr_Function_float %foobar %91 %uint_2 + %93 = OpLoad %float %92 + %94 = OpLoad %float %FragColor + %95 = OpFAdd %float %94 %93 + OpStore %FragColor %95 + OpStore %baz %104 + %105 = OpLoad %int %index + %106 = OpBitwiseAnd %int %105 %int_3 + %107 = OpAccessChain %_ptr_Function_float %baz %106 %uint_2 + %108 = OpLoad %float %107 + %109 = OpLoad %float %FragColor + %110 = OpFAdd %float %109 %108 + OpStore %FragColor %110 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..c6f8e27cbd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/srem.asm.frag @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 2 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %vA %vB + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %vA "vA" + OpName %vB "vB" + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + OpDecorate %vA Flat + OpDecorate %vA Location 0 + OpDecorate %vB Flat + OpDecorate %vB Location 1 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 +%_ptr_Input_v4int = OpTypePointer Input %v4int + %vA = OpVariable %_ptr_Input_v4int Input + %vB = OpVariable %_ptr_Input_v4int Input + %main = OpFunction %void None %3 + %5 = OpLabel + %14 = OpLoad %v4int %vA + %16 = OpLoad %v4int %vB + %17 = OpLoad %v4int %vA + %18 = OpLoad %v4int %vB + %19 = OpSRem %v4int %17 %18 + %20 = OpConvertSToF %v4float %19 + OpStore %FragColor %20 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..53dc63809c --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %gl_FragCoord + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %uTexture "uTexture" + OpName %gl_FragCoord "gl_FragCoord" + OpDecorate %FragColor Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 0 + OpDecorate %gl_FragCoord BuiltIn FragCoord + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown + %11 = OpTypeSampledImage %10 +%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11 + %uTexture = OpVariable %_ptr_UniformConstant_11 UniformConstant +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input + %v2float = OpTypeVector %float 2 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_0 = OpConstant %int 0 + %main = OpFunction %void None %3 + %5 = OpLabel + %14 = OpLoad %11 %uTexture + %18 = OpLoad %v4float %gl_FragCoord + %19 = OpVectorShuffle %v2float %18 %18 0 1 + %22 = OpConvertFToS %v2int %19 + %24 = OpImage %10 %14 + %25 = OpImageFetch %v4float %24 %22 + OpStore %FragColor %25 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/unknown-depth-state.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/unknown-depth-state.asm.frag new file mode 100644 index 0000000000..89036f0eb2 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/unknown-depth-state.asm.frag @@ -0,0 +1,71 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 44 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %vUV %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %sample_combined_ "sample_combined(" + OpName %sample_separate_ "sample_separate(" + OpName %uShadow "uShadow" + OpName %vUV "vUV" + OpName %uTexture "uTexture" + OpName %uSampler "uSampler" + OpName %FragColor "FragColor" + OpDecorate %uShadow DescriptorSet 0 + OpDecorate %uShadow Binding 0 + OpDecorate %vUV Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 1 + OpDecorate %uSampler DescriptorSet 0 + OpDecorate %uSampler Binding 2 + OpDecorate %FragColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %7 = OpTypeFunction %float + %12 = OpTypeImage %float 2D 2 0 0 1 Unknown + %13 = OpTypeSampledImage %12 +%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 + %uShadow = OpVariable %_ptr_UniformConstant_13 UniformConstant + %v3float = OpTypeVector %float 3 +%_ptr_Input_v3float = OpTypePointer Input %v3float + %vUV = OpVariable %_ptr_Input_v3float Input +%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %12 + %uTexture = OpVariable %_ptr_UniformConstant_25 UniformConstant + %29 = OpTypeSampler +%_ptr_UniformConstant_29 = OpTypePointer UniformConstant %29 + %uSampler = OpVariable %_ptr_UniformConstant_29 UniformConstant +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %41 = OpFunctionCall %float %sample_combined_ + %42 = OpFunctionCall %float %sample_separate_ + %43 = OpFAdd %float %41 %42 + OpStore %FragColor %43 + OpReturn + OpFunctionEnd +%sample_combined_ = OpFunction %float None %7 + %9 = OpLabel + %16 = OpLoad %13 %uShadow + %20 = OpLoad %v3float %vUV + %21 = OpCompositeExtract %float %20 2 + %22 = OpImageSampleDrefImplicitLod %float %16 %20 %21 + OpReturnValue %22 + OpFunctionEnd +%sample_separate_ = OpFunction %float None %7 + %11 = OpLabel + %28 = OpLoad %12 %uTexture + %32 = OpLoad %29 %uSampler + %33 = OpSampledImage %13 %28 %32 + %34 = OpLoad %v3float %vUV + %35 = OpCompositeExtract %float %34 2 + %36 = OpImageSampleDrefImplicitLod %float %33 %34 %35 + OpReturnValue %36 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag b/deps/SPIRV-Cross/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag index d60c6f52d4..92652161cb 100644 --- a/deps/SPIRV-Cross/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag +++ b/deps/SPIRV-Cross/shaders-msl/asm/frag/vector-shuffle-oom.asm.frag @@ -15,9 +15,9 @@ OpDecorate %22044 DescriptorSet 0 OpDecorate %22044 Binding 0 OpDecorate %5785 DescriptorSet 0 - OpDecorate %5785 Binding 140 + OpDecorate %5785 Binding 14 OpDecorate %5688 DescriptorSet 0 - OpDecorate %5688 Binding 60 + OpDecorate %5688 Binding 6 OpMemberDecorate %_struct_994 0 Offset 0 OpMemberDecorate %_struct_994 1 Offset 16 OpMemberDecorate %_struct_994 2 Offset 28 @@ -49,13 +49,13 @@ OpDecorate %12348 DescriptorSet 0 OpDecorate %12348 Binding 2 OpDecorate %3312 DescriptorSet 0 - OpDecorate %3312 Binding 142 + OpDecorate %3312 Binding 13 OpDecorate %4646 DescriptorSet 0 - OpDecorate %4646 Binding 62 + OpDecorate %4646 Binding 5 OpDecorate %4862 DescriptorSet 0 - OpDecorate %4862 Binding 141 + OpDecorate %4862 Binding 4 OpDecorate %3594 DescriptorSet 0 - OpDecorate %3594 Binding 61 + OpDecorate %3594 Binding 3 OpDecorate %_arr_mat4v4float_uint_2 ArrayStride 64 OpDecorate %_arr_v4float_uint_2 ArrayStride 16 OpMemberDecorate %_struct_408 0 RowMajor diff --git a/deps/SPIRV-Cross/shaders-msl/asm/vert/packing-test.asm.vert b/deps/SPIRV-Cross/shaders-msl/asm/vert/packing-test.asm.vert new file mode 100644 index 0000000000..8acdebc7d3 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/vert/packing-test.asm.vert @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 18 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" + OpSource HLSL 500 + OpName %main "main" + OpName %TestStruct "TestStruct" + OpMemberName %TestStruct 0 "transforms" + OpName %CB0 "CB0" + OpMemberName %CB0 0 "CB0" + OpName %_ "" + OpDecorate %_arr_mat4v4float_uint_6 ArrayStride 64 + OpMemberDecorate %TestStruct 0 RowMajor + OpMemberDecorate %TestStruct 0 Offset 0 + OpMemberDecorate %TestStruct 0 MatrixStride 16 + OpDecorate %_arr_TestStruct_uint_16 ArrayStride 384 + OpMemberDecorate %CB0 0 Offset 0 + OpDecorate %CB0 Block + OpDecorate %_ DescriptorSet 0 + OpDecorate %_ Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%mat4v4float = OpTypeMatrix %v4float 4 + %uint = OpTypeInt 32 0 + %uint_6 = OpConstant %uint 6 +%_arr_mat4v4float_uint_6 = OpTypeArray %mat4v4float %uint_6 + %TestStruct = OpTypeStruct %_arr_mat4v4float_uint_6 + %uint_16 = OpConstant %uint 16 +%_arr_TestStruct_uint_16 = OpTypeArray %TestStruct %uint_16 + %CB0 = OpTypeStruct %_arr_TestStruct_uint_16 +%_ptr_Uniform_CB0 = OpTypePointer Uniform %CB0 + %_ = OpVariable %_ptr_Uniform_CB0 Uniform + %main = OpFunction %void None %3 + %5 = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert b/deps/SPIRV-Cross/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert new file mode 100644 index 0000000000..b566a3d1a0 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/vert/spec-constant-op-composite.asm.vert @@ -0,0 +1,98 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 1 +; Bound: 58 +; Schema: 0 + OpCapability Shader + OpCapability ClipDistance + OpCapability CullDistance + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %4 "main" %52 %output + OpSource GLSL 450 + OpName %4 "main" + OpName %9 "pos" + OpName %50 "gl_PerVertex" + OpMemberName %50 0 "gl_Position" + OpMemberName %50 1 "gl_PointSize" + OpMemberName %50 2 "gl_ClipDistance" + OpMemberName %50 3 "gl_CullDistance" + OpName %52 "" + OpDecorate %13 SpecId 201 + OpDecorate %24 SpecId 202 + OpMemberDecorate %50 0 BuiltIn Position + OpMemberDecorate %50 1 BuiltIn PointSize + OpMemberDecorate %50 2 BuiltIn ClipDistance + OpMemberDecorate %50 3 BuiltIn CullDistance + OpDecorate %50 Block + OpDecorate %57 SpecId 200 + OpDecorate %output Flat + OpDecorate %output Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypePointer Function %7 + %10 = OpConstant %6 0 + %11 = OpConstantComposite %7 %10 %10 %10 %10 + %12 = OpTypeInt 32 1 + %int_ptr = OpTypePointer Output %12 + %13 = OpSpecConstant %12 -10 + %14 = OpConstant %12 2 + %15 = OpSpecConstantOp %12 IAdd %13 %14 + %17 = OpTypeInt 32 0 + %18 = OpConstant %17 1 + %19 = OpTypePointer Function %6 + %24 = OpSpecConstant %17 100 + %25 = OpConstant %17 5 + %26 = OpSpecConstantOp %17 UMod %24 %25 + %28 = OpConstant %17 2 + %33 = OpConstant %12 20 + %34 = OpConstant %12 30 + %35 = OpTypeVector %12 4 + %36 = OpSpecConstantComposite %35 %33 %34 %15 %15 + %40 = OpTypeVector %12 2 + %41 = OpSpecConstantOp %40 VectorShuffle %36 %36 1 0 + %foo = OpSpecConstantOp %12 CompositeExtract %36 1 + %42 = OpTypeVector %6 2 + %49 = OpTypeArray %6 %18 + %50 = OpTypeStruct %7 %6 %49 %49 + %51 = OpTypePointer Output %50 + %52 = OpVariable %51 Output + %output = OpVariable %int_ptr Output + %53 = OpConstant %12 0 + %55 = OpTypePointer Output %7 + %57 = OpSpecConstant %6 3.14159 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %9 = OpVariable %8 Function + OpStore %9 %11 + %16 = OpConvertSToF %6 %15 + %20 = OpAccessChain %19 %9 %18 + %21 = OpLoad %6 %20 + %22 = OpFAdd %6 %21 %16 + %23 = OpAccessChain %19 %9 %18 + OpStore %23 %22 + %27 = OpConvertUToF %6 %26 + %29 = OpAccessChain %19 %9 %28 + %30 = OpLoad %6 %29 + %31 = OpFAdd %6 %30 %27 + %32 = OpAccessChain %19 %9 %28 + OpStore %32 %31 + %37 = OpConvertSToF %7 %36 + %38 = OpLoad %7 %9 + %39 = OpFAdd %7 %38 %37 + OpStore %9 %39 + %43 = OpConvertSToF %42 %41 + %44 = OpLoad %7 %9 + %45 = OpVectorShuffle %42 %44 %44 0 1 + %46 = OpFAdd %42 %45 %43 + %47 = OpLoad %7 %9 + %48 = OpVectorShuffle %7 %47 %46 4 5 2 3 + OpStore %9 %48 + %54 = OpLoad %7 %9 + %56 = OpAccessChain %55 %52 %53 + OpStore %56 %54 + OpStore %output %foo + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..29b0076a1e --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %vid_1 %iid_1 %_entryPointOutput + OpSource HLSL 500 + OpName %main "main" + OpName %_main_u1_u1_ "@main(u1;u1;" + OpName %vid "vid" + OpName %iid "iid" + OpName %vid_0 "vid" + OpName %vid_1 "vid" + OpName %iid_0 "iid" + OpName %iid_1 "iid" + OpName %_entryPointOutput "@entryPointOutput" + OpName %param "param" + OpName %param_0 "param" + OpDecorate %vid_1 BuiltIn VertexIndex + OpDecorate %iid_1 BuiltIn InstanceIndex + OpDecorate %_entryPointOutput BuiltIn Position + %void = OpTypeVoid + %3 = OpTypeFunction %void + %uint = OpTypeInt 32 0 +%_ptr_Function_uint = OpTypePointer Function %uint + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %10 = OpTypeFunction %v4float %_ptr_Function_uint %_ptr_Function_uint +%_ptr_Input_uint = OpTypePointer Input %uint + %vid_1 = OpVariable %_ptr_Input_uint Input + %iid_1 = OpVariable %_ptr_Input_uint Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %vid_0 = OpVariable %_ptr_Function_uint Function + %iid_0 = OpVariable %_ptr_Function_uint Function + %param = OpVariable %_ptr_Function_uint Function + %param_0 = OpVariable %_ptr_Function_uint Function + %25 = OpLoad %uint %vid_1 + OpStore %vid_0 %25 + %28 = OpLoad %uint %iid_1 + OpStore %iid_0 %28 + %32 = OpLoad %uint %vid_0 + OpStore %param %32 + %34 = OpLoad %uint %iid_0 + OpStore %param_0 %34 + %35 = OpFunctionCall %v4float %_main_u1_u1_ %param %param_0 + OpStore %_entryPointOutput %35 + OpReturn + OpFunctionEnd +%_main_u1_u1_ = OpFunction %v4float None %10 + %vid = OpFunctionParameter %_ptr_Function_uint + %iid = OpFunctionParameter %_ptr_Function_uint + %14 = OpLabel + %15 = OpLoad %uint %vid + %16 = OpLoad %uint %iid + %17 = OpIAdd %uint %15 %16 + %18 = OpConvertUToF %float %17 + %19 = OpCompositeConstruct %v4float %18 %18 %18 %18 + OpReturnValue %19 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-msl/comp/access-private-workgroup-in-function.comp b/deps/SPIRV-Cross/shaders-msl/comp/access-private-workgroup-in-function.comp new file mode 100644 index 0000000000..7cb1e6f131 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/comp/access-private-workgroup-in-function.comp @@ -0,0 +1,31 @@ +#version 450 +layout(local_size_x = 1) in; + +int f; +shared int u; + +void set_f() +{ + f = 40; +} + +void set_shared_u() +{ + u = 50; +} + +void main() +{ + set_f(); + set_shared_u(); + if (gl_LocalInvocationIndex == 0u) + { + f = 10; + } + else + { + f = 30; + u = 20; + } +} + diff --git a/deps/SPIRV-Cross/shaders-msl/comp/atomic.comp b/deps/SPIRV-Cross/shaders-msl/comp/atomic.comp index 417284d5de..e25c4f6d24 100644 --- a/deps/SPIRV-Cross/shaders-msl/comp/atomic.comp +++ b/deps/SPIRV-Cross/shaders-msl/comp/atomic.comp @@ -10,6 +10,9 @@ layout(binding = 2, std430) buffer SSBO int i32; } ssbo; +shared uint shared_u32; +shared int shared_i32; + void main() { atomicAdd(ssbo.u32, 1u); @@ -29,5 +32,25 @@ void main() atomicMax(ssbo.i32, 1); atomicExchange(ssbo.i32, 1); atomicCompSwap(ssbo.i32, 10, 2); + + shared_u32 = 10u; + shared_i32 = 10; + atomicAdd(shared_u32, 1u); + atomicOr(shared_u32, 1u); + atomicXor(shared_u32, 1u); + atomicAnd(shared_u32, 1u); + atomicMin(shared_u32, 1u); + atomicMax(shared_u32, 1u); + atomicExchange(shared_u32, 1u); + atomicCompSwap(shared_u32, 10u, 2u); + + atomicAdd(shared_i32, 1); + atomicOr(shared_i32, 1); + atomicXor(shared_i32, 1); + atomicAnd(shared_i32, 1); + atomicMin(shared_i32, 1); + atomicMax(shared_i32, 1); + atomicExchange(shared_i32, 1); + atomicCompSwap(shared_i32, 10, 2); } diff --git a/deps/SPIRV-Cross/shaders-msl/comp/composite-construct.comp b/deps/SPIRV-Cross/shaders-msl/comp/composite-construct.comp new file mode 100644 index 0000000000..3054775325 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/comp/composite-construct.comp @@ -0,0 +1,31 @@ +#version 310 es +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer SSBO0 +{ + vec4 as[]; +}; + +layout(std430, binding = 1) buffer SSBO1 +{ + vec4 bs[]; +}; + +struct Composite +{ + vec4 a; + vec4 b; +}; + +const vec4 const_values[2] = vec4[](vec4(20.0), vec4(40.0)); + +void main() +{ + vec4 values[2] = vec4[](as[gl_GlobalInvocationID.x], bs[gl_GlobalInvocationID.x]); + vec4 copy_values[2]; + copy_values = const_values; + Composite c = Composite(values[0], copy_values[1]); + + as[0] = values[gl_LocalInvocationIndex]; + bs[1] = c.b; +} diff --git a/deps/SPIRV-Cross/shaders-msl/comp/image-cube-array-load-store.comp b/deps/SPIRV-Cross/shaders-msl/comp/image-cube-array-load-store.comp new file mode 100644 index 0000000000..36a9ffd8ef --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/comp/image-cube-array-load-store.comp @@ -0,0 +1,13 @@ +#version 450 +layout(local_size_x = 1) in; + +layout(r32f, binding = 0) uniform readonly imageCubeArray uImageIn; +layout(r32f, binding = 1) uniform writeonly imageCubeArray uImageOut; + +void main() +{ + ivec3 coord = ivec3(9, 7, 11); + vec4 indata = imageLoad(uImageIn, coord); + imageStore(uImageOut, coord, indata); +} + diff --git a/deps/SPIRV-Cross/shaders-msl/comp/packing-test-1.comp b/deps/SPIRV-Cross/shaders-msl/comp/packing-test-1.comp new file mode 100644 index 0000000000..1a8a39e219 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/comp/packing-test-1.comp @@ -0,0 +1,18 @@ +#version 450 +struct T1 +{ + vec3 a; + float b; +}; + +layout(std430, binding = 1) buffer Buffer0 { T1 buf0[]; }; +layout(std430, binding = 2) buffer Buffer1 { float buf1[]; }; + +layout(local_size_x = 32, local_size_y = 1, local_size_z = 1) in; +void main() +{ + // broken case in Metal! + T1 v = buf0[0]; + float x = v.b; + buf1[gl_GlobalInvocationID.x] = x; +} diff --git a/deps/SPIRV-Cross/shaders-msl/comp/packing-test-2.comp b/deps/SPIRV-Cross/shaders-msl/comp/packing-test-2.comp new file mode 100644 index 0000000000..73268beec4 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/comp/packing-test-2.comp @@ -0,0 +1,16 @@ +#version 450 +struct T1 +{ + vec3 a; + float b; +}; + +layout(std430, binding = 1) buffer Buffer0 { T1 buf0[]; }; +layout(std430, binding = 2) buffer Buffer1 { float buf1[]; }; + +layout(local_size_x = 32, local_size_y = 1, local_size_z = 1) in; +void main() +{ + float x = buf0[0].b; + buf1[gl_GlobalInvocationID.x] = x; +} diff --git a/deps/SPIRV-Cross/shaders-msl/comp/rmw-matrix.comp b/deps/SPIRV-Cross/shaders-msl/comp/rmw-matrix.comp new file mode 100644 index 0000000000..c158ab4ddd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +#version 310 es +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer SSBO +{ + float a; + vec4 b; + mat4 c; + + float a1; + vec4 b1; + mat4 c1; +}; + +void main() +{ + a *= a1; + b *= b1; + c *= c1; +} diff --git a/deps/SPIRV-Cross/shaders-msl/comp/udiv.comp b/deps/SPIRV-Cross/shaders-msl/comp/udiv.comp index 33fe564f07..d4e1133bc1 100644 --- a/deps/SPIRV-Cross/shaders-msl/comp/udiv.comp +++ b/deps/SPIRV-Cross/shaders-msl/comp/udiv.comp @@ -6,7 +6,7 @@ layout(std430, binding = 0) buffer SSBO uint inputs[]; }; -layout(std430, binding = 0) buffer SSBO2 +layout(std430, binding = 1) buffer SSBO2 { uint outputs[]; }; diff --git a/deps/SPIRV-Cross/shaders-msl/flatten/types.flatten.frag b/deps/SPIRV-Cross/shaders-msl/flatten/types.flatten.frag index faab5b7e05..c1231445fc 100644 --- a/deps/SPIRV-Cross/shaders-msl/flatten/types.flatten.frag +++ b/deps/SPIRV-Cross/shaders-msl/flatten/types.flatten.frag @@ -7,13 +7,13 @@ layout(std140, binding = 0) uniform UBO0 vec4 b; }; -layout(std140, binding = 0) uniform UBO1 +layout(std140, binding = 1) uniform UBO1 { ivec4 c; ivec4 d; }; -layout(std140, binding = 0) uniform UBO2 +layout(std140, binding = 2) uniform UBO2 { uvec4 e; uvec4 f; diff --git a/deps/SPIRV-Cross/shaders-msl/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/shaders-msl/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..3493e0cccc --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,13 @@ +#version 310 es +precision mediump float; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + float lut[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0); + for (int i = 0; i < 4; i++, FragColor += lut[i]) + { + } +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/binary-func-unpack-pack-arguments.frag b/deps/SPIRV-Cross/shaders-msl/frag/binary-func-unpack-pack-arguments.frag new file mode 100644 index 0000000000..c0e5dabd2b --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/binary-func-unpack-pack-arguments.frag @@ -0,0 +1,15 @@ +#version 450 +layout(location = 0) out float FragColor; + +layout(binding = 0, std140) uniform UBO +{ + vec3 color; + float v; +}; + +layout(location = 0) in vec3 vIn; + +void main() +{ + FragColor = dot(vIn, color); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/binary-unpack-pack-arguments.frag b/deps/SPIRV-Cross/shaders-msl/frag/binary-unpack-pack-arguments.frag new file mode 100644 index 0000000000..be30f84df7 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/binary-unpack-pack-arguments.frag @@ -0,0 +1,15 @@ +#version 450 +layout(location = 0) out vec3 FragColor; + +layout(binding = 0, std140) uniform UBO +{ + vec3 color; + float v; +}; + +layout(location = 0) in vec3 vIn; + +void main() +{ + FragColor = cross(vIn, color - vIn); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/shaders-msl/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..1f21bef8c8 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,34 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(binding = 0) uniform sampler2D uSampler; +layout(location = 0) in vec4 vInput; + +void main() +{ + FragColor = vInput; + vec4 t = texture(uSampler, vInput.xy); + vec4 d0 = dFdx(vInput); + vec4 d1 = dFdy(vInput); + vec4 d2 = fwidth(vInput); + vec4 d3 = dFdxCoarse(vInput); + vec4 d4 = dFdyCoarse(vInput); + vec4 d5 = fwidthCoarse(vInput); + vec4 d6 = dFdxFine(vInput); + vec4 d7 = dFdyFine(vInput); + vec4 d8 = fwidthFine(vInput); + if (vInput.y > 10.0) + { + FragColor += t; + FragColor += d0; + FragColor += d1; + FragColor += d2; + FragColor += d3; + FragColor += d4; + FragColor += d5; + FragColor += d6; + FragColor += d7; + FragColor += d8; + } +} + diff --git a/deps/SPIRV-Cross/shaders-msl/frag/dual-source-blending.frag b/deps/SPIRV-Cross/shaders-msl/frag/dual-source-blending.frag new file mode 100644 index 0000000000..f322cf4c38 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/dual-source-blending.frag @@ -0,0 +1,10 @@ +#version 450 + +layout(location = 0, index = 0) out vec4 FragColor0; +layout(location = 0, index = 1) out vec4 FragColor1; + +void main() +{ + FragColor0 = vec4(1.0); + FragColor1 = vec4(2.0); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/fp16-packing.frag b/deps/SPIRV-Cross/shaders-msl/frag/fp16-packing.frag new file mode 100644 index 0000000000..98ca24e2f8 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/fp16-packing.frag @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) flat in uint FP16; +layout(location = 1) flat in vec2 FP32; +layout(location = 0) out vec2 FP32Out; +layout(location = 1) out uint FP16Out; + +void main() +{ + FP32Out = unpackHalf2x16(FP16); + FP16Out = packHalf2x16(FP32); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/fp16.desktop.frag b/deps/SPIRV-Cross/shaders-msl/frag/fp16.desktop.frag new file mode 100644 index 0000000000..1e4026eb2b --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/fp16.desktop.frag @@ -0,0 +1,151 @@ +#version 450 +#extension GL_AMD_gpu_shader_half_float : require + +layout(location = 0) in float16_t v1; +layout(location = 1) in f16vec2 v2; +layout(location = 2) in f16vec3 v3; +layout(location = 3) in f16vec4 v4; + +layout(location = 0) out float o1; +layout(location = 1) out vec2 o2; +layout(location = 2) out vec3 o3; +layout(location = 3) out vec4 o4; + +f16mat2 test_mat2(f16vec2 a, f16vec2 b, f16vec2 c, f16vec2 d) +{ + return f16mat2(a, b) * f16mat2(c, d); +} + +f16mat3 test_mat3(f16vec3 a, f16vec3 b, f16vec3 c, f16vec3 d, f16vec3 e, f16vec3 f) +{ + return f16mat3(a, b, c) * f16mat3(d, e, f); +} + +void test_constants() +{ + float16_t a = 1.0hf; + float16_t b = 1.5hf; + float16_t c = -1.5hf; // Negatives + float16_t d = (0.0hf / 0.0hf); // NaN + float16_t e = (1.0hf / 0.0hf); // +Inf + float16_t f = (-1.0hf / 0.0hf); // -Inf + float16_t g = 1014.0hf; // Large. + float16_t h = 0.000001hf; // Denormal +} + +float16_t test_result() +{ + return 1.0hf; +} + +void test_conversions() +{ + float16_t one = test_result(); + int a = int(one); + uint b = uint(one); + bool c = bool(one); + float d = float(one); + //double e = double(one); + float16_t a2 = float16_t(a); + float16_t b2 = float16_t(b); + float16_t c2 = float16_t(c); + float16_t d2 = float16_t(d); + //float16_t e2 = float16_t(e); +} + +void test_builtins() +{ + f16vec4 res; + res = radians(v4); + res = degrees(v4); + res = sin(v4); + res = cos(v4); + res = tan(v4); + res = asin(v4); + res = atan(v4, v3.xyzz); + res = atan(v4); + res = sinh(v4); + res = cosh(v4); + res = tanh(v4); + res = asinh(v4); + res = acosh(v4); + res = atanh(v4); + res = pow(v4, v4); + res = exp(v4); + res = log(v4); + res = exp2(v4); + res = log2(v4); + res = sqrt(v4); + res = inversesqrt(v4); + res = abs(v4); + res = sign(v4); + res = floor(v4); + res = trunc(v4); + res = round(v4); + res = roundEven(v4); + res = ceil(v4); + res = fract(v4); + res = mod(v4, v4); + f16vec4 tmp; + res = modf(v4, tmp); + res = min(v4, v4); + res = max(v4, v4); + res = clamp(v4, v4, v4); + res = mix(v4, v4, v4); + res = mix(v4, v4, lessThan(v4, v4)); + res = step(v4, v4); + res = smoothstep(v4, v4, v4); + + bvec4 btmp = isnan(v4); + btmp = isinf(v4); + res = fma(v4, v4, v4); + + ivec4 itmp; + res = frexp(v4, itmp); + res = ldexp(res, itmp); + + uint pack0 = packFloat2x16(v4.xy); + uint pack1 = packFloat2x16(v4.zw); + res = f16vec4(unpackFloat2x16(pack0), unpackFloat2x16(pack1)); + + float16_t t0 = length(v4); + t0 = distance(v4, v4); + t0 = dot(v4, v4); + f16vec3 res3 = cross(v3, v3); + res = normalize(v4); + res = faceforward(v4, v4, v4); + res = reflect(v4, v4); + res = refract(v4, v4, v1); + + btmp = lessThan(v4, v4); + btmp = lessThanEqual(v4, v4); + btmp = greaterThan(v4, v4); + btmp = greaterThanEqual(v4, v4); + btmp = equal(v4, v4); + btmp = notEqual(v4, v4); + + res = dFdx(v4); + res = dFdy(v4); + res = dFdxFine(v4); + res = dFdyFine(v4); + res = dFdxCoarse(v4); + res = dFdyCoarse(v4); + res = fwidth(v4); + res = fwidthFine(v4); + res = fwidthCoarse(v4); + + //res = interpolateAtCentroid(v4); + //res = interpolateAtSample(v4, 0); + //res = interpolateAtOffset(v4, f16vec2(0.1hf)); +} + +void main() +{ + // Basic matrix tests. + f16mat2 m0 = test_mat2(v2, v2, v3.xy, v3.xy); + f16mat3 m1 = test_mat3(v3, v3, v3, v4.xyz, v4.xyz, v4.yzw); + + test_constants(); + test_conversions(); + test_builtins(); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/gather-dref.frag b/deps/SPIRV-Cross/shaders-msl/frag/gather-dref.frag new file mode 100644 index 0000000000..a8aac56cb5 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/gather-dref.frag @@ -0,0 +1,11 @@ +#version 310 es +precision mediump float; + +layout(binding = 0) uniform mediump sampler2DShadow uT; +layout(location = 0) in vec3 vUV; +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = textureGather(uT, vUV.xy, vUV.z); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/gather-offset.frag b/deps/SPIRV-Cross/shaders-msl/frag/gather-offset.frag new file mode 100644 index 0000000000..409317ab56 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/gather-offset.frag @@ -0,0 +1,9 @@ +#version 450 + +layout(binding = 0) uniform sampler2D uT; +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = textureGather(uT, vec2(0.5), 3); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/illegal-name-test-0.frag b/deps/SPIRV-Cross/shaders-msl/frag/illegal-name-test-0.frag new file mode 100644 index 0000000000..8e6c11d1d3 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/illegal-name-test-0.frag @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; + +void main() +{ + vec4 fragment = vec4(10.0); + vec4 compute = vec4(10.0); + vec4 kernel = vec4(10.0); + vec4 vertex = vec4(10.0); + FragColor = fragment + compute + kernel + vertex; +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/in_mat.frag b/deps/SPIRV-Cross/shaders-msl/frag/in_mat.frag new file mode 100644 index 0000000000..dd0b5d0350 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/in_mat.frag @@ -0,0 +1,19 @@ +#version 450 + +layout(binding = 1) uniform samplerCube samplerColor; + +layout(location = 0) in vec3 inPos; +layout(location = 1) in vec3 inNormal; +layout(location = 2) in mat4 inInvModelView; +layout(location = 6) in float inLodBias; +layout(location = 0) out vec4 outFragColor; + +void main() +{ + vec3 cI = normalize(inPos); + vec3 cR = reflect(cI, normalize(inNormal)); + cR = vec3((inInvModelView * vec4(cR, 0.0)).xyz); + cR.x *= (-1.0); + outFragColor = texture(samplerColor, cR, inLodBias); +} + diff --git a/deps/SPIRV-Cross/shaders-msl/frag/lut-promotion.frag b/deps/SPIRV-Cross/shaders-msl/frag/lut-promotion.frag new file mode 100644 index 0000000000..0cdc8148f9 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/lut-promotion.frag @@ -0,0 +1,44 @@ +#version 310 es +precision mediump float; +layout(location = 0) out float FragColor; +layout(location = 0) flat in int index; + +const float LUT[16] = float[]( + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0); + +void main() +{ + // Try reading LUTs, both in branches and not branch. + FragColor = LUT[index]; + if (index < 10) + FragColor += LUT[index ^ 1]; + else + FragColor += LUT[index & 1]; + + // Not declared as a LUT, but can be promoted to one. + vec4 foo[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + if (index > 30) + { + FragColor += foo[index & 3].y; + } + else + { + FragColor += foo[index & 1].x; + } + + // Not declared as a LUT, but this cannot be promoted, because we have a partial write. + vec4 foobar[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + if (index > 30) + { + foobar[1].z = 20.0; + } + FragColor += foobar[index & 3].z; + + // Not declared as a LUT, but this cannot be promoted, because we have two complete writes. + vec4 baz[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[index & 3].z; +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/mrt-array.frag b/deps/SPIRV-Cross/shaders-msl/frag/mrt-array.frag new file mode 100644 index 0000000000..0460c72ab9 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/mrt-array.frag @@ -0,0 +1,24 @@ +#version 310 es +precision mediump float; + +layout(location = 0) out vec4 FragColor[4]; +layout(location = 0) in vec4 vA; +layout(location = 1) in vec4 vB; + +void write_deeper_in_function() +{ + FragColor[3] = vA * vB; +} + +void write_in_function() +{ + FragColor[2] = vA - vB; + write_deeper_in_function(); +} + +void main() +{ + FragColor[0] = mod(vA, vB); + FragColor[1] = vA + vB; + write_in_function(); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/packed-expression-vector-shuffle.frag b/deps/SPIRV-Cross/shaders-msl/frag/packed-expression-vector-shuffle.frag new file mode 100644 index 0000000000..9958443813 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/packed-expression-vector-shuffle.frag @@ -0,0 +1,15 @@ +#version 450 +layout(location = 0) out vec4 FragColor; + +layout(binding = 0, std140) uniform UBO +{ + vec3 color; + float v; +}; + +void main() +{ + vec4 f = vec4(1.0); + f.rgb = color; + FragColor = f; +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/packing-test-3.frag b/deps/SPIRV-Cross/shaders-msl/frag/packing-test-3.frag new file mode 100644 index 0000000000..56ad6f5f1b --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/packing-test-3.frag @@ -0,0 +1,36 @@ +#version 450 + +struct VertexOutput +{ + vec4 HPosition; +}; + +struct TestStruct +{ + vec3 position; + float radius; +}; + +layout(binding = 0, std140) uniform CB0 +{ + TestStruct CB0[16]; +} _24; + +layout(location = 0) out vec4 _entryPointOutput; + +vec4 _main(VertexOutput IN) +{ + TestStruct st; + st.position = _24.CB0[1].position; + st.radius = _24.CB0[1].radius; + vec4 col = vec4(st.position, st.radius); + return col; +} + +void main() +{ + VertexOutput IN; + IN.HPosition = gl_FragCoord; + VertexOutput param = IN; + _entryPointOutput = _main(param); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/readonly-ssbo.frag b/deps/SPIRV-Cross/shaders-msl/frag/readonly-ssbo.frag new file mode 100644 index 0000000000..9d7cff66fd --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/readonly-ssbo.frag @@ -0,0 +1,16 @@ +#version 450 +layout(location = 0) out vec4 FragColor; +layout(binding = 0, std430) readonly buffer SSBO +{ + vec4 v; +}; + +vec4 read_from_function() +{ + return v; +} + +void main() +{ + FragColor = v + read_from_function(); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/sampler-1d-lod.frag b/deps/SPIRV-Cross/shaders-msl/frag/sampler-1d-lod.frag new file mode 100644 index 0000000000..f4526f39d0 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/sampler-1d-lod.frag @@ -0,0 +1,12 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) flat in float vTex; +layout(binding = 0) uniform sampler1D uSampler; + +void main() +{ + FragColor += texture(uSampler, vTex, 2.0) + + textureLod(uSampler, vTex, 3.0) + + textureGrad(uSampler, vTex, 5.0, 8.0); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/sampler-image-arrays.msl2.frag b/deps/SPIRV-Cross/shaders-msl/frag/sampler-image-arrays.msl2.frag new file mode 100644 index 0000000000..42370d9728 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/sampler-image-arrays.msl2.frag @@ -0,0 +1,33 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(location = 0) flat in vec2 vTex; +layout(location = 1) flat in int vIndex; +layout(binding = 0) uniform sampler2D uSampler[4]; +layout(binding = 4) uniform sampler uSamplers[4]; +layout(binding = 8) uniform texture2D uTextures[4]; + +vec4 sample_from_argument(sampler2D samplers[4]) +{ + return texture(samplers[vIndex], vTex + 0.2); +} + +vec4 sample_single_from_argument(sampler2D samp) +{ + return texture(samp, vTex + 0.3); +} + +vec4 sample_from_global() +{ + return texture(uSampler[vIndex], vTex + 0.1); +} + +void main() +{ + FragColor = vec4(0.0); + FragColor += texture(sampler2D(uTextures[2], uSamplers[1]), vTex); + FragColor += texture(uSampler[vIndex], vTex); + FragColor += sample_from_global(); + FragColor += sample_from_argument(uSampler); + FragColor += sample_single_from_argument(uSampler[3]); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/shadow-compare-global-alias.frag b/deps/SPIRV-Cross/shaders-msl/frag/shadow-compare-global-alias.frag new file mode 100644 index 0000000000..d885a78471 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/shadow-compare-global-alias.frag @@ -0,0 +1,38 @@ +#version 450 + +layout(location = 0) out float FragColor; +layout(binding = 0) uniform sampler2DShadow uSampler; +layout(location = 0) in vec3 vUV; + +layout(binding = 1) uniform texture2D uTex; +layout(binding = 2) uniform samplerShadow uSamp; + +float Samp(vec3 uv) +{ + return texture(sampler2DShadow(uTex, uSamp), uv); +} + +float Samp2(vec3 uv) +{ + return texture(uSampler, vUV); +} + +float Samp3(texture2D uT, samplerShadow uS, vec3 uv) +{ + return texture(sampler2DShadow(uT, uS), vUV); +} + +float Samp4(sampler2DShadow uS, vec3 uv) +{ + return texture(uS, vUV); +} + +void main() +{ + FragColor = texture(uSampler, vUV); + FragColor += texture(sampler2DShadow(uTex, uSamp), vUV); + FragColor += Samp(vUV); + FragColor += Samp2(vUV); + FragColor += Samp3(uTex, uSamp, vUV); + FragColor += Samp4(uSampler, vUV); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/spec-constant-ternary.frag b/deps/SPIRV-Cross/shaders-msl/frag/spec-constant-ternary.frag new file mode 100644 index 0000000000..78dccbf044 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/frag/spec-constant-ternary.frag @@ -0,0 +1,9 @@ +#version 450 +layout(location = 0) out float FragColor; +layout(constant_id = 0) const uint s = 10u; +const uint f = s > 20u ? 30u : 50u; + +void main() +{ + FragColor = float(f); +} diff --git a/deps/SPIRV-Cross/shaders-msl/frag/swizzle.frag b/deps/SPIRV-Cross/shaders-msl/frag/swizzle.frag index 271ba6cb64..af22dd655d 100644 --- a/deps/SPIRV-Cross/shaders-msl/frag/swizzle.frag +++ b/deps/SPIRV-Cross/shaders-msl/frag/swizzle.frag @@ -1,7 +1,7 @@ #version 310 es precision mediump float; -layout(location = 0) uniform sampler2D samp; +layout(binding = 0) uniform sampler2D samp; layout(location = 0) out vec4 FragColor; layout(location = 1) in vec3 vNormal; layout(location = 2) in vec2 vUV; diff --git a/deps/SPIRV-Cross/shaders-msl/vert/in_out_array_mat.vert b/deps/SPIRV-Cross/shaders-msl/vert/in_out_array_mat.vert new file mode 100644 index 0000000000..bdff3d2802 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/vert/in_out_array_mat.vert @@ -0,0 +1,41 @@ +#version 450 + +layout(binding = 0, std140) uniform UBO +{ + mat4 projection; + mat4 model; + float lodBias; +} ubo; + +layout(location = 0) in vec3 inPos; +layout(location = 1) in vec4 colors[3]; +layout(location = 4) in vec3 inNormal; +layout(location = 5) in mat4 inViewMat; +layout(location = 0) out vec3 outPos; +layout(location = 1) out vec3 outNormal; +layout(location = 2) out mat4 outTransModel; +layout(location = 6) out float outLodBias; +layout(location = 7) out vec4 color; + +void write_deeper_in_function() +{ + outTransModel[1][1] = ubo.lodBias; + color = colors[2]; +} + +void write_in_function() +{ + outTransModel[2] = vec4(inNormal, 1.0); + write_deeper_in_function(); +} + +void main() +{ + gl_Position = (ubo.projection * ubo.model) * vec4(inPos, 1.0); + outPos = vec3((ubo.model * vec4(inPos, 1.0)).xyz); + outNormal = mat3(vec3(ubo.model[0].x, ubo.model[0].y, ubo.model[0].z), vec3(ubo.model[1].x, ubo.model[1].y, ubo.model[1].z), vec3(ubo.model[2].x, ubo.model[2].y, ubo.model[2].z)) * inNormal; + outLodBias = ubo.lodBias; + outTransModel = transpose(ubo.model) * inViewMat; + write_in_function(); +} + diff --git a/deps/SPIRV-Cross/shaders-msl/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/shaders-msl/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..792fb8e36c --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/vert/read-from-row-major-array.vert @@ -0,0 +1,20 @@ +#version 310 es +layout(location = 0) in highp vec4 a_position; +layout(location = 0) out mediump float v_vtxResult; + +layout(set = 0, binding = 0, std140, row_major) uniform Block +{ + highp mat2x3 var[3][4]; +}; + +mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; } +mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); } +mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); } + +void main (void) +{ + gl_Position = a_position; + mediump float result = 1.0; + result *= compare_mat2x3(var[0][0], mat2x3(2.0, 6.0, -6.0, 0.0, 5.0, 5.0)); + v_vtxResult = result; +} diff --git a/deps/SPIRV-Cross/shaders-msl/vert/set_builtin_in_func.vert b/deps/SPIRV-Cross/shaders-msl/vert/set_builtin_in_func.vert new file mode 100644 index 0000000000..dd991e3545 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-msl/vert/set_builtin_in_func.vert @@ -0,0 +1,12 @@ +#version 450 + +void write_outblock() +{ + gl_PointSize = 1.0; + gl_Position = vec4(gl_PointSize); +} + +void main() +{ + write_outblock(); +} diff --git a/deps/SPIRV-Cross/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag b/deps/SPIRV-Cross/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag similarity index 100% rename from deps/SPIRV-Cross/shaders/asm/frag/inliner-dominator-inside-loop.asm.frag rename to deps/SPIRV-Cross/shaders-no-opt/asm/frag/inliner-dominator-inside-loop.asm.frag diff --git a/deps/SPIRV-Cross/shaders/asm/vert/empty-struct-composite.asm.vert b/deps/SPIRV-Cross/shaders-no-opt/asm/vert/empty-struct-composite.asm.vert similarity index 100% rename from deps/SPIRV-Cross/shaders/asm/vert/empty-struct-composite.asm.vert rename to deps/SPIRV-Cross/shaders-no-opt/asm/vert/empty-struct-composite.asm.vert diff --git a/deps/SPIRV-Cross/shaders-no-opt/asm/vert/semantic-decoration.asm.vert b/deps/SPIRV-Cross/shaders-no-opt/asm/vert/semantic-decoration.asm.vert new file mode 100644 index 0000000000..76007c30a3 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-no-opt/asm/vert/semantic-decoration.asm.vert @@ -0,0 +1,68 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpExtension "SPV_GOOGLE_decorate_string" + OpExtension "SPV_GOOGLE_hlsl_functionality1" + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %_entryPointOutput_p %_entryPointOutput_c + OpSource HLSL 500 + OpName %main "main" + OpName %VOut "VOut" + OpMemberName %VOut 0 "p" + OpMemberName %VOut 1 "c" + OpName %_main_ "@main(" + OpName %v "v" + OpName %flattenTemp "flattenTemp" + OpName %_entryPointOutput_p "@entryPointOutput.p" + OpName %_entryPointOutput_c "@entryPointOutput.c" + OpMemberDecorateStringGOOGLE %VOut 0 HlslSemanticGOOGLE "SV_POSITION" + OpMemberDecorateStringGOOGLE %VOut 1 HlslSemanticGOOGLE "COLOR" + OpDecorate %_entryPointOutput_p BuiltIn Position + OpDecorateStringGOOGLE %_entryPointOutput_p HlslSemanticGOOGLE "SV_POSITION" + OpDecorate %_entryPointOutput_c Location 0 + OpDecorateStringGOOGLE %_entryPointOutput_c HlslSemanticGOOGLE "COLOR" + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %VOut = OpTypeStruct %v4float %v4float + %9 = OpTypeFunction %VOut +%_ptr_Function_VOut = OpTypePointer Function %VOut + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %float_1 = OpConstant %float 1 + %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %int_1 = OpConstant %int 1 + %float_2 = OpConstant %float 2 + %22 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2 +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput_p = OpVariable %_ptr_Output_v4float Output +%_entryPointOutput_c = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel +%flattenTemp = OpVariable %_ptr_Function_VOut Function + %28 = OpFunctionCall %VOut %_main_ + OpStore %flattenTemp %28 + %31 = OpAccessChain %_ptr_Function_v4float %flattenTemp %int_0 + %32 = OpLoad %v4float %31 + OpStore %_entryPointOutput_p %32 + %34 = OpAccessChain %_ptr_Function_v4float %flattenTemp %int_1 + %35 = OpLoad %v4float %34 + OpStore %_entryPointOutput_c %35 + OpReturn + OpFunctionEnd + %_main_ = OpFunction %VOut None %9 + %11 = OpLabel + %v = OpVariable %_ptr_Function_VOut Function + %19 = OpAccessChain %_ptr_Function_v4float %v %int_0 + OpStore %19 %17 + %23 = OpAccessChain %_ptr_Function_v4float %v %int_1 + OpStore %23 %22 + %24 = OpLoad %VOut %v + OpReturnValue %24 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/comp/bitfield.noopt.comp b/deps/SPIRV-Cross/shaders-no-opt/comp/bitfield.comp similarity index 100% rename from deps/SPIRV-Cross/shaders/comp/bitfield.noopt.comp rename to deps/SPIRV-Cross/shaders-no-opt/comp/bitfield.comp diff --git a/deps/SPIRV-Cross/shaders/comp/loop.noopt.comp b/deps/SPIRV-Cross/shaders-no-opt/comp/loop.comp similarity index 100% rename from deps/SPIRV-Cross/shaders/comp/loop.noopt.comp rename to deps/SPIRV-Cross/shaders-no-opt/comp/loop.comp diff --git a/deps/SPIRV-Cross/shaders/comp/return.comp b/deps/SPIRV-Cross/shaders-no-opt/comp/return.comp similarity index 100% rename from deps/SPIRV-Cross/shaders/comp/return.comp rename to deps/SPIRV-Cross/shaders-no-opt/comp/return.comp diff --git a/deps/SPIRV-Cross/shaders/vulkan/frag/spec-constant.vk.frag b/deps/SPIRV-Cross/shaders-no-opt/vulkan/frag/spec-constant.vk.frag similarity index 100% rename from deps/SPIRV-Cross/shaders/vulkan/frag/spec-constant.vk.frag rename to deps/SPIRV-Cross/shaders-no-opt/vulkan/frag/spec-constant.vk.frag diff --git a/deps/SPIRV-Cross/shaders-reflection/asm/aliased-entry-point-names.asm.multi b/deps/SPIRV-Cross/shaders-reflection/asm/aliased-entry-point-names.asm.multi new file mode 100644 index 0000000000..d60cf3039c --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/asm/aliased-entry-point-names.asm.multi @@ -0,0 +1,60 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 20 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %_ + OpEntryPoint Vertex %main2 "main2" %_ + OpEntryPoint Fragment %main3 "main" %FragColor + OpEntryPoint Fragment %main4 "main2" %FragColor + OpSource GLSL 450 + OpMemberDecorate %gl_PerVertex 0 BuiltIn Position + OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize + OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance + OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance + OpDecorate %FragColor Location 0 + OpDecorate %gl_PerVertex Block + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %v4floatptr = OpTypePointer Output %v4float + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_arr_float_uint_1 = OpTypeArray %float %uint_1 +%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1 +%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex + %_ = OpVariable %_ptr_Output_gl_PerVertex Output + %FragColor = OpVariable %v4floatptr Output + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %float_1 = OpConstant %float 1 + %17 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %float_2 = OpConstant %float 2 + %18 = OpConstantComposite %v4float %float_2 %float_2 %float_2 %float_2 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %main = OpFunction %void None %3 + %5 = OpLabel + %19 = OpAccessChain %_ptr_Output_v4float %_ %int_0 + OpStore %19 %17 + OpReturn + OpFunctionEnd + %main2 = OpFunction %void None %3 + %6 = OpLabel + %20 = OpAccessChain %_ptr_Output_v4float %_ %int_0 + OpStore %20 %18 + OpReturn + OpFunctionEnd + %main3 = OpFunction %void None %3 + %7 = OpLabel + OpStore %FragColor %17 + OpReturn + OpFunctionEnd + %main4 = OpFunction %void None %3 + %8 = OpLabel + OpStore %FragColor %18 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-reflection/comp/struct-layout.comp b/deps/SPIRV-Cross/shaders-reflection/comp/struct-layout.comp new file mode 100644 index 0000000000..5a2b7802df --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/comp/struct-layout.comp @@ -0,0 +1,24 @@ +#version 310 es +layout(local_size_x = 1) in; + +struct Foo +{ + mat4 m; +}; + +layout(std430, binding = 0) readonly buffer SSBO +{ + Foo in_data[]; +}; + +layout(std430, binding = 1) writeonly buffer SSBO2 +{ + Foo out_data[]; +}; + +void main() +{ + uint ident = gl_GlobalInvocationID.x; + out_data[ident].m = in_data[ident].m * in_data[ident].m; +} + diff --git a/deps/SPIRV-Cross/shaders-reflection/comp/struct-packing.comp b/deps/SPIRV-Cross/shaders-reflection/comp/struct-packing.comp new file mode 100644 index 0000000000..d2ffbaef50 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/comp/struct-packing.comp @@ -0,0 +1,87 @@ +#version 450 + +layout(local_size_x = 1) in; + +struct S0 +{ + vec2 a[1]; + float b; +}; + +struct S1 +{ + vec3 a; + float b; +}; + +struct S2 +{ + vec3 a[1]; + float b; +}; + +struct S3 +{ + vec2 a; + float b; +}; + +struct S4 +{ + vec2 c; +}; + +struct Content +{ + S0 m0s[1]; + S1 m1s[1]; + S2 m2s[1]; + S0 m0; + S1 m1; + S2 m2; + S3 m3; + float m4; + + S4 m3s[8]; +}; + +layout(binding = 1, std430) restrict buffer SSBO1 +{ + Content content; + Content content1[2]; + Content content2; + + layout(column_major) mat2 m0; + layout(column_major) mat2 m1; + layout(column_major) mat2x3 m2[4]; + layout(column_major) mat3x2 m3; + layout(row_major) mat2 m4; + layout(row_major) mat2 m5[9]; + layout(row_major) mat2x3 m6[4][2]; + layout(row_major) mat3x2 m7; + float array[]; +} ssbo_430; + +layout(binding = 0, std140) restrict buffer SSBO0 +{ + Content content; + Content content1[2]; + Content content2; + + layout(column_major) mat2 m0; + layout(column_major) mat2 m1; + layout(column_major) mat2x3 m2[4]; + layout(column_major) mat3x2 m3; + layout(row_major) mat2 m4; + layout(row_major) mat2 m5[9]; + layout(row_major) mat2x3 m6[4][2]; + layout(row_major) mat3x2 m7; + + float array[]; +} ssbo_140; + +void main() +{ + ssbo_430.content = ssbo_140.content; +} + diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/combined-texture-sampler-shadow.vk.frag b/deps/SPIRV-Cross/shaders-reflection/frag/combined-texture-sampler-shadow.vk.frag new file mode 100644 index 0000000000..2fabb5ea8a --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/combined-texture-sampler-shadow.vk.frag @@ -0,0 +1,29 @@ +#version 310 es +precision mediump float; + +layout(set = 0, binding = 0) uniform mediump samplerShadow uSampler; +layout(set = 0, binding = 1) uniform mediump sampler uSampler1; +layout(set = 0, binding = 2) uniform texture2D uDepth; +layout(location = 0) out float FragColor; + +float samp2(texture2D t, mediump samplerShadow s) +{ + return texture(sampler2DShadow(t, s), vec3(1.0)); +} + +float samp3(texture2D t, mediump sampler s) +{ + return texture(sampler2D(t, s), vec2(1.0)).x; +} + +float samp(texture2D t, mediump samplerShadow s, mediump sampler s1) +{ + float r0 = samp2(t, s); + float r1 = samp3(t, s1); + return r0 + r1; +} + +void main() +{ + FragColor = samp(uDepth, uSampler, uSampler1); +} diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/combined-texture-sampler.vk.frag b/deps/SPIRV-Cross/shaders-reflection/frag/combined-texture-sampler.vk.frag new file mode 100644 index 0000000000..b7de8d47e9 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/combined-texture-sampler.vk.frag @@ -0,0 +1,47 @@ +#version 310 es +precision mediump float; + +layout(set = 0, binding = 0) uniform mediump sampler uSampler0; +layout(set = 0, binding = 1) uniform mediump sampler uSampler1; +layout(set = 0, binding = 2) uniform mediump texture2D uTexture0; +layout(set = 0, binding = 3) uniform mediump texture2D uTexture1; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vTex; + +vec4 sample_dual(mediump sampler samp, mediump texture2D tex) +{ + return texture(sampler2D(tex, samp), vTex); +} + +vec4 sample_global_tex(mediump sampler samp) +{ + vec4 a = texture(sampler2D(uTexture0, samp), vTex); + vec4 b = sample_dual(samp, uTexture1); + return a + b; +} + +vec4 sample_global_sampler(mediump texture2D tex) +{ + vec4 a = texture(sampler2D(tex, uSampler0), vTex); + vec4 b = sample_dual(uSampler1, tex); + return a + b; +} + +vec4 sample_duals() +{ + vec4 a = sample_dual(uSampler0, uTexture0); + vec4 b = sample_dual(uSampler1, uTexture1); + return a + b; +} + +void main() +{ + vec4 c0 = sample_duals(); + vec4 c1 = sample_global_tex(uSampler0); + vec4 c2 = sample_global_tex(uSampler1); + vec4 c3 = sample_global_sampler(uTexture0); + vec4 c4 = sample_global_sampler(uTexture1); + + FragColor = c0 + c1 + c2 + c3 + c4; +} diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/image-load-store-uint-coord.asm.frag b/deps/SPIRV-Cross/shaders-reflection/frag/image-load-store-uint-coord.asm.frag new file mode 100644 index 0000000000..a9bf1a7497 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/image-load-store-uint-coord.asm.frag @@ -0,0 +1,103 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 2 +; Bound: 63 +; Schema: 0 + OpCapability Shader + OpCapability SampledBuffer + OpCapability ImageBuffer + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %_entryPointOutput + OpExecutionMode %main OriginUpperLeft + OpSource HLSL 500 + OpName %main "main" + OpName %_main_ "@main(" + OpName %storeTemp "storeTemp" + OpName %RWIm "RWIm" + OpName %v "v" + OpName %RWBuf "RWBuf" + OpName %ROIm "ROIm" + OpName %ROBuf "ROBuf" + OpName %_entryPointOutput "@entryPointOutput" + OpDecorate %RWIm DescriptorSet 0 + OpDecorate %RWIm Binding 1 + OpDecorate %RWBuf DescriptorSet 0 + OpDecorate %RWBuf Binding 0 + OpDecorate %ROIm DescriptorSet 0 + OpDecorate %ROIm Binding 1 + OpDecorate %ROBuf DescriptorSet 0 + OpDecorate %ROBuf Binding 0 + OpDecorate %_entryPointOutput Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %8 = OpTypeFunction %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float + %float_10 = OpConstant %float 10 + %float_0_5 = OpConstant %float 0.5 + %float_8 = OpConstant %float 8 + %float_2 = OpConstant %float 2 + %17 = OpConstantComposite %v4float %float_10 %float_0_5 %float_8 %float_2 + %18 = OpTypeImage %float 2D 0 0 0 2 Rgba32f +%_ptr_UniformConstant_18 = OpTypePointer UniformConstant %18 + %RWIm = OpVariable %_ptr_UniformConstant_18 UniformConstant + %uint = OpTypeInt 32 0 + %v2uint = OpTypeVector %uint 2 + %uint_10 = OpConstant %uint 10 + %25 = OpConstantComposite %v2uint %uint_10 %uint_10 + %uint_30 = OpConstant %uint 30 + %30 = OpConstantComposite %v2uint %uint_30 %uint_30 + %32 = OpTypeImage %float Buffer 0 0 0 2 Rgba32f +%_ptr_UniformConstant_32 = OpTypePointer UniformConstant %32 + %RWBuf = OpVariable %_ptr_UniformConstant_32 UniformConstant + %uint_80 = OpConstant %uint 80 + %38 = OpTypeImage %float 2D 0 0 0 1 Unknown + %SampledImage = OpTypeSampledImage %38 +%_ptr_UniformConstant_38 = OpTypePointer UniformConstant %SampledImage + %ROIm = OpVariable %_ptr_UniformConstant_38 UniformConstant + %uint_50 = OpConstant %uint 50 + %uint_60 = OpConstant %uint 60 + %44 = OpConstantComposite %v2uint %uint_50 %uint_60 + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %50 = OpTypeImage %float Buffer 0 0 0 1 Rgba32f +%_ptr_UniformConstant_50 = OpTypePointer UniformConstant %50 + %ROBuf = OpVariable %_ptr_UniformConstant_50 UniformConstant +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %62 = OpFunctionCall %v4float %_main_ + OpStore %_entryPointOutput %62 + OpReturn + OpFunctionEnd + %_main_ = OpFunction %v4float None %8 + %10 = OpLabel + %storeTemp = OpVariable %_ptr_Function_v4float Function + %v = OpVariable %_ptr_Function_v4float Function + OpStore %storeTemp %17 + %21 = OpLoad %18 %RWIm + %26 = OpLoad %v4float %storeTemp + OpImageWrite %21 %25 %26 + %28 = OpLoad %18 %RWIm + %31 = OpImageRead %v4float %28 %30 + OpStore %v %31 + %35 = OpLoad %32 %RWBuf + %37 = OpLoad %v4float %v + OpImageWrite %35 %uint_80 %37 + %41 = OpLoad %SampledImage %ROIm + %ROImage = OpImage %38 %41 + %47 = OpImageFetch %v4float %ROImage %44 Lod %int_0 + %48 = OpLoad %v4float %v + %49 = OpFAdd %v4float %48 %47 + OpStore %v %49 + %53 = OpLoad %50 %ROBuf + %54 = OpImageFetch %v4float %53 %uint_80 + %55 = OpLoad %v4float %v + %56 = OpFAdd %v4float %55 %54 + OpStore %v %56 + %57 = OpLoad %v4float %v + OpReturnValue %57 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/input-attachment-ms.vk.frag b/deps/SPIRV-Cross/shaders-reflection/frag/input-attachment-ms.vk.frag new file mode 100644 index 0000000000..e060738846 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/input-attachment-ms.vk.frag @@ -0,0 +1,10 @@ +#version 450 + +layout(input_attachment_index = 0, set = 0, binding = 0) uniform subpassInputMS uSubpass0; +layout(input_attachment_index = 1, set = 0, binding = 1) uniform subpassInputMS uSubpass1; +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = subpassLoad(uSubpass0, 1) + subpassLoad(uSubpass1, 2) + subpassLoad(uSubpass0, gl_SampleID); +} diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/input-attachment.vk.frag b/deps/SPIRV-Cross/shaders-reflection/frag/input-attachment.vk.frag new file mode 100644 index 0000000000..f082d15b2a --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/input-attachment.vk.frag @@ -0,0 +1,11 @@ +#version 310 es +precision mediump float; + +layout(input_attachment_index = 0, set = 0, binding = 0) uniform mediump subpassInput uSubpass0; +layout(input_attachment_index = 1, set = 0, binding = 1) uniform mediump subpassInput uSubpass1; +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = subpassLoad(uSubpass0) + subpassLoad(uSubpass1); +} diff --git a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/push-constant.frag.vk b/deps/SPIRV-Cross/shaders-reflection/frag/push-constant.vk.frag similarity index 64% rename from deps/SPIRV-Cross/reference/shaders/vulkan/frag/push-constant.frag.vk rename to deps/SPIRV-Cross/shaders-reflection/frag/push-constant.vk.frag index 748a028678..6180faba31 100644 --- a/deps/SPIRV-Cross/reference/shaders/vulkan/frag/push-constant.frag.vk +++ b/deps/SPIRV-Cross/shaders-reflection/frag/push-constant.vk.frag @@ -1,18 +1,16 @@ #version 310 es precision mediump float; -precision highp int; layout(push_constant, std430) uniform PushConstants { - vec4 value0; - vec4 value1; + vec4 value0; + vec4 value1; } push; -layout(location = 0) out vec4 FragColor; layout(location = 0) in vec4 vColor; +layout(location = 0) out vec4 FragColor; void main() { - FragColor = ((vColor + push.value0) + push.value1); + FragColor = vColor + push.value0 + push.value1; } - diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/separate-sampler-texture-array.vk.frag b/deps/SPIRV-Cross/shaders-reflection/frag/separate-sampler-texture-array.vk.frag new file mode 100644 index 0000000000..b3501c1d8d --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/separate-sampler-texture-array.vk.frag @@ -0,0 +1,42 @@ +#version 310 es +precision mediump float; + +layout(set = 0, binding = 0) uniform mediump sampler uSampler; +layout(set = 0, binding = 1) uniform mediump texture2D uTexture[4]; +layout(set = 0, binding = 2) uniform mediump texture3D uTexture3D[4]; +layout(set = 0, binding = 3) uniform mediump textureCube uTextureCube[4]; +layout(set = 0, binding = 4) uniform mediump texture2DArray uTextureArray[4]; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vTex; +layout(location = 1) in vec3 vTex3; + +vec4 sample_func(mediump sampler samp, vec2 uv) +{ + return texture(sampler2D(uTexture[2], samp), uv); +} + +vec4 sample_func_dual(mediump sampler samp, mediump texture2D tex, vec2 uv) +{ + return texture(sampler2D(tex, samp), uv); +} + +vec4 sample_func_dual_array(mediump sampler samp, mediump texture2D tex[4], vec2 uv) +{ + return texture(sampler2D(tex[1], samp), uv); +} + +void main() +{ + vec2 off = 1.0 / vec2(textureSize(sampler2D(uTexture[1], uSampler), 0)); + vec2 off2 = 1.0 / vec2(textureSize(sampler2D(uTexture[2], uSampler), 1)); + + vec4 c0 = sample_func(uSampler, vTex + off + off2); + vec4 c1 = sample_func_dual(uSampler, uTexture[1], vTex + off + off2); + vec4 c2 = sample_func_dual_array(uSampler, uTexture, vTex + off + off2); + vec4 c3 = texture(sampler2DArray(uTextureArray[3], uSampler), vTex3); + vec4 c4 = texture(samplerCube(uTextureCube[1], uSampler), vTex3); + vec4 c5 = texture(sampler3D(uTexture3D[2], uSampler), vTex3); + + FragColor = c0 + c1 + c2 + c3 + c4 + c5; +} diff --git a/deps/SPIRV-Cross/shaders-reflection/frag/spec-constant.vk.frag b/deps/SPIRV-Cross/shaders-reflection/frag/spec-constant.vk.frag new file mode 100644 index 0000000000..e62a26059b --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/frag/spec-constant.vk.frag @@ -0,0 +1,78 @@ +#version 310 es +precision mediump float; + +layout(location = 0) out vec4 FragColor; +layout(constant_id = 1) const float a = 1.5; +layout(constant_id = 2) const float b = 2.5; +layout(constant_id = 3) const int c = 3; +layout(constant_id = 4) const int d = 4; +layout(constant_id = 5) const uint e = 5u; +layout(constant_id = 6) const uint f = 6u; +layout(constant_id = 7) const bool g = false; +layout(constant_id = 8) const bool h = true; + +// glslang doesn't seem to support partial spec constants or composites yet, so only test the basics. + +struct Foo +{ + float elems[d + 2]; +}; + +void main() +{ + float t0 = a; + float t1 = b; + + uint c0 = uint(c); // OpIAdd with different types. + // FConvert, float-to-double. + int c1 = -c; // SNegate + int c2 = ~c; // OpNot + int c3 = c + d; // OpIAdd + int c4 = c - d; // OpISub + int c5 = c * d; // OpIMul + int c6 = c / d; // OpSDiv + uint c7 = e / f; // OpUDiv + int c8 = c % d; // OpSMod + uint c9 = e % f; // OpUMod + // TODO: OpSRem, any way to access this in GLSL? + int c10 = c >> d; // OpShiftRightArithmetic + uint c11 = e >> f; // OpShiftRightLogical + int c12 = c << d; // OpShiftLeftLogical + int c13 = c | d; // OpBitwiseOr + int c14 = c ^ d; // OpBitwiseXor + int c15 = c & d; // OpBitwiseAnd + // VectorShuffle, CompositeExtract, CompositeInsert, not testable atm. + bool c16 = g || h; // OpLogicalOr + bool c17 = g && h; // OpLogicalAnd + bool c18 = !g; // OpLogicalNot + bool c19 = g == h; // OpLogicalEqual + bool c20 = g != h; // OpLogicalNotEqual + // OpSelect not testable atm. + bool c21 = c == d; // OpIEqual + bool c22 = c != d; // OpINotEqual + bool c23 = c < d; // OpSLessThan + bool c24 = e < f; // OpULessThan + bool c25 = c > d; // OpSGreaterThan + bool c26 = e > f; // OpUGreaterThan + bool c27 = c <= d; // OpSLessThanEqual + bool c28 = e <= f; // OpULessThanEqual + bool c29 = c >= d; // OpSGreaterThanEqual + bool c30 = e >= f; // OpUGreaterThanEqual + // OpQuantizeToF16 not testable atm. + + int c31 = c8 + c3; + + int c32 = int(e); // OpIAdd with different types. + bool c33 = bool(c); // int -> bool + bool c34 = bool(e); // uint -> bool + int c35 = int(g); // bool -> int + uint c36 = uint(g); // bool -> uint + float c37 = float(g); // bool -> float + + // Flexible sized arrays with spec constants and spec constant ops. + float vec0[c + 3][8]; + float vec1[c + 2]; + + Foo foo; + FragColor = vec4(t0 + t1) + vec0[0][0] + vec1[0] + foo.elems[c]; +} diff --git a/deps/SPIRV-Cross/shaders-reflection/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/shaders-reflection/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..792fb8e36c --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/vert/read-from-row-major-array.vert @@ -0,0 +1,20 @@ +#version 310 es +layout(location = 0) in highp vec4 a_position; +layout(location = 0) out mediump float v_vtxResult; + +layout(set = 0, binding = 0, std140, row_major) uniform Block +{ + highp mat2x3 var[3][4]; +}; + +mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; } +mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); } +mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); } + +void main (void) +{ + gl_Position = a_position; + mediump float result = 1.0; + result *= compare_mat2x3(var[0][0], mat2x3(2.0, 6.0, -6.0, 0.0, 5.0, 5.0)); + v_vtxResult = result; +} diff --git a/deps/SPIRV-Cross/shaders-reflection/vert/texture_buffer.vert b/deps/SPIRV-Cross/shaders-reflection/vert/texture_buffer.vert new file mode 100644 index 0000000000..6bc7ddfae2 --- /dev/null +++ b/deps/SPIRV-Cross/shaders-reflection/vert/texture_buffer.vert @@ -0,0 +1,10 @@ +#version 310 es +#extension GL_OES_texture_buffer : require + +layout(binding = 4) uniform highp samplerBuffer uSamp; +layout(rgba32f, binding = 5) uniform readonly highp imageBuffer uSampo; + +void main() +{ + gl_Position = texelFetch(uSamp, 10) + imageLoad(uSampo, 100); +} diff --git a/deps/SPIRV-Cross/shaders/amd/fs.invalid.frag b/deps/SPIRV-Cross/shaders/amd/fs.invalid.frag index 8cbd73e336..1ff82de06e 100644 --- a/deps/SPIRV-Cross/shaders/amd/fs.invalid.frag +++ b/deps/SPIRV-Cross/shaders/amd/fs.invalid.frag @@ -2,8 +2,8 @@ #extension GL_AMD_shader_fragment_mask : require #extension GL_AMD_shader_explicit_vertex_parameter : require -uniform sampler2DMS texture1; -layout(location = 0) in vec4 vary; +layout(binding = 0) uniform sampler2DMS texture1; +layout(location = 0) __explicitInterpAMD in vec4 vary; void main() { diff --git a/deps/SPIRV-Cross/shaders/asm/comp/hlsl-functionality.asm.comp b/deps/SPIRV-Cross/shaders/asm/comp/hlsl-functionality.asm.comp new file mode 100644 index 0000000000..dfdcb45402 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/comp/hlsl-functionality.asm.comp @@ -0,0 +1,63 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 31 +; Schema: 0 + OpCapability Shader + OpExtension "SPV_GOOGLE_hlsl_functionality1" + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint GLCompute %main "main" + OpExecutionMode %main LocalSize 1 1 1 + OpSource HLSL 500 + OpName %main "main" + OpName %_main_ "@main(" + OpName %Buf "Buf" + OpMemberName %Buf 0 "@data" + OpName %Buf_0 "Buf" + OpName %Buf_count "Buf@count" + OpMemberName %Buf_count 0 "@count" + OpName %Buf_count_0 "Buf@count" + OpDecorate %_runtimearr_v4float ArrayStride 16 + OpMemberDecorate %Buf 0 Offset 0 + OpDecorate %Buf BufferBlock + OpDecorate %Buf_0 DescriptorSet 0 + OpDecorate %Buf_0 Binding 0 + OpMemberDecorate %Buf_count 0 Offset 0 + OpDecorate %Buf_count BufferBlock + OpDecorate %Buf_count_0 DescriptorSet 0 + OpDecorateId %Buf_0 HlslCounterBufferGOOGLE %Buf_count_0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_runtimearr_v4float = OpTypeRuntimeArray %v4float + %Buf = OpTypeStruct %_runtimearr_v4float +%_ptr_Uniform_Buf = OpTypePointer Uniform %Buf + %Buf_0 = OpVariable %_ptr_Uniform_Buf Uniform + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %Buf_count = OpTypeStruct %int +%_ptr_Uniform_Buf_count = OpTypePointer Uniform %Buf_count +%Buf_count_0 = OpVariable %_ptr_Uniform_Buf_count Uniform +%_ptr_Uniform_int = OpTypePointer Uniform %int + %int_1 = OpConstant %int 1 + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 + %float_1 = OpConstant %float 1 + %27 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 +%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float + %main = OpFunction %void None %3 + %5 = OpLabel + %30 = OpFunctionCall %void %_main_ + OpReturn + OpFunctionEnd + %_main_ = OpFunction %void None %3 + %7 = OpLabel + %20 = OpAccessChain %_ptr_Uniform_int %Buf_count_0 %int_0 + %25 = OpAtomicIAdd %int %20 %uint_1 %uint_0 %int_1 + %29 = OpAccessChain %_ptr_Uniform_v4float %Buf_0 %int_0 %25 + OpStore %29 %27 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/comp/name-alias.asm.invalid.comp b/deps/SPIRV-Cross/shaders/asm/comp/name-alias.asm.invalid.comp deleted file mode 100644 index f9bc6dbb67..0000000000 --- a/deps/SPIRV-Cross/shaders/asm/comp/name-alias.asm.invalid.comp +++ /dev/null @@ -1,124 +0,0 @@ -; SPIR-V -; Version: 1.0 -; Generator: Khronos Glslang Reference Front End; 1 -; Bound: 48 -; Schema: 0 - OpCapability Shader - %1 = OpExtInstImport "GLSL.std.450" - OpMemoryModel Logical GLSL450 - OpEntryPoint GLCompute %4 "main" - OpExecutionMode %4 LocalSize 1 1 1 - OpSource ESSL 310 - OpName %4 "alias" - OpName %15 "alias" - OpMemberName %15 0 "alias" - OpName %18 "alias" - OpMemberName %18 0 "alias" - OpMemberName %18 1 "alias" - OpMemberName %18 2 "alias" - OpName %19 "alias" - OpMemberName %19 0 "alias" - OpMemberName %19 1 "alias" - OpName %21 "alias" - OpName %24 "alias" - OpMemberName %24 0 "alias" - OpName %26 "alias" - OpMemberName %26 0 "alias" - OpMemberName %26 1 "alias" - OpMemberName %26 2 "alias" - OpName %27 "alias" - OpMemberName %27 0 "alias" - OpMemberName %27 1 "alias" - OpName %28 "alias" - OpMemberName %28 0 "alias" - OpName %30 "alias" - OpName %38 "alias" - OpMemberName %38 0 "alias" - OpName %40 "alias" - OpMemberName %40 0 "alias" - OpMemberName %40 1 "alias" - OpMemberName %40 2 "alias" - OpName %41 "alias" - OpMemberName %41 0 "alias" - OpMemberName %41 1 "alias" - OpName %42 "alias" - OpMemberName %42 0 "alias" - OpName %44 "alias" - OpDecorate %22 ArrayStride 8 - OpDecorate %23 ArrayStride 16 - OpMemberDecorate %24 0 Offset 0 - OpDecorate %25 ArrayStride 1600 - OpMemberDecorate %26 0 Offset 0 - OpMemberDecorate %26 1 Offset 16 - OpMemberDecorate %26 2 Offset 96 - OpMemberDecorate %27 0 Offset 0 - OpMemberDecorate %27 1 Offset 16 - OpMemberDecorate %28 0 Offset 0 - OpDecorate %28 BufferBlock - OpDecorate %30 DescriptorSet 0 - OpDecorate %30 Binding 0 - OpDecorate %36 ArrayStride 16 - OpDecorate %37 ArrayStride 16 - OpMemberDecorate %38 0 Offset 0 - OpDecorate %39 ArrayStride 1600 - OpMemberDecorate %40 0 Offset 0 - OpMemberDecorate %40 1 Offset 16 - OpMemberDecorate %40 2 Offset 176 - OpMemberDecorate %41 0 Offset 0 - OpMemberDecorate %41 1 Offset 16 - OpMemberDecorate %42 0 Offset 0 - OpDecorate %42 BufferBlock - OpDecorate %44 DescriptorSet 0 - OpDecorate %44 Binding 1 - %2 = OpTypeVoid - %3 = OpTypeFunction %2 - %6 = OpTypeFloat 32 - %7 = OpTypeVector %6 4 - %8 = OpTypeVector %6 2 - %9 = OpTypeInt 32 0 - %10 = OpConstant %9 10 - %11 = OpTypeArray %8 %10 - %12 = OpTypeVector %6 3 - %13 = OpConstant %9 100 - %14 = OpTypeArray %12 %13 - %15 = OpTypeStruct %14 - %16 = OpConstant %9 2 - %17 = OpTypeArray %15 %16 - %18 = OpTypeStruct %7 %11 %17 - %19 = OpTypeStruct %7 %18 - %20 = OpTypePointer Function %19 - %22 = OpTypeArray %8 %10 - %23 = OpTypeArray %12 %13 - %24 = OpTypeStruct %23 - %25 = OpTypeArray %24 %16 - %26 = OpTypeStruct %7 %22 %25 - %27 = OpTypeStruct %7 %26 - %28 = OpTypeStruct %27 - %29 = OpTypePointer Uniform %28 - %30 = OpVariable %29 Uniform - %31 = OpTypeInt 32 1 - %32 = OpConstant %31 0 - %33 = OpTypePointer Uniform %27 - %36 = OpTypeArray %8 %10 - %37 = OpTypeArray %12 %13 - %38 = OpTypeStruct %37 - %39 = OpTypeArray %38 %16 - %40 = OpTypeStruct %7 %36 %39 - %41 = OpTypeStruct %7 %40 - %42 = OpTypeStruct %41 - %43 = OpTypePointer Uniform %42 - %44 = OpVariable %43 Uniform - %46 = OpTypePointer Uniform %41 - %4 = OpFunction %2 None %3 - %5 = OpLabel - %21 = OpVariable %20 Function - %34 = OpAccessChain %33 %30 %32 - %35 = OpLoad %27 %34 -; This shader has an illegal aliased store for testing purposes. spirv-val is not run for this shader. - OpStore %21 %35 - %45 = OpLoad %19 %21 - %47 = OpAccessChain %46 %44 %32 -; This shader has an illegal aliased store for testing purposes. spirv-val is not run for this shader. - OpStore %47 %45 - OpReturn - OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/comp/storage-buffer-basic.asm.comp b/deps/SPIRV-Cross/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp similarity index 100% rename from deps/SPIRV-Cross/shaders/asm/comp/storage-buffer-basic.asm.comp rename to deps/SPIRV-Cross/shaders/asm/comp/storage-buffer-basic.invalid.asm.comp diff --git a/deps/SPIRV-Cross/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag new file mode 100644 index 0000000000..ba2f95b234 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/combined-sampler-reuse.vk.asm.frag @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %vUV + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %uTex "uTex" + OpName %uSampler "uSampler" + OpName %vUV "vUV" + OpDecorate %FragColor Location 0 + OpDecorate %uTex DescriptorSet 0 + OpDecorate %uTex Binding 1 + OpDecorate %uSampler DescriptorSet 0 + OpDecorate %uSampler Binding 0 + OpDecorate %vUV Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_10 = OpTypePointer UniformConstant %10 + %uTex = OpVariable %_ptr_UniformConstant_10 UniformConstant + %14 = OpTypeSampler +%_ptr_UniformConstant_14 = OpTypePointer UniformConstant %14 + %uSampler = OpVariable %_ptr_UniformConstant_14 UniformConstant + %18 = OpTypeSampledImage %10 + %v2float = OpTypeVector %float 2 +%_ptr_Input_v2float = OpTypePointer Input %v2float + %vUV = OpVariable %_ptr_Input_v2float Input + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_1 = OpConstant %int 1 + %32 = OpConstantComposite %v2int %int_1 %int_1 + %main = OpFunction %void None %3 + %5 = OpLabel + %13 = OpLoad %10 %uTex + %17 = OpLoad %14 %uSampler + %19 = OpSampledImage %18 %13 %17 + %23 = OpLoad %v2float %vUV + %24 = OpImageSampleImplicitLod %v4float %19 %23 + OpStore %FragColor %24 + %28 = OpLoad %v2float %vUV + %33 = OpImageSampleImplicitLod %v4float %19 %28 ConstOffset %32 + %34 = OpLoad %v4float %FragColor + %35 = OpFAdd %v4float %34 %33 + OpStore %FragColor %35 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/complex-name-workarounds.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/complex-name-workarounds.asm.frag new file mode 100644 index 0000000000..59a67730a6 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/complex-name-workarounds.asm.frag @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 47 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %a %b %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %func__vf4_ "fu__nc_" + OpName %a_ "a_" + OpName %func_2_vf4_ "fu__nc_" + OpName %a_2 "___" + OpName %c0 "___" + OpName %a "__" + OpName %b "a" + OpName %param "b" + OpName %c1 "b" + OpName %param_0 "b" + OpName %FragColor "b" + OpDecorate %a Location 0 + OpDecorate %b Location 1 + OpDecorate %FragColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Function %v4float + %9 = OpTypeFunction %v4float %_ptr_Function_v4float +%_ptr_Input_v4float = OpTypePointer Input %v4float + %a = OpVariable %_ptr_Input_v4float Input + %b = OpVariable %_ptr_Input_v4float Input +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %c0 = OpVariable %_ptr_Function_v4float Function + %param = OpVariable %_ptr_Function_v4float Function + %c1 = OpVariable %_ptr_Function_v4float Function + %param_0 = OpVariable %_ptr_Function_v4float Function + %25 = OpLoad %v4float %a + %27 = OpLoad %v4float %b + %28 = OpFAdd %v4float %25 %27 + %30 = OpLoad %v4float %a + OpStore %param %30 + %31 = OpFunctionCall %v4float %func__vf4_ %param + %32 = OpFAdd %v4float %28 %31 + OpStore %c0 %32 + %34 = OpLoad %v4float %a + %35 = OpLoad %v4float %b + %36 = OpFSub %v4float %34 %35 + %38 = OpLoad %v4float %b + OpStore %param_0 %38 + %39 = OpFunctionCall %v4float %func_2_vf4_ %param_0 + %40 = OpFAdd %v4float %36 %39 + OpStore %c1 %40 + %43 = OpLoad %v4float %c0 + OpStore %FragColor %43 + %44 = OpLoad %v4float %c1 + OpStore %FragColor %44 + %45 = OpLoad %v4float %c0 + OpStore %FragColor %45 + %46 = OpLoad %v4float %c1 + OpStore %FragColor %46 + OpReturn + OpFunctionEnd + %func__vf4_ = OpFunction %v4float None %9 + %a_ = OpFunctionParameter %_ptr_Function_v4float + %12 = OpLabel + %16 = OpLoad %v4float %a_ + OpReturnValue %16 + OpFunctionEnd +%func_2_vf4_ = OpFunction %v4float None %9 + %a_2 = OpFunctionParameter %_ptr_Function_v4float + %15 = OpLabel + %19 = OpLoad %v4float %a_2 + OpReturnValue %19 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/empty-struct.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/empty-struct.asm.frag new file mode 100644 index 0000000000..701f9f2a1e --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/empty-struct.asm.frag @@ -0,0 +1,56 @@ +; SPIR-V +; Version: 1.2 +; Generator: Khronos; 0 +; Bound: 43 +; Schema: 0 + OpCapability Linkage + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %EntryPoint_Main "main" + OpExecutionMode %EntryPoint_Main OriginUpperLeft + OpSource Unknown 100 + OpName %EmptyStructTest "EmptyStructTest" + OpName %GetValue "GetValue" + OpName %GetValue2 "GetValue" + OpName %self "self" + OpName %self2 "self" + OpName %emptyStruct "emptyStruct" + OpName %value "value" + OpName %EntryPoint_Main "EntryPoint_Main" + +%EmptyStructTest = OpTypeStruct +%_ptr_Function_EmptyStructTest = OpTypePointer Function %EmptyStructTest + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %5 = OpTypeFunction %float %_ptr_Function_EmptyStructTest + %6 = OpTypeFunction %float %EmptyStructTest + %void = OpTypeVoid +%_ptr_Function_void = OpTypePointer Function %void + %8 = OpTypeFunction %void %_ptr_Function_EmptyStructTest + %9 = OpTypeFunction %void + %float_0 = OpConstant %float 0 + + %GetValue = OpFunction %float None %5 + %self = OpFunctionParameter %_ptr_Function_EmptyStructTest + %13 = OpLabel + OpReturnValue %float_0 + OpFunctionEnd + + %GetValue2 = OpFunction %float None %6 + %self2 = OpFunctionParameter %EmptyStructTest + %14 = OpLabel + OpReturnValue %float_0 + OpFunctionEnd + +%EntryPoint_Main = OpFunction %void None %9 + %37 = OpLabel + %emptyStruct = OpVariable %_ptr_Function_EmptyStructTest Function + %18 = OpVariable %_ptr_Function_EmptyStructTest Function + %value = OpVariable %_ptr_Function_float Function + %value2 = OpCompositeConstruct %EmptyStructTest + %22 = OpFunctionCall %float %GetValue %emptyStruct + %23 = OpFunctionCall %float %GetValue2 %value2 + OpStore %value %22 + OpStore %value %23 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero-cube.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero-cube.asm.frag index 2be18cfeeb..75ce80bfd4 100644 --- a/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero-cube.asm.frag +++ b/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero-cube.asm.frag @@ -16,6 +16,8 @@ OpName %_entryPointOutput "@entryPointOutput" OpDecorate %pointLightShadowMap DescriptorSet 0 OpDecorate %shadowSamplerPCF DescriptorSet 0 + OpDecorate %pointLightShadowMap Binding 0 + OpDecorate %shadowSamplerPCF Binding 1 OpDecorate %_entryPointOutput Location 0 %void = OpTypeVoid %3 = OpTypeFunction %void diff --git a/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero.asm.frag index 34fb6e834b..bb0a1ea313 100644 --- a/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero.asm.frag +++ b/deps/SPIRV-Cross/shaders/asm/frag/hlsl-sample-cmp-level-zero.asm.frag @@ -29,6 +29,8 @@ OpName %param_1 "param" OpDecorate %ShadowMap DescriptorSet 0 OpDecorate %ShadowSamplerPCF DescriptorSet 0 + OpDecorate %ShadowMap Binding 0 + OpDecorate %ShadowSamplerPCF Binding 1 OpDecorate %texCoords_1 Location 0 OpDecorate %cascadeIndex_1 Location 1 OpDecorate %fragDepth_1 Location 2 diff --git a/deps/SPIRV-Cross/shaders/asm/frag/image-extract-reuse.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/image-extract-reuse.asm.frag new file mode 100644 index 0000000000..63c8ab57a5 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/image-extract-reuse.asm.frag @@ -0,0 +1,41 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 19 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %Size + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %Size "Size" + OpName %uTexture "uTexture" + OpDecorate %Size Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 +%_ptr_Output_v2int = OpTypePointer Output %v2int + %Size = OpVariable %_ptr_Output_v2int Output + %float = OpTypeFloat 32 + %11 = OpTypeImage %float 2D 0 0 0 1 Unknown + %12 = OpTypeSampledImage %11 +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %12 + %uTexture = OpVariable %_ptr_UniformConstant_12 UniformConstant + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %15 = OpLoad %12 %uTexture + %17 = OpImage %11 %15 + %18 = OpImageQuerySizeLod %v2int %17 %int_0 + %19 = OpImageQuerySizeLod %v2int %17 %int_1 + %20 = OpIAdd %v2int %18 %19 + OpStore %Size %20 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/image-query-no-sampler.vk.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/image-query-no-sampler.vk.asm.frag new file mode 100644 index 0000000000..a232bd4898 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/image-query-no-sampler.vk.asm.frag @@ -0,0 +1,57 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + OpCapability ImageQuery + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %b "b" + OpName %uSampler2D "uSampler2D" + OpName %c "c" + OpName %uSampler2DMS "uSampler2DMS" + OpName %l1 "l1" + OpName %s0 "s0" + OpDecorate %uSampler2D DescriptorSet 0 + OpDecorate %uSampler2D Binding 0 + OpDecorate %uSampler2DMS DescriptorSet 0 + OpDecorate %uSampler2DMS Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 +%_ptr_Function_v2int = OpTypePointer Function %v2int + %float = OpTypeFloat 32 + %11 = OpTypeImage %float 2D 0 0 0 1 Unknown +%_ptr_UniformConstant_12 = OpTypePointer UniformConstant %11 + %uSampler2D = OpVariable %_ptr_UniformConstant_12 UniformConstant + %int_0 = OpConstant %int 0 + %20 = OpTypeImage %float 2D 0 0 1 1 Unknown +%_ptr_UniformConstant_21 = OpTypePointer UniformConstant %20 +%uSampler2DMS = OpVariable %_ptr_UniformConstant_21 UniformConstant +%_ptr_Function_int = OpTypePointer Function %int + %main = OpFunction %void None %3 + %5 = OpLabel + %b = OpVariable %_ptr_Function_v2int Function + %c = OpVariable %_ptr_Function_v2int Function + %l1 = OpVariable %_ptr_Function_int Function + %s0 = OpVariable %_ptr_Function_int Function + %15 = OpLoad %11 %uSampler2D + %18 = OpImageQuerySizeLod %v2int %15 %int_0 + OpStore %b %18 + %24 = OpLoad %20 %uSampler2DMS + %26 = OpImageQuerySize %v2int %24 + OpStore %c %26 + %29 = OpLoad %11 %uSampler2D + %31 = OpImageQueryLevels %int %29 + OpStore %l1 %31 + %33 = OpLoad %20 %uSampler2DMS + %35 = OpImageQuerySamples %int %33 + OpStore %s0 %35 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/implicit-read-dep-phi.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/implicit-read-dep-phi.asm.frag new file mode 100644 index 0000000000..ccdfeef58d --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/implicit-read-dep-phi.asm.frag @@ -0,0 +1,81 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 60 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %v0 %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %phi "phi" + OpName %i "i" + OpName %v0 "v0" + OpName %FragColor "FragColor" + OpName %uImage "uImage" + OpDecorate %v0 Location 0 + OpDecorate %FragColor Location 0 + OpDecorate %uImage DescriptorSet 0 + OpDecorate %uImage Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Function_float = OpTypePointer Function %float + %float_1 = OpConstant %float 1 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool + %v4float = OpTypeVector %float 4 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %v0 = OpVariable %_ptr_Input_v4float Input +%_ptr_Input_float = OpTypePointer Input %float + %float_0 = OpConstant %float 0 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %36 = OpTypeImage %float 2D 0 0 0 1 Unknown + %37 = OpTypeSampledImage %36 +%_ptr_UniformConstant_37 = OpTypePointer UniformConstant %37 + %uImage = OpVariable %_ptr_UniformConstant_37 UniformConstant + %v2float = OpTypeVector %float 2 + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 + %float_2 = OpConstant %float 2 + %int_1 = OpConstant %int 1 + %float_1_vec = OpConstantComposite %v4float %float_1 %float_2 %float_1 %float_2 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + OpStore %i %int_0 + OpBranch %loop_header + %loop_header = OpLabel + %phi = OpPhi %float %float_1 %5 %phi_plus_2 %continue_block + %tex_phi = OpPhi %v4float %float_1_vec %5 %texture_load_result %continue_block + OpLoopMerge %merge_block %continue_block None + OpBranch %loop_body + %loop_body = OpLabel + OpStore %FragColor %tex_phi + %19 = OpLoad %int %i + %22 = OpSLessThan %bool %19 %int_4 + OpBranchConditional %22 %15 %merge_block + %15 = OpLabel + %26 = OpLoad %int %i + %28 = OpAccessChain %_ptr_Input_float %v0 %26 + %29 = OpLoad %float %28 + %31 = OpFOrdGreaterThan %bool %29 %float_0 + OpBranchConditional %31 %continue_block %merge_block + %continue_block = OpLabel + %40 = OpLoad %37 %uImage + %43 = OpCompositeConstruct %v2float %phi %phi + %texture_load_result = OpImageSampleExplicitLod %v4float %40 %43 Lod %float_0 + %phi_plus_2 = OpFAdd %float %phi %float_2 + %54 = OpLoad %int %i + %56 = OpIAdd %int %54 %int_1 + OpStore %i %56 + OpBranch %loop_header + %merge_block = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/loop-merge-to-continue.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/loop-merge-to-continue.asm.frag new file mode 100644 index 0000000000..f2acc43604 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/loop-merge-to-continue.asm.frag @@ -0,0 +1,85 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 51 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %v0 + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %i "i" + OpName %j "j" + OpName %v0 "v0" + OpDecorate %FragColor Location 0 + OpDecorate %v0 Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %float_1 = OpConstant %float 1 + %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool +%_ptr_Input_v4float = OpTypePointer Input %v4float + %v0 = OpVariable %_ptr_Input_v4float Input + %int_3 = OpConstant %int 3 +%_ptr_Input_float = OpTypePointer Input %float + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + %j = OpVariable %_ptr_Function_int Function + OpStore %FragColor %11 + OpStore %i %int_0 + OpBranch %16 + %16 = OpLabel + OpLoopMerge %18 %19 None + OpBranch %20 + %20 = OpLabel + %21 = OpLoad %int %i + %24 = OpSLessThan %bool %21 %int_4 + OpBranchConditional %24 %17 %18 + %17 = OpLabel + OpStore %j %int_0 + OpBranch %26 + %26 = OpLabel + OpLoopMerge %19 %29 None + OpBranch %30 + %30 = OpLabel + %31 = OpLoad %int %j + %32 = OpSLessThan %bool %31 %int_4 + OpBranchConditional %32 %27 %19 + %27 = OpLabel + %35 = OpLoad %int %i + %36 = OpLoad %int %j + %37 = OpIAdd %int %35 %36 + %39 = OpBitwiseAnd %int %37 %int_3 + %41 = OpAccessChain %_ptr_Input_float %v0 %39 + %42 = OpLoad %float %41 + %43 = OpLoad %v4float %FragColor + %44 = OpCompositeConstruct %v4float %42 %42 %42 %42 + %45 = OpFAdd %v4float %43 %44 + OpStore %FragColor %45 + OpBranch %29 + %29 = OpLabel + %46 = OpLoad %int %j + %48 = OpIAdd %int %46 %int_1 + OpStore %j %48 + OpBranch %26 + %19 = OpLabel + %49 = OpLoad %int %i + %50 = OpIAdd %int %49 %int_1 + OpStore %i %50 + OpBranch %16 + %18 = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/lut-promotion-initializer.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/lut-promotion-initializer.asm.frag new file mode 100644 index 0000000000..320e5ebfbd --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/lut-promotion-initializer.asm.frag @@ -0,0 +1,195 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 111 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %index + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %index "index" + OpName %indexable "indexable" + OpName %indexable_0 "indexable" + OpName %indexable_1 "indexable" + OpName %foo "foo" + OpName %foobar "foobar" + OpName %baz "baz" + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + OpDecorate %index RelaxedPrecision + OpDecorate %index Flat + OpDecorate %index Location 0 + OpDecorate %20 RelaxedPrecision + OpDecorate %25 RelaxedPrecision + OpDecorate %26 RelaxedPrecision + OpDecorate %32 RelaxedPrecision + OpDecorate %34 RelaxedPrecision + OpDecorate %37 RelaxedPrecision + OpDecorate %38 RelaxedPrecision + OpDecorate %39 RelaxedPrecision + OpDecorate %41 RelaxedPrecision + OpDecorate %42 RelaxedPrecision + OpDecorate %45 RelaxedPrecision + OpDecorate %46 RelaxedPrecision + OpDecorate %47 RelaxedPrecision + OpDecorate %foo RelaxedPrecision + OpDecorate %61 RelaxedPrecision + OpDecorate %66 RelaxedPrecision + OpDecorate %68 RelaxedPrecision + OpDecorate %71 RelaxedPrecision + OpDecorate %72 RelaxedPrecision + OpDecorate %73 RelaxedPrecision + OpDecorate %75 RelaxedPrecision + OpDecorate %76 RelaxedPrecision + OpDecorate %79 RelaxedPrecision + OpDecorate %80 RelaxedPrecision + OpDecorate %81 RelaxedPrecision + OpDecorate %foobar RelaxedPrecision + OpDecorate %83 RelaxedPrecision + OpDecorate %90 RelaxedPrecision + OpDecorate %91 RelaxedPrecision + OpDecorate %93 RelaxedPrecision + OpDecorate %94 RelaxedPrecision + OpDecorate %95 RelaxedPrecision + OpDecorate %baz RelaxedPrecision + OpDecorate %105 RelaxedPrecision + OpDecorate %106 RelaxedPrecision + OpDecorate %108 RelaxedPrecision + OpDecorate %109 RelaxedPrecision + OpDecorate %110 RelaxedPrecision + OpDecorate %16 RelaxedPrecision + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %uint = OpTypeInt 32 0 + %uint_16 = OpConstant %uint 16 +%_arr_float_uint_16 = OpTypeArray %float %uint_16 + %float_1 = OpConstant %float 1 + %float_2 = OpConstant %float 2 + %float_3 = OpConstant %float 3 + %float_4 = OpConstant %float 4 + %16 = OpConstantComposite %_arr_float_uint_16 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 %float_1 %float_2 %float_3 %float_4 + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %index = OpVariable %_ptr_Input_int Input +%_ptr_Function__arr_float_uint_16 = OpTypePointer Function %_arr_float_uint_16 +%_ptr_Function_float = OpTypePointer Function %float + %int_10 = OpConstant %int 10 + %bool = OpTypeBool + %int_1 = OpConstant %int 1 + %v4float = OpTypeVector %float 4 + %uint_4 = OpConstant %uint 4 +%_arr_v4float_uint_4 = OpTypeArray %v4float %uint_4 +%_ptr_Function__arr_v4float_uint_4 = OpTypePointer Function %_arr_v4float_uint_4 + %float_0 = OpConstant %float 0 + %54 = OpConstantComposite %v4float %float_0 %float_0 %float_0 %float_0 + %55 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %float_8 = OpConstant %float 8 + %57 = OpConstantComposite %v4float %float_8 %float_8 %float_8 %float_8 + %float_5 = OpConstant %float 5 + %59 = OpConstantComposite %v4float %float_5 %float_5 %float_5 %float_5 + %60 = OpConstantComposite %_arr_v4float_uint_4 %54 %55 %57 %59 + %int_30 = OpConstant %int 30 + %int_3 = OpConstant %int 3 + %uint_1 = OpConstant %uint 1 + %uint_0 = OpConstant %uint 0 + %float_20 = OpConstant %float 20 + %uint_2 = OpConstant %uint 2 + %97 = OpConstantComposite %v4float %float_20 %float_20 %float_20 %float_20 + %float_30 = OpConstant %float 30 + %99 = OpConstantComposite %v4float %float_30 %float_30 %float_30 %float_30 + %float_50 = OpConstant %float 50 + %101 = OpConstantComposite %v4float %float_50 %float_50 %float_50 %float_50 + %float_60 = OpConstant %float 60 + %103 = OpConstantComposite %v4float %float_60 %float_60 %float_60 %float_60 + %104 = OpConstantComposite %_arr_v4float_uint_4 %97 %99 %101 %103 + %main = OpFunction %void None %3 + %5 = OpLabel + %indexable = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 +%indexable_0 = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 +%indexable_1 = OpVariable %_ptr_Function__arr_float_uint_16 Function %16 + %foo = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %foobar = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %baz = OpVariable %_ptr_Function__arr_v4float_uint_4 Function %60 + %20 = OpLoad %int %index + %24 = OpAccessChain %_ptr_Function_float %indexable %20 + %25 = OpLoad %float %24 + OpStore %FragColor %25 + %26 = OpLoad %int %index + %29 = OpSLessThan %bool %26 %int_10 + OpSelectionMerge %31 None + OpBranchConditional %29 %30 %40 + %30 = OpLabel + %32 = OpLoad %int %index + %34 = OpBitwiseXor %int %32 %int_1 + %36 = OpAccessChain %_ptr_Function_float %indexable_0 %34 + %37 = OpLoad %float %36 + %38 = OpLoad %float %FragColor + %39 = OpFAdd %float %38 %37 + OpStore %FragColor %39 + OpBranch %31 + %40 = OpLabel + %41 = OpLoad %int %index + %42 = OpBitwiseAnd %int %41 %int_1 + %44 = OpAccessChain %_ptr_Function_float %indexable_1 %42 + %45 = OpLoad %float %44 + %46 = OpLoad %float %FragColor + %47 = OpFAdd %float %46 %45 + OpStore %FragColor %47 + OpBranch %31 + %31 = OpLabel + %61 = OpLoad %int %index + %63 = OpSGreaterThan %bool %61 %int_30 + OpSelectionMerge %65 None + OpBranchConditional %63 %64 %74 + %64 = OpLabel + %66 = OpLoad %int %index + %68 = OpBitwiseAnd %int %66 %int_3 + %70 = OpAccessChain %_ptr_Function_float %foo %68 %uint_1 + %71 = OpLoad %float %70 + %72 = OpLoad %float %FragColor + %73 = OpFAdd %float %72 %71 + OpStore %FragColor %73 + OpBranch %65 + %74 = OpLabel + %75 = OpLoad %int %index + %76 = OpBitwiseAnd %int %75 %int_1 + %78 = OpAccessChain %_ptr_Function_float %foo %76 %uint_0 + %79 = OpLoad %float %78 + %80 = OpLoad %float %FragColor + %81 = OpFAdd %float %80 %79 + OpStore %FragColor %81 + OpBranch %65 + %65 = OpLabel + %83 = OpLoad %int %index + %84 = OpSGreaterThan %bool %83 %int_30 + OpSelectionMerge %86 None + OpBranchConditional %84 %85 %86 + %85 = OpLabel + %89 = OpAccessChain %_ptr_Function_float %foobar %int_1 %uint_2 + OpStore %89 %float_20 + OpBranch %86 + %86 = OpLabel + %90 = OpLoad %int %index + %91 = OpBitwiseAnd %int %90 %int_3 + %92 = OpAccessChain %_ptr_Function_float %foobar %91 %uint_2 + %93 = OpLoad %float %92 + %94 = OpLoad %float %FragColor + %95 = OpFAdd %float %94 %93 + OpStore %FragColor %95 + OpStore %baz %104 + %105 = OpLoad %int %index + %106 = OpBitwiseAnd %int %105 %int_3 + %107 = OpAccessChain %_ptr_Function_float %baz %106 %uint_2 + %108 = OpLoad %float %107 + %109 = OpLoad %float %FragColor + %110 = OpFAdd %float %109 %108 + OpStore %FragColor %110 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag new file mode 100644 index 0000000000..0c3833e7ec --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-array-without-sampler.asm.frag @@ -0,0 +1,86 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 63 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %sample_from_func_s21_4__ "sample_from_func(s21[4];" + OpName %uSampler "uSampler" + OpName %sample_one_from_func_s21_ "sample_one_from_func(s21;" + OpName %uSampler_0 "uSampler" + OpName %Registers "Registers" + OpMemberName %Registers 0 "index" + OpName %registers "registers" + OpName %FragColor "FragColor" + OpName %uSampler_1 "uSampler" + OpMemberDecorate %Registers 0 Offset 0 + OpDecorate %Registers Block + OpDecorate %FragColor Location 0 + OpDecorate %uSampler_1 DescriptorSet 0 + OpDecorate %uSampler_1 Binding 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %7 = OpTypeImage %float 2D 0 0 0 1 Unknown + %uint = OpTypeInt 32 0 + %uint_4 = OpConstant %uint 4 +%_arr_8_uint_4 = OpTypeArray %7 %uint_4 +%_ptr_UniformConstant__arr_8_uint_4 = OpTypePointer UniformConstant %_arr_8_uint_4 + %v4float = OpTypeVector %float 4 + %14 = OpTypeFunction %v4float %_ptr_UniformConstant__arr_8_uint_4 +%_ptr_UniformConstant_8 = OpTypePointer UniformConstant %7 + %19 = OpTypeFunction %v4float %_ptr_UniformConstant_8 + %int = OpTypeInt 32 1 + %Registers = OpTypeStruct %int +%_ptr_PushConstant_Registers = OpTypePointer PushConstant %Registers + %registers = OpVariable %_ptr_PushConstant_Registers PushConstant + %int_0 = OpConstant %int 0 +%_ptr_PushConstant_int = OpTypePointer PushConstant %int + %v2int = OpTypeVector %int 2 + %int_4 = OpConstant %int 4 + %35 = OpConstantComposite %v2int %int_4 %int_4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %uSampler_1 = OpVariable %_ptr_UniformConstant__arr_8_uint_4 UniformConstant + %int_10 = OpConstant %int 10 + %53 = OpConstantComposite %v2int %int_10 %int_10 + %main = OpFunction %void None %3 + %5 = OpLabel + %48 = OpAccessChain %_ptr_PushConstant_int %registers %int_0 + %49 = OpLoad %int %48 + %50 = OpAccessChain %_ptr_UniformConstant_8 %uSampler_1 %49 + %51 = OpLoad %7 %50 + %55 = OpImageFetch %v4float %51 %53 Lod %int_0 + %56 = OpFunctionCall %v4float %sample_from_func_s21_4__ %uSampler_1 + %57 = OpFAdd %v4float %55 %56 + %58 = OpAccessChain %_ptr_PushConstant_int %registers %int_0 + %59 = OpLoad %int %58 + %60 = OpAccessChain %_ptr_UniformConstant_8 %uSampler_1 %59 + %61 = OpFunctionCall %v4float %sample_one_from_func_s21_ %60 + %62 = OpFAdd %v4float %57 %61 + OpStore %FragColor %62 + OpReturn + OpFunctionEnd +%sample_from_func_s21_4__ = OpFunction %v4float None %14 + %uSampler = OpFunctionParameter %_ptr_UniformConstant__arr_8_uint_4 + %17 = OpLabel + %29 = OpAccessChain %_ptr_PushConstant_int %registers %int_0 + %30 = OpLoad %int %29 + %31 = OpAccessChain %_ptr_UniformConstant_8 %uSampler %30 + %32 = OpLoad %7 %31 + %37 = OpImageFetch %v4float %32 %35 Lod %int_0 + OpReturnValue %37 + OpFunctionEnd +%sample_one_from_func_s21_ = OpFunction %v4float None %19 + %uSampler_0 = OpFunctionParameter %_ptr_UniformConstant_8 + %22 = OpLabel + %40 = OpLoad %7 %uSampler_0 + %42 = OpImageFetch %v4float %40 %35 Lod %int_0 + OpReturnValue %42 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag index 9c08fc2830..e6776eaf5e 100644 --- a/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag +++ b/deps/SPIRV-Cross/shaders/asm/frag/sampler-buffer-without-sampler.asm.frag @@ -5,6 +5,7 @@ ; Schema: 0 OpCapability Shader OpCapability SampledBuffer + OpCapability ImageBuffer %1 = OpExtInstImport "GLSL.std.450" OpMemoryModel Logical GLSL450 OpEntryPoint Fragment %main "main" %_entryPointOutput @@ -17,6 +18,8 @@ OpName %_entryPointOutput "@entryPointOutput" OpDecorate %RWTex DescriptorSet 0 OpDecorate %Tex DescriptorSet 0 + OpDecorate %RWTex Binding 0 + OpDecorate %Tex Binding 1 OpDecorate %_entryPointOutput Location 0 %void = OpTypeVoid %3 = OpTypeFunction %void diff --git a/deps/SPIRV-Cross/shaders/asm/frag/selection-merge-to-continue.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/selection-merge-to-continue.asm.frag new file mode 100644 index 0000000000..ecc491594f --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/selection-merge-to-continue.asm.frag @@ -0,0 +1,85 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 55 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %v0 + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %i "i" + OpName %v0 "v0" + OpDecorate %FragColor Location 0 + OpDecorate %v0 Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %float_1 = OpConstant %float 1 + %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool +%_ptr_Input_v4float = OpTypePointer Input %v4float + %v0 = OpVariable %_ptr_Input_v4float Input + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Input_float = OpTypePointer Input %float + %float_20 = OpConstant %float 20 + %int_3 = OpConstant %int 3 + %int_1 = OpConstant %int 1 + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + OpStore %FragColor %11 + OpStore %i %int_0 + OpBranch %16 + %16 = OpLabel + OpLoopMerge %18 %19 None + OpBranch %20 + %20 = OpLabel + %21 = OpLoad %int %i + %24 = OpSLessThan %bool %21 %int_4 + OpBranchConditional %24 %17 %18 + %17 = OpLabel + %30 = OpAccessChain %_ptr_Input_float %v0 %uint_0 + %31 = OpLoad %float %30 + %33 = OpFOrdEqual %bool %31 %float_20 + OpSelectionMerge %19 None + OpBranchConditional %33 %34 %44 + %34 = OpLabel + %36 = OpLoad %int %i + %38 = OpBitwiseAnd %int %36 %int_3 + %39 = OpAccessChain %_ptr_Input_float %v0 %38 + %40 = OpLoad %float %39 + %41 = OpLoad %v4float %FragColor + %42 = OpCompositeConstruct %v4float %40 %40 %40 %40 + %43 = OpFAdd %v4float %41 %42 + OpStore %FragColor %43 + OpBranch %19 + %44 = OpLabel + %45 = OpLoad %int %i + %47 = OpBitwiseAnd %int %45 %int_1 + %48 = OpAccessChain %_ptr_Input_float %v0 %47 + %49 = OpLoad %float %48 + %50 = OpLoad %v4float %FragColor + %51 = OpCompositeConstruct %v4float %49 %49 %49 %49 + %52 = OpFAdd %v4float %50 %51 + OpStore %FragColor %52 + OpBranch %19 + %19 = OpLabel + %53 = OpLoad %int %i + %54 = OpIAdd %int %53 %int_1 + OpStore %i %54 + OpBranch %16 + %18 = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/srem.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/srem.asm.frag new file mode 100644 index 0000000000..c6f8e27cbd --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/srem.asm.frag @@ -0,0 +1,43 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 2 +; Bound: 23 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %vA %vB + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %vA "vA" + OpName %vB "vB" + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + OpDecorate %vA Flat + OpDecorate %vA Location 0 + OpDecorate %vB Flat + OpDecorate %vB Location 1 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %int = OpTypeInt 32 1 + %v4int = OpTypeVector %int 4 +%_ptr_Input_v4int = OpTypePointer Input %v4int + %vA = OpVariable %_ptr_Input_v4int Input + %vB = OpVariable %_ptr_Input_v4int Input + %main = OpFunction %void None %3 + %5 = OpLabel + %14 = OpLoad %v4int %vA + %16 = OpLoad %v4int %vB + %17 = OpLoad %v4int %vA + %18 = OpLoad %v4int %vB + %19 = OpSRem %v4int %17 %18 + %20 = OpConvertSToF %v4float %19 + OpStore %FragColor %20 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/switch-label-shared-block.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/switch-label-shared-block.asm.frag new file mode 100644 index 0000000000..8f55bcf536 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/switch-label-shared-block.asm.frag @@ -0,0 +1,45 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 28 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %vIndex %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource ESSL 310 + OpName %main "main" + OpName %vIndex "vIndex" + OpName %FragColor "FragColor" + OpDecorate %vIndex RelaxedPrecision + OpDecorate %vIndex Flat + OpDecorate %vIndex Location 0 + OpDecorate %13 RelaxedPrecision + OpDecorate %FragColor RelaxedPrecision + OpDecorate %FragColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %float_8 = OpConstant %float 8 + %int = OpTypeInt 32 1 +%_ptr_Input_int = OpTypePointer Input %int + %vIndex = OpVariable %_ptr_Input_int Input + %float_1 = OpConstant %float 1 + %float_3 = OpConstant %float 3 +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %13 = OpLoad %int %vIndex + OpSelectionMerge %17 None + OpSwitch %13 %15 0 %14 2 %14 1 %15 8 %17 + %15 = OpLabel + OpBranch %17 + %14 = OpLabel + OpBranch %17 + %17 = OpLabel + %27 = OpPhi %float %float_3 %15 %float_1 %14 %float_8 %5 + OpStore %FragColor %27 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/switch-merge-to-continue.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/switch-merge-to-continue.asm.frag new file mode 100644 index 0000000000..94ef5f538f --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/switch-merge-to-continue.asm.frag @@ -0,0 +1,85 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 57 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %v0 + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %i "i" + OpName %v0 "v0" + OpDecorate %FragColor Location 0 + OpDecorate %v0 Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %float_1 = OpConstant %float 1 + %11 = OpConstantComposite %v4float %float_1 %float_1 %float_1 %float_1 + %int = OpTypeInt 32 1 +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_4 = OpConstant %int 4 + %bool = OpTypeBool + %uint = OpTypeInt 32 0 + %uint_0 = OpConstant %uint 0 +%_ptr_Output_float = OpTypePointer Output %float + %float_3 = OpConstant %float 3 + %uint_1 = OpConstant %uint 1 + %uint_2 = OpConstant %uint 2 + %int_1 = OpConstant %int 1 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %v0 = OpVariable %_ptr_Input_v4float Input + %main = OpFunction %void None %3 + %5 = OpLabel + %i = OpVariable %_ptr_Function_int Function + OpStore %FragColor %11 + OpStore %i %int_0 + OpBranch %16 + %16 = OpLabel + OpLoopMerge %18 %19 None + OpBranch %20 + %20 = OpLabel + %21 = OpLoad %int %i + %24 = OpSLessThan %bool %21 %int_4 + OpBranchConditional %24 %17 %18 + %17 = OpLabel + %25 = OpLoad %int %i + OpSelectionMerge %19 None + OpSwitch %25 %28 0 %26 1 %27 + %28 = OpLabel + %46 = OpAccessChain %_ptr_Output_float %FragColor %uint_2 + %47 = OpLoad %float %46 + %48 = OpFAdd %float %47 %float_3 + %49 = OpAccessChain %_ptr_Output_float %FragColor %uint_2 + OpStore %49 %48 + OpBranch %19 + %26 = OpLabel + %33 = OpAccessChain %_ptr_Output_float %FragColor %uint_0 + %34 = OpLoad %float %33 + %35 = OpFAdd %float %34 %float_1 + %36 = OpAccessChain %_ptr_Output_float %FragColor %uint_0 + OpStore %36 %35 + OpBranch %19 + %27 = OpLabel + %40 = OpAccessChain %_ptr_Output_float %FragColor %uint_1 + %41 = OpLoad %float %40 + %42 = OpFAdd %float %41 %float_3 + %43 = OpAccessChain %_ptr_Output_float %FragColor %uint_1 + OpStore %43 %42 + OpBranch %19 + %19 = OpLabel + %52 = OpLoad %int %i + %54 = OpIAdd %int %52 %int_1 + OpStore %i %54 + OpBranch %16 + %18 = OpLabel + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/temporary-name-alias.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/temporary-name-alias.asm.frag new file mode 100644 index 0000000000..fc3c0c362b --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/temporary-name-alias.asm.frag @@ -0,0 +1,48 @@ +; SPIR-V +; Version: 1.2 +; Generator: Khronos; 0 +; Bound: 51 +; Schema: 0 + OpCapability Linkage + OpCapability Shader + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %EntryPoint_Main "main" + OpExecutionMode %EntryPoint_Main OriginUpperLeft + OpSource Unknown 100 + OpName %mat3 "mat3" + OpName %constituent "constituent" + OpName %constituent_0 "constituent" + OpName %constituent_1 "constituent" + OpName %constituent_2 "constituent" + OpName %constituent_3 "constituent" + OpName %constituent_4 "constituent" + OpName %constituent_5 "constituent" + OpName %constituent_6 "constituent" + OpName %EntryPoint_Main "EntryPoint_Main" + %void = OpTypeVoid +%_ptr_Function_void = OpTypePointer Function %void + %float = OpTypeFloat 32 + %int = OpTypeInt 32 1 + %v3float = OpTypeVector %float 3 +%mat3v3float = OpTypeMatrix %v3float 3 +%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float + %14 = OpTypeFunction %void + %int_0 = OpConstant %int 0 + %int_1 = OpConstant %int 1 +%EntryPoint_Main = OpFunction %void None %14 + %45 = OpLabel + %mat3 = OpVariable %_ptr_Function_mat3v3float Function +%constituent = OpConvertSToF %float %int_0 +%constituent_0 = OpCompositeConstruct %v3float %constituent %constituent %constituent +%constituent_1 = OpCompositeConstruct %v3float %constituent %constituent %constituent +%constituent_2 = OpCompositeConstruct %v3float %constituent %constituent %constituent + %25 = OpCompositeConstruct %mat3v3float %constituent_0 %constituent_1 %constituent_2 + OpStore %mat3 %25 +%constituent_3 = OpConvertSToF %float %int_1 +%constituent_4 = OpCompositeConstruct %v3float %constituent_3 %constituent_3 %constituent_3 +%constituent_5 = OpCompositeConstruct %v3float %constituent_3 %constituent_3 %constituent_3 +%constituent_6 = OpCompositeConstruct %v3float %constituent_3 %constituent_3 %constituent_3 + %30 = OpCompositeConstruct %mat3v3float %constituent_4 %constituent_5 %constituent_6 + OpStore %mat3 %30 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/texel-fetch-no-lod.asm.frag b/deps/SPIRV-Cross/shaders/asm/frag/texel-fetch-no-lod.asm.frag new file mode 100644 index 0000000000..53dc63809c --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/texel-fetch-no-lod.asm.frag @@ -0,0 +1,46 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 26 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %FragColor %gl_FragCoord + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %FragColor "FragColor" + OpName %uTexture "uTexture" + OpName %gl_FragCoord "gl_FragCoord" + OpDecorate %FragColor Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 0 + OpDecorate %gl_FragCoord BuiltIn FragCoord + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Output_v4float = OpTypePointer Output %v4float + %FragColor = OpVariable %_ptr_Output_v4float Output + %10 = OpTypeImage %float 2D 0 0 0 1 Unknown + %11 = OpTypeSampledImage %10 +%_ptr_UniformConstant_11 = OpTypePointer UniformConstant %11 + %uTexture = OpVariable %_ptr_UniformConstant_11 UniformConstant +%_ptr_Input_v4float = OpTypePointer Input %v4float +%gl_FragCoord = OpVariable %_ptr_Input_v4float Input + %v2float = OpTypeVector %float 2 + %int = OpTypeInt 32 1 + %v2int = OpTypeVector %int 2 + %int_0 = OpConstant %int 0 + %main = OpFunction %void None %3 + %5 = OpLabel + %14 = OpLoad %11 %uTexture + %18 = OpLoad %v4float %gl_FragCoord + %19 = OpVectorShuffle %v2float %18 %18 0 1 + %22 = OpConvertFToS %v2int %19 + %24 = OpImage %10 %14 + %25 = OpImageFetch %v4float %24 %22 + OpStore %FragColor %25 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/frag/unknown-depth-state.asm.vk.frag b/deps/SPIRV-Cross/shaders/asm/frag/unknown-depth-state.asm.vk.frag new file mode 100644 index 0000000000..89036f0eb2 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/frag/unknown-depth-state.asm.vk.frag @@ -0,0 +1,71 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 44 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Fragment %main "main" %vUV %FragColor + OpExecutionMode %main OriginUpperLeft + OpSource GLSL 450 + OpName %main "main" + OpName %sample_combined_ "sample_combined(" + OpName %sample_separate_ "sample_separate(" + OpName %uShadow "uShadow" + OpName %vUV "vUV" + OpName %uTexture "uTexture" + OpName %uSampler "uSampler" + OpName %FragColor "FragColor" + OpDecorate %uShadow DescriptorSet 0 + OpDecorate %uShadow Binding 0 + OpDecorate %vUV Location 0 + OpDecorate %uTexture DescriptorSet 0 + OpDecorate %uTexture Binding 1 + OpDecorate %uSampler DescriptorSet 0 + OpDecorate %uSampler Binding 2 + OpDecorate %FragColor Location 0 + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %7 = OpTypeFunction %float + %12 = OpTypeImage %float 2D 2 0 0 1 Unknown + %13 = OpTypeSampledImage %12 +%_ptr_UniformConstant_13 = OpTypePointer UniformConstant %13 + %uShadow = OpVariable %_ptr_UniformConstant_13 UniformConstant + %v3float = OpTypeVector %float 3 +%_ptr_Input_v3float = OpTypePointer Input %v3float + %vUV = OpVariable %_ptr_Input_v3float Input +%_ptr_UniformConstant_25 = OpTypePointer UniformConstant %12 + %uTexture = OpVariable %_ptr_UniformConstant_25 UniformConstant + %29 = OpTypeSampler +%_ptr_UniformConstant_29 = OpTypePointer UniformConstant %29 + %uSampler = OpVariable %_ptr_UniformConstant_29 UniformConstant +%_ptr_Output_float = OpTypePointer Output %float + %FragColor = OpVariable %_ptr_Output_float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %41 = OpFunctionCall %float %sample_combined_ + %42 = OpFunctionCall %float %sample_separate_ + %43 = OpFAdd %float %41 %42 + OpStore %FragColor %43 + OpReturn + OpFunctionEnd +%sample_combined_ = OpFunction %float None %7 + %9 = OpLabel + %16 = OpLoad %13 %uShadow + %20 = OpLoad %v3float %vUV + %21 = OpCompositeExtract %float %20 2 + %22 = OpImageSampleDrefImplicitLod %float %16 %20 %21 + OpReturnValue %22 + OpFunctionEnd +%sample_separate_ = OpFunction %float None %7 + %11 = OpLabel + %28 = OpLoad %12 %uTexture + %32 = OpLoad %29 %uSampler + %33 = OpSampledImage %13 %28 %32 + %34 = OpLoad %v3float %vUV + %35 = OpCompositeExtract %float %34 2 + %36 = OpImageSampleDrefImplicitLod %float %33 %34 %35 + OpReturnValue %36 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/geom/inout-split-access-chain-handle.asm.geom b/deps/SPIRV-Cross/shaders/asm/geom/inout-split-access-chain-handle.asm.geom new file mode 100644 index 0000000000..d011cc6967 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/geom/inout-split-access-chain-handle.asm.geom @@ -0,0 +1,90 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 42 +; Schema: 0 + OpCapability Geometry + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %gl_in %_ + OpExecutionMode %main Triangles + OpExecutionMode %main Invocations 1 + OpExecutionMode %main OutputTriangleStrip + OpExecutionMode %main OutputVertices 5 + OpSource GLSL 440 + OpName %main "main" + OpName %Data "Data" + OpMemberName %Data 0 "ApiPerspectivePosition" + OpName %Copy_struct_Data_vf41_3__ "Copy(struct-Data-vf41[3];" + OpName %inputStream "inputStream" + OpName %gl_PerVertex "gl_PerVertex" + OpMemberName %gl_PerVertex 0 "gl_Position" + OpMemberName %gl_PerVertex 1 "gl_PointSize" + OpMemberName %gl_PerVertex 2 "gl_ClipDistance" + OpName %gl_in "gl_in" + OpName %inputStream_0 "inputStream" + OpName %param "param" + OpName %gl_PerVertex_0 "gl_PerVertex" + OpMemberName %gl_PerVertex_0 0 "gl_Position" + OpMemberName %gl_PerVertex_0 1 "gl_PointSize" + OpMemberName %gl_PerVertex_0 2 "gl_ClipDistance" + OpName %_ "" + OpMemberDecorate %gl_PerVertex 0 BuiltIn Position + OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize + OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance + OpDecorate %gl_PerVertex Block + OpMemberDecorate %gl_PerVertex_0 0 BuiltIn Position + OpMemberDecorate %gl_PerVertex_0 1 BuiltIn PointSize + OpMemberDecorate %gl_PerVertex_0 2 BuiltIn ClipDistance + OpDecorate %gl_PerVertex_0 Block + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %Data = OpTypeStruct %v4float + %uint = OpTypeInt 32 0 + %uint_3 = OpConstant %uint 3 +%_arr_Data_uint_3 = OpTypeArray %Data %uint_3 +%_ptr_Function__Data = OpTypePointer Function %Data +%_ptr_Function__arr_Data_uint_3 = OpTypePointer Function %_arr_Data_uint_3 + %13 = OpTypeFunction %void %_ptr_Function__arr_Data_uint_3 + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 + %uint_1 = OpConstant %uint 1 +%_arr_float_uint_1 = OpTypeArray %float %uint_1 +%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 +%_arr_gl_PerVertex_uint_3 = OpTypeArray %gl_PerVertex %uint_3 +%_ptr_Input__arr_gl_PerVertex_uint_3 = OpTypePointer Input %_arr_gl_PerVertex_uint_3 + %gl_in = OpVariable %_ptr_Input__arr_gl_PerVertex_uint_3 Input +%_ptr_Input_v4float = OpTypePointer Input %v4float +%_ptr_Function_v4float = OpTypePointer Function %v4float +%gl_PerVertex_0 = OpTypeStruct %v4float %float %_arr_float_uint_1 +%_ptr_Output_gl_PerVertex_0 = OpTypePointer Output %gl_PerVertex_0 + %_ = OpVariable %_ptr_Output_gl_PerVertex_0 Output +%_ptr_Output_v4float = OpTypePointer Output %v4float + %main = OpFunction %void None %3 + %5 = OpLabel +%inputStream_0 = OpVariable %_ptr_Function__arr_Data_uint_3 Function + %param = OpVariable %_ptr_Function__arr_Data_uint_3 Function + %32 = OpLoad %_arr_Data_uint_3 %inputStream_0 + OpStore %param %32 + %33 = OpFunctionCall %void %Copy_struct_Data_vf41_3__ %param + %34 = OpLoad %_arr_Data_uint_3 %param + OpStore %inputStream_0 %34 + %59 = OpAccessChain %_ptr_Function__Data %inputStream_0 %int_0 + %38 = OpAccessChain %_ptr_Function_v4float %59 %int_0 + %39 = OpLoad %v4float %38 + %41 = OpAccessChain %_ptr_Output_v4float %_ %int_0 + OpStore %41 %39 + OpReturn + OpFunctionEnd +%Copy_struct_Data_vf41_3__ = OpFunction %void None %13 +%inputStream = OpFunctionParameter %_ptr_Function__arr_Data_uint_3 + %16 = OpLabel + %26 = OpAccessChain %_ptr_Input_v4float %gl_in %int_0 %int_0 + %27 = OpLoad %v4float %26 + %28 = OpAccessChain %_ptr_Function__Data %inputStream %int_0 + %29 = OpAccessChain %_ptr_Function_v4float %28 %int_0 + OpStore %29 %27 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/geom/split-access-chain-input.asm.geom b/deps/SPIRV-Cross/shaders/asm/geom/split-access-chain-input.asm.geom new file mode 100644 index 0000000000..1612c892c1 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/geom/split-access-chain-input.asm.geom @@ -0,0 +1,52 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 3 +; Bound: 23 +; Schema: 0 + OpCapability Geometry + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %gl_in + OpExecutionMode %main Triangles + OpExecutionMode %main Invocations 1 + OpExecutionMode %main OutputTriangleStrip + OpExecutionMode %main OutputVertices 3 + OpSource GLSL 440 + OpName %main "main" + OpName %position "position" + OpName %gl_PerVertex "gl_PerVertex" + OpMemberName %gl_PerVertex 0 "gl_Position" + OpMemberName %gl_PerVertex 1 "gl_PointSize" + OpMemberName %gl_PerVertex 2 "gl_ClipDistance" + OpName %gl_in "gl_in" + OpMemberDecorate %gl_PerVertex 0 BuiltIn Position + OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize + OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance + OpDecorate %gl_PerVertex Block + OpDecorate %position BuiltIn Position + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%_ptr_Function_v4float = OpTypePointer Output %v4float + %uint = OpTypeInt 32 0 + %uint_1 = OpConstant %uint 1 +%_arr_float_uint_1 = OpTypeArray %float %uint_1 +%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 + %uint_3 = OpConstant %uint 3 +%_arr_gl_PerVertex_uint_3 = OpTypeArray %gl_PerVertex %uint_3 +%ptr_Input_gl_PerVertex = OpTypePointer Input %gl_PerVertex +%_ptr_Input__arr_gl_PerVertex_uint_3 = OpTypePointer Input %_arr_gl_PerVertex_uint_3 + %gl_in = OpVariable %_ptr_Input__arr_gl_PerVertex_uint_3 Input + %position = OpVariable %_ptr_Function_v4float Output + %int = OpTypeInt 32 1 + %int_0 = OpConstant %int 0 +%_ptr_Input_v4float = OpTypePointer Input %v4float + %main = OpFunction %void None %3 + %5 = OpLabel + %21 = OpAccessChain %ptr_Input_gl_PerVertex %gl_in %int_0 + %22 = OpAccessChain %_ptr_Input_v4float %21 %int_0 + %23 = OpLoad %v4float %22 + OpStore %position %23 + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/geom/store-uint-layer.invalid.asm.geom b/deps/SPIRV-Cross/shaders/asm/geom/store-uint-layer.invalid.asm.geom new file mode 100644 index 0000000000..550fc4e990 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/geom/store-uint-layer.invalid.asm.geom @@ -0,0 +1,130 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 74 +; Schema: 0 + OpCapability Geometry + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Geometry %main "main" %stream_pos %stream_layer %input_pos + OpExecutionMode %main Triangles + OpExecutionMode %main Invocations 1 + OpExecutionMode %main OutputTriangleStrip + OpExecutionMode %main OutputVertices 3 + OpSource HLSL 500 + OpName %main "main" + OpName %VertexOutput "VertexOutput" + OpMemberName %VertexOutput 0 "pos" + OpName %GeometryOutput "GeometryOutput" + OpMemberName %GeometryOutput 0 "pos" + OpMemberName %GeometryOutput 1 "layer" + OpName %_main_struct_VertexOutput_vf41_3__struct_GeometryOutput_vf4_u11_ "@main(struct-VertexOutput-vf41[3];struct-GeometryOutput-vf4-u11;" + OpName %input "input" + OpName %stream "stream" + OpName %output "output" + OpName %v "v" + OpName %stream_pos "stream.pos" + OpName %stream_layer "stream.layer" + OpName %input_0 "input" + OpName %input_pos "input.pos" + OpName %stream_0 "stream" + OpName %param "param" + OpName %param_0 "param" + OpDecorate %stream_pos BuiltIn Position + OpDecorate %stream_layer BuiltIn Layer + OpDecorate %input_pos BuiltIn Position + %void = OpTypeVoid + %3 = OpTypeFunction %void + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 +%VertexOutput = OpTypeStruct %v4float + %uint = OpTypeInt 32 0 + %uint_3 = OpConstant %uint 3 +%_arr_VertexOutput_uint_3 = OpTypeArray %VertexOutput %uint_3 +%_ptr_Function__arr_VertexOutput_uint_3 = OpTypePointer Function %_arr_VertexOutput_uint_3 +%GeometryOutput = OpTypeStruct %v4float %uint +%_ptr_Function_GeometryOutput = OpTypePointer Function %GeometryOutput + %15 = OpTypeFunction %void %_ptr_Function__arr_VertexOutput_uint_3 %_ptr_Function_GeometryOutput + %int = OpTypeInt 32 1 + %int_1 = OpConstant %int 1 + %uint_1 = OpConstant %uint 1 +%_ptr_Function_uint = OpTypePointer Function %uint +%_ptr_Function_int = OpTypePointer Function %int + %int_0 = OpConstant %int 0 + %int_3 = OpConstant %int 3 + %bool = OpTypeBool +%_ptr_Function_v4float = OpTypePointer Function %v4float +%_ptr_Output_v4float = OpTypePointer Output %v4float + %stream_pos = OpVariable %_ptr_Output_v4float Output +%_ptr_Output_uint = OpTypePointer Output %uint +%stream_layer = OpVariable %_ptr_Output_uint Output +%_arr_v4float_uint_3 = OpTypeArray %v4float %uint_3 +%_ptr_Input__arr_v4float_uint_3 = OpTypePointer Input %_arr_v4float_uint_3 + %input_pos = OpVariable %_ptr_Input__arr_v4float_uint_3 Input +%_ptr_Input_v4float = OpTypePointer Input %v4float + %int_2 = OpConstant %int 2 + %main = OpFunction %void None %3 + %5 = OpLabel + %input_0 = OpVariable %_ptr_Function__arr_VertexOutput_uint_3 Function + %stream_0 = OpVariable %_ptr_Function_GeometryOutput Function + %param = OpVariable %_ptr_Function__arr_VertexOutput_uint_3 Function + %param_0 = OpVariable %_ptr_Function_GeometryOutput Function + %58 = OpAccessChain %_ptr_Input_v4float %input_pos %int_0 + %59 = OpLoad %v4float %58 + %60 = OpAccessChain %_ptr_Function_v4float %input_0 %int_0 %int_0 + OpStore %60 %59 + %61 = OpAccessChain %_ptr_Input_v4float %input_pos %int_1 + %62 = OpLoad %v4float %61 + %63 = OpAccessChain %_ptr_Function_v4float %input_0 %int_1 %int_0 + OpStore %63 %62 + %65 = OpAccessChain %_ptr_Input_v4float %input_pos %int_2 + %66 = OpLoad %v4float %65 + %67 = OpAccessChain %_ptr_Function_v4float %input_0 %int_2 %int_0 + OpStore %67 %66 + %70 = OpLoad %_arr_VertexOutput_uint_3 %input_0 + OpStore %param %70 + %72 = OpFunctionCall %void %_main_struct_VertexOutput_vf41_3__struct_GeometryOutput_vf4_u11_ %param %param_0 + %73 = OpLoad %GeometryOutput %param_0 + OpStore %stream_0 %73 + OpReturn + OpFunctionEnd +%_main_struct_VertexOutput_vf41_3__struct_GeometryOutput_vf4_u11_ = OpFunction %void None %15 + %input = OpFunctionParameter %_ptr_Function__arr_VertexOutput_uint_3 + %stream = OpFunctionParameter %_ptr_Function_GeometryOutput + %19 = OpLabel + %output = OpVariable %_ptr_Function_GeometryOutput Function + %v = OpVariable %_ptr_Function_int Function + %25 = OpAccessChain %_ptr_Function_uint %output %int_1 + OpStore %25 %uint_1 + OpStore %v %int_0 + OpBranch %29 + %29 = OpLabel + OpLoopMerge %31 %32 None + OpBranch %33 + %33 = OpLabel + %34 = OpLoad %int %v + %37 = OpSLessThan %bool %34 %int_3 + OpBranchConditional %37 %30 %31 + %30 = OpLabel + %38 = OpLoad %int %v + %40 = OpAccessChain %_ptr_Function_v4float %input %38 %int_0 + %41 = OpLoad %v4float %40 + %42 = OpAccessChain %_ptr_Function_v4float %output %int_0 + OpStore %42 %41 + %45 = OpAccessChain %_ptr_Function_v4float %output %int_0 + %46 = OpLoad %v4float %45 + OpStore %stream_pos %46 + %49 = OpAccessChain %_ptr_Function_uint %output %int_1 + %50 = OpLoad %uint %49 + OpStore %stream_layer %50 + OpEmitVertex + OpBranch %32 + %32 = OpLabel + %51 = OpLoad %int %v + %52 = OpIAdd %int %51 %int_1 + OpStore %v %52 + OpBranch %29 + %31 = OpLabel + OpEndPrimitive + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc b/deps/SPIRV-Cross/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc similarity index 100% rename from deps/SPIRV-Cross/shaders/asm/tesc/tess-fixed-input-array-builtin-array.asm.tesc rename to deps/SPIRV-Cross/shaders/asm/tesc/tess-fixed-input-array-builtin-array.invalid.asm.tesc diff --git a/deps/SPIRV-Cross/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert b/deps/SPIRV-Cross/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert new file mode 100644 index 0000000000..b566a3d1a0 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/vert/spec-constant-op-composite.asm.vk.vert @@ -0,0 +1,98 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 1 +; Bound: 58 +; Schema: 0 + OpCapability Shader + OpCapability ClipDistance + OpCapability CullDistance + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %4 "main" %52 %output + OpSource GLSL 450 + OpName %4 "main" + OpName %9 "pos" + OpName %50 "gl_PerVertex" + OpMemberName %50 0 "gl_Position" + OpMemberName %50 1 "gl_PointSize" + OpMemberName %50 2 "gl_ClipDistance" + OpMemberName %50 3 "gl_CullDistance" + OpName %52 "" + OpDecorate %13 SpecId 201 + OpDecorate %24 SpecId 202 + OpMemberDecorate %50 0 BuiltIn Position + OpMemberDecorate %50 1 BuiltIn PointSize + OpMemberDecorate %50 2 BuiltIn ClipDistance + OpMemberDecorate %50 3 BuiltIn CullDistance + OpDecorate %50 Block + OpDecorate %57 SpecId 200 + OpDecorate %output Flat + OpDecorate %output Location 0 + %2 = OpTypeVoid + %3 = OpTypeFunction %2 + %6 = OpTypeFloat 32 + %7 = OpTypeVector %6 4 + %8 = OpTypePointer Function %7 + %10 = OpConstant %6 0 + %11 = OpConstantComposite %7 %10 %10 %10 %10 + %12 = OpTypeInt 32 1 + %int_ptr = OpTypePointer Output %12 + %13 = OpSpecConstant %12 -10 + %14 = OpConstant %12 2 + %15 = OpSpecConstantOp %12 IAdd %13 %14 + %17 = OpTypeInt 32 0 + %18 = OpConstant %17 1 + %19 = OpTypePointer Function %6 + %24 = OpSpecConstant %17 100 + %25 = OpConstant %17 5 + %26 = OpSpecConstantOp %17 UMod %24 %25 + %28 = OpConstant %17 2 + %33 = OpConstant %12 20 + %34 = OpConstant %12 30 + %35 = OpTypeVector %12 4 + %36 = OpSpecConstantComposite %35 %33 %34 %15 %15 + %40 = OpTypeVector %12 2 + %41 = OpSpecConstantOp %40 VectorShuffle %36 %36 1 0 + %foo = OpSpecConstantOp %12 CompositeExtract %36 1 + %42 = OpTypeVector %6 2 + %49 = OpTypeArray %6 %18 + %50 = OpTypeStruct %7 %6 %49 %49 + %51 = OpTypePointer Output %50 + %52 = OpVariable %51 Output + %output = OpVariable %int_ptr Output + %53 = OpConstant %12 0 + %55 = OpTypePointer Output %7 + %57 = OpSpecConstant %6 3.14159 + %4 = OpFunction %2 None %3 + %5 = OpLabel + %9 = OpVariable %8 Function + OpStore %9 %11 + %16 = OpConvertSToF %6 %15 + %20 = OpAccessChain %19 %9 %18 + %21 = OpLoad %6 %20 + %22 = OpFAdd %6 %21 %16 + %23 = OpAccessChain %19 %9 %18 + OpStore %23 %22 + %27 = OpConvertUToF %6 %26 + %29 = OpAccessChain %19 %9 %28 + %30 = OpLoad %6 %29 + %31 = OpFAdd %6 %30 %27 + %32 = OpAccessChain %19 %9 %28 + OpStore %32 %31 + %37 = OpConvertSToF %7 %36 + %38 = OpLoad %7 %9 + %39 = OpFAdd %7 %38 %37 + OpStore %9 %39 + %43 = OpConvertSToF %42 %41 + %44 = OpLoad %7 %9 + %45 = OpVectorShuffle %42 %44 %44 0 1 + %46 = OpFAdd %42 %45 %43 + %47 = OpLoad %7 %9 + %48 = OpVectorShuffle %7 %47 %46 4 5 2 3 + OpStore %9 %48 + %54 = OpLoad %7 %9 + %56 = OpAccessChain %55 %52 %53 + OpStore %56 %54 + OpStore %output %foo + OpReturn + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert b/deps/SPIRV-Cross/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert new file mode 100644 index 0000000000..29b0076a1e --- /dev/null +++ b/deps/SPIRV-Cross/shaders/asm/vert/uint-vertex-id-instance-id.asm.vert @@ -0,0 +1,65 @@ +; SPIR-V +; Version: 1.0 +; Generator: Khronos Glslang Reference Front End; 6 +; Bound: 36 +; Schema: 0 + OpCapability Shader + %1 = OpExtInstImport "GLSL.std.450" + OpMemoryModel Logical GLSL450 + OpEntryPoint Vertex %main "main" %vid_1 %iid_1 %_entryPointOutput + OpSource HLSL 500 + OpName %main "main" + OpName %_main_u1_u1_ "@main(u1;u1;" + OpName %vid "vid" + OpName %iid "iid" + OpName %vid_0 "vid" + OpName %vid_1 "vid" + OpName %iid_0 "iid" + OpName %iid_1 "iid" + OpName %_entryPointOutput "@entryPointOutput" + OpName %param "param" + OpName %param_0 "param" + OpDecorate %vid_1 BuiltIn VertexIndex + OpDecorate %iid_1 BuiltIn InstanceIndex + OpDecorate %_entryPointOutput BuiltIn Position + %void = OpTypeVoid + %3 = OpTypeFunction %void + %uint = OpTypeInt 32 0 +%_ptr_Function_uint = OpTypePointer Function %uint + %float = OpTypeFloat 32 + %v4float = OpTypeVector %float 4 + %10 = OpTypeFunction %v4float %_ptr_Function_uint %_ptr_Function_uint +%_ptr_Input_uint = OpTypePointer Input %uint + %vid_1 = OpVariable %_ptr_Input_uint Input + %iid_1 = OpVariable %_ptr_Input_uint Input +%_ptr_Output_v4float = OpTypePointer Output %v4float +%_entryPointOutput = OpVariable %_ptr_Output_v4float Output + %main = OpFunction %void None %3 + %5 = OpLabel + %vid_0 = OpVariable %_ptr_Function_uint Function + %iid_0 = OpVariable %_ptr_Function_uint Function + %param = OpVariable %_ptr_Function_uint Function + %param_0 = OpVariable %_ptr_Function_uint Function + %25 = OpLoad %uint %vid_1 + OpStore %vid_0 %25 + %28 = OpLoad %uint %iid_1 + OpStore %iid_0 %28 + %32 = OpLoad %uint %vid_0 + OpStore %param %32 + %34 = OpLoad %uint %iid_0 + OpStore %param_0 %34 + %35 = OpFunctionCall %v4float %_main_u1_u1_ %param %param_0 + OpStore %_entryPointOutput %35 + OpReturn + OpFunctionEnd +%_main_u1_u1_ = OpFunction %v4float None %10 + %vid = OpFunctionParameter %_ptr_Function_uint + %iid = OpFunctionParameter %_ptr_Function_uint + %14 = OpLabel + %15 = OpLoad %uint %vid + %16 = OpLoad %uint %iid + %17 = OpIAdd %uint %15 %16 + %18 = OpConvertUToF %float %17 + %19 = OpCompositeConstruct %v4float %18 %18 %18 %18 + OpReturnValue %19 + OpFunctionEnd diff --git a/deps/SPIRV-Cross/shaders/comp/rmw-matrix.comp b/deps/SPIRV-Cross/shaders/comp/rmw-matrix.comp new file mode 100644 index 0000000000..c158ab4ddd --- /dev/null +++ b/deps/SPIRV-Cross/shaders/comp/rmw-matrix.comp @@ -0,0 +1,20 @@ +#version 310 es +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer SSBO +{ + float a; + vec4 b; + mat4 c; + + float a1; + vec4 b1; + mat4 c1; +}; + +void main() +{ + a *= a1; + b *= b1; + c *= c1; +} diff --git a/deps/SPIRV-Cross/shaders/comp/struct-packing.comp b/deps/SPIRV-Cross/shaders/comp/struct-packing.comp index 53a54e4927..7a1be0478d 100644 --- a/deps/SPIRV-Cross/shaders/comp/struct-packing.comp +++ b/deps/SPIRV-Cross/shaders/comp/struct-packing.comp @@ -44,7 +44,7 @@ struct Content S4 m3s[8]; }; -layout(binding = 1, std430) buffer SSBO1 +layout(binding = 1, std430) restrict buffer SSBO1 { Content content; Content content1[2]; @@ -61,7 +61,7 @@ layout(binding = 1, std430) buffer SSBO1 float array[]; } ssbo_430; -layout(binding = 0, std140) buffer SSBO0 +layout(binding = 0, std140) restrict buffer SSBO0 { Content content; Content content1[2]; diff --git a/deps/SPIRV-Cross/shaders/desktop-only/comp/fp64.desktop.comp b/deps/SPIRV-Cross/shaders/desktop-only/comp/fp64.desktop.comp index dd488a3077..2c2d5018d1 100644 --- a/deps/SPIRV-Cross/shaders/desktop-only/comp/fp64.desktop.comp +++ b/deps/SPIRV-Cross/shaders/desktop-only/comp/fp64.desktop.comp @@ -72,7 +72,7 @@ void main() dvec3 e = cross(a.xyz, a.yzw); a = faceforward(a, a, a); a = reflect(a, a); - a = refract(a, a, a.x); + //a = refract(a, a, 1.45); dmat4 l = matrixCompMult(amat, amat); l = outerProduct(a, a); diff --git a/deps/SPIRV-Cross/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag b/deps/SPIRV-Cross/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag new file mode 100644 index 0000000000..7c75ffe1bd --- /dev/null +++ b/deps/SPIRV-Cross/shaders/desktop-only/frag/control-dependent-in-branch.desktop.frag @@ -0,0 +1,36 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(binding = 0) uniform sampler2D uSampler; +layout(location = 0) in vec4 vInput; + +void main() +{ + FragColor = vInput; + vec4 t = texture(uSampler, vInput.xy); + vec4 d0 = dFdx(vInput); + vec4 d1 = dFdy(vInput); + vec4 d2 = fwidth(vInput); + vec4 d3 = dFdxCoarse(vInput); + vec4 d4 = dFdyCoarse(vInput); + vec4 d5 = fwidthCoarse(vInput); + vec4 d6 = dFdxFine(vInput); + vec4 d7 = dFdyFine(vInput); + vec4 d8 = fwidthFine(vInput); + vec2 lod = textureQueryLod(uSampler, vInput.zw); + if (vInput.y > 10.0) + { + FragColor += t; + FragColor += d0; + FragColor += d1; + FragColor += d2; + FragColor += d3; + FragColor += d4; + FragColor += d5; + FragColor += d6; + FragColor += d7; + FragColor += d8; + FragColor += lod.xyxy; + } +} + diff --git a/deps/SPIRV-Cross/shaders/desktop-only/frag/dual-source-blending.desktop.frag b/deps/SPIRV-Cross/shaders/desktop-only/frag/dual-source-blending.desktop.frag new file mode 100644 index 0000000000..f322cf4c38 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/desktop-only/frag/dual-source-blending.desktop.frag @@ -0,0 +1,10 @@ +#version 450 + +layout(location = 0, index = 0) out vec4 FragColor0; +layout(location = 0, index = 1) out vec4 FragColor1; + +void main() +{ + FragColor0 = vec4(1.0); + FragColor1 = vec4(2.0); +} diff --git a/deps/SPIRV-Cross/shaders/desktop-only/frag/fp16.desktop.frag b/deps/SPIRV-Cross/shaders/desktop-only/frag/fp16.desktop.frag new file mode 100644 index 0000000000..f3517a92f8 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/desktop-only/frag/fp16.desktop.frag @@ -0,0 +1,151 @@ +#version 450 +#extension GL_AMD_gpu_shader_half_float : require + +layout(location = 0) in float16_t v1; +layout(location = 1) in f16vec2 v2; +layout(location = 2) in f16vec3 v3; +layout(location = 3) in f16vec4 v4; + +layout(location = 0) out float o1; +layout(location = 1) out vec2 o2; +layout(location = 2) out vec3 o3; +layout(location = 3) out vec4 o4; + +f16mat2 test_mat2(f16vec2 a, f16vec2 b, f16vec2 c, f16vec2 d) +{ + return f16mat2(a, b) * f16mat2(c, d); +} + +f16mat3 test_mat3(f16vec3 a, f16vec3 b, f16vec3 c, f16vec3 d, f16vec3 e, f16vec3 f) +{ + return f16mat3(a, b, c) * f16mat3(d, e, f); +} + +void test_constants() +{ + float16_t a = 1.0hf; + float16_t b = 1.5hf; + float16_t c = -1.5hf; // Negatives + float16_t d = (0.0hf / 0.0hf); // NaN + float16_t e = (1.0hf / 0.0hf); // +Inf + float16_t f = (-1.0hf / 0.0hf); // -Inf + float16_t g = 1014.0hf; // Large. + float16_t h = 0.000001hf; // Denormal +} + +float16_t test_result() +{ + return 1.0hf; +} + +void test_conversions() +{ + float16_t one = test_result(); + int a = int(one); + uint b = uint(one); + bool c = bool(one); + float d = float(one); + double e = double(one); + float16_t a2 = float16_t(a); + float16_t b2 = float16_t(b); + float16_t c2 = float16_t(c); + float16_t d2 = float16_t(d); + float16_t e2 = float16_t(e); +} + +void test_builtins() +{ + f16vec4 res; + res = radians(v4); + res = degrees(v4); + res = sin(v4); + res = cos(v4); + res = tan(v4); + res = asin(v4); + res = atan(v4, v3.xyzz); + res = atan(v4); + res = sinh(v4); + res = cosh(v4); + res = tanh(v4); + res = asinh(v4); + res = acosh(v4); + res = atanh(v4); + res = pow(v4, v4); + res = exp(v4); + res = log(v4); + res = exp2(v4); + res = log2(v4); + res = sqrt(v4); + res = inversesqrt(v4); + res = abs(v4); + res = sign(v4); + res = floor(v4); + res = trunc(v4); + res = round(v4); + res = roundEven(v4); + res = ceil(v4); + res = fract(v4); + res = mod(v4, v4); + f16vec4 tmp; + res = modf(v4, tmp); + res = min(v4, v4); + res = max(v4, v4); + res = clamp(v4, v4, v4); + res = mix(v4, v4, v4); + res = mix(v4, v4, lessThan(v4, v4)); + res = step(v4, v4); + res = smoothstep(v4, v4, v4); + + bvec4 btmp = isnan(v4); + btmp = isinf(v4); + res = fma(v4, v4, v4); + + ivec4 itmp; + res = frexp(v4, itmp); + res = ldexp(res, itmp); + + uint pack0 = packFloat2x16(v4.xy); + uint pack1 = packFloat2x16(v4.zw); + res = f16vec4(unpackFloat2x16(pack0), unpackFloat2x16(pack1)); + + float16_t t0 = length(v4); + t0 = distance(v4, v4); + t0 = dot(v4, v4); + f16vec3 res3 = cross(v3, v3); + res = normalize(v4); + res = faceforward(v4, v4, v4); + res = reflect(v4, v4); + res = refract(v4, v4, v1); + + btmp = lessThan(v4, v4); + btmp = lessThanEqual(v4, v4); + btmp = greaterThan(v4, v4); + btmp = greaterThanEqual(v4, v4); + btmp = equal(v4, v4); + btmp = notEqual(v4, v4); + + res = dFdx(v4); + res = dFdy(v4); + res = dFdxFine(v4); + res = dFdyFine(v4); + res = dFdxCoarse(v4); + res = dFdyCoarse(v4); + res = fwidth(v4); + res = fwidthFine(v4); + res = fwidthCoarse(v4); + + //res = interpolateAtCentroid(v4); + //res = interpolateAtSample(v4, 0); + //res = interpolateAtOffset(v4, f16vec2(0.1hf)); +} + +void main() +{ + // Basic matrix tests. + f16mat2 m0 = test_mat2(v2, v2, v3.xy, v3.xy); + f16mat3 m1 = test_mat3(v3, v3, v3, v4.xyz, v4.xyz, v4.yzw); + + test_constants(); + test_conversions(); + test_builtins(); +} diff --git a/deps/SPIRV-Cross/shaders/frag/array-lut-no-loop-variable.frag b/deps/SPIRV-Cross/shaders/frag/array-lut-no-loop-variable.frag new file mode 100644 index 0000000000..3493e0cccc --- /dev/null +++ b/deps/SPIRV-Cross/shaders/frag/array-lut-no-loop-variable.frag @@ -0,0 +1,13 @@ +#version 310 es +precision mediump float; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec4 v0; + +void main() +{ + float lut[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0); + for (int i = 0; i < 4; i++, FragColor += lut[i]) + { + } +} diff --git a/deps/SPIRV-Cross/shaders/frag/gather-dref.frag b/deps/SPIRV-Cross/shaders/frag/gather-dref.frag new file mode 100644 index 0000000000..a8aac56cb5 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/frag/gather-dref.frag @@ -0,0 +1,11 @@ +#version 310 es +precision mediump float; + +layout(binding = 0) uniform mediump sampler2DShadow uT; +layout(location = 0) in vec3 vUV; +layout(location = 0) out vec4 FragColor; + +void main() +{ + FragColor = textureGather(uT, vUV.xy, vUV.z); +} diff --git a/deps/SPIRV-Cross/shaders/frag/lut-promotion.frag b/deps/SPIRV-Cross/shaders/frag/lut-promotion.frag new file mode 100644 index 0000000000..0cdc8148f9 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/frag/lut-promotion.frag @@ -0,0 +1,44 @@ +#version 310 es +precision mediump float; +layout(location = 0) out float FragColor; +layout(location = 0) flat in int index; + +const float LUT[16] = float[]( + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0, + 1.0, 2.0, 3.0, 4.0); + +void main() +{ + // Try reading LUTs, both in branches and not branch. + FragColor = LUT[index]; + if (index < 10) + FragColor += LUT[index ^ 1]; + else + FragColor += LUT[index & 1]; + + // Not declared as a LUT, but can be promoted to one. + vec4 foo[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + if (index > 30) + { + FragColor += foo[index & 3].y; + } + else + { + FragColor += foo[index & 1].x; + } + + // Not declared as a LUT, but this cannot be promoted, because we have a partial write. + vec4 foobar[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + if (index > 30) + { + foobar[1].z = 20.0; + } + FragColor += foobar[index & 3].z; + + // Not declared as a LUT, but this cannot be promoted, because we have two complete writes. + vec4 baz[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0)); + baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0)); + FragColor += baz[index & 3].z; +} diff --git a/deps/SPIRV-Cross/shaders/frag/swizzle.frag b/deps/SPIRV-Cross/shaders/frag/swizzle.frag index 271ba6cb64..af22dd655d 100644 --- a/deps/SPIRV-Cross/shaders/frag/swizzle.frag +++ b/deps/SPIRV-Cross/shaders/frag/swizzle.frag @@ -1,7 +1,7 @@ #version 310 es precision mediump float; -layout(location = 0) uniform sampler2D samp; +layout(binding = 0) uniform sampler2D samp; layout(location = 0) out vec4 FragColor; layout(location = 1) in vec3 vNormal; layout(location = 2) in vec2 vUV; diff --git a/deps/SPIRV-Cross/shaders/legacy/fragment/explicit-lod.legacy.frag b/deps/SPIRV-Cross/shaders/legacy/fragment/explicit-lod.legacy.frag index 5a2eeb9913..abe1ef2c30 100644 --- a/deps/SPIRV-Cross/shaders/legacy/fragment/explicit-lod.legacy.frag +++ b/deps/SPIRV-Cross/shaders/legacy/fragment/explicit-lod.legacy.frag @@ -2,7 +2,7 @@ precision mediump float; -uniform sampler2D tex; +layout(binding = 0) uniform sampler2D tex; layout(location = 0) out vec4 FragColor; diff --git a/deps/SPIRV-Cross/shaders/legacy/vert/implicit-lod.legacy.vert b/deps/SPIRV-Cross/shaders/legacy/vert/implicit-lod.legacy.vert index 1f32faebdc..6065694274 100644 --- a/deps/SPIRV-Cross/shaders/legacy/vert/implicit-lod.legacy.vert +++ b/deps/SPIRV-Cross/shaders/legacy/vert/implicit-lod.legacy.vert @@ -1,6 +1,6 @@ #version 310 es -uniform sampler2D tex; +layout(binding = 0) uniform sampler2D tex; void main() { diff --git a/deps/SPIRV-Cross/shaders/vert/read-from-row-major-array.vert b/deps/SPIRV-Cross/shaders/vert/read-from-row-major-array.vert new file mode 100644 index 0000000000..792fb8e36c --- /dev/null +++ b/deps/SPIRV-Cross/shaders/vert/read-from-row-major-array.vert @@ -0,0 +1,20 @@ +#version 310 es +layout(location = 0) in highp vec4 a_position; +layout(location = 0) out mediump float v_vtxResult; + +layout(set = 0, binding = 0, std140, row_major) uniform Block +{ + highp mat2x3 var[3][4]; +}; + +mediump float compare_float (highp float a, highp float b) { return abs(a - b) < 0.05 ? 1.0 : 0.0; } +mediump float compare_vec3 (highp vec3 a, highp vec3 b) { return compare_float(a.x, b.x)*compare_float(a.y, b.y)*compare_float(a.z, b.z); } +mediump float compare_mat2x3 (highp mat2x3 a, highp mat2x3 b){ return compare_vec3(a[0], b[0])*compare_vec3(a[1], b[1]); } + +void main (void) +{ + gl_Position = a_position; + mediump float result = 1.0; + result *= compare_mat2x3(var[0][0], mat2x3(2.0, 6.0, -6.0, 0.0, 5.0, 5.0)); + v_vtxResult = result; +} diff --git a/deps/SPIRV-Cross/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp b/deps/SPIRV-Cross/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp new file mode 100644 index 0000000000..68fc74f910 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/vulkan/comp/subgroups.nocompat.invalid.vk.comp @@ -0,0 +1,125 @@ +#version 450 +#extension GL_KHR_shader_subgroup_basic : require +#extension GL_KHR_shader_subgroup_ballot : require +#extension GL_KHR_shader_subgroup_vote : require +#extension GL_KHR_shader_subgroup_shuffle : require +#extension GL_KHR_shader_subgroup_shuffle_relative : require +#extension GL_KHR_shader_subgroup_arithmetic : require +#extension GL_KHR_shader_subgroup_clustered : require +#extension GL_KHR_shader_subgroup_quad : require +layout(local_size_x = 1) in; + +layout(std430, binding = 0) buffer SSBO +{ + float FragColor; +}; + +void main() +{ + // basic + FragColor = float(gl_NumSubgroups); + FragColor = float(gl_SubgroupID); + FragColor = float(gl_SubgroupSize); + FragColor = float(gl_SubgroupInvocationID); + subgroupBarrier(); + subgroupMemoryBarrier(); + subgroupMemoryBarrierBuffer(); + subgroupMemoryBarrierShared(); + subgroupMemoryBarrierImage(); + bool elected = subgroupElect(); + + // ballot + FragColor = float(gl_SubgroupEqMask); + FragColor = float(gl_SubgroupGeMask); + FragColor = float(gl_SubgroupGtMask); + FragColor = float(gl_SubgroupLeMask); + FragColor = float(gl_SubgroupLtMask); + vec4 broadcasted = subgroupBroadcast(vec4(10.0), 8u); + vec3 first = subgroupBroadcastFirst(vec3(20.0)); + uvec4 ballot_value = subgroupBallot(true); + bool inverse_ballot_value = subgroupInverseBallot(ballot_value); + bool bit_extracted = subgroupBallotBitExtract(uvec4(10u), 8u); + uint bit_count = subgroupBallotBitCount(ballot_value); + uint inclusive_bit_count = subgroupBallotInclusiveBitCount(ballot_value); + uint exclusive_bit_count = subgroupBallotExclusiveBitCount(ballot_value); + uint lsb = subgroupBallotFindLSB(ballot_value); + uint msb = subgroupBallotFindMSB(ballot_value); + + // shuffle + uint shuffled = subgroupShuffle(10u, 8u); + uint shuffled_xor = subgroupShuffleXor(30u, 8u); + + // shuffle relative + uint shuffled_up = subgroupShuffleUp(20u, 4u); + uint shuffled_down = subgroupShuffleDown(20u, 4u); + + // vote + bool has_all = subgroupAll(true); + bool has_any = subgroupAny(true); + bool has_equal = subgroupAllEqual(true); + + // arithmetic + vec4 added = subgroupAdd(vec4(20.0)); + ivec4 iadded = subgroupAdd(ivec4(20)); + vec4 multiplied = subgroupMul(vec4(20.0)); + ivec4 imultiplied = subgroupMul(ivec4(20)); + vec4 lo = subgroupMin(vec4(20.0)); + vec4 hi = subgroupMax(vec4(20.0)); + ivec4 slo = subgroupMin(ivec4(20)); + ivec4 shi = subgroupMax(ivec4(20)); + uvec4 ulo = subgroupMin(uvec4(20)); + uvec4 uhi = subgroupMax(uvec4(20)); + uvec4 anded = subgroupAnd(ballot_value); + uvec4 ored = subgroupOr(ballot_value); + uvec4 xored = subgroupXor(ballot_value); + + added = subgroupInclusiveAdd(added); + iadded = subgroupInclusiveAdd(iadded); + multiplied = subgroupInclusiveMul(multiplied); + imultiplied = subgroupInclusiveMul(imultiplied); + lo = subgroupInclusiveMin(lo); + hi = subgroupInclusiveMax(hi); + slo = subgroupInclusiveMin(slo); + shi = subgroupInclusiveMax(shi); + ulo = subgroupInclusiveMin(ulo); + uhi = subgroupInclusiveMax(uhi); + anded = subgroupInclusiveAnd(anded); + ored = subgroupInclusiveOr(ored); + xored = subgroupInclusiveXor(ored); + added = subgroupExclusiveAdd(lo); + + added = subgroupExclusiveAdd(multiplied); + multiplied = subgroupExclusiveMul(multiplied); + iadded = subgroupExclusiveAdd(imultiplied); + imultiplied = subgroupExclusiveMul(imultiplied); + lo = subgroupExclusiveMin(lo); + hi = subgroupExclusiveMax(hi); + ulo = subgroupExclusiveMin(ulo); + uhi = subgroupExclusiveMax(uhi); + slo = subgroupExclusiveMin(slo); + shi = subgroupExclusiveMax(shi); + anded = subgroupExclusiveAnd(anded); + ored = subgroupExclusiveOr(ored); + xored = subgroupExclusiveXor(ored); + + // clustered + added = subgroupClusteredAdd(added, 4u); + multiplied = subgroupClusteredMul(multiplied, 4u); + iadded = subgroupClusteredAdd(iadded, 4u); + imultiplied = subgroupClusteredMul(imultiplied, 4u); + lo = subgroupClusteredMin(lo, 4u); + hi = subgroupClusteredMax(hi, 4u); + ulo = subgroupClusteredMin(ulo, 4u); + uhi = subgroupClusteredMax(uhi, 4u); + slo = subgroupClusteredMin(slo, 4u); + shi = subgroupClusteredMax(shi, 4u); + anded = subgroupClusteredAnd(anded, 4u); + ored = subgroupClusteredOr(ored, 4u); + xored = subgroupClusteredXor(xored, 4u); + + // quad + vec4 swap_horiz = subgroupQuadSwapHorizontal(vec4(20.0)); + vec4 swap_vertical = subgroupQuadSwapVertical(vec4(20.0)); + vec4 swap_diagonal = subgroupQuadSwapDiagonal(vec4(20.0)); + vec4 quad_broadcast = subgroupQuadBroadcast(vec4(20.0), 3u); +} diff --git a/deps/SPIRV-Cross/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag b/deps/SPIRV-Cross/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag new file mode 100644 index 0000000000..22d18a26a4 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/vulkan/frag/separate-combined-fake-overload.vk.frag @@ -0,0 +1,21 @@ +#version 450 + +layout(location = 0) out vec4 FragColor; +layout(binding = 0) uniform sampler2D uSamp; +layout(binding = 1) uniform texture2D uT; +layout(binding = 2) uniform sampler uS; + +vec4 samp(sampler2D uSamp) +{ + return texture(uSamp, vec2(0.5)); +} + +vec4 samp(texture2D T, sampler S) +{ + return texture(sampler2D(T, S), vec2(0.5)); +} + +void main() +{ + FragColor = samp(uSamp) + samp(uT, uS); +} diff --git a/deps/SPIRV-Cross/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag b/deps/SPIRV-Cross/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag new file mode 100644 index 0000000000..b3501c1d8d --- /dev/null +++ b/deps/SPIRV-Cross/shaders/vulkan/frag/separate-sampler-texture-array.vk.frag @@ -0,0 +1,42 @@ +#version 310 es +precision mediump float; + +layout(set = 0, binding = 0) uniform mediump sampler uSampler; +layout(set = 0, binding = 1) uniform mediump texture2D uTexture[4]; +layout(set = 0, binding = 2) uniform mediump texture3D uTexture3D[4]; +layout(set = 0, binding = 3) uniform mediump textureCube uTextureCube[4]; +layout(set = 0, binding = 4) uniform mediump texture2DArray uTextureArray[4]; + +layout(location = 0) out vec4 FragColor; +layout(location = 0) in vec2 vTex; +layout(location = 1) in vec3 vTex3; + +vec4 sample_func(mediump sampler samp, vec2 uv) +{ + return texture(sampler2D(uTexture[2], samp), uv); +} + +vec4 sample_func_dual(mediump sampler samp, mediump texture2D tex, vec2 uv) +{ + return texture(sampler2D(tex, samp), uv); +} + +vec4 sample_func_dual_array(mediump sampler samp, mediump texture2D tex[4], vec2 uv) +{ + return texture(sampler2D(tex[1], samp), uv); +} + +void main() +{ + vec2 off = 1.0 / vec2(textureSize(sampler2D(uTexture[1], uSampler), 0)); + vec2 off2 = 1.0 / vec2(textureSize(sampler2D(uTexture[2], uSampler), 1)); + + vec4 c0 = sample_func(uSampler, vTex + off + off2); + vec4 c1 = sample_func_dual(uSampler, uTexture[1], vTex + off + off2); + vec4 c2 = sample_func_dual_array(uSampler, uTexture, vTex + off + off2); + vec4 c3 = texture(sampler2DArray(uTextureArray[3], uSampler), vTex3); + vec4 c4 = texture(samplerCube(uTextureCube[1], uSampler), vTex3); + vec4 c5 = texture(sampler3D(uTexture3D[2], uSampler), vTex3); + + FragColor = c0 + c1 + c2 + c3 + c4 + c5; +} diff --git a/deps/SPIRV-Cross/shaders/vulkan/frag/spec-constant-ternary.vk.frag b/deps/SPIRV-Cross/shaders/vulkan/frag/spec-constant-ternary.vk.frag new file mode 100644 index 0000000000..78dccbf044 --- /dev/null +++ b/deps/SPIRV-Cross/shaders/vulkan/frag/spec-constant-ternary.vk.frag @@ -0,0 +1,9 @@ +#version 450 +layout(location = 0) out float FragColor; +layout(constant_id = 0) const uint s = 10u; +const uint f = s > 20u ? 30u : 50u; + +void main() +{ + FragColor = float(f); +} diff --git a/deps/SPIRV-Cross/spirv.hpp b/deps/SPIRV-Cross/spirv.hpp index efa1dbdf0e..1fc24fb288 100644 --- a/deps/SPIRV-Cross/spirv.hpp +++ b/deps/SPIRV-Cross/spirv.hpp @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2017 The Khronos Group Inc. +// Copyright (c) 2014-2018 The Khronos Group Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and/or associated documentation files (the "Materials"), @@ -46,12 +46,12 @@ namespace spv { typedef unsigned int Id; -#define SPV_VERSION 0x10000 -#define SPV_REVISION 10 +#define SPV_VERSION 0x10300 +#define SPV_REVISION 1 static const unsigned int MagicNumber = 0x07230203; -static const unsigned int Version = 0x00010000; -static const unsigned int Revision = 10; +static const unsigned int Version = 0x00010300; +static const unsigned int Revision = 1; static const unsigned int OpCodeMask = 0xffff; static const unsigned int WordCountShift = 16; @@ -122,6 +122,15 @@ enum ExecutionMode { ExecutionModeOutputTriangleStrip = 29, ExecutionModeVecTypeHint = 30, ExecutionModeContractionOff = 31, + ExecutionModeInitializer = 33, + ExecutionModeFinalizer = 34, + ExecutionModeSubgroupSize = 35, + ExecutionModeSubgroupsPerWorkgroup = 36, + ExecutionModeSubgroupsPerWorkgroupId = 37, + ExecutionModeLocalSizeId = 38, + ExecutionModeLocalSizeHintId = 39, + ExecutionModePostDepthCoverage = 4446, + ExecutionModeStencilRefReplacingEXT = 5027, ExecutionModeMax = 0x7fffffff, }; @@ -376,10 +385,16 @@ enum Decoration { DecorationNoContraction = 42, DecorationInputAttachmentIndex = 43, DecorationAlignment = 44, + DecorationMaxByteOffset = 45, + DecorationAlignmentId = 46, + DecorationMaxByteOffsetId = 47, + DecorationExplicitInterpAMD = 4999, DecorationOverrideCoverageNV = 5248, DecorationPassthroughNV = 5250, DecorationViewportRelativeNV = 5252, DecorationSecondaryViewportRelativeNV = 5256, + DecorationHlslCounterBufferGOOGLE = 5634, + DecorationHlslSemanticGOOGLE = 5635, DecorationMax = 0x7fffffff, }; @@ -425,21 +440,35 @@ enum BuiltIn { BuiltInSubgroupLocalInvocationId = 41, BuiltInVertexIndex = 42, BuiltInInstanceIndex = 43, + BuiltInSubgroupEqMask = 4416, BuiltInSubgroupEqMaskKHR = 4416, + BuiltInSubgroupGeMask = 4417, BuiltInSubgroupGeMaskKHR = 4417, + BuiltInSubgroupGtMask = 4418, BuiltInSubgroupGtMaskKHR = 4418, + BuiltInSubgroupLeMask = 4419, BuiltInSubgroupLeMaskKHR = 4419, + BuiltInSubgroupLtMask = 4420, BuiltInSubgroupLtMaskKHR = 4420, BuiltInBaseVertex = 4424, BuiltInBaseInstance = 4425, BuiltInDrawIndex = 4426, BuiltInDeviceIndex = 4438, BuiltInViewIndex = 4440, + BuiltInBaryCoordNoPerspAMD = 4992, + BuiltInBaryCoordNoPerspCentroidAMD = 4993, + BuiltInBaryCoordNoPerspSampleAMD = 4994, + BuiltInBaryCoordSmoothAMD = 4995, + BuiltInBaryCoordSmoothCentroidAMD = 4996, + BuiltInBaryCoordSmoothSampleAMD = 4997, + BuiltInBaryCoordPullModelAMD = 4998, + BuiltInFragStencilRefEXT = 5014, BuiltInViewportMaskNV = 5253, BuiltInSecondaryPositionNV = 5257, BuiltInSecondaryViewportMaskNV = 5258, BuiltInPositionPerViewNV = 5261, BuiltInViewportMaskPerViewNV = 5262, + BuiltInFullyCoveredEXT = 5264, BuiltInMax = 0x7fffffff, }; @@ -458,6 +487,8 @@ enum SelectionControlMask { enum LoopControlShift { LoopControlUnrollShift = 0, LoopControlDontUnrollShift = 1, + LoopControlDependencyInfiniteShift = 2, + LoopControlDependencyLengthShift = 3, LoopControlMax = 0x7fffffff, }; @@ -465,6 +496,8 @@ enum LoopControlMask { LoopControlMaskNone = 0, LoopControlUnrollMask = 0x00000001, LoopControlDontUnrollMask = 0x00000002, + LoopControlDependencyInfiniteMask = 0x00000004, + LoopControlDependencyLengthMask = 0x00000008, }; enum FunctionControlShift { @@ -538,6 +571,7 @@ enum GroupOperation { GroupOperationReduce = 0, GroupOperationInclusiveScan = 1, GroupOperationExclusiveScan = 2, + GroupOperationClusteredReduce = 3, GroupOperationMax = 0x7fffffff, }; @@ -615,6 +649,17 @@ enum Capability { CapabilityStorageImageReadWithoutFormat = 55, CapabilityStorageImageWriteWithoutFormat = 56, CapabilityMultiViewport = 57, + CapabilitySubgroupDispatch = 58, + CapabilityNamedBarrier = 59, + CapabilityPipeStorage = 60, + CapabilityGroupNonUniform = 61, + CapabilityGroupNonUniformVote = 62, + CapabilityGroupNonUniformArithmetic = 63, + CapabilityGroupNonUniformBallot = 64, + CapabilityGroupNonUniformShuffle = 65, + CapabilityGroupNonUniformShuffleRelative = 66, + CapabilityGroupNonUniformClustered = 67, + CapabilityGroupNonUniformQuad = 68, CapabilitySubgroupBallotKHR = 4423, CapabilityDrawParameters = 4427, CapabilitySubgroupVoteKHR = 4431, @@ -628,12 +673,24 @@ enum Capability { CapabilityMultiView = 4439, CapabilityVariablePointersStorageBuffer = 4441, CapabilityVariablePointers = 4442, + CapabilityAtomicStorageOps = 4445, + CapabilitySampleMaskPostDepthCoverage = 4447, + CapabilityFloat16ImageAMD = 5008, + CapabilityImageGatherBiasLodAMD = 5009, + CapabilityFragmentMaskAMD = 5010, + CapabilityStencilExportEXT = 5013, + CapabilityImageReadWriteLodAMD = 5015, CapabilitySampleMaskOverrideCoverageNV = 5249, CapabilityGeometryShaderPassthroughNV = 5251, + CapabilityShaderViewportIndexLayerEXT = 5254, CapabilityShaderViewportIndexLayerNV = 5254, CapabilityShaderViewportMaskNV = 5255, CapabilityShaderStereoViewNV = 5259, CapabilityPerViewAttributesNV = 5260, + CapabilityFragmentFullyCoveredEXT = 5265, + CapabilitySubgroupShuffleINTEL = 5568, + CapabilitySubgroupBufferBlockIOINTEL = 5569, + CapabilitySubgroupImageBlockIOINTEL = 5570, CapabilityMax = 0x7fffffff, }; @@ -932,6 +989,52 @@ enum Op { OpAtomicFlagTestAndSet = 318, OpAtomicFlagClear = 319, OpImageSparseRead = 320, + OpSizeOf = 321, + OpTypePipeStorage = 322, + OpConstantPipeStorage = 323, + OpCreatePipeFromPipeStorage = 324, + OpGetKernelLocalSizeForSubgroupCount = 325, + OpGetKernelMaxNumSubgroups = 326, + OpTypeNamedBarrier = 327, + OpNamedBarrierInitialize = 328, + OpMemoryNamedBarrier = 329, + OpModuleProcessed = 330, + OpExecutionModeId = 331, + OpDecorateId = 332, + OpGroupNonUniformElect = 333, + OpGroupNonUniformAll = 334, + OpGroupNonUniformAny = 335, + OpGroupNonUniformAllEqual = 336, + OpGroupNonUniformBroadcast = 337, + OpGroupNonUniformBroadcastFirst = 338, + OpGroupNonUniformBallot = 339, + OpGroupNonUniformInverseBallot = 340, + OpGroupNonUniformBallotBitExtract = 341, + OpGroupNonUniformBallotBitCount = 342, + OpGroupNonUniformBallotFindLSB = 343, + OpGroupNonUniformBallotFindMSB = 344, + OpGroupNonUniformShuffle = 345, + OpGroupNonUniformShuffleXor = 346, + OpGroupNonUniformShuffleUp = 347, + OpGroupNonUniformShuffleDown = 348, + OpGroupNonUniformIAdd = 349, + OpGroupNonUniformFAdd = 350, + OpGroupNonUniformIMul = 351, + OpGroupNonUniformFMul = 352, + OpGroupNonUniformSMin = 353, + OpGroupNonUniformUMin = 354, + OpGroupNonUniformFMin = 355, + OpGroupNonUniformSMax = 356, + OpGroupNonUniformUMax = 357, + OpGroupNonUniformFMax = 358, + OpGroupNonUniformBitwiseAnd = 359, + OpGroupNonUniformBitwiseOr = 360, + OpGroupNonUniformBitwiseXor = 361, + OpGroupNonUniformLogicalAnd = 362, + OpGroupNonUniformLogicalOr = 363, + OpGroupNonUniformLogicalXor = 364, + OpGroupNonUniformQuadBroadcast = 365, + OpGroupNonUniformQuadSwap = 366, OpSubgroupBallotKHR = 4421, OpSubgroupFirstInvocationKHR = 4422, OpSubgroupAllKHR = 4428, @@ -948,6 +1051,16 @@ enum Op { OpGroupSMaxNonUniformAMD = 5007, OpFragmentMaskFetchAMD = 5011, OpFragmentFetchAMD = 5012, + OpSubgroupShuffleINTEL = 5571, + OpSubgroupShuffleDownINTEL = 5572, + OpSubgroupShuffleUpINTEL = 5573, + OpSubgroupShuffleXorINTEL = 5574, + OpSubgroupBlockReadINTEL = 5575, + OpSubgroupBlockWriteINTEL = 5576, + OpSubgroupImageBlockReadINTEL = 5577, + OpSubgroupImageBlockWriteINTEL = 5578, + OpDecorateStringGOOGLE = 5632, + OpMemberDecorateStringGOOGLE = 5633, OpMax = 0x7fffffff, }; diff --git a/deps/SPIRV-Cross/spirv_cfg.cpp b/deps/SPIRV-Cross/spirv_cfg.cpp index c76698a740..aae31cae0c 100644 --- a/deps/SPIRV-Cross/spirv_cfg.cpp +++ b/deps/SPIRV-Cross/spirv_cfg.cpp @@ -226,4 +226,4 @@ void DominatorBuilder::lift_continue_block_dominator() if (back_edge_dominator) dominator = cfg.get_function().entry_block; } -} +} // namespace spirv_cross diff --git a/deps/SPIRV-Cross/spirv_cfg.hpp b/deps/SPIRV-Cross/spirv_cfg.hpp index 104e494c22..0df88e1034 100644 --- a/deps/SPIRV-Cross/spirv_cfg.hpp +++ b/deps/SPIRV-Cross/spirv_cfg.hpp @@ -114,6 +114,6 @@ private: const CFG &cfg; uint32_t dominator = 0; }; -} +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_common.hpp b/deps/SPIRV-Cross/spirv_common.hpp index b4d6ef1dca..0ea94fcb0c 100644 --- a/deps/SPIRV-Cross/spirv_common.hpp +++ b/deps/SPIRV-Cross/spirv_common.hpp @@ -19,6 +19,7 @@ #include "spirv.hpp" +#include #include #include #include @@ -27,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -90,7 +92,126 @@ void join_helper(std::ostringstream &stream, T &&t, Ts &&... ts) stream << std::forward(t); join_helper(stream, std::forward(ts)...); } -} +} // namespace inner + +class Bitset +{ +public: + Bitset() = default; + explicit inline Bitset(uint64_t lower_) + : lower(lower_) + { + } + + inline bool get(uint32_t bit) const + { + if (bit < 64) + return (lower & (1ull << bit)) != 0; + else + return higher.count(bit) != 0; + } + + inline void set(uint32_t bit) + { + if (bit < 64) + lower |= 1ull << bit; + else + higher.insert(bit); + } + + inline void clear(uint32_t bit) + { + if (bit < 64) + lower &= ~(1ull << bit); + else + higher.erase(bit); + } + + inline uint64_t get_lower() const + { + return lower; + } + + inline void reset() + { + lower = 0; + higher.clear(); + } + + inline void merge_and(const Bitset &other) + { + lower &= other.lower; + std::unordered_set tmp_set; + for (auto &v : higher) + if (other.higher.count(v) != 0) + tmp_set.insert(v); + higher = std::move(tmp_set); + } + + inline void merge_or(const Bitset &other) + { + lower |= other.lower; + for (auto &v : other.higher) + higher.insert(v); + } + + inline bool operator==(const Bitset &other) const + { + if (lower != other.lower) + return false; + + if (higher.size() != other.higher.size()) + return false; + + for (auto &v : higher) + if (other.higher.count(v) == 0) + return false; + + return true; + } + + inline bool operator!=(const Bitset &other) const + { + return !(*this == other); + } + + template + void for_each_bit(const Op &op) const + { + // TODO: Add ctz-based iteration. + for (uint32_t i = 0; i < 64; i++) + { + if (lower & (1ull << i)) + op(i); + } + + if (higher.empty()) + return; + + // Need to enforce an order here for reproducible results, + // but hitting this path should happen extremely rarely, so having this slow path is fine. + std::vector bits; + bits.reserve(higher.size()); + for (auto &v : higher) + bits.push_back(v); + std::sort(std::begin(bits), std::end(bits)); + + for (auto &v : bits) + op(v); + } + + inline bool empty() const + { + return lower == 0 && higher.empty(); + } + +private: + // The most common bits to set are all lower than 64, + // so optimize for this case. Bits spilling outside 64 go into a slower data structure. + // In almost all cases, higher data structure will not be used. + uint64_t lower = 0; + std::unordered_set higher; +}; // Helper template to avoid lots of nasty string temporary munging. template @@ -263,6 +384,7 @@ struct SPIRType : IVariant Int64, UInt64, AtomicCounter, + Half, Float, Double, Struct, @@ -361,7 +483,7 @@ struct SPIREntryPoint std::string orig_name; std::vector interface_variables; - uint64_t flags = 0; + Bitset flags; struct { uint32_t x = 0, y = 0, z = 0; @@ -456,10 +578,20 @@ struct SPIRBlock : IVariant MergeSelection }; + enum Hints + { + HintNone, + HintUnroll, + HintDontUnroll, + HintFlatten, + HintDontFlatten + }; + enum Method { MergeToSelectForLoop, - MergeToDirectForLoop + MergeToDirectForLoop, + MergeToSelectContinueForLoop }; enum ContinueBlockType @@ -487,6 +619,7 @@ struct SPIRBlock : IVariant Terminator terminator = Unknown; Merge merge = MergeNone; + Hints hint = HintNone; uint32_t next_block = 0; uint32_t merge_block = 0; uint32_t continue_block = 0; @@ -513,6 +646,10 @@ struct SPIRBlock : IVariant // Used for handling complex continue blocks which have side effects. std::vector> declare_temporary; + // Declare these temporaries, but only conditionally if this block turns out to be + // a complex loop header. + std::vector> potential_declare_temporary; + struct Case { uint32_t value; @@ -539,6 +676,11 @@ struct SPIRBlock : IVariant // fail to use a classic for-loop, // we remove these variables, and fall back to regular variables outside the loop. std::vector loop_variables; + + // Some expressions are control-flow dependent, i.e. any instruction which relies on derivatives or + // sub-group-like operations. + // Make sure that we only use these expressions in the original block. + std::vector invalidate_expressions; }; struct SPIRFunction : IVariant @@ -611,10 +753,17 @@ struct SPIRFunction : IVariant arguments.push_back({ parameter_type, id, 0u, 0u, alias_global_variable }); } + // Statements to be emitted when the function returns. + // Mostly used for lowering internal data structures onto flattened structures. + std::vector fixup_statements_out; + + // Statements to be emitted when the function begins. + // Mostly used for populating internal data structures from flattened structures. + std::vector fixup_statements_in; + bool active = false; bool flush_undeclared = true; bool do_combined_parameters = true; - bool analyzed_variable_scope = false; }; struct SPIRAccessChain : IVariant @@ -731,6 +880,7 @@ struct SPIRConstant : IVariant // Workaround for MSVC 2013, initializing an array breaks. ConstantVector() { + memset(r, 0, sizeof(r)); for (unsigned i = 0; i < 4; i++) id[i] = 0; } @@ -751,6 +901,57 @@ struct SPIRConstant : IVariant } }; + static inline float f16_to_f32(uint16_t u16_value) + { + // Based on the GLM implementation. + int s = (u16_value >> 15) & 0x1; + int e = (u16_value >> 10) & 0x1f; + int m = (u16_value >> 0) & 0x3ff; + + union { + float f32; + uint32_t u32; + } u; + + if (e == 0) + { + if (m == 0) + { + u.u32 = uint32_t(s) << 31; + return u.f32; + } + else + { + while ((m & 0x400) == 0) + { + m <<= 1; + e--; + } + + e++; + m &= ~0x400; + } + } + else if (e == 31) + { + if (m == 0) + { + u.u32 = (uint32_t(s) << 31) | 0x7f800000u; + return u.f32; + } + else + { + u.u32 = (uint32_t(s) << 31) | 0x7f800000u | (m << 13); + return u.f32; + } + } + + e += 127 - 15; + m <<= 13; + u.u32 = (uint32_t(s) << 31) | (e << 23) | m; + return u.f32; + } + inline uint32_t specialization_constant_id(uint32_t col, uint32_t row) const { return m.c[col].id[row]; @@ -766,6 +967,16 @@ struct SPIRConstant : IVariant return m.c[col].r[row].u32; } + inline uint16_t scalar_u16(uint32_t col = 0, uint32_t row = 0) const + { + return uint16_t(m.c[col].r[row].u32 & 0xffffu); + } + + inline float scalar_f16(uint32_t col = 0, uint32_t row = 0) const + { + return f16_to_f32(scalar_u16(col, row)); + } + inline float scalar_f32(uint32_t col = 0, uint32_t row = 0) const { return m.c[col].r[row].f32; @@ -808,7 +1019,7 @@ struct SPIRConstant : IVariant inline void make_null(const SPIRType &constant_type_) { - std::memset(&m, 0, sizeof(m)); + m = {}; m.columns = constant_type_.columns; for (auto &c : m.c) c.vecsize = constant_type_.vecsize; @@ -819,6 +1030,8 @@ struct SPIRConstant : IVariant { } + SPIRConstant() = default; + SPIRConstant(uint32_t constant_type_, const uint32_t *elements, uint32_t num_elements, bool specialized) : constant_type(constant_type_) , specialization(specialized) @@ -882,9 +1095,14 @@ struct SPIRConstant : IVariant uint32_t constant_type; ConstantMatrix m; - bool specialization = false; // If this constant is a specialization constant (i.e. created with OpSpecConstant*). - bool is_used_as_array_length = - false; // If this constant is used as an array length which creates specialization restrictions on some backends. + + // If this constant is a specialization constant (i.e. created with OpSpecConstant*). + bool specialization = false; + // If this constant is used as an array length which creates specialization restrictions on some backends. + bool is_used_as_array_length = false; + + // If true, this is a LUT, and should always be declared in the outer scope. + bool is_used_as_lut = false; // For composites which are constant arrays, etc. std::vector subconstants; @@ -913,9 +1131,10 @@ public: void set(std::unique_ptr val, uint32_t new_type) { holder = std::move(val); - if (type != TypeNone && type != new_type) + if (!allow_type_rewrite && type != TypeNone && type != new_type) SPIRV_CROSS_THROW("Overwriting a variant with new type."); type = new_type; + allow_type_rewrite = false; } template @@ -956,9 +1175,15 @@ public: type = TypeNone; } + void set_allow_type_rewrite() + { + allow_type_rewrite = true; + } + private: std::unique_ptr holder; uint32_t type = TypeNone; + bool allow_type_rewrite = false; }; template @@ -988,7 +1213,8 @@ struct Meta { std::string alias; std::string qualified_alias; - uint64_t decoration_flags = 0; + std::string hlsl_semantic; + Bitset decoration_flags; spv::BuiltIn builtin_type; uint32_t location = 0; uint32_t set = 0; @@ -998,6 +1224,7 @@ struct Meta uint32_t matrix_stride = 0; uint32_t input_attachment = 0; uint32_t spec_id = 0; + uint32_t index = 0; bool builtin = false; }; @@ -1014,6 +1241,11 @@ struct Meta // is not a valid identifier in any high-level language. std::string hlsl_magic_counter_buffer_name; bool hlsl_magic_counter_buffer_candidate = false; + + // For SPV_GOOGLE_hlsl_functionality1, this avoids the workaround. + bool hlsl_is_magic_counter_buffer = false; + // ID for the sibling counter buffer. + uint32_t hlsl_magic_counter_buffer = 0; }; // A user callback that remaps the type of any variable. @@ -1054,6 +1286,11 @@ public: private: uint64_t h = 0xcbf29ce484222325ull; }; + +static inline bool type_is_floating_point(const SPIRType &type) +{ + return type.basetype == SPIRType::Half || type.basetype == SPIRType::Float || type.basetype == SPIRType::Double; } +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_cpp.cpp b/deps/SPIRV-Cross/spirv_cpp.cpp index 9500195ccb..7d781e9172 100644 --- a/deps/SPIRV-Cross/spirv_cpp.cpp +++ b/deps/SPIRV-Cross/spirv_cpp.cpp @@ -53,7 +53,7 @@ void CompilerCPP::emit_interface_block(const SPIRVariable &var) string buffer_name; auto flags = meta[type.self].decoration.decoration_flags; - if (flags & (1ull << DecorationBlock)) + if (flags.get(DecorationBlock)) { emit_block_struct(type); buffer_name = to_name(type.self); @@ -115,7 +115,7 @@ void CompilerCPP::emit_push_constant_block(const SPIRVariable &var) auto &type = get(var.basetype); auto &flags = meta[var.self].decoration.decoration_flags; - if ((flags & (1ull << DecorationBinding)) || (flags & (1ull << DecorationDescriptorSet))) + if (flags.get(DecorationBinding) || flags.get(DecorationDescriptorSet)) SPIRV_CROSS_THROW("Push constant blocks cannot be compiled to GLSL with Binding or Set syntax. " "Remap to location with reflection API first or disable these decorations."); @@ -151,8 +151,8 @@ void CompilerCPP::emit_resources() { auto &type = id.get(); if (type.basetype == SPIRType::Struct && type.array.empty() && !type.pointer && - (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) == 0) + (!meta[type.self].decoration.decoration_flags.get(DecorationBlock) && + !meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) { emit_struct(type); } @@ -172,8 +172,8 @@ void CompilerCPP::emit_resources() if (var.storage != StorageClassFunction && type.pointer && type.storage == StorageClassUniform && !is_hidden_variable(var) && - (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock)))) + (meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) { emit_buffer_block(var); } @@ -300,6 +300,7 @@ string CompilerCPP::compile() backend.explicit_struct_type = true; backend.use_initializer_list = true; + build_function_control_flow_graphs_and_analyze(); update_active_builtins(); uint32_t pass_count = 0; @@ -317,7 +318,7 @@ string CompilerCPP::compile() emit_header(); emit_resources(); - emit_function(get(entry_point), 0); + emit_function(get(entry_point), Bitset()); pass_count++; } while (force_recompile); @@ -373,7 +374,7 @@ void CompilerCPP::emit_c_linkage() end_scope(); } -void CompilerCPP::emit_function_prototype(SPIRFunction &func, uint64_t) +void CompilerCPP::emit_function_prototype(SPIRFunction &func, const Bitset &) { if (func.self != entry_point) add_function_overload(func); diff --git a/deps/SPIRV-Cross/spirv_cpp.hpp b/deps/SPIRV-Cross/spirv_cpp.hpp index 57f815f3c0..a61dc8ec3c 100644 --- a/deps/SPIRV-Cross/spirv_cpp.hpp +++ b/deps/SPIRV-Cross/spirv_cpp.hpp @@ -51,7 +51,7 @@ public: private: void emit_header() override; void emit_c_linkage(); - void emit_function_prototype(SPIRFunction &func, uint64_t return_flags) override; + void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; void emit_resources(); void emit_buffer_block(const SPIRVariable &type) override; @@ -72,6 +72,6 @@ private: std::string interface_name; }; -} +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_cross.cpp b/deps/SPIRV-Cross/spirv_cross.cpp index 3342aaabe4..dd2a44ca33 100644 --- a/deps/SPIRV-Cross/spirv_cross.cpp +++ b/deps/SPIRV-Cross/spirv_cross.cpp @@ -101,10 +101,16 @@ bool Compiler::variable_storage_is_aliased(const SPIRVariable &v) { auto &type = get(v.basetype); bool ssbo = v.storage == StorageClassStorageBuffer || - ((meta[type.self].decoration.decoration_flags & (1ull << DecorationBufferBlock)) != 0); + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); bool image = type.basetype == SPIRType::Image; bool counter = type.basetype == SPIRType::AtomicCounter; - bool is_restrict = (meta[v.self].decoration.decoration_flags & (1ull << DecorationRestrict)) != 0; + + bool is_restrict; + if (ssbo) + is_restrict = get_buffer_block_flags(v).get(DecorationRestrict); + else + is_restrict = has_decoration(v.self, DecorationRestrict); + return !is_restrict && (ssbo || image || counter); } @@ -188,7 +194,12 @@ string Compiler::to_name(uint32_t id, bool allow_alias) const // as that can be overridden by the reflection APIs after parse. auto &type = get(id); if (type.type_alias) - return to_name(type.type_alias); + { + // If the alias master has been specially packed, we will have emitted a clean variant as well, + // so skip the name aliasing here. + if (!has_decoration(type.type_alias, DecorationCPacked)) + return to_name(type.type_alias); + } } if (meta[id].decoration.alias.empty()) @@ -346,6 +357,14 @@ void Compiler::flush_all_atomic_capable_variables() flush_all_aliased_variables(); } +void Compiler::flush_control_dependent_expressions(uint32_t block_id) +{ + auto &block = get(block_id); + for (auto &expr : block.invalidate_expressions) + invalid_expressions.insert(expr); + block.invalidate_expressions.clear(); +} + void Compiler::flush_all_active_variables() { // Invalidate all temporaries we read from variables in this block since they were forwarded. @@ -683,7 +702,7 @@ ShaderResources Compiler::get_shader_resources(const unordered_set *ac // Input if (var.storage == StorageClassInput && interface_variable_exists_in_entry_point(var.self)) { - if (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) + if (meta[type.self].decoration.decoration_flags.get(DecorationBlock)) res.stage_inputs.push_back( { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) }); else @@ -697,7 +716,7 @@ ShaderResources Compiler::get_shader_resources(const unordered_set *ac // Outputs else if (var.storage == StorageClassOutput && interface_variable_exists_in_entry_point(var.self)) { - if (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) + if (meta[type.self].decoration.decoration_flags.get(DecorationBlock)) res.stage_outputs.push_back( { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) }); else @@ -705,14 +724,14 @@ ShaderResources Compiler::get_shader_resources(const unordered_set *ac } // UBOs else if (type.storage == StorageClassUniform && - (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock))) + (meta[type.self].decoration.decoration_flags.get(DecorationBlock))) { res.uniform_buffers.push_back( { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) }); } // Old way to declare SSBOs. else if (type.storage == StorageClassUniform && - (meta[type.self].decoration.decoration_flags & (1ull << DecorationBufferBlock))) + (meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) { res.storage_buffers.push_back( { var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self) }); @@ -795,6 +814,7 @@ static bool is_valid_spirv_version(uint32_t version) case 0x10000: // SPIR-V 1.0 case 0x10100: // SPIR-V 1.1 case 0x10200: // SPIR-V 1.2 + case 0x10300: // SPIR-V 1.3 return true; default: @@ -802,6 +822,70 @@ static bool is_valid_spirv_version(uint32_t version) } } +bool Compiler::type_is_block_like(const SPIRType &type) const +{ + if (type.basetype != SPIRType::Struct) + return false; + + if (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock)) + { + return true; + } + + // Block-like types may have Offset decorations. + for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) + if (has_member_decoration(type.self, i, DecorationOffset)) + return true; + + return false; +} + +void Compiler::fixup_type_alias() +{ + // Due to how some backends work, the "master" type of type_alias must be a block-like type if it exists. + // FIXME: Multiple alias types which are both block-like will be awkward, for now, it's best to just drop the type + // alias if the slave type is a block type. + for (auto &id : ids) + { + if (id.get_type() != TypeType) + continue; + + auto &type = id.get(); + + if (type.type_alias && type_is_block_like(type)) + { + // Become the master. + for (auto &other_id : ids) + { + if (other_id.get_type() != TypeType) + continue; + if (other_id.get_id() == type.self) + continue; + + auto &other_type = other_id.get(); + if (other_type.type_alias == type.type_alias) + other_type.type_alias = type.self; + } + + get(type.type_alias).type_alias = id.get_id(); + type.type_alias = 0; + } + } + + for (auto &id : ids) + { + if (id.get_type() != TypeType) + continue; + + auto &type = id.get(); + if (type.type_alias && type_is_block_like(type)) + { + // This is not allowed, drop the type_alias. + type.type_alias = 0; + } + } +} + void Compiler::parse() { auto len = spirv.size(); @@ -853,19 +937,21 @@ void Compiler::parse() } } } + + fixup_type_alias(); } void Compiler::flatten_interface_block(uint32_t id) { auto &var = get(id); auto &type = get(var.basetype); - auto flags = meta.at(type.self).decoration.decoration_flags; + auto &flags = meta.at(type.self).decoration.decoration_flags; if (!type.array.empty()) SPIRV_CROSS_THROW("Type is array of UBOs."); if (type.basetype != SPIRType::Struct) SPIRV_CROSS_THROW("Type is not a struct."); - if ((flags & (1ull << DecorationBlock)) == 0) + if (!flags.get(DecorationBlock)) SPIRV_CROSS_THROW("Type is not a block."); if (type.member_types.empty()) SPIRV_CROSS_THROW("Member list of struct is empty."); @@ -912,12 +998,27 @@ void Compiler::update_name_cache(unordered_set &cache, string &name) uint32_t counter = 0; auto tmpname = name; + bool use_linked_underscore = true; + + if (tmpname == "_") + { + // We cannot just append numbers, as we will end up creating internally reserved names. + // Make it like _0_ instead. + tmpname += "0"; + } + else if (tmpname.back() == '_') + { + // The last_character is an underscore, so we don't need to link in underscore. + // This would violate double underscore rules. + use_linked_underscore = false; + } + // If there is a collision (very rare), // keep tacking on extra identifier until it's unique. do { counter++; - name = tmpname + "_" + convert_to_string(counter); + name = tmpname + (use_linked_underscore ? "_" : "") + convert_to_string(counter); } while (cache.find(name) != end(cache)); cache.insert(name); } @@ -932,6 +1033,7 @@ void Compiler::set_name(uint32_t id, const std::string &name) // glslang uses identifiers to pass along meaningful information // about HLSL reflection. + // FIXME: This should be deprecated eventually. auto &m = meta.at(id); if (source.hlsl && name.size() >= 6 && name.find("@count") == name.size() - 6) { @@ -961,11 +1063,57 @@ const SPIRType &Compiler::get_type_from_variable(uint32_t id) const return get(get(id).basetype); } +uint32_t Compiler::get_non_pointer_type_id(uint32_t type_id) const +{ + auto *p_type = &get(type_id); + while (p_type->pointer) + { + assert(p_type->parent_type); + type_id = p_type->parent_type; + p_type = &get(type_id); + } + return type_id; +} + +const SPIRType &Compiler::get_non_pointer_type(const SPIRType &type) const +{ + auto *p_type = &type; + while (p_type->pointer) + { + assert(p_type->parent_type); + p_type = &get(p_type->parent_type); + } + return *p_type; +} + +const SPIRType &Compiler::get_non_pointer_type(uint32_t type_id) const +{ + return get_non_pointer_type(get(type_id)); +} + +void Compiler::set_member_decoration_string(uint32_t id, uint32_t index, spv::Decoration decoration, + const std::string &argument) +{ + meta.at(id).members.resize(max(meta[id].members.size(), size_t(index) + 1)); + auto &dec = meta.at(id).members[index]; + dec.decoration_flags.set(decoration); + + switch (decoration) + { + case DecorationHlslSemanticGOOGLE: + dec.hlsl_semantic = argument; + break; + + default: + break; + } +} + void Compiler::set_member_decoration(uint32_t id, uint32_t index, Decoration decoration, uint32_t argument) { meta.at(id).members.resize(max(meta[id].members.size(), size_t(index) + 1)); auto &dec = meta.at(id).members[index]; - dec.decoration_flags |= 1ull << decoration; + dec.decoration_flags.set(decoration); switch (decoration) { @@ -994,6 +1142,10 @@ void Compiler::set_member_decoration(uint32_t id, uint32_t index, Decoration dec dec.matrix_stride = argument; break; + case DecorationIndex: + dec.index = argument; + break; + default: break; } @@ -1051,7 +1203,7 @@ uint32_t Compiler::get_member_decoration(uint32_t id, uint32_t index, Decoration return 0; auto &dec = m.members[index]; - if (!(dec.decoration_flags & (1ull << decoration))) + if (!dec.decoration_flags.get(decoration)) return 0; switch (decoration) @@ -1066,23 +1218,33 @@ uint32_t Compiler::get_member_decoration(uint32_t id, uint32_t index, Decoration return dec.offset; case DecorationSpecId: return dec.spec_id; + case DecorationIndex: + return dec.index; default: return 1; } } uint64_t Compiler::get_member_decoration_mask(uint32_t id, uint32_t index) const +{ + return get_member_decoration_bitset(id, index).get_lower(); +} + +const Bitset &Compiler::get_member_decoration_bitset(uint32_t id, uint32_t index) const { auto &m = meta.at(id); if (index >= m.members.size()) - return 0; + { + static const Bitset cleared = {}; + return cleared; + } return m.members[index].decoration_flags; } bool Compiler::has_member_decoration(uint32_t id, uint32_t index, Decoration decoration) const { - return get_member_decoration_mask(id, index) & (1ull << decoration); + return get_member_decoration_bitset(id, index).get(decoration); } void Compiler::unset_member_decoration(uint32_t id, uint32_t index, Decoration decoration) @@ -1093,7 +1255,7 @@ void Compiler::unset_member_decoration(uint32_t id, uint32_t index, Decoration d auto &dec = m.members[index]; - dec.decoration_flags &= ~(1ull << decoration); + dec.decoration_flags.clear(decoration); switch (decoration) { case DecorationBuiltIn: @@ -1112,6 +1274,26 @@ void Compiler::unset_member_decoration(uint32_t id, uint32_t index, Decoration d dec.spec_id = 0; break; + case DecorationHlslSemanticGOOGLE: + dec.hlsl_semantic.clear(); + break; + + default: + break; + } +} + +void Compiler::set_decoration_string(uint32_t id, spv::Decoration decoration, const std::string &argument) +{ + auto &dec = meta.at(id).decoration; + dec.decoration_flags.set(decoration); + + switch (decoration) + { + case DecorationHlslSemanticGOOGLE: + dec.hlsl_semantic = argument; + break; + default: break; } @@ -1120,7 +1302,7 @@ void Compiler::unset_member_decoration(uint32_t id, uint32_t index, Decoration d void Compiler::set_decoration(uint32_t id, Decoration decoration, uint32_t argument) { auto &dec = meta.at(id).decoration; - dec.decoration_flags |= 1ull << decoration; + dec.decoration_flags.set(decoration); switch (decoration) { @@ -1161,6 +1343,15 @@ void Compiler::set_decoration(uint32_t id, Decoration decoration, uint32_t argum dec.spec_id = argument; break; + case DecorationIndex: + dec.index = argument; + break; + + case DecorationHlslCounterBufferGOOGLE: + meta.at(id).hlsl_magic_counter_buffer = argument; + meta.at(argument).hlsl_is_magic_counter_buffer = true; + break; + default: break; } @@ -1191,6 +1382,11 @@ const std::string Compiler::get_block_fallback_name(uint32_t id) const } uint64_t Compiler::get_decoration_mask(uint32_t id) const +{ + return get_decoration_bitset(id).get_lower(); +} + +const Bitset &Compiler::get_decoration_bitset(uint32_t id) const { auto &dec = meta.at(id).decoration; return dec.decoration_flags; @@ -1198,13 +1394,31 @@ uint64_t Compiler::get_decoration_mask(uint32_t id) const bool Compiler::has_decoration(uint32_t id, Decoration decoration) const { - return get_decoration_mask(id) & (1ull << decoration); + return get_decoration_bitset(id).get(decoration); +} + +const string &Compiler::get_decoration_string(uint32_t id, spv::Decoration decoration) const +{ + auto &dec = meta.at(id).decoration; + static const string empty; + + if (!dec.decoration_flags.get(decoration)) + return empty; + + switch (decoration) + { + case DecorationHlslSemanticGOOGLE: + return dec.hlsl_semantic; + + default: + return empty; + } } uint32_t Compiler::get_decoration(uint32_t id, Decoration decoration) const { auto &dec = meta.at(id).decoration; - if (!(dec.decoration_flags & (1ull << decoration))) + if (!dec.decoration_flags.get(decoration)) return 0; switch (decoration) @@ -1227,6 +1441,8 @@ uint32_t Compiler::get_decoration(uint32_t id, Decoration decoration) const return dec.array_stride; case DecorationMatrixStride: return dec.matrix_stride; + case DecorationIndex: + return dec.index; default: return 1; } @@ -1235,7 +1451,7 @@ uint32_t Compiler::get_decoration(uint32_t id, Decoration decoration) const void Compiler::unset_decoration(uint32_t id, Decoration decoration) { auto &dec = meta.at(id).decoration; - dec.decoration_flags &= ~(1ull << decoration); + dec.decoration_flags.clear(decoration); switch (decoration) { case DecorationBuiltIn: @@ -1266,6 +1482,21 @@ void Compiler::unset_decoration(uint32_t id, Decoration decoration) dec.spec_id = 0; break; + case DecorationHlslSemanticGOOGLE: + dec.hlsl_semantic.clear(); + break; + + case DecorationHlslCounterBufferGOOGLE: + { + auto &counter = meta.at(id).hlsl_magic_counter_buffer; + if (counter) + { + meta.at(counter).hlsl_is_magic_counter_buffer = false; + counter = 0; + } + break; + } + default: break; } @@ -1403,7 +1634,7 @@ void Compiler::parse(const Instruction &instruction) { auto &execution = entry_points[ops[0]]; auto mode = static_cast(ops[1]); - execution.flags |= 1ull << mode; + execution.flags.set(mode); switch (mode) { @@ -1443,6 +1674,7 @@ void Compiler::parse(const Instruction &instruction) } case OpDecorate: + case OpDecorateId: { uint32_t id = ops[0]; @@ -1458,6 +1690,14 @@ void Compiler::parse(const Instruction &instruction) break; } + case OpDecorateStringGOOGLE: + { + uint32_t id = ops[0]; + auto decoration = static_cast(ops[1]); + set_decoration_string(id, decoration, extract_string(spirv, instruction.offset + 2)); + break; + } + case OpMemberDecorate: { uint32_t id = ops[0]; @@ -1470,6 +1710,15 @@ void Compiler::parse(const Instruction &instruction) break; } + case OpMemberDecorateStringGOOGLE: + { + uint32_t id = ops[0]; + uint32_t member = ops[1]; + auto decoration = static_cast(ops[2]); + set_member_decoration_string(id, member, decoration, extract_string(spirv, instruction.offset + 3)); + break; + } + // Build up basic types. case OpTypeVoid: { @@ -1493,7 +1742,14 @@ void Compiler::parse(const Instruction &instruction) uint32_t id = ops[0]; uint32_t width = ops[1]; auto &type = set(id); - type.basetype = width > 32 ? SPIRType::Double : SPIRType::Float; + if (width == 64) + type.basetype = SPIRType::Double; + else if (width == 32) + type.basetype = SPIRType::Float; + else if (width == 16) + type.basetype = SPIRType::Half; + else + SPIRV_CROSS_THROW("Unrecognized bit-width of floating point type."); type.width = width; break; } @@ -1586,7 +1842,7 @@ void Compiler::parse(const Instruction &instruction) type.basetype = SPIRType::Image; type.image.type = ops[1]; type.image.dim = static_cast(ops[2]); - type.image.depth = ops[3] != 0; + type.image.depth = ops[3] == 1; type.image.arrayed = ops[4] != 0; type.image.ms = ops[5] != 0; type.image.sampled = ops[6]; @@ -1810,9 +2066,28 @@ void Compiler::parse(const Instruction &instruction) if (elements > 4) SPIRV_CROSS_THROW("OpConstantComposite only supports 1, 2, 3 and 4 elements."); + SPIRConstant remapped_constant_ops[4]; const SPIRConstant *c[4]; for (uint32_t i = 0; i < elements; i++) - c[i] = &get(ops[2 + i]); + { + // Specialization constants operations can also be part of this. + // We do not know their value, so any attempt to query SPIRConstant later + // will fail. We can only propagate the ID of the expression and use to_expression on it. + auto *constant_op = maybe_get(ops[2 + i]); + if (constant_op) + { + if (op == OpConstantComposite) + SPIRV_CROSS_THROW("Specialization constant operation used in OpConstantComposite."); + + remapped_constant_ops[i].make_null(get(constant_op->basetype)); + remapped_constant_ops[i].self = constant_op->self; + remapped_constant_ops[i].constant_type = constant_op->basetype; + remapped_constant_ops[i].specialization = true; + c[i] = &remapped_constant_ops[i]; + } + else + c[i] = &get(ops[2 + i]); + } set(id, type, c, elements, op == OpSpecConstantComposite); } break; @@ -1974,6 +2249,14 @@ void Compiler::parse(const Instruction &instruction) current_block->next_block = ops[0]; current_block->merge = SPIRBlock::MergeSelection; selection_merge_targets.insert(current_block->next_block); + + if (length >= 2) + { + if (ops[1] & SelectionControlFlattenMask) + current_block->hint = SPIRBlock::HintFlatten; + else if (ops[1] & SelectionControlDontFlattenMask) + current_block->hint = SPIRBlock::HintDontFlatten; + } break; } @@ -1996,6 +2279,14 @@ void Compiler::parse(const Instruction &instruction) // they are treated as continues. if (current_block->continue_block != current_block->self) continue_blocks.insert(current_block->continue_block); + + if (length >= 3) + { + if (ops[2] & LoopControlUnrollMask) + current_block->hint = SPIRBlock::HintUnroll; + else if (ops[2] & LoopControlDontUnrollMask) + current_block->hint = SPIRBlock::HintDontUnroll; + } break; } @@ -2030,7 +2321,7 @@ bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method if (block.disable_block_optimization || block.complex_continue) return false; - if (method == SPIRBlock::MergeToSelectForLoop) + if (method == SPIRBlock::MergeToSelectForLoop || method == SPIRBlock::MergeToSelectContinueForLoop) { // Try to detect common for loop pattern // which the code backend can use to create cleaner code. @@ -2040,6 +2331,9 @@ bool Compiler::block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method block.true_block != block.merge_block && block.true_block != block.self && block.false_block == block.merge_block; + if (ret && method == SPIRBlock::MergeToSelectContinueForLoop) + ret = block.true_block == block.continue_block; + // If we have OpPhi which depends on branches which came from our own block, // we need to flush phi variables in else block instead of a trivial break, // so we cannot assume this is a for loop candidate. @@ -2237,7 +2531,7 @@ uint32_t Compiler::type_struct_member_offset(const SPIRType &type, uint32_t inde { // Decoration must be set in valid SPIR-V, otherwise throw. auto &dec = meta[type.self].members.at(index); - if (dec.decoration_flags & (1ull << DecorationOffset)) + if (dec.decoration_flags.get(DecorationOffset)) return dec.offset; else SPIRV_CROSS_THROW("Struct member does not have Offset set."); @@ -2248,7 +2542,7 @@ uint32_t Compiler::type_struct_member_array_stride(const SPIRType &type, uint32_ // Decoration must be set in valid SPIR-V, otherwise throw. // ArrayStride is part of the array type not OpMemberDecorate. auto &dec = meta[type.member_types[index]].decoration; - if (dec.decoration_flags & (1ull << DecorationArrayStride)) + if (dec.decoration_flags.get(DecorationArrayStride)) return dec.array_stride; else SPIRV_CROSS_THROW("Struct member does not have ArrayStride set."); @@ -2259,7 +2553,7 @@ uint32_t Compiler::type_struct_member_matrix_stride(const SPIRType &type, uint32 // Decoration must be set in valid SPIR-V, otherwise throw. // MatrixStride is part of OpMemberDecorate. auto &dec = meta[type.self].members[index]; - if (dec.decoration_flags & (1ull << DecorationMatrixStride)) + if (dec.decoration_flags.get(DecorationMatrixStride)) return dec.matrix_stride; else SPIRV_CROSS_THROW("Struct member does not have MatrixStride set."); @@ -2267,6 +2561,9 @@ uint32_t Compiler::type_struct_member_matrix_stride(const SPIRType &type, uint32 size_t Compiler::get_declared_struct_size(const SPIRType &type) const { + if (type.member_types.empty()) + SPIRV_CROSS_THROW("Declared struct in block cannot be empty."); + uint32_t last = uint32_t(type.member_types.size() - 1); size_t offset = type_struct_member_offset(type, last); size_t size = get_declared_struct_member_size(type, last); @@ -2275,7 +2572,10 @@ size_t Compiler::get_declared_struct_size(const SPIRType &type) const size_t Compiler::get_declared_struct_member_size(const SPIRType &struct_type, uint32_t index) const { - auto flags = get_member_decoration_mask(struct_type.self, index); + if (struct_type.member_types.empty()) + SPIRV_CROSS_THROW("Declared struct in block cannot be empty."); + + auto &flags = get_member_decoration_bitset(struct_type.self, index); auto &type = get(struct_type.member_types[index]); switch (type.basetype) @@ -2320,9 +2620,9 @@ size_t Compiler::get_declared_struct_member_size(const SPIRType &struct_type, ui uint32_t matrix_stride = type_struct_member_matrix_stride(struct_type, index); // Per SPIR-V spec, matrices must be tightly packed and aligned up for vec3 accesses. - if (flags & (1ull << DecorationRowMajor)) + if (flags.get(DecorationRowMajor)) return matrix_stride * vecsize; - else if (flags & (1ull << DecorationColMajor)) + else if (flags.get(DecorationColMajor)) return matrix_stride * columns; else SPIRV_CROSS_THROW("Either row-major or column-major must be declared for matrices."); @@ -2430,6 +2730,11 @@ bool Compiler::types_are_logically_equivalent(const SPIRType &a, const SPIRType } uint64_t Compiler::get_execution_mode_mask() const +{ + return get_entry_point().flags.get_lower(); +} + +const Bitset &Compiler::get_execution_mode_bitset() const { return get_entry_point().flags; } @@ -2438,7 +2743,7 @@ void Compiler::set_execution_mode(ExecutionMode mode, uint32_t arg0, uint32_t ar { auto &execution = get_entry_point(); - execution.flags |= 1ull << mode; + execution.flags.set(mode); switch (mode) { case ExecutionModeLocalSize: @@ -2463,7 +2768,7 @@ void Compiler::set_execution_mode(ExecutionMode mode, uint32_t arg0, uint32_t ar void Compiler::unset_execution_mode(ExecutionMode mode) { auto &execution = get_entry_point(); - execution.flags &= ~(1ull << mode); + execution.flags.clear(mode); } uint32_t Compiler::get_work_group_size_specialization_constants(SpecializationConstant &x, SpecializationConstant &y, @@ -2566,6 +2871,14 @@ void Compiler::inherit_expression_dependencies(uint32_t dst, uint32_t source_exp } auto &e = get(dst); + auto *phi = maybe_get(source_expression); + if (phi && phi->phi_variable) + { + // We have used a phi variable, which can change at the end of the block, + // so make sure we take a dependency on this phi variable. + phi->dependees.push_back(dst); + } + auto *s = maybe_get(source_expression); if (!s) return; @@ -2578,6 +2891,7 @@ void Compiler::inherit_expression_dependencies(uint32_t dst, uint32_t source_exp e_deps.insert(end(e_deps), begin(s_deps), end(s_deps)); // Eliminate duplicated dependencies. + sort(begin(e_deps), end(e_deps)); e_deps.erase(unique(begin(e_deps), end(e_deps)), end(e_deps)); } @@ -2879,8 +3193,10 @@ void Compiler::CombinedImageSamplerHandler::register_combined_image_sampler(SPIR // Inherit RelaxedPrecision (and potentially other useful flags if deemed relevant). auto &new_flags = compiler.meta[combined_id].decoration.decoration_flags; - auto old_flags = compiler.meta[sampler_id].decoration.decoration_flags; - new_flags = old_flags & (1ull << DecorationRelaxedPrecision); + auto &old_flags = compiler.meta[sampler_id].decoration.decoration_flags; + new_flags.reset(); + if (old_flags.get(DecorationRelaxedPrecision)) + new_flags.set(DecorationRelaxedPrecision); param.id = combined_id; @@ -2925,8 +3241,12 @@ bool Compiler::DummySamplerForCombinedImageHandler::handle(Op opcode, const uint } case OpImageFetch: + case OpImageQuerySizeLod: + case OpImageQuerySize: + case OpImageQueryLevels: + case OpImageQuerySamples: { - // If we are fetching from a plain OpTypeImage, we must pre-combine with our dummy sampler. + // If we are fetching or querying LOD from a plain OpTypeImage, we must pre-combine with our dummy sampler. auto *var = compiler.maybe_get_backing_variable(args[2]); if (var) { @@ -2944,12 +3264,20 @@ bool Compiler::DummySamplerForCombinedImageHandler::handle(Op opcode, const uint if (length < 3) return false; - auto &type = compiler.get(args[0]); + uint32_t result_type = args[0]; + auto &type = compiler.get(result_type); bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer; - if (separate_image) - SPIRV_CROSS_THROW("Attempting to use arrays or structs of separate images. This is not possible to " - "statically remap to plain GLSL."); + if (!separate_image) + return true; + + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + + // Other backends might use SPIRAccessChain for this later. + compiler.ids[id].set_allow_type_rewrite(); break; } @@ -3001,22 +3329,33 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar // but this seems ridiculously complicated for a problem which is easy to work around. // Checking access chains like this assumes we don't have samplers or textures inside uniform structs, but this makes no sense. - auto &type = compiler.get(args[0]); + uint32_t result_type = args[0]; + + auto &type = compiler.get(result_type); bool separate_image = type.basetype == SPIRType::Image && type.image.sampled == 1; bool separate_sampler = type.basetype == SPIRType::Sampler; - if (separate_image) - SPIRV_CROSS_THROW("Attempting to use arrays or structs of separate images. This is not possible to " - "statically remap to plain GLSL."); if (separate_sampler) SPIRV_CROSS_THROW( "Attempting to use arrays or structs of separate samplers. This is not possible to statically " "remap to plain GLSL."); + + if (separate_image) + { + uint32_t id = args[1]; + uint32_t ptr = args[2]; + compiler.set(id, "", result_type, true); + compiler.register_read(id, ptr, true); + } return true; } case OpImageFetch: + case OpImageQuerySizeLod: + case OpImageQuerySize: + case OpImageQueryLevels: + case OpImageQuerySamples: { - // If we are fetching from a plain OpTypeImage, we must pre-combine with our dummy sampler. + // If we are fetching from a plain OpTypeImage or querying LOD, we must pre-combine with our dummy sampler. auto *var = compiler.maybe_get_backing_variable(args[2]); if (!var) return true; @@ -3044,9 +3383,6 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar return true; } - if (length < 4) - return false; - // Registers sampler2D calls used in case they are parameters so // that their callees know which combined image samplers to propagate down the call stack. if (!functions.empty()) @@ -3093,6 +3429,7 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar type = compiler.expression_type(args[2]); type.self = sampled_type; type.basetype = SPIRType::SampledImage; + type.image.depth = false; } else { @@ -3117,8 +3454,19 @@ bool Compiler::CombinedImageSamplerHandler::handle(Op opcode, const uint32_t *ar // Inherit RelaxedPrecision (and potentially other useful flags if deemed relevant). auto &new_flags = compiler.meta[combined_id].decoration.decoration_flags; // Fetch inherits precision from the image, not sampler (there is no sampler). - auto old_flags = compiler.meta[is_fetch ? image_id : sampler_id].decoration.decoration_flags; - new_flags = old_flags & (1ull << DecorationRelaxedPrecision); + auto &old_flags = compiler.meta[is_fetch ? image_id : sampler_id].decoration.decoration_flags; + new_flags.reset(); + if (old_flags.get(DecorationRelaxedPrecision)) + new_flags.set(DecorationRelaxedPrecision); + + // Propagate the array type for the original image as well. + auto *var = compiler.maybe_get_backing_variable(image_id); + if (var) + { + auto &parent_type = compiler.get(var->basetype); + type.array = parent_type.array; + type.array_size_literal = parent_type.array_size_literal; + } compiler.combined_image_samplers.push_back({ combined_id, image_id, sampler_id }); } @@ -3182,10 +3530,8 @@ vector Compiler::get_specialization_constants() const if (id.get_type() == TypeConstant) { auto &c = id.get(); - if (c.specialization) - { + if (c.specialization && has_decoration(c.self, DecorationSpecId)) spec_consts.push_back({ c.self, get_decoration(c.self, DecorationSpecId) }); - } } } return spec_consts; @@ -3301,297 +3647,449 @@ void Compiler::analyze_parameter_preservation( } } -void Compiler::analyze_variable_scope(SPIRFunction &entry) +Compiler::AnalyzeVariableScopeAccessHandler::AnalyzeVariableScopeAccessHandler(Compiler &compiler_, + SPIRFunction &entry_) + : compiler(compiler_) + , entry(entry_) { - struct AccessHandler : OpcodeHandler +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::follow_function_call(const SPIRFunction &) +{ + // Only analyze within this function. + return false; +} + +void Compiler::AnalyzeVariableScopeAccessHandler::set_current_block(const SPIRBlock &block) +{ + current_block = █ + + // If we're branching to a block which uses OpPhi, in GLSL + // this will be a variable write when we branch, + // so we need to track access to these variables as well to + // have a complete picture. + const auto test_phi = [this, &block](uint32_t to) { + auto &next = compiler.get(to); + for (auto &phi : next.phi_variables) + { + if (phi.parent == block.self) + { + accessed_variables_to_block[phi.function_variable].insert(block.self); + // Phi variables are also accessed in our target branch block. + accessed_variables_to_block[phi.function_variable].insert(next.self); + + notify_variable_access(phi.local_variable, block.self); + } + } + }; + + switch (block.terminator) { - public: - AccessHandler(Compiler &compiler_, SPIRFunction &entry_) - : compiler(compiler_) - , entry(entry_) - { - } + case SPIRBlock::Direct: + notify_variable_access(block.condition, block.self); + test_phi(block.next_block); + break; - bool follow_function_call(const SPIRFunction &) - { - // Only analyze within this function. + case SPIRBlock::Select: + notify_variable_access(block.condition, block.self); + test_phi(block.true_block); + test_phi(block.false_block); + break; + + case SPIRBlock::MultiSelect: + notify_variable_access(block.condition, block.self); + for (auto &target : block.cases) + test_phi(target.block); + if (block.default_block) + test_phi(block.default_block); + break; + + default: + break; + } +} + +void Compiler::AnalyzeVariableScopeAccessHandler::notify_variable_access(uint32_t id, uint32_t block) +{ + if (id_is_phi_variable(id)) + accessed_variables_to_block[id].insert(block); + else if (id_is_potential_temporary(id)) + accessed_temporaries_to_block[id].insert(block); +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::id_is_phi_variable(uint32_t id) const +{ + if (id >= compiler.get_current_id_bound()) + return false; + auto *var = compiler.maybe_get(id); + return var && var->phi_variable; +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::id_is_potential_temporary(uint32_t id) const +{ + if (id >= compiler.get_current_id_bound()) + return false; + + // Temporaries are not created before we start emitting code. + return compiler.ids[id].empty() || (compiler.ids[id].get_type() == TypeExpression); +} + +bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint32_t *args, uint32_t length) +{ + // Keep track of the types of temporaries, so we can hoist them out as necessary. + uint32_t result_type, result_id; + if (compiler.instruction_to_result_type(result_type, result_id, op, args, length)) + result_id_to_type[result_id] = result_type; + + switch (op) + { + case OpStore: + { + if (length < 2) return false; - } - void set_current_block(const SPIRBlock &block) + uint32_t ptr = args[0]; + auto *var = compiler.maybe_get_backing_variable(ptr); + + // If we store through an access chain, we have a partial write. + if (var) { - current_block = █ - - // If we're branching to a block which uses OpPhi, in GLSL - // this will be a variable write when we branch, - // so we need to track access to these variables as well to - // have a complete picture. - const auto test_phi = [this, &block](uint32_t to) { - auto &next = compiler.get(to); - for (auto &phi : next.phi_variables) - { - if (phi.parent == block.self) - { - accessed_variables_to_block[phi.function_variable].insert(block.self); - // Phi variables are also accessed in our target branch block. - accessed_variables_to_block[phi.function_variable].insert(next.self); - - notify_variable_access(phi.local_variable, block.self); - } - } - }; - - switch (block.terminator) - { - case SPIRBlock::Direct: - notify_variable_access(block.condition, block.self); - test_phi(block.next_block); - break; - - case SPIRBlock::Select: - notify_variable_access(block.condition, block.self); - test_phi(block.true_block); - test_phi(block.false_block); - break; - - case SPIRBlock::MultiSelect: - notify_variable_access(block.condition, block.self); - for (auto &target : block.cases) - test_phi(target.block); - if (block.default_block) - test_phi(block.default_block); - break; - - default: - break; - } + accessed_variables_to_block[var->self].insert(current_block->self); + if (var->self == ptr) + complete_write_variables_to_block[var->self].insert(current_block->self); + else + partial_write_variables_to_block[var->self].insert(current_block->self); } - void notify_variable_access(uint32_t id, uint32_t block) + // Might try to store a Phi variable here. + notify_variable_access(args[1], current_block->self); + break; + } + + case OpAccessChain: + case OpInBoundsAccessChain: + { + if (length < 3) + return false; + + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get(ptr); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + + for (uint32_t i = 3; i < length; i++) + notify_variable_access(args[i], current_block->self); + + // The result of an access chain is a fixed expression and is not really considered a temporary. + auto &e = compiler.set(args[1], "", args[0], true); + auto *backing_variable = compiler.maybe_get_backing_variable(ptr); + e.loaded_from = backing_variable ? backing_variable->self : 0; + + // Other backends might use SPIRAccessChain for this later. + compiler.ids[args[1]].set_allow_type_rewrite(); + break; + } + + case OpCopyMemory: + { + if (length < 2) + return false; + + uint32_t lhs = args[0]; + uint32_t rhs = args[1]; + auto *var = compiler.maybe_get_backing_variable(lhs); + + // If we store through an access chain, we have a partial write. + if (var) { - if (id_is_phi_variable(id)) - accessed_variables_to_block[id].insert(block); - else if (id_is_potential_temporary(id)) - accessed_temporaries_to_block[id].insert(block); + accessed_variables_to_block[var->self].insert(current_block->self); + if (var->self == lhs) + complete_write_variables_to_block[var->self].insert(current_block->self); + else + partial_write_variables_to_block[var->self].insert(current_block->self); } - bool id_is_phi_variable(uint32_t id) + var = compiler.maybe_get_backing_variable(rhs); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + break; + } + + case OpCopyObject: + { + if (length < 3) + return false; + + auto *var = compiler.maybe_get_backing_variable(args[2]); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + + // Might try to copy a Phi variable here. + notify_variable_access(args[2], current_block->self); + break; + } + + case OpLoad: + { + if (length < 3) + return false; + uint32_t ptr = args[2]; + auto *var = compiler.maybe_get_backing_variable(ptr); + if (var) + accessed_variables_to_block[var->self].insert(current_block->self); + + // Loaded value is a temporary. + notify_variable_access(args[1], current_block->self); + break; + } + + case OpFunctionCall: + { + if (length < 3) + return false; + + length -= 3; + args += 3; + + for (uint32_t i = 0; i < length; i++) { - if (id >= compiler.get_current_id_bound()) - return false; - auto *var = compiler.maybe_get(id); - return var && var->phi_variable; + auto *var = compiler.maybe_get_backing_variable(args[i]); + if (var) + { + accessed_variables_to_block[var->self].insert(current_block->self); + // Assume we can get partial writes to this variable. + partial_write_variables_to_block[var->self].insert(current_block->self); + } + + // Cannot easily prove if argument we pass to a function is completely written. + // Usually, functions write to a dummy variable, + // which is then copied to in full to the real argument. + + // Might try to copy a Phi variable here. + notify_variable_access(args[i], current_block->self); } - bool id_is_potential_temporary(uint32_t id) + // Return value may be a temporary. + notify_variable_access(args[1], current_block->self); + break; + } + + case OpExtInst: + { + for (uint32_t i = 4; i < length; i++) + notify_variable_access(args[i], current_block->self); + notify_variable_access(args[1], current_block->self); + break; + } + + case OpArrayLength: + // Uses literals, but cannot be a phi variable, so ignore. + break; + + // Atomics shouldn't be able to access function-local variables. + // Some GLSL builtins access a pointer. + + case OpCompositeInsert: + case OpVectorShuffle: + // Specialize for opcode which contains literals. + for (uint32_t i = 1; i < 4; i++) + notify_variable_access(args[i], current_block->self); + break; + + case OpCompositeExtract: + // Specialize for opcode which contains literals. + for (uint32_t i = 1; i < 3; i++) + notify_variable_access(args[i], current_block->self); + break; + + default: + { + // Rather dirty way of figuring out where Phi variables are used. + // As long as only IDs are used, we can scan through instructions and try to find any evidence that + // the ID of a variable has been used. + // There are potential false positives here where a literal is used in-place of an ID, + // but worst case, it does not affect the correctness of the compile. + // Exhaustive analysis would be better here, but it's not worth it for now. + for (uint32_t i = 0; i < length; i++) + notify_variable_access(args[i], current_block->self); + break; + } + } + return true; +} + +Compiler::StaticExpressionAccessHandler::StaticExpressionAccessHandler(Compiler &compiler_, uint32_t variable_id_) + : compiler(compiler_) + , variable_id(variable_id_) +{ +} + +bool Compiler::StaticExpressionAccessHandler::follow_function_call(const SPIRFunction &) +{ + return false; +} + +bool Compiler::StaticExpressionAccessHandler::handle(spv::Op op, const uint32_t *args, uint32_t length) +{ + switch (op) + { + case OpStore: + if (length < 2) + return false; + if (args[0] == variable_id) { - if (id >= compiler.get_current_id_bound()) - return false; - - // Temporaries are not created before we start emitting code. - return compiler.ids[id].empty() || (compiler.ids[id].get_type() == TypeExpression); + static_expression = args[1]; + write_count++; } + break; - bool handle(spv::Op op, const uint32_t *args, uint32_t length) + case OpLoad: + if (length < 3) + return false; + if (args[2] == variable_id && static_expression == 0) // Tried to read from variable before it was initialized. + return false; + break; + + case OpAccessChain: + case OpInBoundsAccessChain: + if (length < 3) + return false; + if (args[2] == variable_id) // If we try to access chain our candidate variable before we store to it, bail. + return false; + break; + + default: + break; + } + + return true; +} + +void Compiler::find_function_local_luts(SPIRFunction &entry, const AnalyzeVariableScopeAccessHandler &handler) +{ + auto &cfg = *function_cfgs.find(entry.self)->second; + + // For each variable which is statically accessed. + for (auto &accessed_var : handler.accessed_variables_to_block) + { + auto &blocks = accessed_var.second; + auto &var = get(accessed_var.first); + auto &type = expression_type(accessed_var.first); + + // Only consider function local variables here. + if (var.storage != StorageClassFunction) + continue; + + // We cannot be a phi variable. + if (var.phi_variable) + continue; + + // Only consider arrays here. + if (type.array.empty()) + continue; + + // HACK: Do not consider structs. This is a quirk with how types are currently being emitted. + // Structs are emitted after specialization constants and composite constants. + // FIXME: Fix declaration order so declared constants can have struct types. + if (type.basetype == SPIRType::Struct) + continue; + + // If the variable has an initializer, make sure it is a constant expression. + uint32_t static_constant_expression = 0; + if (var.initializer) { - // Keep track of the types of temporaries, so we can hoist them out as necessary. - uint32_t result_type, result_id; - if (compiler.instruction_to_result_type(result_type, result_id, op, args, length)) - result_id_to_type[result_id] = result_type; + if (ids[var.initializer].get_type() != TypeConstant) + continue; + static_constant_expression = var.initializer; - switch (op) - { - case OpStore: - { - if (length < 2) - return false; + // There can be no stores to this variable, we have now proved we have a LUT. + if (handler.complete_write_variables_to_block.count(var.self) != 0 || + handler.partial_write_variables_to_block.count(var.self) != 0) + continue; + } + else + { + // We can have one, and only one write to the variable, and that write needs to be a constant. - uint32_t ptr = args[0]; - auto *var = compiler.maybe_get_backing_variable(ptr); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); + // No partial writes allowed. + if (handler.partial_write_variables_to_block.count(var.self) != 0) + continue; - // If we store through an access chain, we have a partial write. - if (var && var->self == ptr && var->storage == StorageClassFunction) - complete_write_variables_to_block[var->self].insert(current_block->self); + auto itr = handler.complete_write_variables_to_block.find(var.self); - // Might try to store a Phi variable here. - notify_variable_access(args[1], current_block->self); - break; - } + // No writes? + if (itr == end(handler.complete_write_variables_to_block)) + continue; - case OpAccessChain: - case OpInBoundsAccessChain: - { - if (length < 3) - return false; + // We write to the variable in more than one block. + auto &write_blocks = itr->second; + if (write_blocks.size() != 1) + continue; - uint32_t ptr = args[2]; - auto *var = compiler.maybe_get(ptr); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); + // The write needs to happen in the dominating block. + DominatorBuilder builder(cfg); + for (auto &block : blocks) + builder.add_block(block); + uint32_t dominator = builder.get_dominator(); - for (uint32_t i = 3; i < length; i++) - notify_variable_access(args[i], current_block->self); + // The complete write happened in a branch or similar, cannot deduce static expression. + if (write_blocks.count(dominator) == 0) + continue; - // The result of an access chain is a fixed expression and is not really considered a temporary. - break; - } + // Find the static expression for this variable. + StaticExpressionAccessHandler static_expression_handler(*this, var.self); + traverse_all_reachable_opcodes(get(dominator), static_expression_handler); - case OpCopyMemory: - { - if (length < 2) - return false; + // We want one, and exactly one write + if (static_expression_handler.write_count != 1 || static_expression_handler.static_expression == 0) + continue; - uint32_t lhs = args[0]; - uint32_t rhs = args[1]; - auto *var = compiler.maybe_get_backing_variable(lhs); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); + // Is it a constant expression? + if (ids[static_expression_handler.static_expression].get_type() != TypeConstant) + continue; - // If we store through an access chain, we have a partial write. - if (var && var->self == lhs) - complete_write_variables_to_block[var->self].insert(current_block->self); - - var = compiler.maybe_get_backing_variable(rhs); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); - break; - } - - case OpCopyObject: - { - if (length < 3) - return false; - - auto *var = compiler.maybe_get_backing_variable(args[2]); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); - - // Might try to copy a Phi variable here. - notify_variable_access(args[2], current_block->self); - break; - } - - case OpLoad: - { - if (length < 3) - return false; - uint32_t ptr = args[2]; - auto *var = compiler.maybe_get_backing_variable(ptr); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); - - // Loaded value is a temporary. - notify_variable_access(args[1], current_block->self); - break; - } - - case OpFunctionCall: - { - if (length < 3) - return false; - - length -= 3; - args += 3; - for (uint32_t i = 0; i < length; i++) - { - auto *var = compiler.maybe_get_backing_variable(args[i]); - if (var && var->storage == StorageClassFunction) - accessed_variables_to_block[var->self].insert(current_block->self); - - // Cannot easily prove if argument we pass to a function is completely written. - // Usually, functions write to a dummy variable, - // which is then copied to in full to the real argument. - - // Might try to copy a Phi variable here. - notify_variable_access(args[i], current_block->self); - } - - // Return value may be a temporary. - notify_variable_access(args[1], current_block->self); - break; - } - - case OpExtInst: - { - for (uint32_t i = 4; i < length; i++) - notify_variable_access(args[i], current_block->self); - notify_variable_access(args[1], current_block->self); - break; - } - - case OpArrayLength: - // Uses literals, but cannot be a phi variable, so ignore. - break; - - // Atomics shouldn't be able to access function-local variables. - // Some GLSL builtins access a pointer. - - case OpCompositeInsert: - case OpVectorShuffle: - // Specialize for opcode which contains literals. - for (uint32_t i = 1; i < 4; i++) - notify_variable_access(args[i], current_block->self); - break; - - case OpCompositeExtract: - // Specialize for opcode which contains literals. - for (uint32_t i = 1; i < 3; i++) - notify_variable_access(args[i], current_block->self); - break; - - default: - { - // Rather dirty way of figuring out where Phi variables are used. - // As long as only IDs are used, we can scan through instructions and try to find any evidence that - // the ID of a variable has been used. - // There are potential false positives here where a literal is used in-place of an ID, - // but worst case, it does not affect the correctness of the compile. - // Exhaustive analysis would be better here, but it's not worth it for now. - for (uint32_t i = 0; i < length; i++) - notify_variable_access(args[i], current_block->self); - break; - } - } - return true; + // We found a LUT! + static_constant_expression = static_expression_handler.static_expression; } - Compiler &compiler; - SPIRFunction &entry; - std::unordered_map> accessed_variables_to_block; - std::unordered_map> accessed_temporaries_to_block; - std::unordered_map result_id_to_type; - std::unordered_map> complete_write_variables_to_block; - const SPIRBlock *current_block = nullptr; - } handler(*this, entry); + get(static_constant_expression).is_used_as_lut = true; + var.static_expression = static_constant_expression; + var.statically_assigned = true; + var.remapped_variable = true; + } +} +void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeAccessHandler &handler) +{ // First, we map out all variable access within a function. // Essentially a map of block -> { variables accessed in the basic block } - this->traverse_all_reachable_opcodes(entry, handler); + traverse_all_reachable_opcodes(entry, handler); - // Compute the control flow graph for this function. - CFG cfg(*this, entry); + auto &cfg = *function_cfgs.find(entry.self)->second; // Analyze if there are parameters which need to be implicitly preserved with an "in" qualifier. - this->analyze_parameter_preservation(entry, cfg, handler.accessed_variables_to_block, - handler.complete_write_variables_to_block); + analyze_parameter_preservation(entry, cfg, handler.accessed_variables_to_block, + handler.complete_write_variables_to_block); unordered_map potential_loop_variables; // For each variable which is statically accessed. for (auto &var : handler.accessed_variables_to_block) { + // Only deal with variables which are considered local variables in this function. + if (find(begin(entry.local_variables), end(entry.local_variables), var.first) == end(entry.local_variables)) + continue; + DominatorBuilder builder(cfg); auto &blocks = var.second; - auto &type = this->expression_type(var.first); + auto &type = expression_type(var.first); // Figure out which block is dominating all accesses of those variables. for (auto &block : blocks) { // If we're accessing a variable inside a continue block, this variable might be a loop variable. // We can only use loop variables with scalars, as we cannot track static expressions for vectors. - if (this->is_continue(block)) + if (is_continue(block)) { // Potentially awkward case to check for. // We might have a variable inside a loop, which is touched by the continue block, @@ -3599,9 +4097,10 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) // The continue block is dominated by the inner part of the loop, which does not make sense in high-level // language output because it will be declared before the body, // so we will have to lift the dominator up to the relevant loop header instead. - builder.add_block(this->continue_block_to_loop_header[block]); + builder.add_block(continue_block_to_loop_header[block]); - if (type.vecsize == 1 && type.columns == 1) + // Arrays or structs cannot be loop variables. + if (type.vecsize == 1 && type.columns == 1 && type.basetype != SPIRType::Struct && type.array.empty()) { // The variable is used in multiple continue blocks, this is not a loop // candidate, signal that by setting block to -1u. @@ -3625,9 +4124,9 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) // will be completely eliminated. if (dominating_block) { - auto &block = this->get(dominating_block); + auto &block = get(dominating_block); block.dominated_variables.push_back(var.first); - this->get(var.first).dominator = dominating_block; + get(var.first).dominator = dominating_block; } } @@ -3643,6 +4142,7 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) } DominatorBuilder builder(cfg); + bool force_temporary = false; // Figure out which block is dominating all accesses of those temporaries. auto &blocks = var.second; @@ -3652,8 +4152,13 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) // If a temporary is used in more than one block, we might have to lift continue block // access up to loop header like we did for variables. - if (blocks.size() != 1 && this->is_continue(block)) - builder.add_block(this->continue_block_to_loop_header[block]); + if (blocks.size() != 1 && is_continue(block)) + builder.add_block(continue_block_to_loop_header[block]); + else if (blocks.size() != 1 && is_single_block_loop(block)) + { + // Awkward case, because the loop header is also the continue block. + force_temporary = true; + } } uint32_t dominating_block = builder.get_dominator(); @@ -3663,15 +4168,25 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) // SPIR-V normally mandates this, but we have extra cases for temporary use inside loops. bool first_use_is_dominator = blocks.count(dominating_block) != 0; - if (!first_use_is_dominator) + if (!first_use_is_dominator || force_temporary) { // This should be very rare, but if we try to declare a temporary inside a loop, // and that temporary is used outside the loop as well (spirv-opt inliner likes this) // we should actually emit the temporary outside the loop. - this->hoisted_temporaries.insert(var.first); - this->forced_temporaries.insert(var.first); + hoisted_temporaries.insert(var.first); + forced_temporaries.insert(var.first); - auto &block_temporaries = this->get(dominating_block).declare_temporary; + auto &block_temporaries = get(dominating_block).declare_temporary; + block_temporaries.emplace_back(handler.result_id_to_type[var.first], var.first); + } + else if (blocks.size() > 1) + { + // Keep track of the temporary as we might have to declare this temporary. + // This can happen if the loop header dominates a temporary, but we have a complex fallback loop. + // In this case, the header is actually inside the for (;;) {} block, and we have problems. + // What we need to do is hoist the temporaries outside the for (;;) {} block in case the header block + // declares the temporary. + auto &block_temporaries = get(dominating_block).potential_declare_temporary; block_temporaries.emplace_back(handler.result_id_to_type[var.first], var.first); } } @@ -3682,7 +4197,7 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) // Now, try to analyze whether or not these variables are actually loop variables. for (auto &loop_variable : potential_loop_variables) { - auto &var = this->get(loop_variable.first); + auto &var = get(loop_variable.first); auto dominator = var.dominator; auto block = loop_variable.second; @@ -3697,9 +4212,9 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) uint32_t header = 0; // Find the loop header for this block. - for (auto b : this->loop_blocks) + for (auto b : loop_blocks) { - auto &potential_header = this->get(b); + auto &potential_header = get(b); if (potential_header.continue_block == block) { header = b; @@ -3708,7 +4223,7 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) } assert(header); - auto &header_block = this->get(header); + auto &header_block = get(header); auto &blocks = handler.accessed_variables_to_block[loop_variable.first]; // If a loop variable is not used before the loop, it's probably not a loop variable. @@ -3764,11 +4279,16 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry) // Need to sort here as variables come from an unordered container, and pushing stuff in wrong order // will break reproducability in regression runs. sort(begin(header_block.loop_variables), end(header_block.loop_variables)); - this->get(loop_variable.first).loop_variable = true; + get(loop_variable.first).loop_variable = true; } } -uint64_t Compiler::get_buffer_block_flags(const SPIRVariable &var) +Bitset Compiler::get_buffer_block_flags(uint32_t id) const +{ + return get_buffer_block_flags(get(id)); +} + +Bitset Compiler::get_buffer_block_flags(const SPIRVariable &var) const { auto &type = get(var.basetype); assert(type.basetype == SPIRType::Struct); @@ -3776,16 +4296,17 @@ uint64_t Compiler::get_buffer_block_flags(const SPIRVariable &var) // Some flags like non-writable, non-readable are actually found // as member decorations. If all members have a decoration set, propagate // the decoration up as a regular variable decoration. - uint64_t base_flags = meta[var.self].decoration.decoration_flags; + Bitset base_flags = meta[var.self].decoration.decoration_flags; if (type.member_types.empty()) return base_flags; - uint64_t all_members_flag_mask = ~(0ull); - for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++) - all_members_flag_mask &= get_member_decoration_mask(type.self, i); + Bitset all_members_flags = get_member_decoration_bitset(type.self, 0); + for (uint32_t i = 1; i < uint32_t(type.member_types.size()); i++) + all_members_flags.merge_and(get_member_decoration_bitset(type.self, i)); - return base_flags | all_members_flag_mask; + base_flags.merge_or(all_members_flags); + return base_flags; } bool Compiler::get_common_basic_type(const SPIRType &type, SPIRType::BaseType &base_type) @@ -3813,7 +4334,8 @@ bool Compiler::get_common_basic_type(const SPIRType &type, SPIRType::BaseType &b } } -void Compiler::ActiveBuiltinHandler::handle_builtin(const SPIRType &type, BuiltIn builtin, uint64_t decoration_flags) +void Compiler::ActiveBuiltinHandler::handle_builtin(const SPIRType &type, BuiltIn builtin, + const Bitset &decoration_flags) { // If used, we will need to explicitly declare a new array size for these builtins. @@ -3837,7 +4359,7 @@ void Compiler::ActiveBuiltinHandler::handle_builtin(const SPIRType &type, BuiltI } else if (builtin == BuiltInPosition) { - if (decoration_flags & (1ull << DecorationInvariant)) + if (decoration_flags.get(DecorationInvariant)) compiler.position_invariant = true; } } @@ -3854,7 +4376,7 @@ bool Compiler::ActiveBuiltinHandler::handle(spv::Op opcode, const uint32_t *args auto &type = compiler.get(var->basetype); auto &flags = type.storage == StorageClassInput ? compiler.active_input_builtins : compiler.active_output_builtins; - flags |= 1ull << decorations.builtin_type; + flags.set(decorations.builtin_type); handle_builtin(type, decorations.builtin_type, decorations.decoration_flags); } }; @@ -3911,14 +4433,8 @@ bool Compiler::ActiveBuiltinHandler::handle(spv::Op opcode, const uint32_t *args // Required if we access chain into builtins like gl_GlobalInvocationID. add_if_builtin(args[2]); - auto *type = &compiler.get(var->basetype); - // Start traversing type hierarchy at the proper non-pointer types. - while (type->pointer) - { - assert(type->parent_type); - type = &compiler.get(type->parent_type); - } + auto *type = &compiler.get_non_pointer_type(var->basetype); auto &flags = type->storage == StorageClassInput ? compiler.active_input_builtins : compiler.active_output_builtins; @@ -3942,7 +4458,7 @@ bool Compiler::ActiveBuiltinHandler::handle(spv::Op opcode, const uint32_t *args auto &decorations = compiler.meta[type->self].members[index]; if (decorations.builtin) { - flags |= 1ull << decorations.builtin_type; + flags.set(decorations.builtin_type); handle_builtin(compiler.get(type->member_types[index]), decorations.builtin_type, decorations.decoration_flags); } @@ -3968,8 +4484,8 @@ bool Compiler::ActiveBuiltinHandler::handle(spv::Op opcode, const uint32_t *args void Compiler::update_active_builtins() { - active_input_builtins = 0; - active_output_builtins = 0; + active_input_builtins.reset(); + active_output_builtins.reset(); cull_distance_count = 0; clip_distance_count = 0; ActiveBuiltinHandler handler(*this); @@ -3979,29 +4495,127 @@ void Compiler::update_active_builtins() // Returns whether this shader uses a builtin of the storage class bool Compiler::has_active_builtin(BuiltIn builtin, StorageClass storage) { - uint64_t flags; + const Bitset *flags; switch (storage) { case StorageClassInput: - flags = active_input_builtins; + flags = &active_input_builtins; break; case StorageClassOutput: - flags = active_output_builtins; + flags = &active_output_builtins; break; default: return false; } - return flags & (1ull << builtin); + return flags->get(builtin); } void Compiler::analyze_image_and_sampler_usage() { - CombinedImageSamplerUsageHandler handler(*this); + CombinedImageSamplerDrefHandler dref_handler(*this); + traverse_all_reachable_opcodes(get(entry_point), dref_handler); + + CombinedImageSamplerUsageHandler handler(*this, dref_handler.dref_combined_samplers); traverse_all_reachable_opcodes(get(entry_point), handler); - comparison_samplers = move(handler.comparison_samplers); - comparison_images = move(handler.comparison_images); + comparison_ids = move(handler.comparison_ids); need_subpass_input = handler.need_subpass_input; + + // Forward information from separate images and samplers into combined image samplers. + for (auto &combined : combined_image_samplers) + if (comparison_ids.count(combined.sampler_id)) + comparison_ids.insert(combined.combined_id); +} + +bool Compiler::CombinedImageSamplerDrefHandler::handle(spv::Op opcode, const uint32_t *args, uint32_t) +{ + // Mark all sampled images which are used with Dref. + switch (opcode) + { + case OpImageSampleDrefExplicitLod: + case OpImageSampleDrefImplicitLod: + case OpImageSampleProjDrefExplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageSparseSampleProjDrefImplicitLod: + case OpImageSparseSampleDrefImplicitLod: + case OpImageSparseSampleProjDrefExplicitLod: + case OpImageSparseSampleDrefExplicitLod: + case OpImageDrefGather: + case OpImageSparseDrefGather: + dref_combined_samplers.insert(args[2]); + return true; + + default: + break; + } + + return true; +} + +void Compiler::build_function_control_flow_graphs_and_analyze() +{ + CFGBuilder handler(*this); + handler.function_cfgs[entry_point].reset(new CFG(*this, get(entry_point))); + traverse_all_reachable_opcodes(get(entry_point), handler); + function_cfgs = move(handler.function_cfgs); + + for (auto &f : function_cfgs) + { + auto &func = get(f.first); + AnalyzeVariableScopeAccessHandler scope_handler(*this, func); + analyze_variable_scope(func, scope_handler); + find_function_local_luts(func, scope_handler); + + // Check if we can actually use the loop variables we found in analyze_variable_scope. + // To use multiple initializers, we need the same type and qualifiers. + for (auto block : func.blocks) + { + auto &b = get(block); + if (b.loop_variables.size() < 2) + continue; + + auto &flags = get_decoration_bitset(b.loop_variables.front()); + uint32_t type = get(b.loop_variables.front()).basetype; + bool invalid_initializers = false; + for (auto loop_variable : b.loop_variables) + { + if (flags != get_decoration_bitset(loop_variable) || + type != get(b.loop_variables.front()).basetype) + { + invalid_initializers = true; + break; + } + } + + if (invalid_initializers) + { + for (auto loop_variable : b.loop_variables) + get(loop_variable).loop_variable = false; + b.loop_variables.clear(); + } + } + } +} + +Compiler::CFGBuilder::CFGBuilder(spirv_cross::Compiler &compiler_) + : compiler(compiler_) +{ +} + +bool Compiler::CFGBuilder::handle(spv::Op, const uint32_t *, uint32_t) +{ + return true; +} + +bool Compiler::CFGBuilder::follow_function_call(const SPIRFunction &func) +{ + if (function_cfgs.find(func.self) == end(function_cfgs)) + { + function_cfgs[func.self].reset(new CFG(compiler, func)); + return true; + } + else + return false; } bool Compiler::CombinedImageSamplerUsageHandler::begin_function_scope(const uint32_t *args, uint32_t length) @@ -4022,20 +4636,12 @@ bool Compiler::CombinedImageSamplerUsageHandler::begin_function_scope(const uint return true; } -void Compiler::CombinedImageSamplerUsageHandler::add_hierarchy_to_comparison_images(uint32_t image) +void Compiler::CombinedImageSamplerUsageHandler::add_hierarchy_to_comparison_ids(uint32_t id) { - // Traverse the variable dependency hierarchy and tag everything in its path with comparison images. - comparison_images.insert(image); - for (auto &img : dependency_hierarchy[image]) - add_hierarchy_to_comparison_images(img); -} - -void Compiler::CombinedImageSamplerUsageHandler::add_hierarchy_to_comparison_samplers(uint32_t sampler) -{ - // Traverse the variable dependency hierarchy and tag everything in its path with comparison samplers. - comparison_samplers.insert(sampler); - for (auto &samp : dependency_hierarchy[sampler]) - add_hierarchy_to_comparison_samplers(samp); + // Traverse the variable dependency hierarchy and tag everything in its path with comparison ids. + comparison_ids.insert(id); + for (auto &dep_id : dependency_hierarchy[id]) + add_hierarchy_to_comparison_ids(dep_id); } bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_t *args, uint32_t length) @@ -4055,6 +4661,10 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_ auto &type = compiler.get(args[0]); if (type.image.dim == DimSubpassData) need_subpass_input = true; + + // If we load a SampledImage and it will be used with Dref, propagate the state up. + if (dref_combined_samplers.count(args[1]) != 0) + add_hierarchy_to_comparison_ids(args[1]); break; } @@ -4064,16 +4674,20 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_ return false; uint32_t result_type = args[0]; + uint32_t result_id = args[1]; auto &type = compiler.get(result_type); - if (type.image.depth) + if (type.image.depth || dref_combined_samplers.count(result_id) != 0) { // This image must be a depth image. uint32_t image = args[2]; - add_hierarchy_to_comparison_images(image); + add_hierarchy_to_comparison_ids(image); - // This sampler must be a SamplerComparisionState, and not a regular SamplerState. + // This sampler must be a SamplerComparisonState, and not a regular SamplerState. uint32_t sampler = args[3]; - add_hierarchy_to_comparison_samplers(sampler); + add_hierarchy_to_comparison_ids(sampler); + + // Mark the OpSampledImage itself as being comparison state. + comparison_ids.insert(result_id); } return true; } @@ -4087,6 +4701,13 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_ bool Compiler::buffer_is_hlsl_counter_buffer(uint32_t id) const { + // First, check for the proper decoration. + if (meta.at(id).hlsl_is_magic_counter_buffer) + return true; + + // Check for legacy fallback method. + // FIXME: This should be deprecated eventually. + if (meta.at(id).hlsl_magic_counter_buffer_candidate) { auto *var = maybe_get(id); @@ -4100,6 +4721,16 @@ bool Compiler::buffer_is_hlsl_counter_buffer(uint32_t id) const bool Compiler::buffer_get_hlsl_counter_buffer(uint32_t id, uint32_t &counter_id) const { + // First, check for the proper decoration. + if (meta[id].hlsl_magic_counter_buffer != 0) + { + counter_id = meta[id].hlsl_magic_counter_buffer; + return true; + } + + // Check for legacy fallback method. + // FIXME: This should be deprecated eventually. + auto &name = get_name(id); uint32_t id_bound = get_current_id_bound(); for (uint32_t i = 0; i < id_bound; i++) @@ -4218,3 +4849,57 @@ bool Compiler::instruction_to_result_type(uint32_t &result_type, uint32_t &resul return false; } } + +Bitset Compiler::combined_decoration_for_member(const SPIRType &type, uint32_t index) const +{ + Bitset flags; + auto &memb = meta[type.self].members; + if (index >= memb.size()) + return flags; + auto &dec = memb[index]; + + // If our type is a struct, traverse all the members as well recursively. + flags.merge_or(dec.decoration_flags); + for (uint32_t i = 0; i < type.member_types.size(); i++) + flags.merge_or(combined_decoration_for_member(get(type.member_types[i]), i)); + + return flags; +} + +bool Compiler::is_desktop_only_format(spv::ImageFormat format) +{ + switch (format) + { + // Desktop-only formats + case ImageFormatR11fG11fB10f: + case ImageFormatR16f: + case ImageFormatRgb10A2: + case ImageFormatR8: + case ImageFormatRg8: + case ImageFormatR16: + case ImageFormatRg16: + case ImageFormatRgba16: + case ImageFormatR16Snorm: + case ImageFormatRg16Snorm: + case ImageFormatRgba16Snorm: + case ImageFormatR8Snorm: + case ImageFormatRg8Snorm: + case ImageFormatR8ui: + case ImageFormatRg8ui: + case ImageFormatR16ui: + case ImageFormatRgb10a2ui: + case ImageFormatR8i: + case ImageFormatRg8i: + case ImageFormatR16i: + return true; + default: + break; + } + + return false; +} + +bool Compiler::image_is_comparison(const spirv_cross::SPIRType &type, uint32_t id) const +{ + return type.image.depth || (comparison_ids.count(id) != 0); +} diff --git a/deps/SPIRV-Cross/spirv_cross.hpp b/deps/SPIRV-Cross/spirv_cross.hpp index 193efc7477..159e1988be 100644 --- a/deps/SPIRV-Cross/spirv_cross.hpp +++ b/deps/SPIRV-Cross/spirv_cross.hpp @@ -18,11 +18,11 @@ #define SPIRV_CROSS_HPP #include "spirv.hpp" +#include "spirv_cfg.hpp" #include "spirv_common.hpp" namespace spirv_cross { -class CFG; struct Resource { // Resources are identified with their SPIR-V ID. @@ -136,6 +136,7 @@ public: // Applies a decoration to an ID. Effectively injects OpDecorate. void set_decoration(uint32_t id, spv::Decoration decoration, uint32_t argument = 0); + void set_decoration_string(uint32_t id, spv::Decoration decoration, const std::string &argument); // Overrides the identifier OpName of an ID. // Identifiers beginning with underscores or identifiers which contain double underscores @@ -144,7 +145,9 @@ public: // Gets a bitmask for the decorations which are applied to ID. // I.e. (1ull << spv::DecorationFoo) | (1ull << spv::DecorationBar) + SPIRV_CROSS_DEPRECATED("Please use get_decoration_bitset instead.") uint64_t get_decoration_mask(uint32_t id) const; + const Bitset &get_decoration_bitset(uint32_t id) const; // Returns whether the decoration has been applied to the ID. bool has_decoration(uint32_t id, spv::Decoration decoration) const; @@ -155,6 +158,7 @@ public: // If decoration doesn't exist or decoration is not recognized, // 0 will be returned. uint32_t get_decoration(uint32_t id, spv::Decoration decoration) const; + const std::string &get_decoration_string(uint32_t id, spv::Decoration decoration) const; // Removes the decoration for a an ID. void unset_decoration(uint32_t id, spv::Decoration decoration); @@ -166,6 +170,15 @@ public: // Gets the SPIR-V type of a variable. const SPIRType &get_type_from_variable(uint32_t id) const; + // Gets the id of SPIR-V type underlying the given type_id, which might be a pointer. + uint32_t get_non_pointer_type_id(uint32_t type_id) const; + + // Gets the SPIR-V type underlying the given type, which might be a pointer. + const SPIRType &get_non_pointer_type(const SPIRType &type) const; + + // Gets the SPIR-V type underlying the given type_id, which might be a pointer. + const SPIRType &get_non_pointer_type(uint32_t type_id) const; + // Gets the underlying storage class for an OpVariable. spv::StorageClass get_storage_class(uint32_t id) const; @@ -183,6 +196,7 @@ public: // Given an OpTypeStruct in ID, obtain the OpMemberDecoration for member number "index". uint32_t get_member_decoration(uint32_t id, uint32_t index, spv::Decoration decoration) const; + const std::string &get_member_decoration_string(uint32_t id, uint32_t index, spv::Decoration decoration) const; // Sets the member identifier for OpTypeStruct ID, member number "index". void set_member_name(uint32_t id, uint32_t index, const std::string &name); @@ -195,13 +209,17 @@ public: void set_member_qualified_name(uint32_t type_id, uint32_t index, const std::string &name); // Gets the decoration mask for a member of a struct, similar to get_decoration_mask. + SPIRV_CROSS_DEPRECATED("Please use get_member_decoration_bitset instead.") uint64_t get_member_decoration_mask(uint32_t id, uint32_t index) const; + const Bitset &get_member_decoration_bitset(uint32_t id, uint32_t index) const; // Returns whether the decoration has been applied to a member of a struct. bool has_member_decoration(uint32_t id, uint32_t index, spv::Decoration decoration) const; // Similar to set_decoration, but for struct members. void set_member_decoration(uint32_t id, uint32_t index, spv::Decoration decoration, uint32_t argument = 0); + void set_member_decoration_string(uint32_t id, uint32_t index, spv::Decoration decoration, + const std::string &argument); // Unsets a member decoration, similar to unset_decoration. void unset_member_decoration(uint32_t id, uint32_t index, spv::Decoration decoration); @@ -311,7 +329,10 @@ public: spv::ExecutionModel execution_model) const; // Query and modify OpExecutionMode. + SPIRV_CROSS_DEPRECATED("Please use get_execution_mode_bitset instead.") uint64_t get_execution_mode_mask() const; + const Bitset &get_execution_mode_bitset() const; + void unset_execution_mode(spv::ExecutionMode mode); void set_execution_mode(spv::ExecutionMode mode, uint32_t arg0 = 0, uint32_t arg1 = 0, uint32_t arg2 = 0); @@ -372,6 +393,8 @@ public: // so this can be added before compile() if desired. // // Combined image samplers originating from this set are always considered active variables. + // Arrays of separate samplers are not supported, but arrays of separate images are supported. + // Array of images + sampler -> Array of combined image samplers. void build_combined_image_samplers(); // Gets a remapping for the combined image samplers. @@ -434,14 +457,18 @@ public: // which lets us link the two buffers together. // Queries if a variable ID is a counter buffer which "belongs" to a regular buffer object. - // NOTE: This query is purely based on OpName identifiers as found in the SPIR-V module, and will + + // If SPV_GOOGLE_hlsl_functionality1 is used, this can be used even with a stripped SPIR-V module. + // Otherwise, this query is purely based on OpName identifiers as found in the SPIR-V module, and will // only return true if OpSource was reported HLSL. // To rely on this functionality, ensure that the SPIR-V module is not stripped. + bool buffer_is_hlsl_counter_buffer(uint32_t id) const; // Queries if a buffer object has a neighbor "counter" buffer. // If so, the ID of that counter buffer will be returned in counter_id. - // NOTE: This query is purely based on OpName identifiers as found in the SPIR-V module, and will + // If SPV_GOOGLE_hlsl_functionality1 is used, this can be used even with a stripped SPIR-V module. + // Otherwise, this query is purely based on OpName identifiers as found in the SPIR-V module, and will // only return true if OpSource was reported HLSL. // To rely on this functionality, ensure that the SPIR-V module is not stripped. bool buffer_get_hlsl_counter_buffer(uint32_t id, uint32_t &counter_id) const; @@ -465,6 +492,12 @@ public: // ID is the name of a variable as returned by Resource::id, and must be a variable with a Block-like type. std::string get_remapped_declared_block_name(uint32_t id) const; + // For buffer block variables, get the decorations for that variable. + // Sometimes, decorations for buffer blocks are found in member decorations instead + // of direct decorations on the variable itself. + // The most common use here is to check if a buffer is readonly or writeonly. + Bitset get_buffer_block_flags(uint32_t id) const; + protected: const uint32_t *stream(const Instruction &instr) const { @@ -579,12 +612,23 @@ protected: return continue_blocks.find(next) != end(continue_blocks); } + inline bool is_single_block_loop(uint32_t next) const + { + auto &block = get(next); + return block.merge == SPIRBlock::MergeLoop && block.continue_block == next; + } + inline bool is_break(uint32_t next) const { return loop_merge_targets.find(next) != end(loop_merge_targets) || multiselect_merge_targets.find(next) != end(multiselect_merge_targets); } + inline bool is_loop_break(uint32_t next) const + { + return loop_merge_targets.find(next) != end(loop_merge_targets); + } + inline bool is_conditional(uint32_t next) const { return selection_merge_targets.find(next) != end(selection_merge_targets) && @@ -594,6 +638,7 @@ protected: // Dependency tracking for temporaries read from variables. void flush_dependees(SPIRVariable &var); void flush_all_active_variables(); + void flush_control_dependent_expressions(uint32_t block); void flush_all_atomic_capable_variables(); void flush_all_aliased_variables(); void register_global_read_dependencies(const SPIRBlock &func, uint32_t id); @@ -631,8 +676,6 @@ protected: variable_remap_callback(type, var_name, type_name); } - void analyze_variable_scope(SPIRFunction &function); - void parse(); void parse(const Instruction &i); @@ -742,7 +785,7 @@ protected: bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override; Compiler &compiler; - void handle_builtin(const SPIRType &type, spv::BuiltIn builtin, uint64_t decoration_flags); + void handle_builtin(const SPIRType &type, spv::BuiltIn builtin, const Bitset &decoration_flags); }; bool traverse_all_reachable_opcodes(const SPIRBlock &block, OpcodeHandler &handler) const; @@ -754,15 +797,15 @@ protected: VariableTypeRemapCallback variable_remap_callback; - uint64_t get_buffer_block_flags(const SPIRVariable &var); + Bitset get_buffer_block_flags(const SPIRVariable &var) const; bool get_common_basic_type(const SPIRType &type, SPIRType::BaseType &base_type); std::unordered_set forced_temporaries; std::unordered_set forwarded_temporaries; std::unordered_set hoisted_temporaries; - uint64_t active_input_builtins = 0; - uint64_t active_output_builtins = 0; + Bitset active_input_builtins; + Bitset active_output_builtins; uint32_t clip_distance_count = 0; uint32_t cull_distance_count = 0; bool position_invariant = false; @@ -781,8 +824,7 @@ protected: // There might be unrelated IDs found in this set which do not correspond to actual variables. // This set should only be queried for the existence of samplers which are already known to be variables or parameter IDs. // Similar is implemented for images, as well as if subpass inputs are needed. - std::unordered_set comparison_samplers; - std::unordered_set comparison_images; + std::unordered_set comparison_ids; bool need_subpass_input = false; // In certain backends, we will need to use a dummy sampler to be able to emit code. @@ -791,26 +833,89 @@ protected: uint32_t dummy_sampler_id = 0; void analyze_image_and_sampler_usage(); + + struct CombinedImageSamplerDrefHandler : OpcodeHandler + { + CombinedImageSamplerDrefHandler(Compiler &compiler_) + : compiler(compiler_) + { + } + bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override; + + Compiler &compiler; + std::unordered_set dref_combined_samplers; + }; + struct CombinedImageSamplerUsageHandler : OpcodeHandler { - CombinedImageSamplerUsageHandler(Compiler &compiler_) + CombinedImageSamplerUsageHandler(Compiler &compiler_, + const std::unordered_set &dref_combined_samplers_) : compiler(compiler_) + , dref_combined_samplers(dref_combined_samplers_) { } bool begin_function_scope(const uint32_t *args, uint32_t length) override; bool handle(spv::Op opcode, const uint32_t *args, uint32_t length) override; Compiler &compiler; + const std::unordered_set &dref_combined_samplers; std::unordered_map> dependency_hierarchy; - std::unordered_set comparison_images; - std::unordered_set comparison_samplers; + std::unordered_set comparison_ids; - void add_hierarchy_to_comparison_samplers(uint32_t sampler); - void add_hierarchy_to_comparison_images(uint32_t sampler); + void add_hierarchy_to_comparison_ids(uint32_t ids); bool need_subpass_input = false; }; + void build_function_control_flow_graphs_and_analyze(); + std::unordered_map> function_cfgs; + struct CFGBuilder : OpcodeHandler + { + CFGBuilder(Compiler &compiler_); + + bool follow_function_call(const SPIRFunction &func) override; + bool handle(spv::Op op, const uint32_t *args, uint32_t length) override; + Compiler &compiler; + std::unordered_map> function_cfgs; + }; + + struct AnalyzeVariableScopeAccessHandler : OpcodeHandler + { + AnalyzeVariableScopeAccessHandler(Compiler &compiler_, SPIRFunction &entry_); + + bool follow_function_call(const SPIRFunction &) override; + void set_current_block(const SPIRBlock &block) override; + + void notify_variable_access(uint32_t id, uint32_t block); + bool id_is_phi_variable(uint32_t id) const; + bool id_is_potential_temporary(uint32_t id) const; + bool handle(spv::Op op, const uint32_t *args, uint32_t length) override; + + Compiler &compiler; + SPIRFunction &entry; + std::unordered_map> accessed_variables_to_block; + std::unordered_map> accessed_temporaries_to_block; + std::unordered_map result_id_to_type; + std::unordered_map> complete_write_variables_to_block; + std::unordered_map> partial_write_variables_to_block; + const SPIRBlock *current_block = nullptr; + }; + + struct StaticExpressionAccessHandler : OpcodeHandler + { + StaticExpressionAccessHandler(Compiler &compiler_, uint32_t variable_id_); + bool follow_function_call(const SPIRFunction &) override; + bool handle(spv::Op op, const uint32_t *args, uint32_t length) override; + + Compiler &compiler; + uint32_t variable_id; + uint32_t static_expression = 0; + uint32_t write_count = 0; + }; + + void analyze_variable_scope(SPIRFunction &function, AnalyzeVariableScopeAccessHandler &handler); + void find_function_local_luts(SPIRFunction &function, const AnalyzeVariableScopeAccessHandler &handler); + void make_constant_null(uint32_t id, uint32_t type); std::vector declared_capabilities; @@ -820,11 +925,19 @@ protected: bool instruction_to_result_type(uint32_t &result_type, uint32_t &result_id, spv::Op op, const uint32_t *args, uint32_t length); + Bitset combined_decoration_for_member(const SPIRType &type, uint32_t index) const; + static bool is_desktop_only_format(spv::ImageFormat format); + + bool image_is_comparison(const SPIRType &type, uint32_t id) const; + private: // Used only to implement the old deprecated get_entry_point() interface. const SPIREntryPoint &get_first_entry_point(const std::string &name) const; SPIREntryPoint &get_first_entry_point(const std::string &name); + + void fixup_type_alias(); + bool type_is_block_like(const SPIRType &type) const; }; -} +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_cross_util.cpp b/deps/SPIRV-Cross/spirv_cross_util.cpp index 5bc2f3517a..4cf336e87d 100644 --- a/deps/SPIRV-Cross/spirv_cross_util.cpp +++ b/deps/SPIRV-Cross/spirv_cross_util.cpp @@ -48,4 +48,23 @@ void rename_interface_variable(spirv_cross::Compiler &compiler, const std::vecto compiler.set_name(v.id, name); } } + +void inherit_combined_sampler_bindings(spirv_cross::Compiler &compiler) +{ + auto &samplers = compiler.get_combined_image_samplers(); + for (auto &s : samplers) + { + if (compiler.has_decoration(s.image_id, spv::DecorationDescriptorSet)) + { + uint32_t set = compiler.get_decoration(s.image_id, spv::DecorationDescriptorSet); + compiler.set_decoration(s.combined_id, spv::DecorationDescriptorSet, set); + } + + if (compiler.has_decoration(s.image_id, spv::DecorationBinding)) + { + uint32_t binding = compiler.get_decoration(s.image_id, spv::DecorationBinding); + compiler.set_decoration(s.combined_id, spv::DecorationBinding, binding); + } + } } +} // namespace spirv_cross_util diff --git a/deps/SPIRV-Cross/spirv_cross_util.hpp b/deps/SPIRV-Cross/spirv_cross_util.hpp index 509c7c09ce..cabfa413f9 100644 --- a/deps/SPIRV-Cross/spirv_cross_util.hpp +++ b/deps/SPIRV-Cross/spirv_cross_util.hpp @@ -23,6 +23,7 @@ namespace spirv_cross_util { void rename_interface_variable(spirv_cross::Compiler &compiler, const std::vector &resources, uint32_t location, const std::string &name); -} +void inherit_combined_sampler_bindings(spirv_cross::Compiler &compiler); +} // namespace spirv_cross_util #endif diff --git a/deps/SPIRV-Cross/spirv_glsl.cpp b/deps/SPIRV-Cross/spirv_glsl.cpp index 882d241f5f..a973274616 100644 --- a/deps/SPIRV-Cross/spirv_glsl.cpp +++ b/deps/SPIRV-Cross/spirv_glsl.cpp @@ -26,6 +26,45 @@ using namespace spv; using namespace spirv_cross; using namespace std; +static bool is_unsigned_opcode(Op op) +{ + // Don't have to be exhaustive, only relevant for legacy target checking ... + switch (op) + { + case OpShiftRightLogical: + case OpUGreaterThan: + case OpUGreaterThanEqual: + case OpULessThan: + case OpULessThanEqual: + case OpUConvert: + case OpUDiv: + case OpUMod: + case OpUMulExtended: + case OpConvertUToF: + case OpConvertFToU: + return true; + + default: + return false; + } +} + +static bool is_unsigned_glsl_opcode(GLSLstd450 op) +{ + // Don't have to be exhaustive, only relevant for legacy target checking ... + switch (op) + { + case GLSLstd450UClamp: + case GLSLstd450UMin: + case GLSLstd450UMax: + case GLSLstd450FindUMsb: + return true; + + default: + return false; + } +} + static bool packing_is_vec4_padded(BufferPackingStandard packing) { switch (packing) @@ -309,7 +348,7 @@ void CompilerGLSL::find_static_extensions() if (options.es) SPIRV_CROSS_THROW("FP64 not supported in ES profile."); if (!options.es && options.version < 400) - require_extension("GL_ARB_gpu_shader_fp64"); + require_extension_internal("GL_ARB_gpu_shader_fp64"); } if (type.basetype == SPIRType::Int64 || type.basetype == SPIRType::UInt64) @@ -317,8 +356,11 @@ void CompilerGLSL::find_static_extensions() if (options.es) SPIRV_CROSS_THROW("64-bit integers not supported in ES profile."); if (!options.es) - require_extension("GL_ARB_gpu_shader_int64"); + require_extension_internal("GL_ARB_gpu_shader_int64"); } + + if (type.basetype == SPIRType::Half) + require_extension_internal("GL_AMD_gpu_shader_half_float"); } } @@ -327,31 +369,31 @@ void CompilerGLSL::find_static_extensions() { case ExecutionModelGLCompute: if (!options.es && options.version < 430) - require_extension("GL_ARB_compute_shader"); + require_extension_internal("GL_ARB_compute_shader"); if (options.es && options.version < 310) SPIRV_CROSS_THROW("At least ESSL 3.10 required for compute shaders."); break; case ExecutionModelGeometry: if (options.es && options.version < 320) - require_extension("GL_EXT_geometry_shader"); + require_extension_internal("GL_EXT_geometry_shader"); if (!options.es && options.version < 150) - require_extension("GL_ARB_geometry_shader4"); + require_extension_internal("GL_ARB_geometry_shader4"); - if ((execution.flags & (1ull << ExecutionModeInvocations)) && execution.invocations != 1) + if (execution.flags.get(ExecutionModeInvocations) && execution.invocations != 1) { // Instanced GS is part of 400 core or this extension. if (!options.es && options.version < 400) - require_extension("GL_ARB_gpu_shader5"); + require_extension_internal("GL_ARB_gpu_shader5"); } break; case ExecutionModelTessellationEvaluation: case ExecutionModelTessellationControl: if (options.es && options.version < 320) - require_extension("GL_EXT_tessellation_shader"); + require_extension_internal("GL_EXT_tessellation_shader"); if (!options.es && options.version < 400) - require_extension("GL_ARB_tessellation_shader"); + require_extension_internal("GL_ARB_tessellation_shader"); break; default: @@ -359,10 +401,10 @@ void CompilerGLSL::find_static_extensions() } if (!pls_inputs.empty() || !pls_outputs.empty()) - require_extension("GL_EXT_shader_pixel_local_storage"); + require_extension_internal("GL_EXT_shader_pixel_local_storage"); if (options.separate_shader_objects && !options.es && options.version < 410) - require_extension("GL_ARB_separate_shader_objects"); + require_extension_internal("GL_ARB_separate_shader_objects"); } string CompilerGLSL::compile() @@ -376,6 +418,7 @@ string CompilerGLSL::compile() backend.supports_extensions = true; // Scan the SPIR-V to find trivial uses of extensions. + build_function_control_flow_graphs_and_analyze(); find_static_extensions(); fixup_image_load_store_access(); update_active_builtins(); @@ -395,7 +438,7 @@ string CompilerGLSL::compile() emit_header(); emit_resources(); - emit_function(get(entry_point), 0); + emit_function(get(entry_point), Bitset()); pass_count++; } while (force_recompile); @@ -426,8 +469,8 @@ void CompilerGLSL::emit_header() statement("#endif"); } // Needed for: layout(early_fragment_tests) in; - if (execution.flags & (1ull << ExecutionModeEarlyFragmentTests)) - require_extension("GL_ARB_shader_image_load_store"); + if (execution.flags.get(ExecutionModeEarlyFragmentTests)) + require_extension_internal("GL_ARB_shader_image_load_store"); } for (auto &ext : forced_extensions) @@ -443,54 +486,54 @@ void CompilerGLSL::emit_header() { case ExecutionModelGeometry: outputs.push_back(join("max_vertices = ", execution.output_vertices)); - if ((execution.flags & (1ull << ExecutionModeInvocations)) && execution.invocations != 1) + if ((execution.flags.get(ExecutionModeInvocations)) && execution.invocations != 1) inputs.push_back(join("invocations = ", execution.invocations)); - if (execution.flags & (1ull << ExecutionModeInputPoints)) + if (execution.flags.get(ExecutionModeInputPoints)) inputs.push_back("points"); - if (execution.flags & (1ull << ExecutionModeInputLines)) + if (execution.flags.get(ExecutionModeInputLines)) inputs.push_back("lines"); - if (execution.flags & (1ull << ExecutionModeInputLinesAdjacency)) + if (execution.flags.get(ExecutionModeInputLinesAdjacency)) inputs.push_back("lines_adjacency"); - if (execution.flags & (1ull << ExecutionModeTriangles)) + if (execution.flags.get(ExecutionModeTriangles)) inputs.push_back("triangles"); - if (execution.flags & (1ull << ExecutionModeInputTrianglesAdjacency)) + if (execution.flags.get(ExecutionModeInputTrianglesAdjacency)) inputs.push_back("triangles_adjacency"); - if (execution.flags & (1ull << ExecutionModeOutputTriangleStrip)) + if (execution.flags.get(ExecutionModeOutputTriangleStrip)) outputs.push_back("triangle_strip"); - if (execution.flags & (1ull << ExecutionModeOutputPoints)) + if (execution.flags.get(ExecutionModeOutputPoints)) outputs.push_back("points"); - if (execution.flags & (1ull << ExecutionModeOutputLineStrip)) + if (execution.flags.get(ExecutionModeOutputLineStrip)) outputs.push_back("line_strip"); break; case ExecutionModelTessellationControl: - if (execution.flags & (1ull << ExecutionModeOutputVertices)) + if (execution.flags.get(ExecutionModeOutputVertices)) outputs.push_back(join("vertices = ", execution.output_vertices)); break; case ExecutionModelTessellationEvaluation: - if (execution.flags & (1ull << ExecutionModeQuads)) + if (execution.flags.get(ExecutionModeQuads)) inputs.push_back("quads"); - if (execution.flags & (1ull << ExecutionModeTriangles)) + if (execution.flags.get(ExecutionModeTriangles)) inputs.push_back("triangles"); - if (execution.flags & (1ull << ExecutionModeIsolines)) + if (execution.flags.get(ExecutionModeIsolines)) inputs.push_back("isolines"); - if (execution.flags & (1ull << ExecutionModePointMode)) + if (execution.flags.get(ExecutionModePointMode)) inputs.push_back("point_mode"); - if ((execution.flags & (1ull << ExecutionModeIsolines)) == 0) + if (!execution.flags.get(ExecutionModeIsolines)) { - if (execution.flags & (1ull << ExecutionModeVertexOrderCw)) + if (execution.flags.get(ExecutionModeVertexOrderCw)) inputs.push_back("cw"); - if (execution.flags & (1ull << ExecutionModeVertexOrderCcw)) + if (execution.flags.get(ExecutionModeVertexOrderCcw)) inputs.push_back("ccw"); } - if (execution.flags & (1ull << ExecutionModeSpacingFractionalEven)) + if (execution.flags.get(ExecutionModeSpacingFractionalEven)) inputs.push_back("fractional_even_spacing"); - if (execution.flags & (1ull << ExecutionModeSpacingFractionalOdd)) + if (execution.flags.get(ExecutionModeSpacingFractionalOdd)) inputs.push_back("fractional_odd_spacing"); - if (execution.flags & (1ull << ExecutionModeSpacingEqual)) + if (execution.flags.get(ExecutionModeSpacingEqual)) inputs.push_back("equal_spacing"); break; @@ -580,11 +623,11 @@ void CompilerGLSL::emit_header() } } - if (execution.flags & (1ull << ExecutionModeEarlyFragmentTests)) + if (execution.flags.get(ExecutionModeEarlyFragmentTests)) inputs.push_back("early_fragment_tests"); - if (execution.flags & (1ull << ExecutionModeDepthGreater)) + if (execution.flags.get(ExecutionModeDepthGreater)) inputs.push_back("depth_greater"); - if (execution.flags & (1ull << ExecutionModeDepthLess)) + if (execution.flags.get(ExecutionModeDepthLess)) inputs.push_back("depth_less"); break; @@ -612,13 +655,8 @@ void CompilerGLSL::emit_struct(SPIRType &type) // with just different offsets, matrix layouts, etc ... // Type-punning with these types is legal, which complicates things // when we are storing struct and array types in an SSBO for example. - if (type.type_alias != 0) - return; - - // Don't declare empty structs in GLSL, this is not allowed. - // Empty structs is a corner case of HLSL output, and only sensible thing to do is avoiding to declare - // these types. - if (type_is_empty(type)) + // If the type master is packed however, we can no longer assume that the struct declaration will be redundant. + if (type.type_alias != 0 && !has_decoration(type.type_alias, DecorationCPacked)) return; add_resource_name(type.self); @@ -638,45 +676,39 @@ void CompilerGLSL::emit_struct(SPIRType &type) i++; emitted = true; } + + // Don't declare empty structs in GLSL, this is not allowed. + if (type_is_empty(type) && !backend.supports_empty_struct) + { + statement("int empty_struct_member;"); + emitted = true; + } + end_scope_decl(); if (emitted) statement(""); } -uint64_t CompilerGLSL::combined_decoration_for_member(const SPIRType &type, uint32_t index) -{ - uint64_t flags = 0; - auto &memb = meta[type.self].members; - if (index >= memb.size()) - return 0; - auto &dec = memb[index]; - - // If our type is a struct, traverse all the members as well recursively. - flags |= dec.decoration_flags; - for (uint32_t i = 0; i < type.member_types.size(); i++) - flags |= combined_decoration_for_member(get(type.member_types[i]), i); - - return flags; -} - -string CompilerGLSL::to_interpolation_qualifiers(uint64_t flags) +string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags) { string res; //if (flags & (1ull << DecorationSmooth)) // res += "smooth "; - if (flags & (1ull << DecorationFlat)) + if (flags.get(DecorationFlat)) res += "flat "; - if (flags & (1ull << DecorationNoPerspective)) + if (flags.get(DecorationNoPerspective)) res += "noperspective "; - if (flags & (1ull << DecorationCentroid)) + if (flags.get(DecorationCentroid)) res += "centroid "; - if (flags & (1ull << DecorationPatch)) + if (flags.get(DecorationPatch)) res += "patch "; - if (flags & (1ull << DecorationSample)) + if (flags.get(DecorationSample)) res += "sample "; - if (flags & (1ull << DecorationInvariant)) + if (flags.get(DecorationInvariant)) res += "invariant "; + if (flags.get(DecorationExplicitInterpAMD)) + res += "__explicitInterpAMD "; return res; } @@ -686,8 +718,8 @@ string CompilerGLSL::layout_for_member(const SPIRType &type, uint32_t index) if (is_legacy()) return ""; - bool is_block = (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; + bool is_block = meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); if (!is_block) return ""; @@ -714,18 +746,18 @@ string CompilerGLSL::layout_for_member(const SPIRType &type, uint32_t index) // buffer UBO { layout(row_major) Foo foo; }; // Apply the layout on top-level. auto flags = combined_decoration_for_member(type, index); - if (flags & (1ull << DecorationRowMajor)) + if (flags.get(DecorationRowMajor)) attr.push_back("row_major"); // We don't emit any global layouts, so column_major is default. //if (flags & (1ull << DecorationColMajor)) // attr.push_back("column_major"); - if ((dec.decoration_flags & (1ull << DecorationLocation)) != 0 && can_use_io_location(type.storage)) + if (dec.decoration_flags.get(DecorationLocation) && can_use_io_location(type.storage, true)) attr.push_back(join("location = ", dec.location)); // DecorationCPacked is set by layout_for_variable earlier to mark that we need to emit offset qualifiers. // This is only done selectively in GLSL as needed. - if (has_decoration(type.self, DecorationCPacked) && (dec.decoration_flags & (1ull << DecorationOffset)) != 0) + if (has_decoration(type.self, DecorationCPacked) && dec.decoration_flags.get(DecorationOffset)) attr.push_back(join("offset = ", dec.offset)); if (attr.empty()) @@ -739,10 +771,8 @@ string CompilerGLSL::layout_for_member(const SPIRType &type, uint32_t index) const char *CompilerGLSL::format_to_glsl(spv::ImageFormat format) { - auto check_desktop = [this] { - if (options.es) - SPIRV_CROSS_THROW("Attempting to use image format not supported in ES profile."); - }; + if (options.es && is_desktop_only_format(format)) + SPIRV_CROSS_THROW("Attempting to use image format not supported in ES profile."); switch (format) { @@ -760,7 +790,6 @@ const char *CompilerGLSL::format_to_glsl(spv::ImageFormat format) return "rg32f"; case ImageFormatRg16f: return "rg16f"; - case ImageFormatRgba32i: return "rgba32i"; case ImageFormatRgba16i: @@ -773,7 +802,6 @@ const char *CompilerGLSL::format_to_glsl(spv::ImageFormat format) return "rg32i"; case ImageFormatRg16i: return "rg16i"; - case ImageFormatRgba32ui: return "rgba32ui"; case ImageFormatRgba16ui: @@ -786,71 +814,46 @@ const char *CompilerGLSL::format_to_glsl(spv::ImageFormat format) return "rg32ui"; case ImageFormatRg16ui: return "rg16ui"; - - // Desktop-only formats case ImageFormatR11fG11fB10f: - check_desktop(); return "r11f_g11f_b10f"; case ImageFormatR16f: - check_desktop(); return "r16f"; case ImageFormatRgb10A2: - check_desktop(); return "rgb10_a2"; case ImageFormatR8: - check_desktop(); return "r8"; case ImageFormatRg8: - check_desktop(); return "rg8"; case ImageFormatR16: - check_desktop(); return "r16"; case ImageFormatRg16: - check_desktop(); return "rg16"; case ImageFormatRgba16: - check_desktop(); return "rgba16"; case ImageFormatR16Snorm: - check_desktop(); return "r16_snorm"; case ImageFormatRg16Snorm: - check_desktop(); return "rg16_snorm"; case ImageFormatRgba16Snorm: - check_desktop(); return "rgba16_snorm"; case ImageFormatR8Snorm: - check_desktop(); return "r8_snorm"; case ImageFormatRg8Snorm: - check_desktop(); return "rg8_snorm"; - case ImageFormatR8ui: - check_desktop(); return "r8ui"; case ImageFormatRg8ui: - check_desktop(); return "rg8ui"; case ImageFormatR16ui: - check_desktop(); return "r16ui"; case ImageFormatRgb10a2ui: - check_desktop(); return "rgb10_a2ui"; - case ImageFormatR8i: - check_desktop(); return "r8i"; case ImageFormatRg8i: - check_desktop(); return "rg8i"; case ImageFormatR16i: - check_desktop(); return "r16i"; - default: case ImageFormatUnknown: return nullptr; @@ -865,15 +868,21 @@ uint32_t CompilerGLSL::type_to_packed_base_size(const SPIRType &type, BufferPack case SPIRType::Int64: case SPIRType::UInt64: return 8; - default: + case SPIRType::Float: + case SPIRType::Int: + case SPIRType::UInt: return 4; + case SPIRType::Half: + return 2; + + default: + SPIRV_CROSS_THROW("Unrecognized type in type_to_packed_base_size."); } } -uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, uint64_t flags, BufferPackingStandard packing) +uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, const Bitset &flags, + BufferPackingStandard packing) { - const uint32_t base_alignment = type_to_packed_base_size(type, packing); - if (!type.array.empty()) { uint32_t minimum_alignment = 1; @@ -907,6 +916,8 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, uint64_t f } else { + const uint32_t base_alignment = type_to_packed_base_size(type, packing); + // Vectors are *not* aligned in HLSL, but there's an extra rule where vectors cannot straddle // a vec4, this is handled outside since that part knows our current offset. if (type.columns == 1 && packing_is_hlsl(packing)) @@ -929,7 +940,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, uint64_t f // Rule 5. Column-major matrices are stored as arrays of // vectors. - if ((flags & (1ull << DecorationColMajor)) && type.columns > 1) + if (flags.get(DecorationColMajor) && type.columns > 1) { if (packing_is_vec4_padded(packing)) return 4 * base_alignment; @@ -942,7 +953,7 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, uint64_t f // Rule 6 implied. // Rule 7. - if ((flags & (1ull << DecorationRowMajor)) && type.vecsize > 1) + if (flags.get(DecorationRowMajor) && type.vecsize > 1) { if (packing_is_vec4_padded(packing)) return 4 * base_alignment; @@ -958,7 +969,8 @@ uint32_t CompilerGLSL::type_to_packed_alignment(const SPIRType &type, uint64_t f SPIRV_CROSS_THROW("Did not find suitable rule for type. Bogus decorations?"); } -uint32_t CompilerGLSL::type_to_packed_array_stride(const SPIRType &type, uint64_t flags, BufferPackingStandard packing) +uint32_t CompilerGLSL::type_to_packed_array_stride(const SPIRType &type, const Bitset &flags, + BufferPackingStandard packing) { // Array stride is equal to aligned size of the underlying type. uint32_t parent = type.parent_type; @@ -980,7 +992,7 @@ uint32_t CompilerGLSL::type_to_packed_array_stride(const SPIRType &type, uint64_ } } -uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, uint64_t flags, BufferPackingStandard packing) +uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing) { if (!type.array.empty()) { @@ -988,7 +1000,6 @@ uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, uint64_t flags, type_to_packed_array_stride(type, flags, packing); } - const uint32_t base_alignment = type_to_packed_base_size(type, packing); uint32_t size = 0; if (type.basetype == SPIRType::Struct) @@ -1016,10 +1027,12 @@ uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, uint64_t flags, } else { + const uint32_t base_alignment = type_to_packed_base_size(type, packing); + if (type.columns == 1) size = type.vecsize * base_alignment; - if ((flags & (1ull << DecorationColMajor)) && type.columns > 1) + if (flags.get(DecorationColMajor) && type.columns > 1) { if (packing_is_vec4_padded(packing)) size = type.columns * 4 * base_alignment; @@ -1029,7 +1042,7 @@ uint32_t CompilerGLSL::type_to_packed_size(const SPIRType &type, uint64_t flags, size = type.columns * type.vecsize * base_alignment; } - if ((flags & (1ull << DecorationRowMajor)) && type.vecsize > 1) + if (flags.get(DecorationRowMajor) && type.vecsize > 1) { if (packing_is_vec4_padded(packing)) size = type.vecsize * 4 * base_alignment; @@ -1126,14 +1139,17 @@ bool CompilerGLSL::buffer_is_packing_standard(const SPIRType &type, BufferPackin return true; } -bool CompilerGLSL::can_use_io_location(StorageClass storage) +bool CompilerGLSL::can_use_io_location(StorageClass storage, bool block) { // Location specifiers are must have in SPIR-V, but they aren't really supported in earlier versions of GLSL. // Be very explicit here about how to solve the issue. if ((get_execution_model() != ExecutionModelVertex && storage == StorageClassInput) || (get_execution_model() != ExecutionModelFragment && storage == StorageClassOutput)) { - if (!options.es && options.version < 410 && !options.separate_shader_objects) + uint32_t minimum_desktop_version = block ? 440 : 410; + // ARB_enhanced_layouts vs ARB_separate_shader_objects ... + + if (!options.es && options.version < minimum_desktop_version && !options.separate_shader_objects) return false; else if (options.es && options.version < 310) return false; @@ -1148,6 +1164,14 @@ bool CompilerGLSL::can_use_io_location(StorageClass storage) return false; } + if (storage == StorageClassUniform || storage == StorageClassUniformConstant) + { + if (options.es && options.version < 310) + return false; + else if (!options.es && options.version < 430) + return false; + } + return true; } @@ -1170,56 +1194,67 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) if (options.vulkan_semantics && var.storage == StorageClassPushConstant) attr.push_back("push_constant"); - if (flags & (1ull << DecorationRowMajor)) + if (flags.get(DecorationRowMajor)) attr.push_back("row_major"); - if (flags & (1ull << DecorationColMajor)) + if (flags.get(DecorationColMajor)) attr.push_back("column_major"); if (options.vulkan_semantics) { - if (flags & (1ull << DecorationInputAttachmentIndex)) + if (flags.get(DecorationInputAttachmentIndex)) attr.push_back(join("input_attachment_index = ", dec.input_attachment)); } - if ((flags & (1ull << DecorationLocation)) != 0 && can_use_io_location(var.storage)) + bool is_block = has_decoration(type.self, DecorationBlock); + if (flags.get(DecorationLocation) && can_use_io_location(var.storage, is_block)) { - uint64_t combined_decoration = 0; + Bitset combined_decoration; for (uint32_t i = 0; i < meta[type.self].members.size(); i++) - combined_decoration |= combined_decoration_for_member(type, i); + combined_decoration.merge_or(combined_decoration_for_member(type, i)); // If our members have location decorations, we don't need to // emit location decorations at the top as well (looks weird). - if ((combined_decoration & (1ull << DecorationLocation)) == 0) + if (!combined_decoration.get(DecorationLocation)) attr.push_back(join("location = ", dec.location)); } - // set = 0 is the default. Do not emit set = decoration in regular GLSL output, but - // we should preserve it in Vulkan GLSL mode. + if (flags.get(DecorationIndex)) + attr.push_back(join("index = ", dec.index)); + + // Do not emit set = decoration in regular GLSL output, but + // we need to preserve it in Vulkan GLSL mode. if (var.storage != StorageClassPushConstant) { - if ((flags & (1ull << DecorationDescriptorSet)) && (dec.set != 0 || options.vulkan_semantics)) + if (flags.get(DecorationDescriptorSet) && options.vulkan_semantics) attr.push_back(join("set = ", dec.set)); } + // GL 3.0/GLSL 1.30 is not considered legacy, but it doesn't have UBOs ... + bool can_use_buffer_blocks = (options.es && options.version >= 300) || (!options.es && options.version >= 140); + bool can_use_binding; if (options.es) can_use_binding = options.version >= 310; else can_use_binding = options.enable_420pack_extension || (options.version >= 420); - if (can_use_binding && (flags & (1ull << DecorationBinding))) + // Make sure we don't emit binding layout for a classic uniform on GLSL 1.30. + if (!can_use_buffer_blocks && var.storage == StorageClassUniform) + can_use_binding = false; + + if (can_use_binding && flags.get(DecorationBinding)) attr.push_back(join("binding = ", dec.binding)); - if (flags & (1ull << DecorationOffset)) + if (flags.get(DecorationOffset)) attr.push_back(join("offset = ", dec.offset)); bool push_constant_block = options.vulkan_semantics && var.storage == StorageClassPushConstant; bool ssbo_block = var.storage == StorageClassStorageBuffer || - (var.storage == StorageClassUniform && (typeflags & (1ull << DecorationBufferBlock))); + (var.storage == StorageClassUniform && typeflags.get(DecorationBufferBlock)); // Instead of adding explicit offsets for every element here, just assume we're using std140 or std430. // If SPIR-V does not comply with either layout, we cannot really work around it. - if (var.storage == StorageClassUniform && (typeflags & (1ull << DecorationBlock))) + if (can_use_buffer_blocks && var.storage == StorageClassUniform && typeflags.get(DecorationBlock)) { if (buffer_is_packing_standard(type, BufferPackingStd140)) attr.push_back("std140"); @@ -1233,7 +1268,7 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) SPIRV_CROSS_THROW("Push constant block cannot be expressed as neither std430 nor std140. ES-targets do " "not support GL_ARB_enhanced_layouts."); if (!options.es && !options.vulkan_semantics && options.version < 440) - require_extension("GL_ARB_enhanced_layouts"); + require_extension_internal("GL_ARB_enhanced_layouts"); // This is a very last minute to check for this, but use this unused decoration to mark that we should emit // explicit offsets for this block type. @@ -1249,7 +1284,7 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) "support a more flexible layout."); } } - else if (push_constant_block || ssbo_block) + else if (can_use_buffer_blocks && (push_constant_block || ssbo_block)) { if (buffer_is_packing_standard(type, BufferPackingStd430)) attr.push_back("std430"); @@ -1266,7 +1301,7 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) SPIRV_CROSS_THROW("Push constant block cannot be expressed as neither std430 nor std140. ES-targets do " "not support GL_ARB_enhanced_layouts."); if (!options.es && !options.vulkan_semantics && options.version < 440) - require_extension("GL_ARB_enhanced_layouts"); + require_extension_internal("GL_ARB_enhanced_layouts"); set_decoration(type.self, DecorationCPacked); } @@ -1277,7 +1312,7 @@ string CompilerGLSL::layout_for_variable(const SPIRVariable &var) SPIRV_CROSS_THROW("Push constant block cannot be expressed as neither std430 nor std140. ES-targets do " "not support GL_ARB_enhanced_layouts."); if (!options.es && !options.vulkan_semantics && options.version < 440) - require_extension("GL_ARB_enhanced_layouts"); + require_extension_internal("GL_ARB_enhanced_layouts"); set_decoration(type.self, DecorationCPacked); } @@ -1327,7 +1362,8 @@ void CompilerGLSL::emit_push_constant_block_glsl(const SPIRVariable &var) auto &type = get(var.basetype); auto &flags = meta[var.self].decoration.decoration_flags; - flags &= ~((1ull << DecorationBinding) | (1ull << DecorationDescriptorSet)); + flags.clear(DecorationBinding); + flags.clear(DecorationDescriptorSet); #if 0 if (flags & ((1ull << DecorationBinding) | (1ull << DecorationDescriptorSet))) @@ -1338,12 +1374,13 @@ void CompilerGLSL::emit_push_constant_block_glsl(const SPIRVariable &var) // We're emitting the push constant block as a regular struct, so disable the block qualifier temporarily. // Otherwise, we will end up emitting layout() qualifiers on naked structs which is not allowed. auto &block_flags = meta[type.self].decoration.decoration_flags; - uint64_t block_flag = block_flags & (1ull << DecorationBlock); - block_flags &= ~block_flag; + bool block_flag = block_flags.get(DecorationBlock); + block_flags.clear(DecorationBlock); emit_struct(type); - block_flags |= block_flag; + if (block_flag) + block_flags.set(DecorationBlock); emit_uniform(var); statement(""); @@ -1353,7 +1390,7 @@ void CompilerGLSL::emit_buffer_block(const SPIRVariable &var) { if (flattened_buffer_blocks.count(var.self)) emit_buffer_block_flattened(var); - else if (is_legacy()) + else if (is_legacy() || (!options.es && options.version == 130)) emit_buffer_block_legacy(var); else emit_buffer_block_native(var); @@ -1363,17 +1400,18 @@ void CompilerGLSL::emit_buffer_block_legacy(const SPIRVariable &var) { auto &type = get(var.basetype); bool ssbo = var.storage == StorageClassStorageBuffer || - ((meta[type.self].decoration.decoration_flags & (1ull << DecorationBufferBlock)) != 0); + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); if (ssbo) SPIRV_CROSS_THROW("SSBOs not supported in legacy targets."); // We're emitting the push constant block as a regular struct, so disable the block qualifier temporarily. // Otherwise, we will end up emitting layout() qualifiers on naked structs which is not allowed. auto &block_flags = meta[type.self].decoration.decoration_flags; - uint64_t block_flag = block_flags & (1ull << DecorationBlock); - block_flags &= ~block_flag; + bool block_flag = block_flags.get(DecorationBlock); + block_flags.clear(DecorationBlock); emit_struct(type); - block_flags |= block_flag; + if (block_flag) + block_flags.set(DecorationBlock); emit_uniform(var); statement(""); } @@ -1382,13 +1420,13 @@ void CompilerGLSL::emit_buffer_block_native(const SPIRVariable &var) { auto &type = get(var.basetype); - uint64_t flags = get_buffer_block_flags(var); + Bitset flags = get_buffer_block_flags(var); bool ssbo = var.storage == StorageClassStorageBuffer || - ((meta[type.self].decoration.decoration_flags & (1ull << DecorationBufferBlock)) != 0); - bool is_restrict = ssbo && (flags & (1ull << DecorationRestrict)) != 0; - bool is_writeonly = ssbo && (flags & (1ull << DecorationNonReadable)) != 0; - bool is_readonly = ssbo && (flags & (1ull << DecorationNonWritable)) != 0; - bool is_coherent = ssbo && (flags & (1ull << DecorationCoherent)) != 0; + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + bool is_restrict = ssbo && flags.get(DecorationRestrict); + bool is_writeonly = ssbo && flags.get(DecorationNonReadable); + bool is_readonly = ssbo && flags.get(DecorationNonWritable); + bool is_coherent = ssbo && flags.get(DecorationCoherent); // Block names should never alias, but from HLSL input they kind of can because block types are reused for UAVs ... auto buffer_name = to_name(type.self, false); @@ -1485,7 +1523,7 @@ void CompilerGLSL::emit_flattened_io_block(const SPIRVariable &var, const char * auto old_flags = meta[type.self].decoration.decoration_flags; // Emit the members as if they are part of a block to get all qualifiers. - meta[type.self].decoration.decoration_flags |= 1ull << DecorationBlock; + meta[type.self].decoration.decoration_flags.set(DecorationBlock); type.member_name_cache.clear(); @@ -1522,7 +1560,7 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var) auto &type = get(var.basetype); // Either make it plain in/out or in/out blocks depending on what shader is doing ... - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); const char *qual = to_storage_qualifiers_glsl(var); if (block) @@ -1542,7 +1580,7 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var) { // Geometry and tessellation extensions imply this extension. if (!has_extension("GL_EXT_geometry_shader") && !has_extension("GL_EXT_tessellation_shader")) - require_extension("GL_EXT_shader_io_blocks"); + require_extension_internal("GL_EXT_shader_io_blocks"); } // Block names should never alias. @@ -1597,7 +1635,7 @@ void CompilerGLSL::emit_uniform(const SPIRVariable &var) if (type.basetype == SPIRType::Image && type.image.sampled == 2) { if (!options.es && options.version < 420) - require_extension("GL_ARB_shader_image_load_store"); + require_extension_internal("GL_ARB_shader_image_load_store"); else if (options.es && options.version < 310) SPIRV_CROSS_THROW("At least ESSL 3.10 required for shader image load store."); } @@ -1606,7 +1644,14 @@ void CompilerGLSL::emit_uniform(const SPIRVariable &var) statement(layout_for_variable(var), variable_decl(var), ";"); } -void CompilerGLSL::emit_specialization_constant(const SPIRConstant &constant) +void CompilerGLSL::emit_specialization_constant_op(const SPIRConstantOp &constant) +{ + auto &type = get(constant.basetype); + auto name = to_name(constant.self); + statement("const ", variable_decl(type, name), " = ", constant_op_expression(constant), ";"); +} + +void CompilerGLSL::emit_constant(const SPIRConstant &constant) { auto &type = get(constant.constant_type); auto name = to_name(constant.self); @@ -1633,11 +1678,38 @@ void CompilerGLSL::emit_specialization_constant(const SPIRConstant &constant) } } +void CompilerGLSL::emit_entry_point_declarations() +{ +} + void CompilerGLSL::replace_illegal_names() { // clang-format off static const unordered_set keywords = { - "active", "asm", "atomic_uint", "attribute", "bool", "break", + "abs", "acos", "acosh", "all", "any", "asin", "asinh", "atan", "atanh", + "atomicAdd", "atomicCompSwap", "atomicCounter", "atomicCounterDecrement", "atomicCounterIncrement", + "atomicExchange", "atomicMax", "atomicMin", "atomicOr", "atomicXor", + "bitCount", "bitfieldExtract", "bitfieldInsert", "bitfieldReverse", + "ceil", "cos", "cosh", "cross", "degrees", + "dFdx", "dFdxCoarse", "dFdxFine", + "dFdy", "dFdyCoarse", "dFdyFine", + "distance", "dot", "EmitStreamVertex", "EmitVertex", "EndPrimitive", "EndStreamPrimitive", "equal", "exp", "exp2", + "faceforward", "findLSB", "findMSB", "floatBitsToInt", "floatBitsToUint", "floor", "fma", "fract", "frexp", "fwidth", "fwidthCoarse", "fwidthFine", + "greaterThan", "greaterThanEqual", "groupMemoryBarrier", + "imageAtomicAdd", "imageAtomicAnd", "imageAtomicCompSwap", "imageAtomicExchange", "imageAtomicMax", "imageAtomicMin", "imageAtomicOr", "imageAtomicXor", + "imageLoad", "imageSamples", "imageSize", "imageStore", "imulExtended", "intBitsToFloat", "interpolateAtOffset", "interpolateAtCentroid", "interpolateAtSample", + "inverse", "inversesqrt", "isinf", "isnan", "ldexp", "length", "lessThan", "lessThanEqual", "log", "log2", + "matrixCompMult", "max", "memoryBarrier", "memoryBarrierAtomicCounter", "memoryBarrierBuffer", "memoryBarrierImage", "memoryBarrierShared", + "min", "mix", "mod", "modf", "noise", "noise1", "noise2", "noise3", "noise4", "normalize", "not", "notEqual", + "outerProduct", "packDouble2x32", "packHalf2x16", "packSnorm2x16", "packSnorm4x8", "packUnorm2x16", "packUnorm4x8", "pow", + "radians", "reflect", "refract", "round", "roundEven", "sign", "sin", "sinh", "smoothstep", "sqrt", "step", + "tan", "tanh", "texelFetch", "texelFetchOffset", "texture", "textureGather", "textureGatherOffset", "textureGatherOffsets", + "textureGrad", "textureGradOffset", "textureLod", "textureLodOffset", "textureOffset", "textureProj", "textureProjGrad", + "textureProjGradOffset", "textureProjLod", "textureProjLodOffset", "textureProjOffset", "textureQueryLevels", "textureQueryLod", "textureSamples", "textureSize", + "transpose", "trunc", "uaddCarry", "uintBitsToFloat", "umulExtended", "unpackDouble2x32", "unpackHalf2x16", "unpackSnorm2x16", "unpackSnorm4x8", + "unpackUnorm2x16", "unpackUnorm4x8", "usubBorrow", + + "active", "asm", "atomic_uint", "attribute", "bool", "break", "buffer", "bvec2", "bvec3", "bvec4", "case", "cast", "centroid", "class", "coherent", "common", "const", "continue", "default", "discard", "dmat2", "dmat2x2", "dmat2x3", "dmat2x4", "dmat3", "dmat3x2", "dmat3x3", "dmat3x4", "dmat4", "dmat4x2", "dmat4x3", "dmat4x4", "do", "double", "dvec2", "dvec3", "dvec4", "else", "enum", "extern", "external", "false", "filter", "fixed", "flat", "float", @@ -1646,19 +1718,19 @@ void CompilerGLSL::replace_illegal_names() "iimageCubeArray", "image1D", "image1DArray", "image2D", "image2DArray", "image2DMS", "image2DMSArray", "image2DRect", "image3D", "imageBuffer", "imageCube", "imageCubeArray", "in", "inline", "inout", "input", "int", "interface", "invariant", "isampler1D", "isampler1DArray", "isampler2D", "isampler2DArray", "isampler2DMS", "isampler2DMSArray", "isampler2DRect", - "isampler3D", "isamplerBuffer", "isamplerCube", "isamplerCubeArray", "ivec2", "ivec3", "ivec4", "layout", "line", "linear", "long", "lowp", - "mat2", "mat2x2", "mat2x3", "mat2x4", "mat3", "mat3x2", "mat3x3", "mat3x4", "mat4", "mat4x2", "mat4x3", "mat4x4", "matrix", "mediump", - "namespace", "noinline", "noperspective", "out", "output", "packed", "partition", "patch", "point", "precision", "public", "readonly", - "resource", "restrict", "return", "row_major", "sample", "sampler", "sampler1D", "sampler1DArray", "sampler1DArrayShadow", + "isampler3D", "isamplerBuffer", "isamplerCube", "isamplerCubeArray", "ivec2", "ivec3", "ivec4", "layout", "long", "lowp", + "mat2", "mat2x2", "mat2x3", "mat2x4", "mat3", "mat3x2", "mat3x3", "mat3x4", "mat4", "mat4x2", "mat4x3", "mat4x4", "mediump", + "namespace", "noinline", "noperspective", "out", "output", "packed", "partition", "patch", "precise", "precision", "public", "readonly", + "resource", "restrict", "return", "sample", "sampler1D", "sampler1DArray", "sampler1DArrayShadow", "sampler1DShadow", "sampler2D", "sampler2DArray", "sampler2DArrayShadow", "sampler2DMS", "sampler2DMSArray", "sampler2DRect", "sampler2DRectShadow", "sampler2DShadow", "sampler3D", "sampler3DRect", "samplerBuffer", - "samplerCube", "samplerCubeArray", "samplerCubeArrayShadow", "samplerCubeShadow", "short", "sizeof", "smooth", "static", + "samplerCube", "samplerCubeArray", "samplerCubeArrayShadow", "samplerCubeShadow", "shared", "short", "sizeof", "smooth", "static", "struct", "subroutine", "superp", "switch", "template", "this", "true", "typedef", "uimage1D", "uimage1DArray", "uimage2D", "uimage2DArray", "uimage2DMS", "uimage2DMSArray", "uimage2DRect", "uimage3D", "uimageBuffer", "uimageCube", "uimageCubeArray", "uint", "uniform", "union", "unsigned", "usampler1D", "usampler1DArray", "usampler2D", "usampler2DArray", "usampler2DMS", "usampler2DMSArray", "usampler2DRect", "usampler3D", "usamplerBuffer", "usamplerCube", - "usamplerCubeArray", "using", "uvec2", "uvec3", "uvec4", "varying", "vec2", "vec3", "vec4", "void", "volatile", "volatile", - "while", "writeonly", "texture" + "usamplerCubeArray", "using", "uvec2", "uvec3", "uvec4", "varying", "vec2", "vec3", "vec4", "void", "volatile", + "while", "writeonly", }; // clang-format on @@ -1681,7 +1753,7 @@ void CompilerGLSL::replace_fragment_output(SPIRVariable &var) { auto &m = meta[var.self].decoration; uint32_t location = 0; - if (m.decoration_flags & (1ull << DecorationLocation)) + if (m.decoration_flags.get(DecorationLocation)) location = m.location; // If our variable is arrayed, we must not emit the array part of this as the SPIR-V will @@ -1694,7 +1766,7 @@ void CompilerGLSL::replace_fragment_output(SPIRVariable &var) m.alias = join("gl_FragData[", location, "]"); if (is_legacy_es() && location != 0) - require_extension("GL_EXT_draw_buffers"); + require_extension_internal("GL_EXT_draw_buffers"); } else if (type.array.size() == 1) { @@ -1707,7 +1779,7 @@ void CompilerGLSL::replace_fragment_output(SPIRVariable &var) "This is unimplemented in SPIRV-Cross."); if (is_legacy_es()) - require_extension("GL_EXT_draw_buffers"); + require_extension_internal("GL_EXT_draw_buffers"); } else SPIRV_CROSS_THROW("Array-of-array output variable used. This cannot be implemented in legacy GLSL."); @@ -1739,6 +1811,7 @@ string CompilerGLSL::remap_swizzle(const SPIRType &out_type, uint32_t input_comp return join(type_to_glsl(out_type), "(", expr, ")"); else { + // FIXME: This will not work with packed expressions. auto e = enclose_expression(expr) + "."; // Just clamp the swizzle index if we have more outputs than inputs. for (uint32_t c = 0; c < out_type.vecsize; c++) @@ -1800,18 +1873,19 @@ void CompilerGLSL::fixup_image_load_store_access() // If any no-read/no-write flags are actually set, assume that the compiler knows what it's doing. auto &flags = meta.at(var).decoration.decoration_flags; - static const uint64_t NoWrite = 1ull << DecorationNonWritable; - static const uint64_t NoRead = 1ull << DecorationNonReadable; - if ((flags & (NoWrite | NoRead)) == 0) - flags |= NoRead | NoWrite; + if (!flags.get(DecorationNonWritable) && !flags.get(DecorationNonReadable)) + { + flags.set(DecorationNonWritable); + flags.set(DecorationNonReadable); + } } } } void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionModel model) { - uint64_t emitted_builtins = 0; - uint64_t global_builtins = 0; + Bitset emitted_builtins; + Bitset global_builtins; const SPIRVariable *block_var = nullptr; bool emitted_block = false; bool builtin_array = false; @@ -1829,7 +1903,7 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo auto &var = id.get(); auto &type = get(var.basetype); bool block = has_decoration(type.self, DecorationBlock); - uint64_t builtins = 0; + Bitset builtins; if (var.storage == storage && block && is_builtin_variable(var)) { @@ -1838,7 +1912,7 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo { if (m.builtin) { - builtins |= 1ull << m.builtin_type; + builtins.set(m.builtin_type); if (m.builtin_type == BuiltInCullDistance) cull_distance_size = get(type.member_types[index]).array.front(); else if (m.builtin_type == BuiltInClipDistance) @@ -1853,7 +1927,7 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo auto &m = meta[var.self].decoration; if (m.builtin) { - global_builtins |= 1ull << m.builtin_type; + global_builtins.set(m.builtin_type); if (m.builtin_type == BuiltInCullDistance) cull_distance_size = type.array.front(); else if (m.builtin_type == BuiltInClipDistance) @@ -1861,7 +1935,7 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo } } - if (!builtins) + if (builtins.empty()) continue; if (emitted_block) @@ -1873,15 +1947,16 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo block_var = &var; } - global_builtins &= (1ull << BuiltInPosition) | (1ull << BuiltInPointSize) | (1ull << BuiltInClipDistance) | - (1ull << BuiltInCullDistance); + global_builtins = + Bitset(global_builtins.get_lower() & ((1ull << BuiltInPosition) | (1ull << BuiltInPointSize) | + (1ull << BuiltInClipDistance) | (1ull << BuiltInCullDistance))); // Try to collect all other declared builtins. if (!emitted_block) emitted_builtins = global_builtins; // Can't declare an empty interface block. - if (!emitted_builtins) + if (emitted_builtins.empty()) return; if (storage == StorageClassOutput) @@ -1890,13 +1965,13 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo statement("in gl_PerVertex"); begin_scope(); - if (emitted_builtins & (1ull << BuiltInPosition)) + if (emitted_builtins.get(BuiltInPosition)) statement("vec4 gl_Position;"); - if (emitted_builtins & (1ull << BuiltInPointSize)) + if (emitted_builtins.get(BuiltInPointSize)) statement("float gl_PointSize;"); - if (emitted_builtins & (1ull << BuiltInClipDistance)) + if (emitted_builtins.get(BuiltInClipDistance)) statement("float gl_ClipDistance[", clip_distance_size, "];"); - if (emitted_builtins & (1ull << BuiltInCullDistance)) + if (emitted_builtins.get(BuiltInCullDistance)) statement("float gl_CullDistance[", cull_distance_size, "];"); bool tessellation = model == ExecutionModelTessellationEvaluation || model == ExecutionModelTessellationControl; @@ -1997,20 +2072,25 @@ void CompilerGLSL::emit_resources() // // TODO: If we have the fringe case that we create a spec constant which depends on a struct type, // we'll have to deal with that, but there's currently no known way to express that. - if (options.vulkan_semantics) + for (auto &id : ids) { - for (auto &id : ids) + if (id.get_type() == TypeConstant) { - if (id.get_type() == TypeConstant) - { - auto &c = id.get(); - if (!c.specialization) - continue; + auto &c = id.get(); - emit_specialization_constant(c); + bool needs_declaration = (c.specialization && options.vulkan_semantics) || c.is_used_as_lut; + + if (needs_declaration) + { + emit_constant(c); emitted = true; } } + else if (options.vulkan_semantics && id.get_type() == TypeConstantOp) + { + emit_specialization_constant_op(id.get()); + emitted = true; + } } if (emitted) @@ -2025,8 +2105,8 @@ void CompilerGLSL::emit_resources() { auto &type = id.get(); if (type.basetype == SPIRType::Struct && type.array.empty() && !type.pointer && - (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) == 0) + (!meta[type.self].decoration.decoration_flags.get(DecorationBlock) && + !meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) { emit_struct(type); } @@ -2042,8 +2122,8 @@ void CompilerGLSL::emit_resources() auto &type = get(var.basetype); bool is_block_storage = type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform; - bool has_block_flags = (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; + bool has_block_flags = meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); if (var.storage != StorageClassFunction && type.pointer && is_block_storage && !is_hidden_variable(var) && has_block_flags) @@ -2111,11 +2191,6 @@ void CompilerGLSL::emit_resources() auto &var = id.get(); auto &type = get(var.basetype); - // HLSL output from glslang may emit interface variables which are "empty". - // Just avoid declaring them. - if (type_is_empty(type)) - continue; - if (var.storage != StorageClassFunction && type.pointer && (var.storage == StorageClassInput || var.storage == StorageClassOutput) && interface_variable_exists_in_entry_point(var.self) && !is_hidden_variable(var)) @@ -2127,7 +2202,8 @@ void CompilerGLSL::emit_resources() { // For gl_InstanceIndex emulation on GLES, the API user needs to // supply this uniform. - if (meta[var.self].decoration.builtin_type == BuiltInInstanceIndex && !options.vulkan_semantics) + if (options.vertex.support_nonzero_base_instance && + meta[var.self].decoration.builtin_type == BuiltInInstanceIndex && !options.vulkan_semantics) { statement("uniform int SPIRV_Cross_BaseInstance;"); emitted = true; @@ -2223,9 +2299,9 @@ string CompilerGLSL::enclose_expression(const string &expr) uint32_t paren_count = 0; for (auto c : expr) { - if (c == '(') + if (c == '(' || c == '[') paren_count++; - else if (c == ')') + else if (c == ')' || c == ']') { assert(paren_count); paren_count--; @@ -2254,6 +2330,37 @@ string CompilerGLSL::to_enclosed_expression(uint32_t id) return enclose_expression(to_expression(id)); } +string CompilerGLSL::to_unpacked_expression(uint32_t id) +{ + // If we need to transpose, it will also take care of unpacking rules. + auto *e = maybe_get(id); + bool need_transpose = e && e->need_transpose; + if (!need_transpose && has_decoration(id, DecorationCPacked)) + return unpack_expression_type(to_expression(id), expression_type(id)); + else + return to_expression(id); +} + +string CompilerGLSL::to_enclosed_unpacked_expression(uint32_t id) +{ + // If we need to transpose, it will also take care of unpacking rules. + auto *e = maybe_get(id); + bool need_transpose = e && e->need_transpose; + if (!need_transpose && has_decoration(id, DecorationCPacked)) + return unpack_expression_type(to_expression(id), expression_type(id)); + else + return to_enclosed_expression(id); +} + +string CompilerGLSL::to_extract_component_expression(uint32_t id, uint32_t index) +{ + auto expr = to_enclosed_expression(id); + if (has_decoration(id, DecorationCPacked)) + return join(expr, "[", index, "]"); + else + return join(expr, ".", index_to_swizzle(index)); +} + string CompilerGLSL::to_expression(uint32_t id) { auto itr = invalid_expressions.find(id); @@ -2318,6 +2425,8 @@ string CompilerGLSL::to_expression(uint32_t id) return builtin_to_glsl(dec.builtin_type, StorageClassGeneric); else if (c.specialization && options.vulkan_semantics) return to_name(id); + else if (c.is_used_as_lut) + return to_name(id); else if (type.basetype == SPIRType::Struct && !backend.can_declare_struct_inline) return to_name(id); else if (!type.array.empty() && !backend.can_declare_arrays_inline) @@ -2327,7 +2436,10 @@ string CompilerGLSL::to_expression(uint32_t id) } case TypeConstantOp: - return constant_op_expression(get(id)); + if (options.vulkan_semantics) + return to_name(id); + else + return constant_op_expression(get(id)); case TypeVariable: { @@ -2379,6 +2491,9 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop) bool unary = false; string op; + if (is_legacy() && is_unsigned_opcode(cop.opcode)) + SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy targets."); + // TODO: Find a clean way to reuse emit_instruction. switch (cop.opcode) { @@ -2388,48 +2503,48 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop) op = type_to_glsl_constructor(type); break; -#define BOP(opname, x) \ - case Op##opname: \ - binary = true; \ - op = x; \ +#define GLSL_BOP(opname, x) \ + case Op##opname: \ + binary = true; \ + op = x; \ break -#define UOP(opname, x) \ - case Op##opname: \ - unary = true; \ - op = x; \ +#define GLSL_UOP(opname, x) \ + case Op##opname: \ + unary = true; \ + op = x; \ break - UOP(SNegate, "-"); - UOP(Not, "~"); - BOP(IAdd, "+"); - BOP(ISub, "-"); - BOP(IMul, "*"); - BOP(SDiv, "/"); - BOP(UDiv, "/"); - BOP(UMod, "%"); - BOP(SMod, "%"); - BOP(ShiftRightLogical, ">>"); - BOP(ShiftRightArithmetic, ">>"); - BOP(ShiftLeftLogical, "<<"); - BOP(BitwiseOr, "|"); - BOP(BitwiseXor, "^"); - BOP(BitwiseAnd, "&"); - BOP(LogicalOr, "||"); - BOP(LogicalAnd, "&&"); - UOP(LogicalNot, "!"); - BOP(LogicalEqual, "=="); - BOP(LogicalNotEqual, "!="); - BOP(IEqual, "=="); - BOP(INotEqual, "!="); - BOP(ULessThan, "<"); - BOP(SLessThan, "<"); - BOP(ULessThanEqual, "<="); - BOP(SLessThanEqual, "<="); - BOP(UGreaterThan, ">"); - BOP(SGreaterThan, ">"); - BOP(UGreaterThanEqual, ">="); - BOP(SGreaterThanEqual, ">="); + GLSL_UOP(SNegate, "-"); + GLSL_UOP(Not, "~"); + GLSL_BOP(IAdd, "+"); + GLSL_BOP(ISub, "-"); + GLSL_BOP(IMul, "*"); + GLSL_BOP(SDiv, "/"); + GLSL_BOP(UDiv, "/"); + GLSL_BOP(UMod, "%"); + GLSL_BOP(SMod, "%"); + GLSL_BOP(ShiftRightLogical, ">>"); + GLSL_BOP(ShiftRightArithmetic, ">>"); + GLSL_BOP(ShiftLeftLogical, "<<"); + GLSL_BOP(BitwiseOr, "|"); + GLSL_BOP(BitwiseXor, "^"); + GLSL_BOP(BitwiseAnd, "&"); + GLSL_BOP(LogicalOr, "||"); + GLSL_BOP(LogicalAnd, "&&"); + GLSL_UOP(LogicalNot, "!"); + GLSL_BOP(LogicalEqual, "=="); + GLSL_BOP(LogicalNotEqual, "!="); + GLSL_BOP(IEqual, "=="); + GLSL_BOP(INotEqual, "!="); + GLSL_BOP(ULessThan, "<"); + GLSL_BOP(SLessThan, "<"); + GLSL_BOP(ULessThanEqual, "<="); + GLSL_BOP(SLessThanEqual, "<="); + GLSL_BOP(UGreaterThan, ">"); + GLSL_BOP(SGreaterThan, ">"); + GLSL_BOP(UGreaterThanEqual, ">="); + GLSL_BOP(SGreaterThanEqual, ">="); case OpSelect: { @@ -2441,15 +2556,53 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop) // In order to preserve its compile-time constness in Vulkan GLSL, // we need to reduce the OpSelect expression back to this simplified model. // If we cannot, fail. - if (!to_trivial_mix_op(type, op, cop.arguments[2], cop.arguments[1], cop.arguments[0])) + if (to_trivial_mix_op(type, op, cop.arguments[2], cop.arguments[1], cop.arguments[0])) { - SPIRV_CROSS_THROW( - "Cannot implement specialization constant op OpSelect. " - "Need trivial select implementation which can be resolved to a simple cast from boolean."); + // Implement as a simple cast down below. + } + else + { + // Implement a ternary and pray the compiler understands it :) + return to_ternary_expression(type, cop.arguments[0], cop.arguments[1], cop.arguments[2]); } break; } + case OpVectorShuffle: + { + string expr = type_to_glsl_constructor(type); + expr += "("; + + uint32_t left_components = expression_type(cop.arguments[0]).vecsize; + string left_arg = to_enclosed_expression(cop.arguments[0]); + string right_arg = to_enclosed_expression(cop.arguments[1]); + + for (uint32_t i = 2; i < uint32_t(cop.arguments.size()); i++) + { + uint32_t index = cop.arguments[i]; + if (index >= left_components) + expr += right_arg + "." + "xyzw"[index - left_components]; + else + expr += left_arg + "." + "xyzw"[index]; + + if (i + 1 < uint32_t(cop.arguments.size())) + expr += ", "; + } + + expr += ")"; + return expr; + } + + case OpCompositeExtract: + { + auto expr = + access_chain_internal(cop.arguments[0], &cop.arguments[1], uint32_t(cop.arguments.size() - 1), true, false); + return expr; + } + + case OpCompositeInsert: + SPIRV_CROSS_THROW("OpCompositeInsert spec constant op is not supported."); + default: // Some opcodes are unimplemented here, these are currently not possible to test from glslang. SPIRV_CROSS_THROW("Unimplemented spec constant op."); @@ -2470,8 +2623,8 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop) break; } -#undef BOP -#undef UOP +#undef GLSL_BOP +#undef GLSL_UOP if (binary) { if (cop.arguments.size() < 2) @@ -2566,6 +2719,61 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c) #pragma warning(disable : 4996) #endif +string CompilerGLSL::convert_half_to_string(const SPIRConstant &c, uint32_t col, uint32_t row) +{ + string res; + float float_value = c.scalar_f16(col, row); + + if (std::isnan(float_value) || std::isinf(float_value)) + { + if (backend.half_literal_suffix) + { + // There is no uintBitsToFloat for 16-bit, so have to rely on legacy fallback here. + if (float_value == numeric_limits::infinity()) + res = join("(1.0", backend.half_literal_suffix, " / 0.0", backend.half_literal_suffix, ")"); + else if (float_value == -numeric_limits::infinity()) + res = join("(-1.0", backend.half_literal_suffix, " / 0.0", backend.half_literal_suffix, ")"); + else if (std::isnan(float_value)) + res = join("(0.0", backend.half_literal_suffix, " / 0.0", backend.half_literal_suffix, ")"); + else + SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant."); + } + else + { + SPIRType type; + type.basetype = SPIRType::Half; + type.vecsize = 1; + type.columns = 1; + + if (float_value == numeric_limits::infinity()) + res = join(type_to_glsl(type), "(1.0 / 0.0)"); + else if (float_value == -numeric_limits::infinity()) + res = join(type_to_glsl(type), "(-1.0 / 0.0)"); + else if (std::isnan(float_value)) + res = join(type_to_glsl(type), "(0.0 / 0.0)"); + else + SPIRV_CROSS_THROW("Cannot represent non-finite floating point constant."); + } + } + else + { + if (backend.half_literal_suffix) + res = convert_to_string(float_value) + backend.half_literal_suffix; + else + { + // In HLSL (FXC), it's important to cast the literals to half precision right away. + // There is no literal for it. + SPIRType type; + type.basetype = SPIRType::Half; + type.vecsize = 1; + type.columns = 1; + res = join(type_to_glsl(type), "(", convert_to_string(float_value), ")"); + } + } + + return res; +} + string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col, uint32_t row) { string res; @@ -2649,7 +2857,7 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32 if (options.es) SPIRV_CROSS_THROW("64-bit integers/float not supported in ES profile."); - require_extension("GL_ARB_gpu_shader_int64"); + require_extension_internal("GL_ARB_gpu_shader_int64"); char print_buffer[64]; sprintf(print_buffer, "0x%llx%s", static_cast(u64_value), @@ -2661,7 +2869,7 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32 if (options.es) SPIRV_CROSS_THROW("FP64 not supported in ES profile."); if (options.version < 400) - require_extension("GL_ARB_gpu_shader_fp64"); + require_extension_internal("GL_ARB_gpu_shader_fp64"); if (double_value == numeric_limits::infinity()) { @@ -2711,7 +2919,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t bool splat = backend.use_constructor_splatting && c.vector_size() > 1; bool swizzle_splat = backend.can_swizzle_scalar && c.vector_size() > 1; - if (type.basetype != SPIRType::Float && type.basetype != SPIRType::Double) + if (!type_is_floating_point(type)) { // Cannot swizzle literal integers as a special case. swizzle_splat = false; @@ -2765,6 +2973,28 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t switch (type.basetype) { + case SPIRType::Half: + if (splat || swizzle_splat) + { + res += convert_half_to_string(c, vector, 0); + if (swizzle_splat) + res = remap_swizzle(get(c.constant_type), 1, res); + } + else + { + for (uint32_t i = 0; i < c.vector_size(); i++) + { + if (options.vulkan_semantics && c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0) + res += to_name(c.specialization_constant_id(vector, i)); + else + res += convert_half_to_string(c, vector, i); + + if (i + 1 < c.vector_size()) + res += ", "; + } + } + break; + case SPIRType::Float: if (splat || swizzle_splat) { @@ -2873,7 +3103,14 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t if (splat) { res += convert_to_string(c.scalar(vector, 0)); - if (backend.uint32_t_literal_suffix) + if (is_legacy()) + { + // Fake unsigned constant literals with signed ones if possible. + // Things like array sizes, etc, tend to be unsigned even though they could just as easily be signed. + if (c.scalar_i32(vector, 0) < 0) + SPIRV_CROSS_THROW("Tried to convert uint literal into int, but this made the literal negative."); + } + else if (backend.uint32_t_literal_suffix) res += "u"; } else @@ -2885,7 +3122,15 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t else { res += convert_to_string(c.scalar(vector, i)); - if (backend.uint32_t_literal_suffix) + if (is_legacy()) + { + // Fake unsigned constant literals with signed ones if possible. + // Things like array sizes, etc, tend to be unsigned even though they could just as easily be signed. + if (c.scalar_i32(vector, i) < 0) + SPIRV_CROSS_THROW( + "Tried to convert uint literal into int, but this made the literal negative."); + } + else if (backend.uint32_t_literal_suffix) res += "u"; } @@ -2970,6 +3215,7 @@ string CompilerGLSL::declare_temporary(uint32_t result_type, uint32_t result_id) else { // The result_id has not been made into an expression yet, so use flags interface. + add_local_variable_name(result_id); return join(flags_to_precision_qualifiers_glsl(type, flags), variable_decl(type, to_name(result_id)), " = "); } } @@ -3002,15 +3248,15 @@ SPIRExpression &CompilerGLSL::emit_op(uint32_t result_type, uint32_t result_id, void CompilerGLSL::emit_unary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op) { bool forward = should_forward(op0); - emit_op(result_type, result_id, join(op, to_enclosed_expression(op0)), forward); + emit_op(result_type, result_id, join(op, to_enclosed_unpacked_expression(op0)), forward); inherit_expression_dependencies(result_id, op0); } void CompilerGLSL::emit_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op) { bool forward = should_forward(op0) && should_forward(op1); - emit_op(result_type, result_id, join(to_enclosed_expression(op0), " ", op, " ", to_enclosed_expression(op1)), - forward); + emit_op(result_type, result_id, + join(to_enclosed_unpacked_expression(op0), " ", op, " ", to_enclosed_unpacked_expression(op1)), forward); inherit_expression_dependencies(result_id, op0); inherit_expression_dependencies(result_id, op1); @@ -3026,9 +3272,7 @@ void CompilerGLSL::emit_unrolled_unary_op(uint32_t result_type, uint32_t result_ // Make sure to call to_expression multiple times to ensure // that these expressions are properly flushed to temporaries if needed. expr += op; - expr += to_enclosed_expression(operand); - expr += '.'; - expr += index_to_swizzle(i); + expr += to_extract_component_expression(operand, i); if (i + 1 < type.vecsize) expr += ", "; @@ -3049,15 +3293,11 @@ void CompilerGLSL::emit_unrolled_binary_op(uint32_t result_type, uint32_t result { // Make sure to call to_expression multiple times to ensure // that these expressions are properly flushed to temporaries if needed. - expr += to_enclosed_expression(op0); - expr += '.'; - expr += index_to_swizzle(i); + expr += to_extract_component_expression(op0, i); expr += ' '; expr += op; expr += ' '; - expr += to_enclosed_expression(op1); - expr += '.'; - expr += index_to_swizzle(i); + expr += to_extract_component_expression(op1, i); if (i + 1 < type.vecsize) expr += ", "; @@ -3096,8 +3336,8 @@ SPIRType CompilerGLSL::binary_op_bitcast_helper(string &cast_op0, string &cast_o else { // If we don't cast, our actual input type is that of the first (or second) argument. - cast_op0 = to_enclosed_expression(op0); - cast_op1 = to_enclosed_expression(op1); + cast_op0 = to_enclosed_unpacked_expression(op0); + cast_op1 = to_enclosed_unpacked_expression(op1); input_type = type0.basetype; } @@ -3127,12 +3367,14 @@ void CompilerGLSL::emit_binary_op_cast(uint32_t result_type, uint32_t result_id, expr += join(cast_op0, " ", op, " ", cast_op1); emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1)); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); } void CompilerGLSL::emit_unary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op) { bool forward = should_forward(op0); - emit_op(result_type, result_id, join(op, "(", to_expression(op0), ")"), forward); + emit_op(result_type, result_id, join(op, "(", to_unpacked_expression(op0), ")"), forward); inherit_expression_dependencies(result_id, op0); } @@ -3140,7 +3382,8 @@ void CompilerGLSL::emit_binary_func_op(uint32_t result_type, uint32_t result_id, const char *op) { bool forward = should_forward(op0) && should_forward(op1); - emit_op(result_type, result_id, join(op, "(", to_expression(op0), ", ", to_expression(op1), ")"), forward); + emit_op(result_type, result_id, join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ")"), + forward); inherit_expression_dependencies(result_id, op0); inherit_expression_dependencies(result_id, op1); } @@ -3168,6 +3411,8 @@ void CompilerGLSL::emit_binary_func_op_cast(uint32_t result_type, uint32_t resul } emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1)); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); } void CompilerGLSL::emit_trinary_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, @@ -3175,7 +3420,9 @@ void CompilerGLSL::emit_trinary_func_op(uint32_t result_type, uint32_t result_id { bool forward = should_forward(op0) && should_forward(op1) && should_forward(op2); emit_op(result_type, result_id, - join(op, "(", to_expression(op0), ", ", to_expression(op1), ", ", to_expression(op2), ")"), forward); + join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ", ", + to_unpacked_expression(op2), ")"), + forward); inherit_expression_dependencies(result_id, op0); inherit_expression_dependencies(result_id, op1); @@ -3187,8 +3434,8 @@ void CompilerGLSL::emit_quaternary_func_op(uint32_t result_type, uint32_t result { bool forward = should_forward(op0) && should_forward(op1) && should_forward(op2) && should_forward(op3); emit_op(result_type, result_id, - join(op, "(", to_expression(op0), ", ", to_expression(op1), ", ", to_expression(op2), ", ", - to_expression(op3), ")"), + join(op, "(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), ", ", + to_unpacked_expression(op2), ", ", to_unpacked_expression(op3), ")"), forward); inherit_expression_dependencies(result_id, op0); @@ -3216,7 +3463,7 @@ bool CompilerGLSL::check_explicit_lod_allowed(uint32_t lod) return allowed; } -string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t lod) +string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t lod, uint32_t tex) { const char *type; switch (imgtype.image.dim) @@ -3246,34 +3493,75 @@ string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtyp bool use_explicit_lod = check_explicit_lod_allowed(lod); - if (op == "textureLod" || op == "textureProjLod") + if (op == "textureLod" || op == "textureProjLod" || op == "textureGrad" || op == "textureProjGrad") { if (is_legacy_es()) { if (use_explicit_lod) - require_extension("GL_EXT_shader_texture_lod"); + require_extension_internal("GL_EXT_shader_texture_lod"); } else if (is_legacy()) - require_extension("GL_ARB_shader_texture_lod"); + require_extension_internal("GL_ARB_shader_texture_lod"); } + if (op == "textureLodOffset" || op == "textureProjLodOffset") + { + if (is_legacy_es()) + SPIRV_CROSS_THROW(join(op, " not allowed in legacy ES")); + + require_extension_internal("GL_EXT_gpu_shader4"); + } + + // GLES has very limited support for shadow samplers. + // Basically shadow2D and shadow2DProj work through EXT_shadow_samplers, + // everything else can just throw + if (image_is_comparison(imgtype, tex) && is_legacy_es()) + { + if (op == "texture" || op == "textureProj") + require_extension_internal("GL_EXT_shadow_samplers"); + else + SPIRV_CROSS_THROW(join(op, " not allowed on depth samplers in legacy ES")); + } + + bool is_es_and_depth = is_legacy_es() && image_is_comparison(imgtype, tex); + std::string type_prefix = image_is_comparison(imgtype, tex) ? "shadow" : "texture"; + if (op == "texture") - return join("texture", type); + return is_es_and_depth ? join(type_prefix, type, "EXT") : join(type_prefix, type); else if (op == "textureLod") { if (use_explicit_lod) - return join("texture", type, is_legacy_es() ? "LodEXT" : "Lod"); + return join(type_prefix, type, is_legacy_es() ? "LodEXT" : "Lod"); else - return join("texture", type); + return join(type_prefix, type); } else if (op == "textureProj") - return join("texture", type, "Proj"); + return join(type_prefix, type, is_es_and_depth ? "ProjEXT" : "Proj"); + else if (op == "textureGrad") + return join(type_prefix, type, is_legacy_es() ? "GradEXT" : is_legacy_desktop() ? "GradARB" : "Grad"); else if (op == "textureProjLod") { if (use_explicit_lod) - return join("texture", type, is_legacy_es() ? "ProjLodEXT" : "ProjLod"); + return join(type_prefix, type, is_legacy_es() ? "ProjLodEXT" : "ProjLod"); else - return join("texture", type); + return join(type_prefix, type, "Proj"); + } + else if (op == "textureLodOffset") + { + if (use_explicit_lod) + return join(type_prefix, type, "LodOffset"); + else + return join(type_prefix, type); + } + else if (op == "textureProjGrad") + return join(type_prefix, type, + is_legacy_es() ? "ProjGradEXT" : is_legacy_desktop() ? "ProjGradARB" : "ProjGrad"); + else if (op == "textureProjLodOffset") + { + if (use_explicit_lod) + return join(type_prefix, type, "ProjLodOffset"); + else + return join(type_prefix, type, "ProjOffset"); } else { @@ -3309,6 +3597,10 @@ bool CompilerGLSL::to_trivial_mix_op(const SPIRType &type, string &op, uint32_t ret = cleft->scalar() == 0 && cright->scalar() == 1; break; + case SPIRType::Half: + ret = cleft->scalar_f16() == 0.0f && cright->scalar_f16() == 1.0f; + break; + case SPIRType::Float: ret = cleft->scalar_f32() == 0.0f && cright->scalar_f32() == 1.0f; break; @@ -3331,6 +3623,37 @@ bool CompilerGLSL::to_trivial_mix_op(const SPIRType &type, string &op, uint32_t return ret; } +string CompilerGLSL::to_ternary_expression(const SPIRType &restype, uint32_t select, uint32_t true_value, + uint32_t false_value) +{ + string expr; + auto &lerptype = expression_type(select); + + if (lerptype.vecsize == 1) + expr = join(to_enclosed_expression(select), " ? ", to_enclosed_expression(true_value), " : ", + to_enclosed_expression(false_value)); + else + { + auto swiz = [this](uint32_t expression, uint32_t i) { return to_extract_component_expression(expression, i); }; + + expr = type_to_glsl_constructor(restype); + expr += "("; + for (uint32_t i = 0; i < restype.vecsize; i++) + { + expr += swiz(select, i); + expr += " ? "; + expr += swiz(true_value, i); + expr += " : "; + expr += swiz(false_value, i); + if (i + 1 < restype.vecsize) + expr += ", "; + } + expr += ")"; + } + + return expr; +} + void CompilerGLSL::emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, uint32_t right, uint32_t lerp) { auto &lerptype = expression_type(lerp); @@ -3361,32 +3684,11 @@ void CompilerGLSL::emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, // Could use GL_EXT_shader_integer_mix on desktop at least, // but Apple doesn't support it. :( // Just implement it as ternary expressions. - string expr; - if (lerptype.vecsize == 1) - expr = join(to_enclosed_expression(lerp), " ? ", to_enclosed_expression(right), " : ", - to_enclosed_expression(left)); - else - { - auto swiz = [this](uint32_t expression, uint32_t i) { - return join(to_enclosed_expression(expression), ".", index_to_swizzle(i)); - }; - - expr = type_to_glsl_constructor(restype); - expr += "("; - for (uint32_t i = 0; i < restype.vecsize; i++) - { - expr += swiz(lerp, i); - expr += " ? "; - expr += swiz(right, i); - expr += " : "; - expr += swiz(left, i); - if (i + 1 < restype.vecsize) - expr += ", "; - } - expr += ")"; - } - + auto expr = to_ternary_expression(get(result_type), lerp, right, left); emit_op(result_type, id, expr, should_forward(left) && should_forward(right) && should_forward(lerp)); + inherit_expression_dependencies(id, left); + inherit_expression_dependencies(id, right); + inherit_expression_dependencies(id, lerp); } else emit_trinary_func_op(result_type, id, left, right, lerp, "mix"); @@ -3394,6 +3696,14 @@ void CompilerGLSL::emit_mix_op(uint32_t result_type, uint32_t id, uint32_t left, string CompilerGLSL::to_combined_image_sampler(uint32_t image_id, uint32_t samp_id) { + // Keep track of the array indices we have used to load the image. + // We'll need to use the same array index into the combined image sampler array. + auto image_expr = to_expression(image_id); + string array_expr; + auto array_index = image_expr.find_first_of('['); + if (array_index != string::npos) + array_expr = image_expr.substr(array_index, string::npos); + auto &args = current_function->arguments; // For GLSL and ESSL targets, we must enumerate all possible combinations for sampler2D(texture2D, sampler) and redirect @@ -3426,7 +3736,7 @@ string CompilerGLSL::to_combined_image_sampler(uint32_t image_id, uint32_t samp_ }); if (itr != end(combined)) - return to_expression(itr->id); + return to_expression(itr->id) + array_expr; else { SPIRV_CROSS_THROW( @@ -3443,7 +3753,7 @@ string CompilerGLSL::to_combined_image_sampler(uint32_t image_id, uint32_t samp_ }); if (itr != end(combined_image_samplers)) - return to_expression(itr->combined_id); + return to_expression(itr->combined_id) + array_expr; else { SPIRV_CROSS_THROW("Cannot find mapping for combined sampler, was build_combined_image_samplers() used " @@ -3457,10 +3767,16 @@ void CompilerGLSL::emit_sampled_image_op(uint32_t result_type, uint32_t result_i if (options.vulkan_semantics && combined_image_samplers.empty()) { emit_binary_func_op(result_type, result_id, image_id, samp_id, - type_to_glsl(get(result_type)).c_str()); + type_to_glsl(get(result_type), result_id).c_str()); + + // Make sure to suppress usage tracking. It is illegal to create temporaries of opaque types. + forwarded_temporaries.erase(result_id); } else - emit_op(result_type, result_id, to_combined_image_sampler(image_id, samp_id), true); + { + // Make sure to suppress usage tracking. It is illegal to create temporaries of opaque types. + emit_op(result_type, result_id, to_combined_image_sampler(image_id, samp_id), true, true); + } } void CompilerGLSL::emit_texture_op(const Instruction &i) @@ -3472,6 +3788,8 @@ void CompilerGLSL::emit_texture_op(const Instruction &i) if (i.offset + length > spirv.size()) SPIRV_CROSS_THROW("Compiler::parse() opcode out of range."); + vector inherited_expressions; + uint32_t result_type = ops[0]; uint32_t id = ops[1]; uint32_t img = ops[2]; @@ -3483,6 +3801,8 @@ void CompilerGLSL::emit_texture_op(const Instruction &i) bool fetch = false; const uint32_t *opt = nullptr; + inherited_expressions.push_back(coord); + switch (op) { case OpImageSampleDrefImplicitLod: @@ -3561,6 +3881,9 @@ void CompilerGLSL::emit_texture_op(const Instruction &i) break; } + if (dref) + inherited_expressions.push_back(dref); + if (proj) coord_components++; if (imgtype.image.arrayed) @@ -3586,6 +3909,7 @@ void CompilerGLSL::emit_texture_op(const Instruction &i) if (length && (flags & flag)) { v = *opt++; + inherited_expressions.push_back(v); length--; } }; @@ -3608,13 +3932,33 @@ void CompilerGLSL::emit_texture_op(const Instruction &i) coffset, offset, bias, comp, sample, &forward); expr += ")"; + // texture(samplerXShadow) returns float. shadowX() returns vec4. Swizzle here. + if (is_legacy() && image_is_comparison(imgtype, img)) + expr += ".r"; + emit_op(result_type, id, expr, forward); + for (auto &inherit : inherited_expressions) + inherit_expression_dependencies(id, inherit); + + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + register_control_dependent_expression(id); + break; + + default: + break; + } } // Returns the function name for a texture sampling function for the specified image and sampling characteristics. // For some subclasses, the function is a method on the specified image. -string CompilerGLSL::to_function_name(uint32_t, const SPIRType &imgtype, bool is_fetch, bool is_gather, bool is_proj, - bool has_array_offsets, bool has_offset, bool has_grad, bool, uint32_t lod) +string CompilerGLSL::to_function_name(uint32_t tex, const SPIRType &imgtype, bool is_fetch, bool is_gather, + bool is_proj, bool has_array_offsets, bool has_offset, bool has_grad, bool, + uint32_t lod) { string fname; @@ -3624,7 +3968,7 @@ string CompilerGLSL::to_function_name(uint32_t, const SPIRType &imgtype, bool is // This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube. bool workaround_lod_array_shadow_as_grad = false; if (((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) && - imgtype.image.depth && lod) + image_is_comparison(imgtype, tex) && lod) { auto *constant_lod = maybe_get(lod); if (!constant_lod || constant_lod->scalar_f32() != 0.0f) @@ -3654,43 +3998,50 @@ string CompilerGLSL::to_function_name(uint32_t, const SPIRType &imgtype, bool is if (has_offset) fname += "Offset"; - return is_legacy() ? legacy_tex_op(fname, imgtype, lod) : fname; + return is_legacy() ? legacy_tex_op(fname, imgtype, lod, tex) : fname; +} + +std::string CompilerGLSL::convert_separate_image_to_combined(uint32_t id) +{ + auto &imgtype = expression_type(id); + auto *var = maybe_get_backing_variable(id); + + // If we are fetching from a plain OpTypeImage, we must combine with a dummy sampler. + if (var) + { + auto &type = get(var->basetype); + if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer) + { + if (!dummy_sampler_id) + SPIRV_CROSS_THROW( + "Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?"); + + if (options.vulkan_semantics) + { + auto sampled_type = imgtype; + sampled_type.basetype = SPIRType::SampledImage; + return join(type_to_glsl(sampled_type), "(", to_expression(id), ", ", to_expression(dummy_sampler_id), + ")"); + } + else + return to_combined_image_sampler(id, dummy_sampler_id); + } + } + + return to_expression(id); } // Returns the function args for a texture sampling function for the specified image and sampling characteristics. -string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool, bool is_proj, - uint32_t coord, uint32_t coord_components, uint32_t dref, uint32_t grad_x, - uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias, - uint32_t comp, uint32_t sample, bool *p_forward) +string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool is_fetch, bool is_gather, + bool is_proj, uint32_t coord, uint32_t coord_components, uint32_t dref, + uint32_t grad_x, uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, + uint32_t bias, uint32_t comp, uint32_t sample, bool *p_forward) { - string farg_str = to_expression(img); - + string farg_str; if (is_fetch) - { - auto *var = maybe_get_backing_variable(img); - - // If we are fetching from a plain OpTypeImage, we must combine with a dummy sampler. - if (var) - { - auto &type = get(var->basetype); - if (type.basetype == SPIRType::Image && type.image.sampled == 1 && type.image.dim != DimBuffer) - { - if (!dummy_sampler_id) - SPIRV_CROSS_THROW( - "Cannot find dummy sampler ID. Was build_dummy_sampler_for_combined_images() called?"); - - if (options.vulkan_semantics) - { - auto sampled_type = imgtype; - sampled_type.basetype = SPIRType::SampledImage; - farg_str = join(type_to_glsl(sampled_type), "(", to_expression(img), ", ", - to_expression(dummy_sampler_id), ")"); - } - else - farg_str = to_combined_image_sampler(img, dummy_sampler_id); - } - } - } + farg_str = convert_separate_image_to_combined(img); + else + farg_str = to_expression(img); bool swizz_func = backend.swizzle_is_function; auto swizzle = [swizz_func](uint32_t comps, uint32_t in_comps) -> const char * { @@ -3732,14 +4083,14 @@ string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, boo // This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube. bool workaround_lod_array_shadow_as_grad = ((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) && - imgtype.image.depth && lod; + image_is_comparison(imgtype, img) && lod; if (dref) { forward = forward && should_forward(dref); // SPIR-V splits dref and coordinate. - if (coord_components == 4) // GLSL also splits the arguments in two. + if (is_gather || coord_components == 4) // GLSL also splits the arguments in two. Same for textureGather. { farg_str += ", "; farg_str += to_expression(coord); @@ -3826,6 +4177,11 @@ string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, boo } } } + else if (is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms) + { + // Lod argument is optional in OpImageFetch, but we require a LOD value, pick 0 as the default. + farg_str += ", 0"; + } if (coffset) { @@ -3867,7 +4223,10 @@ string CompilerGLSL::to_function_args(uint32_t img, const SPIRType &imgtype, boo void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t) { - GLSLstd450 op = static_cast(eop); + auto op = static_cast(eop); + + if (is_legacy() && is_unsigned_glsl_opcode(op)) + SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy GLSL targets."); switch (op) { @@ -3932,8 +4291,8 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, } // Minmax - case GLSLstd450FMin: case GLSLstd450UMin: + case GLSLstd450FMin: case GLSLstd450SMin: emit_binary_func_op(result_type, id, args[0], args[1], "min"); break; @@ -4138,6 +4497,16 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, emit_binary_func_op(result_type, id, args[0], args[1], "interpolateAtOffset"); break; + case GLSLstd450NMin: + emit_binary_func_op(result_type, id, args[0], args[1], "unsupported_glsl450_nmin"); + break; + case GLSLstd450NMax: + emit_binary_func_op(result_type, id, args[0], args[1], "unsupported_glsl450_nmax"); + break; + case GLSLstd450NClamp: + emit_binary_func_op(result_type, id, args[0], args[1], "unsupported_glsl450_nclamp"); + break; + default: statement("// unimplemented GLSL op ", eop); break; @@ -4147,7 +4516,7 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, void CompilerGLSL::emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t) { - require_extension("GL_AMD_shader_ballot"); + require_extension_internal("GL_AMD_shader_ballot"); enum AMDShaderBallot { @@ -4163,18 +4532,22 @@ void CompilerGLSL::emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t { case SwizzleInvocationsAMD: emit_binary_func_op(result_type, id, args[0], args[1], "swizzleInvocationsAMD"); + register_control_dependent_expression(id); break; case SwizzleInvocationsMaskedAMD: emit_binary_func_op(result_type, id, args[0], args[1], "swizzleInvocationsMaskedAMD"); + register_control_dependent_expression(id); break; case WriteInvocationAMD: emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "writeInvocationAMD"); + register_control_dependent_expression(id); break; case MbcntAMD: emit_unary_func_op(result_type, id, args[0], "mbcntAMD"); + register_control_dependent_expression(id); break; default: @@ -4186,7 +4559,7 @@ void CompilerGLSL::emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t void CompilerGLSL::emit_spv_amd_shader_explicit_vertex_parameter_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t) { - require_extension("GL_AMD_shader_explicit_vertex_parameter"); + require_extension_internal("GL_AMD_shader_explicit_vertex_parameter"); enum AMDShaderExplicitVertexParameter { @@ -4210,7 +4583,7 @@ void CompilerGLSL::emit_spv_amd_shader_explicit_vertex_parameter_op(uint32_t res void CompilerGLSL::emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t) { - require_extension("GL_AMD_shader_trinary_minmax"); + require_extension_internal("GL_AMD_shader_trinary_minmax"); enum AMDShaderTrinaryMinMax { @@ -4256,7 +4629,7 @@ void CompilerGLSL::emit_spv_amd_shader_trinary_minmax_op(uint32_t result_type, u void CompilerGLSL::emit_spv_amd_gcn_shader_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t) { - require_extension("GL_AMD_gcn_shader"); + require_extension_internal("GL_AMD_gcn_shader"); enum AMDGCNShader { @@ -4279,6 +4652,7 @@ void CompilerGLSL::emit_spv_amd_gcn_shader_op(uint32_t result_type, uint32_t id, { string expr = "timeAMD()"; emit_op(result_type, id, expr, true); + register_control_dependent_expression(id); break; } @@ -4288,6 +4662,228 @@ void CompilerGLSL::emit_spv_amd_gcn_shader_op(uint32_t result_type, uint32_t id, } } +void CompilerGLSL::emit_subgroup_op(const Instruction &i) +{ + const uint32_t *ops = stream(i); + auto op = static_cast(i.op); + + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Can only use subgroup operations in Vulkan semantics."); + + switch (op) + { + case OpGroupNonUniformElect: + require_extension_internal("GL_KHR_shader_subgroup_basic"); + break; + + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + case OpGroupNonUniformBallot: + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformBallotBitCount: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + require_extension_internal("GL_KHR_shader_subgroup_ballot"); + break; + + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + require_extension_internal("GL_KHR_shader_subgroup_shuffle"); + break; + + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + require_extension_internal("GL_KHR_shader_subgroup_shuffle_relative"); + break; + + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + require_extension_internal("GL_KHR_shader_subgroup_vote"); + break; + + case OpGroupNonUniformFAdd: + case OpGroupNonUniformFMul: + case OpGroupNonUniformFMin: + case OpGroupNonUniformFMax: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformIMul: + case OpGroupNonUniformSMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMin: + case OpGroupNonUniformUMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + { + auto operation = static_cast(ops[3]); + if (operation == GroupOperationClusteredReduce) + { + require_extension_internal("GL_KHR_shader_subgroup_clustered"); + } + else if (operation == GroupOperationExclusiveScan || operation == GroupOperationInclusiveScan || + operation == GroupOperationReduce) + { + require_extension_internal("GL_KHR_shader_subgroup_arithmetic"); + } + else + SPIRV_CROSS_THROW("Invalid group operation."); + break; + } + + case OpGroupNonUniformQuadSwap: + case OpGroupNonUniformQuadBroadcast: + require_extension_internal("GL_KHR_shader_subgroup_quad"); + break; + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto scope = static_cast(get(ops[2]).scalar()); + if (scope != ScopeSubgroup) + SPIRV_CROSS_THROW("Only subgroup scope is supported."); + + switch (op) + { + case OpGroupNonUniformElect: + emit_op(result_type, id, "subgroupElect()", true); + break; + + case OpGroupNonUniformBroadcast: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupBroadcast"); + break; + + case OpGroupNonUniformBroadcastFirst: + emit_unary_func_op(result_type, id, ops[3], "subgroupBroadcastFirst"); + break; + + case OpGroupNonUniformBallot: + emit_unary_func_op(result_type, id, ops[3], "subgroupBallot"); + break; + + case OpGroupNonUniformInverseBallot: + emit_unary_func_op(result_type, id, ops[3], "subgroupInverseBallot"); + break; + + case OpGroupNonUniformBallotBitExtract: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupBallotBitExtract"); + break; + + case OpGroupNonUniformBallotFindLSB: + emit_unary_func_op(result_type, id, ops[3], "subgroupBallotFindLSB"); + break; + + case OpGroupNonUniformBallotFindMSB: + emit_unary_func_op(result_type, id, ops[3], "subgroupBallotFindMSB"); + break; + + case OpGroupNonUniformBallotBitCount: + { + auto operation = static_cast(ops[3]); + if (operation == GroupOperationReduce) + emit_unary_func_op(result_type, id, ops[4], "subgroupBallotBitCount"); + else if (operation == GroupOperationInclusiveScan) + emit_unary_func_op(result_type, id, ops[4], "subgroupBallotInclusiveBitCount"); + else if (operation == GroupOperationExclusiveScan) + emit_unary_func_op(result_type, id, ops[4], "subgroupBallotExclusiveBitCount"); + else + SPIRV_CROSS_THROW("Invalid BitCount operation."); + break; + } + + case OpGroupNonUniformShuffle: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffle"); + break; + + case OpGroupNonUniformShuffleXor: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffleXor"); + break; + + case OpGroupNonUniformShuffleUp: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffleUp"); + break; + + case OpGroupNonUniformShuffleDown: + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupShuffleDown"); + break; + + case OpGroupNonUniformAll: + emit_unary_func_op(result_type, id, ops[3], "subgroupAll"); + break; + + case OpGroupNonUniformAny: + emit_unary_func_op(result_type, id, ops[3], "subgroupAny"); + break; + + case OpGroupNonUniformAllEqual: + emit_unary_func_op(result_type, id, ops[3], "subgroupAllEqual"); + break; + + // clang-format off +#define GLSL_GROUP_OP(op, glsl_op) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[3]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op(result_type, id, ops[4], "subgroup" #glsl_op); \ + else if (operation == GroupOperationInclusiveScan) \ + emit_unary_func_op(result_type, id, ops[4], "subgroupInclusive" #glsl_op); \ + else if (operation == GroupOperationExclusiveScan) \ + emit_unary_func_op(result_type, id, ops[4], "subgroupExclusive" #glsl_op); \ + else if (operation == GroupOperationClusteredReduce) \ + emit_binary_func_op(result_type, id, ops[4], ops[5], "subgroupClustered" #glsl_op); \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + GLSL_GROUP_OP(FAdd, Add) + GLSL_GROUP_OP(FMul, Mul) + GLSL_GROUP_OP(FMin, Min) + GLSL_GROUP_OP(FMax, Max) + GLSL_GROUP_OP(IAdd, Add) + GLSL_GROUP_OP(IMul, Mul) + GLSL_GROUP_OP(SMin, Min) + GLSL_GROUP_OP(SMax, Max) + GLSL_GROUP_OP(UMin, Min) + GLSL_GROUP_OP(UMax, Max) + GLSL_GROUP_OP(BitwiseAnd, And) + GLSL_GROUP_OP(BitwiseOr, Or) + GLSL_GROUP_OP(BitwiseXor, Xor) +#undef GLSL_GROUP_OP + // clang-format on + + case OpGroupNonUniformQuadSwap: + { + uint32_t direction = get(ops[4]).scalar(); + if (direction == 0) + emit_unary_func_op(result_type, id, ops[3], "subgroupQuadSwapHorizontal"); + else if (direction == 1) + emit_unary_func_op(result_type, id, ops[3], "subgroupQuadSwapVertical"); + else if (direction == 2) + emit_unary_func_op(result_type, id, ops[3], "subgroupQuadSwapDiagonal"); + else + SPIRV_CROSS_THROW("Invalid quad swap direction."); + break; + } + + case OpGroupNonUniformQuadBroadcast: + { + emit_binary_func_op(result_type, id, ops[3], ops[4], "subgroupQuadBroadcast"); + break; + } + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + register_control_dependent_expression(id); +} + string CompilerGLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in_type) { if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Int) @@ -4316,6 +4912,10 @@ string CompilerGLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &i return "uint64BitsToDouble"; else if (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::UInt && in_type.vecsize == 2) return "packUint2x32"; + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UInt && in_type.vecsize == 1) + return "unpackFloat2x16"; + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Half && in_type.vecsize == 2) + return "packFloat2x16"; else return ""; } @@ -4384,10 +4984,15 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) case BuiltInInstanceIndex: if (options.vulkan_semantics) return "gl_InstanceIndex"; - else + else if (options.vertex.support_nonzero_base_instance) return "(gl_InstanceID + SPIRV_Cross_BaseInstance)"; // ... but not gl_InstanceID. + else + return "gl_InstanceID"; case BuiltInPrimitiveId: - return "gl_PrimitiveID"; + if (storage == StorageClassInput && get_entry_point().model == ExecutionModelGeometry) + return "gl_PrimitiveIDIn"; + else + return "gl_PrimitiveID"; case BuiltInInvocationId: return "gl_InvocationID"; case BuiltInLayer: @@ -4423,14 +5028,14 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) case BuiltInSampleId: if (options.es && options.version < 320) - require_extension("GL_OES_sample_variables"); + require_extension_internal("GL_OES_sample_variables"); if (!options.es && options.version < 400) SPIRV_CROSS_THROW("gl_SampleID not supported before GLSL 400."); return "gl_SampleID"; case BuiltInSampleMask: if (options.es && options.version < 320) - require_extension("GL_OES_sample_variables"); + require_extension_internal("GL_OES_sample_variables"); if (!options.es && options.version < 400) SPIRV_CROSS_THROW("gl_SampleMask/gl_SampleMaskIn not supported before GLSL 400."); @@ -4441,7 +5046,7 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) case BuiltInSamplePosition: if (options.es && options.version < 320) - require_extension("GL_OES_sample_variables"); + require_extension_internal("GL_OES_sample_variables"); if (!options.es && options.version < 400) SPIRV_CROSS_THROW("gl_SamplePosition not supported before GLSL 400."); return "gl_SamplePosition"; @@ -4449,15 +5054,69 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage) case BuiltInViewIndex: if (options.vulkan_semantics) { - require_extension("GL_EXT_multiview"); + require_extension_internal("GL_EXT_multiview"); return "gl_ViewIndex"; } else { - require_extension("GL_OVR_multiview2"); + require_extension_internal("GL_OVR_multiview2"); return "gl_ViewID_OVR"; } + case BuiltInNumSubgroups: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_basic"); + return "gl_NumSubgroups"; + + case BuiltInSubgroupId: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_basic"); + return "gl_SubgroupID"; + + case BuiltInSubgroupSize: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_basic"); + return "gl_SubgroupSize"; + + case BuiltInSubgroupLocalInvocationId: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_basic"); + return "gl_SubgroupInvocationID"; + + case BuiltInSubgroupEqMask: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_ballot"); + return "gl_SubgroupEqMask"; + + case BuiltInSubgroupGeMask: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_ballot"); + return "gl_SubgroupGeMask"; + + case BuiltInSubgroupGtMask: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_ballot"); + return "gl_SubgroupGtMask"; + + case BuiltInSubgroupLeMask: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_ballot"); + return "gl_SubgroupLeMask"; + + case BuiltInSubgroupLtMask: + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Need Vulkan semantics for subgroup."); + require_extension_internal("GL_KHR_shader_subgroup_ballot"); + return "gl_SubgroupLtMask"; + default: return join("gl_BuiltIn_", convert_to_string(builtin)); } @@ -4488,20 +5147,14 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice if (!chain_only) expr = to_enclosed_expression(base); - uint32_t type_id = expression_type_id(base); - const auto *type = &get(type_id); - // Start traversing type hierarchy at the proper non-pointer types, // but keep type_id referencing the original pointer for use below. - while (type->pointer) - { - assert(type->parent_type); - type = &get(type->parent_type); - } + uint32_t type_id = expression_type_id(base); + const auto *type = &get_non_pointer_type(type_id); - bool access_chain_is_arrayed = false; + bool access_chain_is_arrayed = expr.find_first_of('[') != string::npos; bool row_major_matrix_needs_conversion = is_non_native_row_major_matrix(base); - bool is_packed = false; + bool is_packed = has_decoration(base, DecorationCPacked); bool pending_array_enclose = false; bool dimension_flatten = false; @@ -4660,23 +5313,22 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice // Vector -> Scalar else if (type->vecsize > 1) { - if (is_packed) - { - expr = unpack_expression_type(expr, *type); - is_packed = false; - } - - if (index_is_literal) + if (index_is_literal && !is_packed) { expr += "."; expr += index_to_swizzle(index); } - else if (ids[index].get_type() == TypeConstant) + else if (ids[index].get_type() == TypeConstant && !is_packed) { auto &c = get(index); expr += "."; expr += index_to_swizzle(c.scalar()); } + else if (index_is_literal) + { + // For packed vectors, we can only access them as an array, not by swizzle. + expr += join("[", index, "]"); + } else { expr += "["; @@ -4684,6 +5336,7 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice expr += "]"; } + is_packed = false; type_id = type->parent_type; type = &get(type_id); } @@ -4824,7 +5477,7 @@ std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uin uint32_t matrix_stride = 0; if (member_type.columns > 1) { - need_transpose = (combined_decoration_for_member(target_type, i) & (1ull << DecorationRowMajor)) != 0; + need_transpose = combined_decoration_for_member(target_type, i).get(DecorationRowMajor); matrix_stride = type_struct_member_matrix_stride(target_type, i); } @@ -4940,14 +5593,8 @@ std::pair CompilerGLSL::flattened_access_chain_offset(con bool *need_transpose, uint32_t *out_matrix_stride) { - const auto *type = &basetype; - // Start traversing type hierarchy at the proper non-pointer types. - while (type->pointer) - { - assert(type->parent_type); - type = &get(type->parent_type); - } + const auto *type = &get_non_pointer_type(basetype); // This holds the type of the current pointer which we are traversing through. // We always start out from a struct type which is the block. @@ -5023,7 +5670,7 @@ std::pair CompilerGLSL::flattened_access_chain_offset(con { matrix_stride = type_struct_member_matrix_stride(struct_type, index); row_major_matrix_needs_conversion = - (combined_decoration_for_member(struct_type, index) & (1ull << DecorationRowMajor)) != 0; + combined_decoration_for_member(struct_type, index).get(DecorationRowMajor); } else row_major_matrix_needs_conversion = false; @@ -5391,13 +6038,18 @@ bool CompilerGLSL::skip_argument(uint32_t id) const return false; } -bool CompilerGLSL::optimize_read_modify_write(const string &lhs, const string &rhs) +bool CompilerGLSL::optimize_read_modify_write(const SPIRType &type, const string &lhs, const string &rhs) { // Do this with strings because we have a very clear pattern we can check for and it avoids // adding lots of special cases to the code emission. if (rhs.size() < lhs.size() + 3) return false; + // Do not optimize matrices. They are a bit awkward to reason about in general + // (in which order does operation happen?), and it does not work on MSL anyways. + if (type.vecsize > 1 && type.columns > 1) + return false; + auto index = rhs.find(lhs); if (index != 0) return false; @@ -5422,7 +6074,16 @@ bool CompilerGLSL::optimize_read_modify_write(const string &lhs, const string &r return true; } -void CompilerGLSL::emit_block_instructions(const SPIRBlock &block) +void CompilerGLSL::register_control_dependent_expression(uint32_t expr) +{ + if (forwarded_temporaries.find(expr) == end(forwarded_temporaries)) + return; + + assert(current_emitting_block); + current_emitting_block->invalidate_expressions.push_back(expr); +} + +void CompilerGLSL::emit_block_instructions(SPIRBlock &block) { current_emitting_block = █ for (auto &op : block.ops) @@ -5436,17 +6097,17 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) auto opcode = static_cast(instruction.op); uint32_t length = instruction.length; -#define BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) -#define BOP_CAST(op, type) \ +#define GLSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) +#define GLSL_BOP_CAST(op, type) \ emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, glsl_opcode_is_sign_invariant(opcode)) -#define UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) -#define QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) -#define TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) -#define BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) -#define BFOP_CAST(op, type) \ +#define GLSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) +#define GLSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) +#define GLSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) +#define GLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define GLSL_BFOP_CAST(op, type) \ emit_binary_func_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, glsl_opcode_is_sign_invariant(opcode)) -#define BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) -#define UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) +#define GLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define GLSL_UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) switch (opcode) { @@ -5480,6 +6141,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) auto expr = to_expression(ptr); + // We might need to bitcast in order to load from a builtin. + bitcast_from_builtin_load(ptr, expr, get(result_type)); + if (ptr_expression) ptr_expression->need_transpose = old_need_transpose; @@ -5507,7 +6171,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) bool need_transpose, result_is_packed; auto e = access_chain(ops[2], &ops[3], length - 3, get(ops[0]), &need_transpose, &result_is_packed); auto &expr = set(ops[1], move(e), ops[0], should_forward(ops[2])); - expr.loaded_from = ops[2]; + + auto *backing_variable = maybe_get_backing_variable(ops[2]); + expr.loaded_from = backing_variable ? backing_variable->self : ops[2]; expr.need_transpose = need_transpose; // Mark the result as being packed. Some platforms handled packed vectors differently than non-packed. @@ -5527,6 +6193,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) var->static_expression = ops[1]; else if (var && var->loop_variable && !var->loop_variable_enable) var->static_expression = ops[1]; + else if (var && var->remapped_variable) + { + // Skip the write. + } else if (var && flattened_structs.count(ops[0])) { store_flattened_struct(*var, ops[1]); @@ -5535,16 +6205,20 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) else { auto rhs = to_expression(ops[1]); + // Statements to OpStore may be empty if it is a struct with zero members. Just forward the store to /dev/null. if (!rhs.empty()) { auto lhs = to_expression(ops[0]); + // We might need to bitcast in order to store to a builtin. + bitcast_to_builtin_store(ops[0], rhs, expression_type(ops[1])); + // Tries to optimize assignments like " = op expr". // While this is purely cosmetic, this is important for legacy ESSL where loop // variable increments must be in either i++ or i += const-expr. // Without this, we end up with i = i + 1, which is correct GLSL, but not correct GLES 2.0. - if (!optimize_read_modify_write(lhs, rhs)) + if (!optimize_read_modify_write(expression_type(ops[1]), lhs, rhs)) statement(lhs, " = ", rhs, ";"); register_write(ops[0]); } @@ -5622,15 +6296,6 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { uint32_t image_id = combined.global_image ? combined.image_id : arg[combined.image_id]; uint32_t sampler_id = combined.global_sampler ? combined.sampler_id : arg[combined.sampler_id]; - - auto *image = maybe_get_backing_variable(image_id); - if (image) - image_id = image->self; - - auto *samp = maybe_get_backing_variable(sampler_id); - if (samp) - sampler_id = samp->self; - arglist.push_back(to_combined_image_sampler(image_id, sampler_id)); } @@ -5683,7 +6348,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { uint32_t result_type = ops[0]; uint32_t id = ops[1]; - const auto *elems = &ops[2]; + const auto *const elems = &ops[2]; length -= 2; bool forward = true; @@ -5691,34 +6356,25 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) forward = forward && should_forward(elems[i]); auto &out_type = get(result_type); - - if (!length) - { - if (out_type.basetype == SPIRType::Struct) - { - // It is technically allowed to make a blank struct, - // but we cannot make a meaningful expression out of it in high level languages, - // so make it a blank expression. - emit_op(result_type, id, "", forward); - break; - } - else - SPIRV_CROSS_THROW("Invalid input to OpCompositeConstruct."); - } - - auto &in_type = expression_type(elems[0]); + auto *in_type = length > 0 ? &expression_type(elems[0]) : nullptr; // Only splat if we have vector constructors. // Arrays and structs must be initialized properly in full. bool composite = !out_type.array.empty() || out_type.basetype == SPIRType::Struct; - bool splat = in_type.vecsize == 1 && in_type.columns == 1 && !composite && backend.use_constructor_splatting; - bool swizzle_splat = in_type.vecsize == 1 && in_type.columns == 1 && backend.can_swizzle_scalar; - if (ids[elems[0]].get_type() == TypeConstant && - (in_type.basetype != SPIRType::Float && in_type.basetype != SPIRType::Double)) + bool splat = false; + bool swizzle_splat = false; + + if (in_type) { - // Cannot swizzle literal integers as a special case. - swizzle_splat = false; + splat = in_type->vecsize == 1 && in_type->columns == 1 && !composite && backend.use_constructor_splatting; + swizzle_splat = in_type->vecsize == 1 && in_type->columns == 1 && backend.can_swizzle_scalar; + + if (ids[elems[0]].get_type() == TypeConstant && !type_is_floating_point(*in_type)) + { + // Cannot swizzle literal integers as a special case. + swizzle_splat = false; + } } if (splat || swizzle_splat) @@ -5738,16 +6394,20 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) forward = false; if (!out_type.array.empty() && !backend.can_declare_arrays_inline) forward = false; + if (type_is_empty(out_type) && !backend.supports_empty_struct) + forward = false; string constructor_op; if (backend.use_initializer_list && composite) { // Only use this path if we are building composites. // This path cannot be used for arithmetic. - if (backend.use_typed_initializer_list) + if (backend.use_typed_initializer_list && out_type.basetype == SPIRType::Struct) constructor_op += type_to_glsl_constructor(get(result_type)); constructor_op += "{ "; - if (splat) + if (type_is_empty(out_type) && !backend.supports_empty_struct) + constructor_op += "0"; + else if (splat) constructor_op += to_expression(elems[0]); else constructor_op += build_composite_combiner(result_type, elems, length); @@ -5760,7 +6420,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) else { constructor_op = type_to_glsl_constructor(get(result_type)) + "("; - if (splat) + if (type_is_empty(out_type) && !backend.supports_empty_struct) + constructor_op += "0"; + else if (splat) constructor_op += to_expression(elems[0]); else constructor_op += build_composite_combiner(result_type, elems, length); @@ -5768,6 +6430,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) } emit_op(result_type, id, constructor_op, forward); + for (uint32_t i = 0; i < length; i++) + inherit_expression_dependencies(id, elems[i]); break; } @@ -5796,6 +6460,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) auto expr = access_chain_internal(ops[2], &ops[3], 1, false); emit_op(result_type, id, expr, should_forward(ops[2])); + inherit_expression_dependencies(id, ops[2]); + inherit_expression_dependencies(id, ops[3]); break; } @@ -5815,6 +6481,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (composite_type.basetype == SPIRType::Struct || !composite_type.array.empty()) allow_base_expression = false; + // Packed expressions cannot be split up. + if (has_decoration(ops[2], DecorationCPacked)) + allow_base_expression = false; + // Only apply this optimization if result is scalar. if (allow_base_expression && should_forward(ops[2]) && type.vecsize == 1 && type.columns == 1 && length == 1) { @@ -5832,12 +6502,14 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // from expression causing it to be forced to an actual temporary in GLSL. auto expr = access_chain_internal(ops[2], &ops[3], length, true, true); auto &e = emit_op(result_type, id, expr, true, !expression_is_forwarded(ops[2])); + inherit_expression_dependencies(id, ops[2]); e.base_expression = ops[2]; } else { auto expr = access_chain_internal(ops[2], &ops[3], length, true); emit_op(result_type, id, expr, should_forward(ops[2]), !expression_is_forwarded(ops[2])); + inherit_expression_dependencies(id, ops[2]); } break; } @@ -5889,6 +6561,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // For pointer types, we copy the pointer itself. statement(declare_temporary(result_type, id), to_expression(rhs), ";"); set(id, to_name(id), result_type, true); + inherit_expression_dependencies(id, rhs); } else { @@ -5921,6 +6594,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (elems[i] >= type0.vecsize) shuffle = true; + // Cannot use swizzles with packed expressions, force shuffle path. + if (!shuffle && has_decoration(vec0, DecorationCPacked)) + shuffle = true; + string expr; bool should_fwd, trivial_forward; @@ -5934,9 +6611,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) for (uint32_t i = 0; i < length; i++) { if (elems[i] >= type0.vecsize) - args.push_back(join(to_enclosed_expression(vec1), ".", index_to_swizzle(elems[i] - type0.vecsize))); + args.push_back(to_extract_component_expression(vec1, elems[i] - type0.vecsize)); else - args.push_back(join(to_enclosed_expression(vec0), ".", index_to_swizzle(elems[i]))); + args.push_back(to_extract_component_expression(vec0, elems[i])); } expr += join(type_to_glsl_constructor(get(result_type)), "(", merge(args), ")"); } @@ -5947,10 +6624,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // We only source from first vector, so can use swizzle. // If the vector is packed, unpack it before applying a swizzle (needed for MSL) - expr += to_enclosed_expression(vec0); - if (has_decoration(vec0, DecorationCPacked)) - expr = unpack_expression_type(expr, expression_type(vec0)); - + expr += to_enclosed_unpacked_expression(vec0); expr += "."; for (uint32_t i = 0; i < length; i++) expr += index_to_swizzle(elems[i]); @@ -5963,50 +6637,52 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // We inherit the forwardedness from our arguments to avoid flushing out to temporaries when it's not really needed. emit_op(result_type, id, expr, should_fwd, trivial_forward); + inherit_expression_dependencies(id, vec0); + inherit_expression_dependencies(id, vec1); break; } // ALU case OpIsNan: - UFOP(isnan); + GLSL_UFOP(isnan); break; case OpIsInf: - UFOP(isinf); + GLSL_UFOP(isinf); break; case OpSNegate: case OpFNegate: - UOP(-); + GLSL_UOP(-); break; case OpIAdd: { // For simple arith ops, prefer the output type if there's a mismatch to avoid extra bitcasts. auto type = get(ops[0]).basetype; - BOP_CAST(+, type); + GLSL_BOP_CAST(+, type); break; } case OpFAdd: - BOP(+); + GLSL_BOP(+); break; case OpISub: { auto type = get(ops[0]).basetype; - BOP_CAST(-, type); + GLSL_BOP_CAST(-, type); break; } case OpFSub: - BOP(-); + GLSL_BOP(-); break; case OpIMul: { auto type = get(ops[0]).basetype; - BOP_CAST(*, type); + GLSL_BOP_CAST(*, type); break; } @@ -6022,7 +6698,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) e->need_transpose = true; } else - BOP(*); + GLSL_BOP(*); break; } @@ -6030,83 +6706,101 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpMatrixTimesScalar: case OpVectorTimesScalar: case OpMatrixTimesMatrix: - BOP(*); + GLSL_BOP(*); break; case OpOuterProduct: - BFOP(outerProduct); + GLSL_BFOP(outerProduct); break; case OpDot: - BFOP(dot); + GLSL_BFOP(dot); break; case OpTranspose: - UFOP(transpose); + GLSL_UFOP(transpose); break; + case OpSRem: + { + uint32_t result_type = ops[0]; + uint32_t result_id = ops[1]; + uint32_t op0 = ops[2]; + uint32_t op1 = ops[3]; + + // Needs special handling. + bool forward = should_forward(op0) && should_forward(op1); + auto expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", "(", + to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), ")"); + + emit_op(result_type, result_id, expr, forward); + inherit_expression_dependencies(result_id, op0); + inherit_expression_dependencies(result_id, op1); + break; + } + case OpSDiv: - BOP_CAST(/, SPIRType::Int); + GLSL_BOP_CAST(/, SPIRType::Int); break; case OpUDiv: - BOP_CAST(/, SPIRType::UInt); + GLSL_BOP_CAST(/, SPIRType::UInt); break; case OpFDiv: - BOP(/); + GLSL_BOP(/); break; case OpShiftRightLogical: - BOP_CAST(>>, SPIRType::UInt); + GLSL_BOP_CAST(>>, SPIRType::UInt); break; case OpShiftRightArithmetic: - BOP_CAST(>>, SPIRType::Int); + GLSL_BOP_CAST(>>, SPIRType::Int); break; case OpShiftLeftLogical: { auto type = get(ops[0]).basetype; - BOP_CAST(<<, type); + GLSL_BOP_CAST(<<, type); break; } case OpBitwiseOr: { auto type = get(ops[0]).basetype; - BOP_CAST(|, type); + GLSL_BOP_CAST(|, type); break; } case OpBitwiseXor: { auto type = get(ops[0]).basetype; - BOP_CAST (^, type); + GLSL_BOP_CAST (^, type); break; } case OpBitwiseAnd: { auto type = get(ops[0]).basetype; - BOP_CAST(&, type); + GLSL_BOP_CAST(&, type); break; } case OpNot: - UOP(~); + GLSL_UOP(~); break; case OpUMod: - BOP_CAST(%, SPIRType::UInt); + GLSL_BOP_CAST(%, SPIRType::UInt); break; case OpSMod: - BOP_CAST(%, SPIRType::Int); + GLSL_BOP_CAST(%, SPIRType::Int); break; case OpFMod: - BFOP(mod); + GLSL_BFOP(mod); break; case OpFRem: @@ -6133,11 +6827,11 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // Relational case OpAny: - UFOP(any); + GLSL_UFOP(any); break; case OpAll: - UFOP(all); + GLSL_UFOP(all); break; case OpSelect: @@ -6154,7 +6848,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (type.vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "||"); else - BOP(||); + GLSL_BOP(||); break; } @@ -6168,7 +6862,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (type.vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "&&"); else - BOP(&&); + GLSL_BOP(&&); break; } @@ -6176,18 +6870,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { auto &type = get(ops[0]); if (type.vecsize > 1) - UFOP(not); + GLSL_UFOP(not); else - UOP(!); + GLSL_UOP(!); break; } case OpIEqual: { if (expression_type(ops[2]).vecsize > 1) - BFOP_CAST(equal, SPIRType::Int); + GLSL_BFOP_CAST(equal, SPIRType::Int); else - BOP_CAST(==, SPIRType::Int); + GLSL_BOP_CAST(==, SPIRType::Int); break; } @@ -6195,18 +6889,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpFOrdEqual: { if (expression_type(ops[2]).vecsize > 1) - BFOP(equal); + GLSL_BFOP(equal); else - BOP(==); + GLSL_BOP(==); break; } case OpINotEqual: { if (expression_type(ops[2]).vecsize > 1) - BFOP_CAST(notEqual, SPIRType::Int); + GLSL_BFOP_CAST(notEqual, SPIRType::Int); else - BOP_CAST(!=, SPIRType::Int); + GLSL_BOP_CAST(!=, SPIRType::Int); break; } @@ -6214,9 +6908,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpFOrdNotEqual: { if (expression_type(ops[2]).vecsize > 1) - BFOP(notEqual); + GLSL_BFOP(notEqual); else - BOP(!=); + GLSL_BOP(!=); break; } @@ -6225,18 +6919,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { auto type = opcode == OpUGreaterThan ? SPIRType::UInt : SPIRType::Int; if (expression_type(ops[2]).vecsize > 1) - BFOP_CAST(greaterThan, type); + GLSL_BFOP_CAST(greaterThan, type); else - BOP_CAST(>, type); + GLSL_BOP_CAST(>, type); break; } case OpFOrdGreaterThan: { if (expression_type(ops[2]).vecsize > 1) - BFOP(greaterThan); + GLSL_BFOP(greaterThan); else - BOP(>); + GLSL_BOP(>); break; } @@ -6245,18 +6939,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { auto type = opcode == OpUGreaterThanEqual ? SPIRType::UInt : SPIRType::Int; if (expression_type(ops[2]).vecsize > 1) - BFOP_CAST(greaterThanEqual, type); + GLSL_BFOP_CAST(greaterThanEqual, type); else - BOP_CAST(>=, type); + GLSL_BOP_CAST(>=, type); break; } case OpFOrdGreaterThanEqual: { if (expression_type(ops[2]).vecsize > 1) - BFOP(greaterThanEqual); + GLSL_BFOP(greaterThanEqual); else - BOP(>=); + GLSL_BOP(>=); break; } @@ -6265,18 +6959,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { auto type = opcode == OpULessThan ? SPIRType::UInt : SPIRType::Int; if (expression_type(ops[2]).vecsize > 1) - BFOP_CAST(lessThan, type); + GLSL_BFOP_CAST(lessThan, type); else - BOP_CAST(<, type); + GLSL_BOP_CAST(<, type); break; } case OpFOrdLessThan: { if (expression_type(ops[2]).vecsize > 1) - BFOP(lessThan); + GLSL_BFOP(lessThan); else - BOP(<); + GLSL_BOP(<); break; } @@ -6285,18 +6979,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { auto type = opcode == OpULessThanEqual ? SPIRType::UInt : SPIRType::Int; if (expression_type(ops[2]).vecsize > 1) - BFOP_CAST(lessThanEqual, type); + GLSL_BFOP_CAST(lessThanEqual, type); else - BOP_CAST(<=, type); + GLSL_BOP_CAST(<=, type); break; } case OpFOrdLessThanEqual: { if (expression_type(ops[2]).vecsize > 1) - BFOP(lessThanEqual); + GLSL_BFOP(lessThanEqual); else - BOP(<=); + GLSL_BOP(<=); break; } @@ -6364,40 +7058,45 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) } emit_op(result_type, id, op, should_forward(arg)); + inherit_expression_dependencies(id, arg); break; } // Derivatives case OpDPdx: - UFOP(dFdx); + GLSL_UFOP(dFdx); if (is_legacy_es()) - require_extension("GL_OES_standard_derivatives"); + require_extension_internal("GL_OES_standard_derivatives"); + register_control_dependent_expression(ops[1]); break; case OpDPdy: - UFOP(dFdy); + GLSL_UFOP(dFdy); if (is_legacy_es()) - require_extension("GL_OES_standard_derivatives"); + require_extension_internal("GL_OES_standard_derivatives"); + register_control_dependent_expression(ops[1]); break; case OpDPdxFine: - UFOP(dFdxFine); + GLSL_UFOP(dFdxFine); if (options.es) { SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); } if (options.version < 450) - require_extension("GL_ARB_derivative_control"); + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); break; case OpDPdyFine: - UFOP(dFdyFine); + GLSL_UFOP(dFdyFine); if (options.es) { SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); } if (options.version < 450) - require_extension("GL_ARB_derivative_control"); + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); break; case OpDPdxCoarse: @@ -6405,45 +7104,70 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); } - UFOP(dFdxCoarse); + GLSL_UFOP(dFdxCoarse); if (options.version < 450) - require_extension("GL_ARB_derivative_control"); + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); break; case OpDPdyCoarse: - UFOP(dFdyCoarse); + GLSL_UFOP(dFdyCoarse); if (options.es) { SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); } if (options.version < 450) - require_extension("GL_ARB_derivative_control"); + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); break; case OpFwidth: - UFOP(fwidth); + GLSL_UFOP(fwidth); if (is_legacy_es()) - require_extension("GL_OES_standard_derivatives"); + require_extension_internal("GL_OES_standard_derivatives"); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidthCoarse: + GLSL_UFOP(fwidthCoarse); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidthFine: + GLSL_UFOP(fwidthFine); + if (options.es) + { + SPIRV_CROSS_THROW("GL_ARB_derivative_control is unavailable in OpenGL ES."); + } + if (options.version < 450) + require_extension_internal("GL_ARB_derivative_control"); + register_control_dependent_expression(ops[1]); break; // Bitfield case OpBitFieldInsert: // TODO: The signedness of inputs is strict in GLSL, but not in SPIR-V, bitcast if necessary. - QFOP(bitfieldInsert); + GLSL_QFOP(bitfieldInsert); break; case OpBitFieldSExtract: case OpBitFieldUExtract: // TODO: The signedness of inputs is strict in GLSL, but not in SPIR-V, bitcast if necessary. - TFOP(bitfieldExtract); + GLSL_TFOP(bitfieldExtract); break; case OpBitReverse: - UFOP(bitfieldReverse); + GLSL_UFOP(bitfieldReverse); break; case OpBitCount: - UFOP(bitCount); + GLSL_UFOP(bitCount); break; // Atomics @@ -6480,7 +7204,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) flush_all_atomic_capable_variables(); // FIXME: Image? // OpAtomicLoad seems to only be relevant for atomic counters. - UFOP(atomicCounter); + GLSL_UFOP(atomicCounter); register_read(ops[1], ops[2], should_forward(ops[2])); break; @@ -6490,7 +7214,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpAtomicIIncrement: forced_temporaries.insert(ops[1]); // FIXME: Image? - UFOP(atomicCounterIncrement); + GLSL_UFOP(atomicCounterIncrement); flush_all_atomic_capable_variables(); register_read(ops[1], ops[2], should_forward(ops[2])); break; @@ -6498,7 +7222,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpAtomicIDecrement: forced_temporaries.insert(ops[1]); // FIXME: Image? - UFOP(atomicCounterDecrement); + GLSL_UFOP(atomicCounterDecrement); flush_all_atomic_capable_variables(); register_read(ops[1], ops[2], should_forward(ops[2])); break; @@ -6613,7 +7337,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { uint32_t result_type = ops[0]; uint32_t id = ops[1]; - auto &e = emit_op(result_type, id, to_expression(ops[2]), true); + + // Suppress usage tracking. + auto &e = emit_op(result_type, id, to_expression(ops[2]), true, true); // When using the image, we need to know which variable it is actually loaded from. auto *var = maybe_get_backing_variable(ops[2]); @@ -6625,14 +7351,15 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) { if (!options.es && options.version < 400) { - require_extension("GL_ARB_texture_query_lod"); + require_extension_internal("GL_ARB_texture_query_lod"); // For some reason, the ARB spec is all-caps. - BFOP(textureQueryLOD); + GLSL_BFOP(textureQueryLOD); } else if (options.es) SPIRV_CROSS_THROW("textureQueryLod not supported in ES profile."); else - BFOP(textureQueryLod); + GLSL_BFOP(textureQueryLod); + register_control_dependent_expression(ops[1]); break; } @@ -6642,11 +7369,11 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; if (!options.es && options.version < 430) - require_extension("GL_ARB_texture_query_levels"); + require_extension_internal("GL_ARB_texture_query_levels"); if (options.es) SPIRV_CROSS_THROW("textureQueryLevels not supported in ES profile."); - auto expr = join("textureQueryLevels(", to_expression(ops[2]), ")"); + auto expr = join("textureQueryLevels(", convert_separate_image_to_combined(ops[2]), ")"); auto &restype = get(ops[0]); expr = bitcast_expression(restype, SPIRType::Int, expr); emit_op(result_type, id, expr, true); @@ -6663,7 +7390,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (type.image.sampled == 2) expr = join("imageSamples(", to_expression(ops[2]), ")"); else - expr = join("textureSamples(", to_expression(ops[2]), ")"); + expr = join("textureSamples(", convert_separate_image_to_combined(ops[2]), ")"); auto &restype = get(ops[0]); expr = bitcast_expression(restype, SPIRType::Int, expr); @@ -6684,7 +7411,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t result_type = ops[0]; uint32_t id = ops[1]; - auto expr = join("textureSize(", to_expression(ops[2]), ", ", bitcast_expression(SPIRType::Int, ops[3]), ")"); + auto expr = join("textureSize(", convert_separate_image_to_combined(ops[2]), ", ", + bitcast_expression(SPIRType::Int, ops[3]), ")"); auto &restype = get(ops[0]); expr = bitcast_expression(restype, SPIRType::Int, expr); emit_op(result_type, id, expr, true); @@ -6701,9 +7429,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (var) { auto &flags = meta.at(var->self).decoration.decoration_flags; - if (flags & (1ull << DecorationNonReadable)) + if (flags.get(DecorationNonReadable)) { - flags &= ~(1ull << DecorationNonReadable); + flags.clear(DecorationNonReadable); force_recompile = true; } } @@ -6821,6 +7549,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) } else emit_op(result_type, id, imgexpr, false); + + inherit_expression_dependencies(id, ops[2]); + if (type.image.ms) + inherit_expression_dependencies(id, ops[5]); break; } @@ -6845,9 +7577,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) if (var) { auto &flags = meta.at(var->self).decoration.decoration_flags; - if (flags & (1ull << DecorationNonWritable)) + if (flags.get(DecorationNonWritable)) { - flags &= ~(1ull << DecorationNonWritable); + flags.clear(DecorationNonWritable); force_recompile = true; } } @@ -6898,7 +7630,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) else { // This path is hit for samplerBuffers and multisampled images which do not have LOD. - expr = join("textureSize(", to_expression(ops[2]), ")"); + expr = join("textureSize(", convert_separate_image_to_combined(ops[2]), ")"); } auto &restype = get(ops[0]); @@ -6914,14 +7646,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) case OpControlBarrier: case OpMemoryBarrier: { - if (get_entry_point().model == ExecutionModelTessellationControl) - { - // Control shaders only have barriers, and it implies memory barriers. - if (opcode == OpControlBarrier) - statement("barrier();"); - break; - } - + uint32_t execution_scope = 0; uint32_t memory; uint32_t semantics; @@ -6932,10 +7657,26 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) } else { + execution_scope = get(ops[0]).scalar(); memory = get(ops[1]).scalar(); semantics = get(ops[2]).scalar(); } + if (execution_scope == ScopeSubgroup || memory == ScopeSubgroup) + { + if (!options.vulkan_semantics) + SPIRV_CROSS_THROW("Can only use subgroup operations in Vulkan semantics."); + require_extension_internal("GL_KHR_shader_subgroup_basic"); + } + + if (execution_scope != ScopeSubgroup && get_entry_point().model == ExecutionModelTessellationControl) + { + // Control shaders only have barriers, and it implies memory barriers. + if (opcode == OpControlBarrier) + statement("barrier();"); + break; + } + // We only care about these flags, acquire/release and friends are not relevant to GLSL. semantics = mask_relevant_memory_semantics(semantics); @@ -6979,7 +7720,11 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) // We are synchronizing some memory or syncing execution, // so we cannot forward any loads beyond the memory barrier. if (semantics || opcode == OpControlBarrier) + { + assert(current_emitting_block); + flush_control_dependent_expressions(current_emitting_block->self); flush_all_active_variables(); + } if (memory == ScopeWorkgroup) // Only need to consider memory within a group { @@ -6988,6 +7733,33 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) else if (semantics != 0) statement("groupMemoryBarrier();"); } + else if (memory == ScopeSubgroup) + { + const uint32_t all_barriers = + MemorySemanticsWorkgroupMemoryMask | MemorySemanticsUniformMemoryMask | MemorySemanticsImageMemoryMask; + + if (semantics & (MemorySemanticsCrossWorkgroupMemoryMask | MemorySemanticsSubgroupMemoryMask)) + { + // These are not relevant for GLSL, but assume it means memoryBarrier(). + // memoryBarrier() does everything, so no need to test anything else. + statement("subgroupMemoryBarrier();"); + } + else if ((semantics & all_barriers) == all_barriers) + { + // Short-hand instead of emitting 3 barriers. + statement("subgroupMemoryBarrier();"); + } + else + { + // Pick out individual barriers. + if (semantics & MemorySemanticsWorkgroupMemoryMask) + statement("subgroupMemoryBarrierShared();"); + if (semantics & MemorySemanticsUniformMemoryMask) + statement("subgroupMemoryBarrierBuffer();"); + if (semantics & MemorySemanticsImageMemoryMask) + statement("subgroupMemoryBarrierImage();"); + } + } else { const uint32_t all_barriers = MemorySemanticsWorkgroupMemoryMask | MemorySemanticsUniformMemoryMask | @@ -7019,7 +7791,12 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) } if (opcode == OpControlBarrier) - statement("barrier();"); + { + if (execution_scope == ScopeSubgroup) + statement("subgroupBarrier();"); + else + statement("barrier();"); + } break; } @@ -7056,15 +7833,18 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) break; } + // Legacy sub-group stuff ... case OpSubgroupBallotKHR: { uint32_t result_type = ops[0]; uint32_t id = ops[1]; string expr; - expr = join("unpackUint2x32(ballotARB(" + to_expression(ops[2]) + "))"); - emit_op(result_type, id, expr, true); + expr = join("uvec4(unpackUint2x32(ballotARB(" + to_expression(ops[2]) + ")), 0u, 0u)"); + emit_op(result_type, id, expr, should_forward(ops[2])); - require_extension("GL_ARB_shader_ballot"); + require_extension_internal("GL_ARB_shader_ballot"); + inherit_expression_dependencies(id, ops[2]); + register_control_dependent_expression(ops[1]); break; } @@ -7074,7 +7854,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[2], "readFirstInvocationARB"); - require_extension("GL_ARB_shader_ballot"); + require_extension_internal("GL_ARB_shader_ballot"); + register_control_dependent_expression(ops[1]); break; } @@ -7084,7 +7865,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_binary_func_op(result_type, id, ops[2], ops[3], "readInvocationARB"); - require_extension("GL_ARB_shader_ballot"); + require_extension_internal("GL_ARB_shader_ballot"); + register_control_dependent_expression(ops[1]); break; } @@ -7094,7 +7876,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[2], "allInvocationsARB"); - require_extension("GL_ARB_shader_group_vote"); + require_extension_internal("GL_ARB_shader_group_vote"); + register_control_dependent_expression(ops[1]); break; } @@ -7104,7 +7887,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[2], "anyInvocationARB"); - require_extension("GL_ARB_shader_group_vote"); + require_extension_internal("GL_ARB_shader_group_vote"); + register_control_dependent_expression(ops[1]); break; } @@ -7114,7 +7898,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[2], "allInvocationsEqualARB"); - require_extension("GL_ARB_shader_group_vote"); + require_extension_internal("GL_ARB_shader_group_vote"); + register_control_dependent_expression(ops[1]); break; } @@ -7125,7 +7910,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[4], "addInvocationsNonUniformAMD"); - require_extension("GL_AMD_shader_ballot"); + require_extension_internal("GL_AMD_shader_ballot"); + register_control_dependent_expression(ops[1]); break; } @@ -7137,7 +7923,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[4], "minInvocationsNonUniformAMD"); - require_extension("GL_AMD_shader_ballot"); + require_extension_internal("GL_AMD_shader_ballot"); + register_control_dependent_expression(ops[1]); break; } @@ -7149,7 +7936,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) uint32_t id = ops[1]; emit_unary_func_op(result_type, id, ops[4], "maxInvocationsNonUniformAMD"); - require_extension("GL_AMD_shader_ballot"); + require_extension_internal("GL_AMD_shader_ballot"); + register_control_dependent_expression(ops[1]); break; } @@ -7168,7 +7956,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) emit_binary_func_op(result_type, id, ops[2], ops[3], "fragmentMaskFetchAMD"); } - require_extension("GL_AMD_shader_fragment_mask"); + require_extension_internal("GL_AMD_shader_fragment_mask"); break; } @@ -7187,10 +7975,69 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction) emit_trinary_func_op(result_type, id, ops[2], ops[3], ops[4], "fragmentFetchAMD"); } - require_extension("GL_AMD_shader_fragment_mask"); + require_extension_internal("GL_AMD_shader_fragment_mask"); break; } + // Vulkan 1.1 sub-group stuff ... + case OpGroupNonUniformElect: + case OpGroupNonUniformBroadcast: + case OpGroupNonUniformBroadcastFirst: + case OpGroupNonUniformBallot: + case OpGroupNonUniformInverseBallot: + case OpGroupNonUniformBallotBitExtract: + case OpGroupNonUniformBallotBitCount: + case OpGroupNonUniformBallotFindLSB: + case OpGroupNonUniformBallotFindMSB: + case OpGroupNonUniformShuffle: + case OpGroupNonUniformShuffleXor: + case OpGroupNonUniformShuffleUp: + case OpGroupNonUniformShuffleDown: + case OpGroupNonUniformAll: + case OpGroupNonUniformAny: + case OpGroupNonUniformAllEqual: + case OpGroupNonUniformFAdd: + case OpGroupNonUniformIAdd: + case OpGroupNonUniformFMul: + case OpGroupNonUniformIMul: + case OpGroupNonUniformFMin: + case OpGroupNonUniformFMax: + case OpGroupNonUniformSMin: + case OpGroupNonUniformSMax: + case OpGroupNonUniformUMin: + case OpGroupNonUniformUMax: + case OpGroupNonUniformBitwiseAnd: + case OpGroupNonUniformBitwiseOr: + case OpGroupNonUniformBitwiseXor: + case OpGroupNonUniformQuadSwap: + case OpGroupNonUniformQuadBroadcast: + emit_subgroup_op(instruction); + break; + + case OpFUnordEqual: + GLSL_BFOP(unsupported_FUnordEqual); + break; + + case OpFUnordNotEqual: + GLSL_BFOP(unsupported_FUnordNotEqual); + break; + + case OpFUnordLessThan: + GLSL_BFOP(unsupported_FUnordLessThan); + break; + + case OpFUnordGreaterThan: + GLSL_BFOP(unsupported_FUnordGreaterThan); + break; + + case OpFUnordLessThanEqual: + GLSL_BFOP(unsupported_FUnordLessThanEqual); + break; + + case OpFUnordGreaterThanEqual: + GLSL_BFOP(unsupported_FUnordGreaterThanEqual); + break; + default: statement("// unimplemented op ", instruction.op); break; @@ -7261,7 +8108,7 @@ bool CompilerGLSL::is_non_native_row_major_matrix(uint32_t id) return false; // Non-matrix or column-major matrix types do not need to be converted. - if (!(meta[id].decoration.decoration_flags & (1ull << DecorationRowMajor))) + if (!meta[id].decoration.decoration_flags.get(DecorationRowMajor)) return false; // Only square row-major matrices can be converted at this time. @@ -7282,7 +8129,7 @@ bool CompilerGLSL::member_is_non_native_row_major_matrix(const SPIRType &type, u return false; // Non-matrix or column-major matrix types do not need to be converted. - if (!(combined_decoration_for_member(type, index) & (1ull << DecorationRowMajor))) + if (!combined_decoration_for_member(type, index).get(DecorationRowMajor)) return false; // Only square row-major matrices can be converted at this time. @@ -7326,14 +8173,15 @@ void CompilerGLSL::emit_struct_member(const SPIRType &type, uint32_t member_type { auto &membertype = get(member_type_id); - uint64_t memberflags = 0; + Bitset memberflags; auto &memb = meta[type.self].members; if (index < memb.size()) memberflags = memb[index].decoration_flags; string qualifiers; - bool is_block = (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; + bool is_block = meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + if (is_block) qualifiers = to_interpolation_qualifiers(memberflags); @@ -7342,7 +8190,7 @@ void CompilerGLSL::emit_struct_member(const SPIRType &type, uint32_t member_type variable_decl(membertype, to_member_name(type, index)), ";"); } -const char *CompilerGLSL::flags_to_precision_qualifiers_glsl(const SPIRType &type, uint64_t flags) +const char *CompilerGLSL::flags_to_precision_qualifiers_glsl(const SPIRType &type, const Bitset &flags) { // Structs do not have precision qualifiers, neither do doubles (desktop only anyways, so no mediump/highp). if (type.basetype != SPIRType::Float && type.basetype != SPIRType::Int && type.basetype != SPIRType::UInt && @@ -7354,7 +8202,7 @@ const char *CompilerGLSL::flags_to_precision_qualifiers_glsl(const SPIRType &typ { auto &execution = get_entry_point(); - if (flags & (1ull << DecorationRelaxedPrecision)) + if (flags.get(DecorationRelaxedPrecision)) { bool implied_fmediump = type.basetype == SPIRType::Float && options.fragment.default_float_precision == Options::Mediump && @@ -7385,12 +8233,8 @@ const char *CompilerGLSL::flags_to_precision_qualifiers_glsl(const SPIRType &typ { // Vulkan GLSL supports precision qualifiers, even in desktop profiles, which is convenient. // The default is highp however, so only emit mediump in the rare case that a shader has these. - if (flags & (1ull << DecorationRelaxedPrecision)) - { - bool can_use_mediump = - type.basetype == SPIRType::Float || type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt; - return can_use_mediump ? "mediump " : ""; - } + if (flags.get(DecorationRelaxedPrecision)) + return "mediump "; else return ""; } @@ -7420,13 +8264,13 @@ string CompilerGLSL::to_qualifiers_glsl(uint32_t id) auto &type = expression_type(id); if (type.image.dim != DimSubpassData && type.image.sampled == 2) { - if (flags & (1ull << DecorationCoherent)) + if (flags.get(DecorationCoherent)) res += "coherent "; - if (flags & (1ull << DecorationRestrict)) + if (flags.get(DecorationRestrict)) res += "restrict "; - if (flags & (1ull << DecorationNonWritable)) + if (flags.get(DecorationNonWritable)) res += "readonly "; - if (flags & (1ull << DecorationNonReadable)) + if (flags.get(DecorationNonReadable)) res += "writeonly "; } @@ -7452,6 +8296,11 @@ string CompilerGLSL::argument_decl(const SPIRFunction::Parameter &arg) return join(direction, to_qualifiers_glsl(arg.id), variable_decl(type, to_name(arg.id), arg.id)); } +string CompilerGLSL::to_initializer_expression(const SPIRVariable &var) +{ + return to_expression(var.initializer); +} + string CompilerGLSL::variable_decl(const SPIRVariable &variable) { // Ignore the pointer type since GLSL doesn't have pointers. @@ -7469,7 +8318,7 @@ string CompilerGLSL::variable_decl(const SPIRVariable &variable) { uint32_t expr = variable.initializer; if (ids[expr].get_type() != TypeUndef) - res += join(" = ", to_expression(variable.initializer)); + res += join(" = ", to_initializer_expression(variable)); } return res; } @@ -7477,7 +8326,7 @@ string CompilerGLSL::variable_decl(const SPIRVariable &variable) const char *CompilerGLSL::to_pls_qualifiers_glsl(const SPIRVariable &variable) { auto flags = meta[variable.self].decoration.decoration_flags; - if (flags & (1ull << DecorationRelaxedPrecision)) + if (flags.get(DecorationRelaxedPrecision)) return "mediump "; else return "highp "; @@ -7564,7 +8413,7 @@ string CompilerGLSL::type_to_array_glsl(const SPIRType &type) if (type.array.size() > 1) { if (!options.es && options.version < 430) - require_extension("GL_ARB_arrays_of_arrays"); + require_extension_internal("GL_ARB_arrays_of_arrays"); else if (options.es && options.version < 310) SPIRV_CROSS_THROW("Arrays of arrays not supported before ESSL version 310. " "Try using --flatten-multidimensional-arrays or set " @@ -7582,7 +8431,7 @@ string CompilerGLSL::type_to_array_glsl(const SPIRType &type) } } -string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t /* id */) +string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id) { auto &imagetype = get(type.image.type); string res; @@ -7632,9 +8481,9 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t /* id */) case DimBuffer: if (options.es && options.version < 320) - require_extension("GL_OES_texture_buffer"); + require_extension_internal("GL_OES_texture_buffer"); else if (!options.es && options.version < 300) - require_extension("GL_EXT_texture_buffer_object"); + require_extension_internal("GL_EXT_texture_buffer_object"); res += "Buffer"; break; @@ -7650,13 +8499,16 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t /* id */) if (type.image.arrayed) { if (is_legacy_desktop()) - require_extension("GL_EXT_texture_array"); + require_extension_internal("GL_EXT_texture_array"); res += "Array"; } // "Shadow" state in GLSL only exists for samplers and combined image samplers. - if (((type.basetype == SPIRType::SampledImage) || (type.basetype == SPIRType::Sampler)) && type.image.depth) + if (((type.basetype == SPIRType::SampledImage) || (type.basetype == SPIRType::Sampler)) && + image_is_comparison(type, id)) + { res += "Shadow"; + } return res; } @@ -7668,7 +8520,7 @@ string CompilerGLSL::type_to_glsl_constructor(const SPIRType &type) if (options.flatten_multidimensional_arrays) SPIRV_CROSS_THROW("Cannot flatten constructors of multidimensional array constructors, e.g. float[][]()."); else if (!options.es && options.version < 430) - require_extension("GL_ARB_arrays_of_arrays"); + require_extension_internal("GL_ARB_arrays_of_arrays"); else if (options.es && options.version < 310) SPIRV_CROSS_THROW("Arrays of arrays not supported before ESSL version 310."); } @@ -7702,7 +8554,7 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) case SPIRType::Sampler: // The depth field is set by calling code based on the variable ID of the sampler, effectively reintroducing // this distinction into the type system. - return comparison_samplers.count(id) ? "samplerShadow" : "sampler"; + return comparison_ids.count(id) ? "samplerShadow" : "sampler"; case SPIRType::Void: return "void"; @@ -7711,6 +8563,9 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) break; } + if (type.basetype == SPIRType::UInt && is_legacy()) + SPIRV_CROSS_THROW("Unsigned integers are not supported on legacy targets."); + if (type.vecsize == 1 && type.columns == 1) // Scalar builtin { switch (type.basetype) @@ -7723,6 +8578,8 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) return backend.basic_uint_type; case SPIRType::AtomicCounter: return "atomic_uint"; + case SPIRType::Half: + return "float16_t"; case SPIRType::Float: return "float"; case SPIRType::Double: @@ -7745,6 +8602,8 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) return join("ivec", type.vecsize); case SPIRType::UInt: return join("uvec", type.vecsize); + case SPIRType::Half: + return join("f16vec", type.vecsize); case SPIRType::Float: return join("vec", type.vecsize); case SPIRType::Double: @@ -7767,6 +8626,8 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) return join("imat", type.vecsize); case SPIRType::UInt: return join("umat", type.vecsize); + case SPIRType::Half: + return join("f16mat", type.vecsize); case SPIRType::Float: return join("mat", type.vecsize); case SPIRType::Double: @@ -7786,6 +8647,8 @@ string CompilerGLSL::type_to_glsl(const SPIRType &type, uint32_t id) return join("imat", type.columns, "x", type.vecsize); case SPIRType::UInt: return join("umat", type.columns, "x", type.vecsize); + case SPIRType::Half: + return join("f16mat", type.columns, "x", type.vecsize); case SPIRType::Float: return join("mat", type.columns, "x", type.vecsize); case SPIRType::Double: @@ -7809,6 +8672,9 @@ void CompilerGLSL::add_variable(unordered_set &variables, string &name) return; } + // Avoid double underscores. + name = sanitize_underscores(name); + update_name_cache(variables, name); } @@ -7839,7 +8705,13 @@ bool CompilerGLSL::has_extension(const std::string &ext) const return itr != end(forced_extensions); } -void CompilerGLSL::require_extension(const string &ext) +void CompilerGLSL::require_extension(const std::string &ext) +{ + if (!has_extension(ext)) + forced_extensions.push_back(ext); +} + +void CompilerGLSL::require_extension_internal(const string &ext) { if (backend.supports_extensions && !has_extension(ext)) { @@ -7859,7 +8731,7 @@ void CompilerGLSL::flatten_buffer_block(uint32_t id) SPIRV_CROSS_THROW(name + " is an array of UBOs."); if (type.basetype != SPIRType::Struct) SPIRV_CROSS_THROW(name + " is not a struct."); - if ((flags & (1ull << DecorationBlock)) == 0) + if (!flags.get(DecorationBlock)) SPIRV_CROSS_THROW(name + " is not a block."); if (type.member_types.empty()) SPIRV_CROSS_THROW(name + " is an empty struct."); @@ -7873,16 +8745,16 @@ bool CompilerGLSL::check_atomic_image(uint32_t id) if (type.storage == StorageClassImage) { if (options.es && options.version < 320) - require_extension("GL_OES_shader_image_atomic"); + require_extension_internal("GL_OES_shader_image_atomic"); auto *var = maybe_get_backing_variable(id); if (var) { auto &flags = meta.at(var->self).decoration.decoration_flags; - if (flags & ((1ull << DecorationNonWritable) | (1ull << DecorationNonReadable))) + if (flags.get(DecorationNonWritable) || flags.get(DecorationNonReadable)) { - flags &= ~(1ull << DecorationNonWritable); - flags &= ~(1ull << DecorationNonReadable); + flags.clear(DecorationNonWritable); + flags.clear(DecorationNonReadable); force_recompile = true; } } @@ -7900,13 +8772,22 @@ void CompilerGLSL::add_function_overload(const SPIRFunction &func) // Parameters can vary with pointer type or not, // but that will not change the signature in GLSL/HLSL, // so strip the pointer type before hashing. - uint32_t type_id = arg.type; - auto *type = &get(type_id); - while (type->pointer) + uint32_t type_id = get_non_pointer_type_id(arg.type); + auto &type = get(type_id); + + if (!combined_image_samplers.empty()) { - type_id = type->parent_type; - type = &get(type_id); + // If we have combined image samplers, we cannot really trust the image and sampler arguments + // we pass down to callees, because they may be shuffled around. + // Ignore these arguments, to make sure that functions need to differ in some other way + // to be considered different overloads. + if (type.basetype == SPIRType::SampledImage || + (type.basetype == SPIRType::Image && type.image.sampled == 1) || type.basetype == SPIRType::Sampler) + { + continue; + } } + hasher.u32(type_id); } uint64_t types_hash = hasher.get(); @@ -7937,7 +8818,7 @@ void CompilerGLSL::add_function_overload(const SPIRFunction &func) } } -void CompilerGLSL::emit_function_prototype(SPIRFunction &func, uint64_t return_flags) +void CompilerGLSL::emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) { if (func.self != entry_point) add_function_overload(func); @@ -8005,7 +8886,7 @@ void CompilerGLSL::emit_function_prototype(SPIRFunction &func, uint64_t return_f statement(decl); } -void CompilerGLSL::emit_function(SPIRFunction &func, uint64_t return_flags) +void CompilerGLSL::emit_function(SPIRFunction &func, const Bitset &return_flags) { // Avoid potential cycles. if (func.active) @@ -8033,48 +8914,44 @@ void CompilerGLSL::emit_function(SPIRFunction &func, uint64_t return_flags) emit_function_prototype(func, return_flags); begin_scope(); + if (func.self == entry_point) + emit_entry_point_declarations(); + current_function = &func; auto &entry_block = get(func.entry_block); - if (!func.analyzed_variable_scope) - { - analyze_variable_scope(func); - - // Check if we can actually use the loop variables we found in analyze_variable_scope. - // To use multiple initializers, we need the same type and qualifiers. - for (auto block : func.blocks) - { - auto &b = get(block); - if (b.loop_variables.size() < 2) - continue; - - uint64_t flags = get_decoration_mask(b.loop_variables.front()); - uint32_t type = get(b.loop_variables.front()).basetype; - bool invalid_initializers = false; - for (auto loop_variable : b.loop_variables) - { - if (flags != get_decoration_mask(loop_variable) || - type != get(b.loop_variables.front()).basetype) - { - invalid_initializers = true; - break; - } - } - - if (invalid_initializers) - { - for (auto loop_variable : b.loop_variables) - get(loop_variable).loop_variable = false; - b.loop_variables.clear(); - } - } - func.analyzed_variable_scope = true; - } - for (auto &v : func.local_variables) { auto &var = get(v); - if (expression_is_lvalue(v)) + if (var.storage == StorageClassWorkgroup) + { + // Special variable type which cannot have initializer, + // need to be declared as standalone variables. + // Comes from MSL which can push global variables as local variables in main function. + add_local_variable_name(var.self); + statement(variable_decl(var), ";"); + var.deferred_declaration = false; + } + else if (var.storage == StorageClassPrivate) + { + // These variables will not have had their CFG usage analyzed, so move it to the entry block. + // Comes from MSL which can push global variables as local variables in main function. + // We could just declare them right now, but we would miss out on an important initialization case which is + // LUT declaration in MSL. + // If we don't declare the variable when it is assigned we're forced to go through a helper function + // which copies elements one by one. + add_local_variable_name(var.self); + auto &dominated = entry_block.dominated_variables; + if (find(begin(dominated), end(dominated), var.self) == end(dominated)) + entry_block.dominated_variables.push_back(var.self); + var.deferred_declaration = true; + } + else if (var.storage == StorageClassFunction && var.remapped_variable && var.static_expression) + { + // No need to declare this variable, it has a static expression. + var.deferred_declaration = false; + } + else if (expression_is_lvalue(v)) { add_local_variable_name(var.self); @@ -8085,10 +8962,7 @@ void CompilerGLSL::emit_function(SPIRFunction &func, uint64_t return_flags) // Don't declare variable until first use to declutter the GLSL output quite a lot. // If we don't touch the variable before first branch, // declare it then since we need variable declaration to be in top scope. - // Never declare empty structs. They have no meaningful representation. - auto &type = get(var.basetype); - bool empty_struct = type.basetype == SPIRType::Struct && type.member_types.empty(); - var.deferred_declaration = !empty_struct; + var.deferred_declaration = true; } } else @@ -8108,6 +8982,9 @@ void CompilerGLSL::emit_function(SPIRFunction &func, uint64_t return_flags) var.deferred_declaration = false; } + for (auto &line : current_function->fixup_statements_in) + statement(line); + entry_block.loop_dominator = SPIRBlock::NoDominator; emit_block_chain(entry_block); @@ -8162,16 +9039,78 @@ void CompilerGLSL::flush_phi(uint32_t from, uint32_t to) // use this to emit ESSL 1.0 compliant increments/decrements. auto lhs = to_expression(phi.function_variable); auto rhs = to_expression(phi.local_variable); - if (!optimize_read_modify_write(lhs, rhs)) + if (!optimize_read_modify_write(get(var.basetype), lhs, rhs)) statement(lhs, " = ", rhs, ";"); } + + register_write(phi.function_variable); } } } +void CompilerGLSL::branch_to_continue(uint32_t from, uint32_t to) +{ + auto &to_block = get(to); + if (from == to) + return; + + assert(is_continue(to)); + if (to_block.complex_continue) + { + // Just emit the whole block chain as is. + auto usage_counts = expression_usage_counts; + auto invalid = invalid_expressions; + + emit_block_chain(to_block); + + // Expression usage counts and invalid expressions + // are moot after returning from the continue block. + // Since we emit the same block multiple times, + // we don't want to invalidate ourselves. + expression_usage_counts = usage_counts; + invalid_expressions = invalid; + } + else + { + auto &from_block = get(from); + bool outside_control_flow = false; + uint32_t loop_dominator = 0; + + // FIXME: Refactor this to not use the old loop_dominator tracking. + if (from_block.merge_block) + { + // If we are a loop header, we don't set the loop dominator, + // so just use "self" here. + loop_dominator = from; + } + else if (from_block.loop_dominator != SPIRBlock::NoDominator) + { + loop_dominator = from_block.loop_dominator; + } + + if (loop_dominator != 0) + { + auto &dominator = get(loop_dominator); + + // For non-complex continue blocks, we implicitly branch to the continue block + // by having the continue block be part of the loop header in for (; ; continue-block). + outside_control_flow = block_is_outside_flow_control_from_block(dominator, from_block); + } + + // Some simplification for for-loops. We always end up with a useless continue; + // statement since we branch to a loop block. + // Walk the CFG, if we uncoditionally execute the block calling continue assuming we're in the loop block, + // we can avoid writing out an explicit continue statement. + // Similar optimization to return statements if we know we're outside flow control. + if (!outside_control_flow) + statement("continue;"); + } +} + void CompilerGLSL::branch(uint32_t from, uint32_t to) { flush_phi(from, to); + flush_control_dependent_expressions(from); flush_all_active_variables(); // This is only a continue if we branch to our loop dominator. @@ -8182,64 +9121,22 @@ void CompilerGLSL::branch(uint32_t from, uint32_t to) // and end the chain here. statement("continue;"); } - else if (is_continue(to)) - { - auto &to_block = get(to); - if (to_block.complex_continue) - { - // Just emit the whole block chain as is. - auto usage_counts = expression_usage_counts; - auto invalid = invalid_expressions; - - emit_block_chain(to_block); - - // Expression usage counts and invalid expressions - // are moot after returning from the continue block. - // Since we emit the same block multiple times, - // we don't want to invalidate ourselves. - expression_usage_counts = usage_counts; - invalid_expressions = invalid; - } - else - { - auto &from_block = get(from); - bool outside_control_flow = false; - uint32_t loop_dominator = 0; - - // FIXME: Refactor this to not use the old loop_dominator tracking. - if (from_block.merge_block) - { - // If we are a loop header, we don't set the loop dominator, - // so just use "self" here. - loop_dominator = from; - } - else if (from_block.loop_dominator != SPIRBlock::NoDominator) - { - loop_dominator = from_block.loop_dominator; - } - - if (loop_dominator != 0) - { - auto &dominator = get(loop_dominator); - - // For non-complex continue blocks, we implicitly branch to the continue block - // by having the continue block be part of the loop header in for (; ; continue-block). - outside_control_flow = block_is_outside_flow_control_from_block(dominator, from_block); - } - - // Some simplification for for-loops. We always end up with a useless continue; - // statement since we branch to a loop block. - // Walk the CFG, if we uncoditionally execute the block calling continue assuming we're in the loop block, - // we can avoid writing out an explicit continue statement. - // Similar optimization to return statements if we know we're outside flow control. - if (!outside_control_flow) - statement("continue;"); - } - } else if (is_break(to)) statement("break;"); + else if (is_continue(to) || (from == to)) + { + // For from == to case can happen for a do-while loop which branches into itself. + // We don't mark these cases as continue blocks, but the only possible way to branch into + // ourselves is through means of continue blocks. + branch_to_continue(from, to); + } else if (!is_conditional(to)) emit_block_chain(get(to)); + + // It is important that we check for break before continue. + // A block might serve two purposes, a break block for the inner scope, and + // a continue block in the outer scope. + // Inner scope always takes precedence. } void CompilerGLSL::branch(uint32_t from, uint32_t cond, uint32_t true_block, uint32_t false_block) @@ -8250,12 +9147,13 @@ void CompilerGLSL::branch(uint32_t from, uint32_t cond, uint32_t true_block, uin if (true_sub) { + emit_block_hints(get(from)); statement("if (", to_expression(cond), ")"); begin_scope(); branch(from, true_block); end_scope(); - if (false_sub) + if (false_sub || is_continue(false_block) || is_break(false_block)) { statement("else"); begin_scope(); @@ -8273,12 +9171,20 @@ void CompilerGLSL::branch(uint32_t from, uint32_t cond, uint32_t true_block, uin else if (false_sub && !true_sub) { // Only need false path, use negative conditional. - statement("if (!", to_expression(cond), ")"); + emit_block_hints(get(from)); + statement("if (!", to_enclosed_expression(cond), ")"); begin_scope(); branch(from, false_block); end_scope(); - if (flush_phi_required(from, true_block)) + if (is_continue(true_block) || is_break(true_block)) + { + statement("else"); + begin_scope(); + branch(from, true_block); + end_scope(); + } + else if (flush_phi_required(from, true_block)) { statement("else"); begin_scope(); @@ -8426,7 +9332,7 @@ string CompilerGLSL::emit_for_loop_initializers(const SPIRBlock &block) if (expr.empty()) { // For loop initializers are of the form (block.loop_variables.front()); + auto &var = get(loop_var); auto &type = get(var.basetype); expr = join(to_qualifiers_glsl(var.self), type_to_glsl(type), " "); } @@ -8447,7 +9353,7 @@ bool CompilerGLSL::for_loop_initializers_are_same_type(const SPIRBlock &block) return true; uint32_t expected = 0; - uint64_t expected_flags = 0; + Bitset expected_flags; for (auto &var : block.loop_variables) { // Don't care about uninitialized variables as they will not be part of the initializers. @@ -8458,13 +9364,13 @@ bool CompilerGLSL::for_loop_initializers_are_same_type(const SPIRBlock &block) if (expected == 0) { expected = get(var).basetype; - expected_flags = get_decoration_mask(var); + expected_flags = get_decoration_bitset(var); } else if (expected != get(var).basetype) return false; // Precision flags and things like that must also match. - if (expected_flags != get_decoration_mask(var)) + if (expected_flags != get_decoration_bitset(var)) return false; } @@ -8475,7 +9381,7 @@ bool CompilerGLSL::attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method { SPIRBlock::ContinueBlockType continue_type = continue_block_type(get(block.continue_block)); - if (method == SPIRBlock::MergeToSelectForLoop) + if (method == SPIRBlock::MergeToSelectForLoop || method == SPIRBlock::MergeToSelectContinueForLoop) { uint32_t current_count = statement_count; // If we're trying to create a true for loop, @@ -8494,19 +9400,26 @@ bool CompilerGLSL::attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method { // This block may be a dominating block, so make sure we flush undeclared variables before building the for loop header. flush_undeclared_variables(block); + emit_block_hints(block); // Important that we do this in this order because // emitting the continue block can invalidate the condition expression. auto initializer = emit_for_loop_initializers(block); auto condition = to_expression(block.condition); - auto continue_block = emit_continue_block(block.continue_block); - statement("for (", initializer, "; ", condition, "; ", continue_block, ")"); + if (method != SPIRBlock::MergeToSelectContinueForLoop) + { + auto continue_block = emit_continue_block(block.continue_block); + statement("for (", initializer, "; ", condition, "; ", continue_block, ")"); + } + else + statement("for (", initializer, "; ", condition, "; )"); break; } case SPIRBlock::WhileLoop: // This block may be a dominating block, so make sure we flush undeclared variables before building the while loop header. flush_undeclared_variables(block); + emit_block_hints(block); statement("while (", to_expression(block.condition), ")"); break; @@ -8554,11 +9467,13 @@ bool CompilerGLSL::attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method auto initializer = emit_for_loop_initializers(block); auto condition = to_expression(child.condition); auto continue_block = emit_continue_block(block.continue_block); + emit_block_hints(block); statement("for (", initializer, "; ", condition, "; ", continue_block, ")"); break; } case SPIRBlock::WhileLoop: + emit_block_hints(block); statement("while (", to_expression(child.condition), ")"); break; @@ -8596,6 +9511,28 @@ void CompilerGLSL::flush_undeclared_variables(SPIRBlock &block) } } +void CompilerGLSL::emit_hoisted_temporaries(vector> &temporaries) +{ + // If we need to force temporaries for certain IDs due to continue blocks, do it before starting loop header. + // Need to sort these to ensure that reference output is stable. + sort(begin(temporaries), end(temporaries), + [](const pair &a, const pair &b) { return a.second < b.second; }); + + for (auto &tmp : temporaries) + { + add_local_variable_name(tmp.second); + auto flags = meta[tmp.second].decoration.decoration_flags; + auto &type = get(tmp.first); + statement(flags_to_precision_qualifiers_glsl(type, flags), variable_decl(type, to_name(tmp.second)), ";"); + + hoisted_temporaries.insert(tmp.second); + forced_temporaries.insert(tmp.second); + + // The temporary might be read from before it's assigned, set up the expression now. + set(tmp.second, to_name(tmp.second), tmp.first, true); + } +} + void CompilerGLSL::emit_block_chain(SPIRBlock &block) { propagate_loop_dominators(block); @@ -8603,21 +9540,9 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) bool select_branch_to_true_block = false; bool skip_direct_branch = false; bool emitted_for_loop_header = false; + bool force_complex_continue_block = false; - // If we need to force temporaries for certain IDs due to continue blocks, do it before starting loop header. - // Need to sort these to ensure that reference output is stable. - sort(begin(block.declare_temporary), end(block.declare_temporary), - [](const pair &a, const pair &b) { return a.second < b.second; }); - - for (auto &tmp : block.declare_temporary) - { - auto flags = meta[tmp.second].decoration.decoration_flags; - auto &type = get(tmp.first); - statement(flags_to_precision_qualifiers_glsl(type, flags), variable_decl(type, to_name(tmp.second)), ";"); - - // The temporary might be read from before it's assigned, set up the expression now. - set(tmp.second, to_name(tmp.second), tmp.first, true); - } + emit_hoisted_temporaries(block.declare_temporary); SPIRBlock::ContinueBlockType continue_type = SPIRBlock::ContinueNone; if (block.continue_block) @@ -8627,8 +9552,22 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) for (auto var : block.loop_variables) get(var).loop_variable_enable = true; + // This is the method often used by spirv-opt to implement loops. + // The loop header goes straight into the continue block. + // However, don't attempt this on ESSL 1.0, because if a loop variable is used in a continue block, + // it *MUST* be used in the continue block. This loop method will not work. + if (!is_legacy_es() && block_is_loop_candidate(block, SPIRBlock::MergeToSelectContinueForLoop)) + { + flush_undeclared_variables(block); + if (attempt_emit_loop_header(block, SPIRBlock::MergeToSelectContinueForLoop)) + { + select_branch_to_true_block = true; + emitted_for_loop_header = true; + force_complex_continue_block = true; + } + } // This is the older loop behavior in glslang which branches to loop body directly from the loop header. - if (block_is_loop_candidate(block, SPIRBlock::MergeToSelectForLoop)) + else if (block_is_loop_candidate(block, SPIRBlock::MergeToSelectForLoop)) { flush_undeclared_variables(block); if (attempt_emit_loop_header(block, SPIRBlock::MergeToSelectForLoop)) @@ -8652,6 +9591,11 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) else if (continue_type == SPIRBlock::DoWhileLoop) { flush_undeclared_variables(block); + // We have some temporaries where the loop header is the dominator. + // We risk a case where we have code like: + // for (;;) { create-temporary; break; } consume-temporary; + // so force-declare temporaries here. + emit_hoisted_temporaries(block.potential_declare_temporary); statement("do"); begin_scope(); @@ -8665,6 +9609,11 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) get(block.continue_block).complex_continue = true; continue_type = SPIRBlock::ComplexLoop; + // We have some temporaries where the loop header is the dominator. + // We risk a case where we have code like: + // for (;;) { create-temporary; break; } consume-temporary; + // so force-declare temporaries here. + emit_hoisted_temporaries(block.potential_declare_temporary); statement("for (;;)"); begin_scope(); @@ -8709,9 +9658,23 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) break; case SPIRBlock::Select: - // True if MergeToSelectForLoop succeeded. + // True if MergeToSelectForLoop or MergeToSelectContinueForLoop succeeded. if (select_branch_to_true_block) - branch(block.self, block.true_block); + { + if (force_complex_continue_block) + { + assert(block.true_block == block.continue_block); + + // We're going to emit a continue block directly here, so make sure it's marked as complex. + auto &complex_continue = get(block.continue_block).complex_continue; + bool old_complex = complex_continue; + complex_continue = true; + branch(block.self, block.true_block); + complex_continue = old_complex; + } + else + branch(block.self, block.true_block); + } else branch(block.self, block.condition, block.true_block, block.false_block); break; @@ -8721,35 +9684,65 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) auto &type = expression_type(block.condition); bool uint32_t_case = type.basetype == SPIRType::UInt; + emit_block_hints(block); statement("switch (", to_expression(block.condition), ")"); begin_scope(); + // Multiple case labels can branch to same block, so find all unique blocks. + bool emitted_default = false; + unordered_set emitted_blocks; + for (auto &c : block.cases) { - auto case_value = - uint32_t_case ? convert_to_string(uint32_t(c.value)) : convert_to_string(int32_t(c.value)); - statement("case ", case_value, ":"); + if (emitted_blocks.count(c.block) != 0) + continue; + + // Emit all case labels which branch to our target. + // FIXME: O(n^2), revisit if we hit shaders with 100++ case labels ... + for (auto &other_case : block.cases) + { + if (other_case.block == c.block) + { + auto case_value = uint32_t_case ? convert_to_string(uint32_t(other_case.value)) : + convert_to_string(int32_t(other_case.value)); + statement("case ", case_value, ":"); + } + } + + // Maybe we share with default block? + if (block.default_block == c.block) + { + statement("default:"); + emitted_default = true; + } + + // Complete the target. + emitted_blocks.insert(c.block); + begin_scope(); branch(block.self, c.block); end_scope(); } - if (block.default_block != block.next_block) + if (!emitted_default) { - statement("default:"); - begin_scope(); - if (is_break(block.default_block)) - SPIRV_CROSS_THROW("Cannot break; out of a switch statement and out of a loop at the same time ..."); - branch(block.self, block.default_block); - end_scope(); - } - else if (flush_phi_required(block.self, block.next_block)) - { - statement("default:"); - begin_scope(); - flush_phi(block.self, block.next_block); - statement("break;"); - end_scope(); + if (block.default_block != block.next_block) + { + statement("default:"); + begin_scope(); + if (is_break(block.default_block)) + SPIRV_CROSS_THROW("Cannot break; out of a switch statement and out of a loop at the same time ..."); + branch(block.self, block.default_block); + end_scope(); + } + else if (flush_phi_required(block.self, block.next_block)) + { + statement("default:"); + begin_scope(); + flush_phi(block.self, block.next_block); + statement("break;"); + end_scope(); + } } end_scope(); @@ -8757,6 +9750,9 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) } case SPIRBlock::Return: + for (auto &line : current_function->fixup_statements_out) + statement(line); + if (processing_entry_point) emit_fixup(); @@ -8812,7 +9808,23 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) // that block after this. If we had selection merge, we already flushed phi variables. if (block.merge != SPIRBlock::MergeSelection) flush_phi(block.self, block.next_block); - emit_block_chain(get(block.next_block)); + + // For merge selects we might have ignored the fact that a merge target + // could have been a break; or continue; + // We will need to deal with it here. + if (is_loop_break(block.next_block)) + { + // Cannot check for just break, because switch statements will also use break. + assert(block.merge == SPIRBlock::MergeSelection); + statement("break;"); + } + else if (is_continue(block.next_block)) + { + assert(block.merge == SPIRBlock::MergeSelection); + branch_to_continue(block.self, block.next_block); + } + else + emit_block_chain(get(block.next_block)); } if (block.merge == SPIRBlock::MergeLoop) @@ -8835,9 +9847,17 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block) else end_scope(); - flush_phi(block.self, block.merge_block); - emit_block_chain(get(block.merge_block)); + // We cannot break out of two loops at once, so don't check for break; here. + // Using block.self as the "from" block isn't quite right, but it has the same scope + // and dominance structure, so it's fine. + if (is_continue(block.merge_block)) + branch_to_continue(block.self, block.merge_block); + else + emit_block_chain(get(block.merge_block)); } + + // Forget about control dependent expressions now. + block.invalidate_expressions.clear(); } void CompilerGLSL::begin_scope() @@ -8914,3 +9934,70 @@ void CompilerGLSL::emit_array_copy(const string &lhs, uint32_t rhs_id) { statement(lhs, " = ", to_expression(rhs_id), ";"); } + +void CompilerGLSL::bitcast_from_builtin_load(uint32_t source_id, std::string &expr, + const spirv_cross::SPIRType &expr_type) +{ + // Only interested in standalone builtin variables. + if (!has_decoration(source_id, DecorationBuiltIn)) + return; + + auto builtin = static_cast(get_decoration(source_id, DecorationBuiltIn)); + auto expected_type = expr_type.basetype; + + // TODO: Fill in for more builtins. + switch (builtin) + { + case BuiltInLayer: + case BuiltInPrimitiveId: + case BuiltInViewportIndex: + case BuiltInInstanceId: + case BuiltInInstanceIndex: + case BuiltInVertexId: + case BuiltInVertexIndex: + case BuiltInSampleId: + expected_type = SPIRType::Int; + break; + + default: + break; + } + + if (expected_type != expr_type.basetype) + expr = bitcast_expression(expr_type, expected_type, expr); +} + +void CompilerGLSL::bitcast_to_builtin_store(uint32_t target_id, std::string &expr, + const spirv_cross::SPIRType &expr_type) +{ + // Only interested in standalone builtin variables. + if (!has_decoration(target_id, DecorationBuiltIn)) + return; + + auto builtin = static_cast(get_decoration(target_id, DecorationBuiltIn)); + auto expected_type = expr_type.basetype; + + // TODO: Fill in for more builtins. + switch (builtin) + { + case BuiltInLayer: + case BuiltInPrimitiveId: + case BuiltInViewportIndex: + expected_type = SPIRType::Int; + break; + + default: + break; + } + + if (expected_type != expr_type.basetype) + { + auto type = expr_type; + type.basetype = expected_type; + expr = bitcast_expression(type, expr_type.basetype, expr); + } +} + +void CompilerGLSL::emit_block_hints(const SPIRBlock &) +{ +} diff --git a/deps/SPIRV-Cross/spirv_glsl.hpp b/deps/SPIRV-Cross/spirv_glsl.hpp index 2d01092587..e426e5061e 100644 --- a/deps/SPIRV-Cross/spirv_glsl.hpp +++ b/deps/SPIRV-Cross/spirv_glsl.hpp @@ -106,6 +106,11 @@ public: // Inverts gl_Position.y or equivalent. bool flip_vert_y = false; + + // If true, the backend will assume that InstanceIndex will need to apply + // a base instance offset. Set to false if you know you will never use base instance + // functionality as it might remove some internal uniforms. + bool support_nonzero_base_instance = true; } vertex; struct @@ -136,15 +141,32 @@ public: init(); } + // Deprecate this interface because it doesn't overload properly with subclasses. + // Requires awkward static casting, which was a mistake. + SPIRV_CROSS_DEPRECATED("get_options() is obsolete, use get_common_options() instead.") const Options &get_options() const { return options; } + + const Options &get_common_options() const + { + return options; + } + + // Deprecate this interface because it doesn't overload properly with subclasses. + // Requires awkward static casting, which was a mistake. + SPIRV_CROSS_DEPRECATED("set_options() is obsolete, use set_common_options() instead.") void set_options(Options &opts) { options = opts; } + void set_common_options(const Options &opts) + { + options = opts; + } + std::string compile() override; // Returns the current string held in the conversion buffer. Useful for @@ -176,18 +198,18 @@ public: protected: void reset(); - void emit_function(SPIRFunction &func, uint64_t return_flags); + void emit_function(SPIRFunction &func, const Bitset &return_flags); bool has_extension(const std::string &ext) const; + void require_extension_internal(const std::string &ext); // Virtualize methods which need to be overridden by subclass targets like C++ and such. - virtual void emit_function_prototype(SPIRFunction &func, uint64_t return_flags); + virtual void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags); - // Kinda ugly way to let opcodes peek at their neighbor instructions for trivial peephole scenarios. - const SPIRBlock *current_emitting_block = nullptr; + SPIRBlock *current_emitting_block = nullptr; virtual void emit_instruction(const Instruction &instr); - void emit_block_instructions(const SPIRBlock &block); + void emit_block_instructions(SPIRBlock &block); virtual void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count); virtual void emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t result_id, uint32_t op, @@ -201,6 +223,7 @@ protected: virtual void emit_header(); virtual void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id); virtual void emit_texture_op(const Instruction &i); + virtual void emit_subgroup_op(const Instruction &i); virtual std::string type_to_glsl(const SPIRType &type, uint32_t id = 0); virtual std::string builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage); virtual void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, @@ -259,7 +282,6 @@ protected: { for (uint32_t i = 0; i < indent; i++) (*buffer) << " "; - statement_inner(std::forward(ts)...); (*buffer) << '\n'; } @@ -320,6 +342,7 @@ protected: bool long_long_literal_suffix = false; const char *basic_int_type = "int"; const char *basic_uint_type = "uint"; + const char *half_literal_suffix = "hf"; bool swizzle_is_function = false; bool shared_is_implied = false; bool flexible_member_array_supported = true; @@ -337,6 +360,7 @@ protected: bool can_return_array = true; bool allow_truncated_access_chain = false; bool supports_extensions = false; + bool supports_empty_struct = false; } backend; void emit_struct(SPIRType &type); @@ -350,12 +374,15 @@ protected: void emit_interface_block(const SPIRVariable &type); void emit_flattened_io_block(const SPIRVariable &var, const char *qual); void emit_block_chain(SPIRBlock &block); - void emit_specialization_constant(const SPIRConstant &constant); + void emit_hoisted_temporaries(std::vector> &temporaries); + void emit_constant(const SPIRConstant &constant); + void emit_specialization_constant_op(const SPIRConstantOp &constant); std::string emit_continue_block(uint32_t continue_block); bool attempt_emit_loop_header(SPIRBlock &block, SPIRBlock::Method method); void propagate_loop_dominators(const SPIRBlock &block); void branch(uint32_t from, uint32_t to); + void branch_to_continue(uint32_t from, uint32_t to); void branch(uint32_t from, uint32_t cond, uint32_t true_block, uint32_t false_block); void flush_phi(uint32_t from, uint32_t to); bool flush_phi_required(uint32_t from, uint32_t to); @@ -382,6 +409,9 @@ protected: SPIRType binary_op_bitcast_helper(std::string &cast_op0, std::string &cast_op1, SPIRType::BaseType &input_type, uint32_t op0, uint32_t op1, bool skip_cast_if_equal_type); + std::string to_ternary_expression(const SPIRType &result_type, uint32_t select, uint32_t true_value, + uint32_t false_value); + void emit_unary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op); bool expression_is_forwarded(uint32_t id); SPIRExpression &emit_op(uint32_t result_type, uint32_t result_id, const std::string &rhs, bool forward_rhs, @@ -414,6 +444,9 @@ protected: void append_global_func_args(const SPIRFunction &func, uint32_t index, std::vector &arglist); std::string to_expression(uint32_t id); std::string to_enclosed_expression(uint32_t id); + std::string to_unpacked_expression(uint32_t id); + std::string to_enclosed_unpacked_expression(uint32_t id); + std::string to_extract_component_expression(uint32_t id, uint32_t index); std::string enclose_expression(const std::string &expr); void strip_enclosed_expression(std::string &expr); std::string to_member_name(const SPIRType &type, uint32_t index); @@ -422,22 +455,23 @@ protected: virtual std::string to_qualifiers_glsl(uint32_t id); const char *to_precision_qualifiers_glsl(uint32_t id); virtual const char *to_storage_qualifiers_glsl(const SPIRVariable &var); - const char *flags_to_precision_qualifiers_glsl(const SPIRType &type, uint64_t flags); + const char *flags_to_precision_qualifiers_glsl(const SPIRType &type, const Bitset &flags); const char *format_to_glsl(spv::ImageFormat format); virtual std::string layout_for_member(const SPIRType &type, uint32_t index); - virtual std::string to_interpolation_qualifiers(uint64_t flags); - uint64_t combined_decoration_for_member(const SPIRType &type, uint32_t index); + virtual std::string to_interpolation_qualifiers(const Bitset &flags); std::string layout_for_variable(const SPIRVariable &variable); std::string to_combined_image_sampler(uint32_t image_id, uint32_t samp_id); virtual bool skip_argument(uint32_t id) const; virtual void emit_array_copy(const std::string &lhs, uint32_t rhs_id); + virtual void emit_block_hints(const SPIRBlock &block); + virtual std::string to_initializer_expression(const SPIRVariable &var); bool buffer_is_packing_standard(const SPIRType &type, BufferPackingStandard packing, uint32_t start_offset = 0, uint32_t end_offset = UINT32_MAX); uint32_t type_to_packed_base_size(const SPIRType &type, BufferPackingStandard packing); - uint32_t type_to_packed_alignment(const SPIRType &type, uint64_t flags, BufferPackingStandard packing); - uint32_t type_to_packed_array_stride(const SPIRType &type, uint64_t flags, BufferPackingStandard packing); - uint32_t type_to_packed_size(const SPIRType &type, uint64_t flags, BufferPackingStandard packing); + uint32_t type_to_packed_alignment(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); + uint32_t type_to_packed_array_stride(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); + uint32_t type_to_packed_size(const SPIRType &type, const Bitset &flags, BufferPackingStandard packing); std::string bitcast_glsl(const SPIRType &result_type, uint32_t arg); virtual std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type); @@ -454,11 +488,12 @@ protected: bool check_atomic_image(uint32_t id); virtual void replace_illegal_names(); + virtual void emit_entry_point_declarations(); void replace_fragment_output(SPIRVariable &var); void replace_fragment_outputs(); bool check_explicit_lod_allowed(uint32_t lod); - std::string legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t lod); + std::string legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t lod, uint32_t id); uint32_t indent = 0; @@ -499,6 +534,7 @@ protected: bool args_will_forward(uint32_t id, const uint32_t *args, uint32_t num_args, bool pure); void register_call_out_argument(uint32_t id); void register_impure_function_call(); + void register_control_dependent_expression(uint32_t expr); // GL_EXT_shader_pixel_local_storage support. std::vector pls_inputs; @@ -516,7 +552,7 @@ protected: std::string emit_for_loop_initializers(const SPIRBlock &block); bool for_loop_initializers_are_same_type(const SPIRBlock &block); - bool optimize_read_modify_write(const std::string &lhs, const std::string &rhs); + bool optimize_read_modify_write(const SPIRType &type, const std::string &lhs, const std::string &rhs); void fixup_image_load_store_access(); bool type_is_empty(const SPIRType &type); @@ -525,13 +561,22 @@ protected: static std::string sanitize_underscores(const std::string &str); - bool can_use_io_location(spv::StorageClass storage); + bool can_use_io_location(spv::StorageClass storage, bool block); const Instruction *get_next_instruction_in_block(const Instruction &instr); static uint32_t mask_relevant_memory_semantics(uint32_t semantics); + std::string convert_half_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); std::string convert_float_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); std::string convert_double_to_string(const SPIRConstant &value, uint32_t col, uint32_t row); + std::string convert_separate_image_to_combined(uint32_t id); + + // Builtins in GLSL are always specific signedness, but the SPIR-V can declare them + // as either unsigned or signed. + // Sometimes we will need to automatically perform bitcasts on load and store to make this work. + virtual void bitcast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type); + virtual void bitcast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type); + private: void init() { @@ -542,6 +587,6 @@ private: } } }; -} +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_hlsl.cpp b/deps/SPIRV-Cross/spirv_hlsl.cpp index 7f2d14799b..34e1d19fb5 100644 --- a/deps/SPIRV-Cross/spirv_hlsl.cpp +++ b/deps/SPIRV-Cross/spirv_hlsl.cpp @@ -224,7 +224,7 @@ static bool hlsl_opcode_is_sign_invariant(Op opcode) } } -string CompilerHLSL::image_type_hlsl_modern(const SPIRType &type) +string CompilerHLSL::image_type_hlsl_modern(const SPIRType &type, uint32_t) { auto &imagetype = get(type.image.type); const char *dim = nullptr; @@ -275,7 +275,7 @@ string CompilerHLSL::image_type_hlsl_modern(const SPIRType &type) ">"); } -string CompilerHLSL::image_type_hlsl_legacy(const SPIRType &type) +string CompilerHLSL::image_type_hlsl_legacy(const SPIRType &type, uint32_t id) { auto &imagetype = get(type.image.type); string res; @@ -338,18 +338,18 @@ string CompilerHLSL::image_type_hlsl_legacy(const SPIRType &type) res += "MS"; if (type.image.arrayed) res += "Array"; - if (type.image.depth) + if (image_is_comparison(type, id)) res += "Shadow"; return res; } -string CompilerHLSL::image_type_hlsl(const SPIRType &type) +string CompilerHLSL::image_type_hlsl(const SPIRType &type, uint32_t id) { - if (options.shader_model <= 30) - return image_type_hlsl_legacy(type); + if (hlsl_options.shader_model <= 30) + return image_type_hlsl_legacy(type, id); else - return image_type_hlsl_modern(type); + return image_type_hlsl_modern(type, id); } // The optional id parameter indicates the object whose type we are trying @@ -370,10 +370,10 @@ string CompilerHLSL::type_to_glsl(const SPIRType &type, uint32_t id) case SPIRType::Image: case SPIRType::SampledImage: - return image_type_hlsl(type); + return image_type_hlsl(type, id); case SPIRType::Sampler: - return comparison_samplers.count(id) ? "SamplerComparisonState" : "SamplerState"; + return comparison_ids.count(id) ? "SamplerComparisonState" : "SamplerState"; case SPIRType::Void: return "void"; @@ -394,6 +394,8 @@ string CompilerHLSL::type_to_glsl(const SPIRType &type, uint32_t id) return backend.basic_uint_type; case SPIRType::AtomicCounter: return "atomic_uint"; + case SPIRType::Half: + return "min16float"; case SPIRType::Float: return "float"; case SPIRType::Double: @@ -416,6 +418,8 @@ string CompilerHLSL::type_to_glsl(const SPIRType &type, uint32_t id) return join("int", type.vecsize); case SPIRType::UInt: return join("uint", type.vecsize); + case SPIRType::Half: + return join("min16float", type.vecsize); case SPIRType::Float: return join("float", type.vecsize); case SPIRType::Double: @@ -438,6 +442,8 @@ string CompilerHLSL::type_to_glsl(const SPIRType &type, uint32_t id) return join("int", type.columns, "x", type.vecsize); case SPIRType::UInt: return join("uint", type.columns, "x", type.vecsize); + case SPIRType::Half: + return join("min16float", type.columns, "x", type.vecsize); case SPIRType::Float: return join("float", type.columns, "x", type.vecsize); case SPIRType::Double: @@ -468,7 +474,7 @@ void CompilerHLSL::emit_interface_block_globally(const SPIRVariable &var) // These are emitted inside the interface structs. auto &flags = meta[var.self].decoration.decoration_flags; auto old_flags = flags; - flags = 0; + flags.reset(); statement("static ", variable_decl(var), ";"); flags = old_flags; } @@ -488,12 +494,8 @@ const char *CompilerHLSL::to_storage_qualifiers_glsl(const SPIRVariable &var) void CompilerHLSL::emit_builtin_outputs_in_struct() { - bool legacy = options.shader_model <= 30; - for (uint32_t i = 0; i < 64; i++) - { - if (!(active_output_builtins & (1ull << i))) - continue; - + bool legacy = hlsl_options.shader_model <= 30; + active_output_builtins.for_each_bit([&](uint32_t i) { const char *type = nullptr; const char *semantic = nullptr; auto builtin = static_cast(i); @@ -545,7 +547,7 @@ void CompilerHLSL::emit_builtin_outputs_in_struct() // If point_size_compat is enabled, just ignore PointSize. // PointSize does not exist in HLSL, but some code bases might want to be able to use these shaders, // even if it means working around the missing feature. - if (options.point_size_compat) + if (hlsl_options.point_size_compat) break; else SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); @@ -557,17 +559,13 @@ void CompilerHLSL::emit_builtin_outputs_in_struct() if (type && semantic) statement(type, " ", builtin_to_glsl(builtin, StorageClassOutput), " : ", semantic, ";"); - } + }); } void CompilerHLSL::emit_builtin_inputs_in_struct() { - bool legacy = options.shader_model <= 30; - for (uint32_t i = 0; i < 64; i++) - { - if (!(active_input_builtins & (1ull << i))) - continue; - + bool legacy = hlsl_options.shader_model <= 30; + active_input_builtins.for_each_bit([&](uint32_t i) { const char *type = nullptr; const char *semantic = nullptr; auto builtin = static_cast(i); @@ -627,6 +625,13 @@ void CompilerHLSL::emit_builtin_inputs_in_struct() break; case BuiltInNumWorkgroups: + case BuiltInSubgroupSize: + case BuiltInSubgroupLocalInvocationId: + case BuiltInSubgroupEqMask: + case BuiltInSubgroupLtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupGeMask: // Handled specially. break; @@ -664,7 +669,7 @@ void CompilerHLSL::emit_builtin_inputs_in_struct() case BuiltInPointCoord: // PointCoord is not supported, but provide a way to just ignore that, similar to PointSize. - if (options.point_coord_compat) + if (hlsl_options.point_coord_compat) break; else SPIRV_CROSS_THROW("Unsupported builtin in HLSL."); @@ -676,7 +681,7 @@ void CompilerHLSL::emit_builtin_inputs_in_struct() if (type && semantic) statement(type, " ", builtin_to_glsl(builtin, StorageClassInput), " : ", semantic, ";"); - } + }); } uint32_t CompilerHLSL::type_to_consumed_locations(const SPIRType &type) const @@ -704,22 +709,22 @@ uint32_t CompilerHLSL::type_to_consumed_locations(const SPIRType &type) const return elements; } -string CompilerHLSL::to_interpolation_qualifiers(uint64_t flags) +string CompilerHLSL::to_interpolation_qualifiers(const Bitset &flags) { string res; //if (flags & (1ull << DecorationSmooth)) // res += "linear "; - if (flags & (1ull << DecorationFlat)) + if (flags.get(DecorationFlat)) res += "nointerpolation "; - if (flags & (1ull << DecorationNoPerspective)) + if (flags.get(DecorationNoPerspective)) res += "noperspective "; - if (flags & (1ull << DecorationCentroid)) + if (flags.get(DecorationCentroid)) res += "centroid "; - if (flags & (1ull << DecorationPatch)) + if (flags.get(DecorationPatch)) res += "patch "; // Seems to be different in actual HLSL. - if (flags & (1ull << DecorationSample)) + if (flags.get(DecorationSample)) res += "sample "; - if (flags & (1ull << DecorationInvariant)) + if (flags.get(DecorationInvariant)) res += "invariant "; // Not supported? return res; @@ -765,7 +770,7 @@ void CompilerHLSL::emit_io_block(const SPIRVariable &var) add_member_name(type, i); auto &membertype = get(type.member_types[i]); - statement(to_interpolation_qualifiers(get_member_decoration_mask(type.self, i)), + statement(to_interpolation_qualifiers(get_member_decoration_bitset(type.self, i)), variable_decl(membertype, to_member_name(type, i)), semantic, ";"); } @@ -783,7 +788,7 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord string binding; bool use_location_number = true; - bool legacy = options.shader_model <= 30; + bool legacy = hlsl_options.shader_model <= 30; if (execution.model == ExecutionModelFragment && var.storage == StorageClassOutput) { binding = join(legacy ? "COLOR" : "SV_Target", get_decoration(var.self, DecorationLocation)); @@ -807,7 +812,7 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord // If an explicit location exists, use it with TEXCOORD[N] semantic. // Otherwise, pick a vacant location. - if (m.decoration_flags & (1ull << DecorationLocation)) + if (m.decoration_flags.get(DecorationLocation)) location_number = m.location; else location_number = get_vacant_location(); @@ -825,14 +830,14 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord { SPIRType newtype = type; newtype.columns = 1; - statement(to_interpolation_qualifiers(get_decoration_mask(var.self)), + statement(to_interpolation_qualifiers(get_decoration_bitset(var.self)), variable_decl(newtype, join(name, "_", i)), " : ", semantic, "_", i, ";"); active_locations.insert(location_number++); } } else { - statement(to_interpolation_qualifiers(get_decoration_mask(var.self)), variable_decl(type, name), " : ", + statement(to_interpolation_qualifiers(get_decoration_bitset(var.self)), variable_decl(type, name), " : ", semantic, ";"); // Structs and arrays should consume more locations. @@ -866,6 +871,11 @@ std::string CompilerHLSL::builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClas case BuiltInPointCoord: // Crude hack, but there is no real alternative. This path is only enabled if point_coord_compat is set. return "float2(0.5f, 0.5f)"; + case BuiltInSubgroupLocalInvocationId: + return "WaveGetLaneIndex()"; + case BuiltInSubgroupSize: + return "WaveGetLaneCount()"; + default: return CompilerGLSL::builtin_to_glsl(builtin, storage); } @@ -873,12 +883,11 @@ std::string CompilerHLSL::builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClas void CompilerHLSL::emit_builtin_variables() { - // Emit global variables for the interface variables which are statically used by the shader. - for (uint32_t i = 0; i < 64; i++) - { - if (!((active_input_builtins | active_output_builtins) & (1ull << i))) - continue; + Bitset builtins = active_input_builtins; + builtins.merge_or(active_output_builtins); + // Emit global variables for the interface variables which are statically used by the shader. + builtins.for_each_bit([&](uint32_t i) { const char *type = nullptr; auto builtin = static_cast(i); uint32_t array_size = 0; @@ -903,7 +912,7 @@ void CompilerHLSL::emit_builtin_variables() break; case BuiltInPointSize: - if (options.point_size_compat) + if (hlsl_options.point_size_compat) { // Just emit the global variable, it will be ignored. type = "float"; @@ -931,6 +940,22 @@ void CompilerHLSL::emit_builtin_variables() // Handled specially. break; + case BuiltInSubgroupLocalInvocationId: + case BuiltInSubgroupSize: + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("Need SM 6.0 for Wave ops."); + break; + + case BuiltInSubgroupEqMask: + case BuiltInSubgroupLtMask: + case BuiltInSubgroupLeMask: + case BuiltInSubgroupGtMask: + case BuiltInSubgroupGeMask: + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("Need SM 6.0 for Wave ops."); + type = "uint4"; + break; + case BuiltInClipDistance: array_size = clip_distance_count; type = "float"; @@ -943,10 +968,9 @@ void CompilerHLSL::emit_builtin_variables() default: SPIRV_CROSS_THROW(join("Unsupported builtin in HLSL: ", unsigned(builtin))); - break; } - StorageClass storage = (active_input_builtins & (1ull << i)) != 0 ? StorageClassInput : StorageClassOutput; + StorageClass storage = active_input_builtins.get(i) ? StorageClassInput : StorageClassOutput; // FIXME: SampleMask can be both in and out with sample builtin, // need to distinguish that when we add support for that. @@ -957,7 +981,7 @@ void CompilerHLSL::emit_builtin_variables() else statement("static ", type, " ", builtin_to_glsl(builtin, storage), ";"); } - } + }); } void CompilerHLSL::emit_composite_constants() @@ -1010,6 +1034,13 @@ void CompilerHLSL::emit_specialization_constants() statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";"); emitted = true; } + else if (id.get_type() == TypeConstantOp) + { + auto &c = id.get(); + auto &type = get(c.basetype); + auto name = to_name(c.self); + statement("static const ", variable_decl(type, name), " = ", constant_op_expression(c), ";"); + } } if (workgroup_size_id) @@ -1023,6 +1054,30 @@ void CompilerHLSL::emit_specialization_constants() statement(""); } +void CompilerHLSL::replace_illegal_names() +{ + static const unordered_set keywords = { + // Additional HLSL specific keywords. + "line", "linear", "matrix", "point", "row_major", "sampler", + }; + + for (auto &id : ids) + { + if (id.get_type() == TypeVariable) + { + auto &var = id.get(); + if (!is_hidden_variable(var)) + { + auto &m = meta[var.self].decoration; + if (keywords.find(m.alias) != end(keywords)) + m.alias = join("_", m.alias); + } + } + } + + CompilerGLSL::replace_illegal_names(); +} + void CompilerHLSL::emit_resources() { auto &execution = get_entry_point(); @@ -1039,8 +1094,8 @@ void CompilerHLSL::emit_resources() { auto &type = id.get(); if (type.basetype == SPIRType::Struct && type.array.empty() && !type.pointer && - (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) == 0) + (!meta[type.self].decoration.decoration_flags.get(DecorationBlock) && + !meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock))) { emit_struct(type); } @@ -1060,8 +1115,8 @@ void CompilerHLSL::emit_resources() auto &type = get(var.basetype); bool is_block_storage = type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform; - bool has_block_flags = (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; + bool has_block_flags = meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); if (var.storage != StorageClassFunction && type.pointer && is_block_storage && !is_hidden_variable(var) && has_block_flags) @@ -1088,7 +1143,7 @@ void CompilerHLSL::emit_resources() } } - if (execution.model == ExecutionModelVertex && options.shader_model <= 30) + if (execution.model == ExecutionModelVertex && hlsl_options.shader_model <= 30) { statement("uniform float4 gl_HalfPixel;"); emitted = true; @@ -1125,7 +1180,7 @@ void CompilerHLSL::emit_resources() { auto &var = id.get(); auto &type = get(var.basetype); - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); // Do not emit I/O blocks here. // I/O blocks can be arrayed, so we must deal with them separately to support geometry shaders @@ -1157,7 +1212,7 @@ void CompilerHLSL::emit_resources() { auto &var = id.get(); auto &type = get(var.basetype); - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); if (var.storage != StorageClassInput && var.storage != StorageClassOutput) continue; @@ -1225,8 +1280,18 @@ void CompilerHLSL::emit_resources() return name1.compare(name2) < 0; }; - static const uint64_t implicit_builtins = (1ull << BuiltInNumWorkgroups) | (1ull << BuiltInPointCoord); - if (!input_variables.empty() || (active_input_builtins & ~implicit_builtins)) + auto input_builtins = active_input_builtins; + input_builtins.clear(BuiltInNumWorkgroups); + input_builtins.clear(BuiltInPointCoord); + input_builtins.clear(BuiltInSubgroupSize); + input_builtins.clear(BuiltInSubgroupLocalInvocationId); + input_builtins.clear(BuiltInSubgroupEqMask); + input_builtins.clear(BuiltInSubgroupLtMask); + input_builtins.clear(BuiltInSubgroupLeMask); + input_builtins.clear(BuiltInSubgroupGtMask); + input_builtins.clear(BuiltInSubgroupGeMask); + + if (!input_variables.empty() || !input_builtins.empty()) { require_input = true; statement("struct SPIRV_Cross_Input"); @@ -1240,7 +1305,7 @@ void CompilerHLSL::emit_resources() statement(""); } - if (!output_variables.empty() || active_output_builtins) + if (!output_variables.empty() || !active_output_builtins.empty()) { require_output = true; statement("struct SPIRV_Cross_Output"); @@ -1305,7 +1370,7 @@ void CompilerHLSL::emit_resources() if (requires_textureProj) { - if (options.shader_model >= 40) + if (hlsl_options.shader_model >= 40) { statement("float SPIRV_Cross_projectTextureCoordinate(float2 coord)"); begin_scope(); @@ -1427,6 +1492,23 @@ void CompilerHLSL::emit_resources() statement(""); } + if (requires_explicit_fp16_packing) + { + // HLSL does not pack into a single word sadly :( + statement("uint SPIRV_Cross_packFloat2x16(min16float2 value)"); + begin_scope(); + statement("uint2 Packed = f32tof16(value);"); + statement("return Packed.x | (Packed.y << 16);"); + end_scope(); + statement(""); + + statement("min16float2 SPIRV_Cross_unpackFloat2x16(uint value)"); + begin_scope(); + statement("return min16float2(f16tof32(uint2(value & 0xffff, value >> 16)));"); + end_scope(); + statement(""); + } + // HLSL does not seem to have builtins for these operation, so roll them by hand ... if (requires_unorm8_packing) { @@ -1696,19 +1778,16 @@ void CompilerHLSL::emit_resources() string CompilerHLSL::layout_for_member(const SPIRType &type, uint32_t index) { - auto flags = combined_decoration_for_member(type, index); + auto &flags = get_member_decoration_bitset(type.self, index); - bool is_block = (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; - - if (!is_block) - return ""; + // HLSL can emit row_major or column_major decoration in any struct. + // Do not try to merge combined decorations for children like in GLSL. // Flip the convention. HLSL is a bit odd in that the memory layout is column major ... but the language API is "row-major". // The way to deal with this is to multiply everything in inverse order, and reverse the memory layout. - if (flags & (1ull << DecorationColMajor)) + if (flags.get(DecorationColMajor)) return "row_major "; - else if (flags & (1ull << DecorationRowMajor)) + else if (flags.get(DecorationRowMajor)) return "column_major "; return ""; @@ -1719,14 +1798,15 @@ void CompilerHLSL::emit_struct_member(const SPIRType &type, uint32_t member_type { auto &membertype = get(member_type_id); - uint64_t memberflags = 0; + Bitset memberflags; auto &memb = meta[type.self].members; if (index < memb.size()) memberflags = memb[index].decoration_flags; string qualifiers; - bool is_block = (meta[type.self].decoration.decoration_flags & - ((1ull << DecorationBlock) | (1ull << DecorationBufferBlock))) != 0; + bool is_block = meta[type.self].decoration.decoration_flags.get(DecorationBlock) || + meta[type.self].decoration.decoration_flags.get(DecorationBufferBlock); + if (is_block) qualifiers = to_interpolation_qualifiers(memberflags); @@ -1756,11 +1836,12 @@ void CompilerHLSL::emit_buffer_block(const SPIRVariable &var) if (is_uav) { - uint64_t flags = get_buffer_block_flags(var); - bool is_readonly = (flags & (1ull << DecorationNonWritable)) != 0; + Bitset flags = get_buffer_block_flags(var); + bool is_readonly = flags.get(DecorationNonWritable); + bool is_coherent = flags.get(DecorationCoherent); add_resource_name(var.self); - statement(is_readonly ? "ByteAddressBuffer " : "RWByteAddressBuffer ", to_name(var.self), - type_to_array_glsl(type), to_resource_binding(var), ";"); + statement(is_coherent ? "globallycoherent " : "", is_readonly ? "ByteAddressBuffer " : "RWByteAddressBuffer ", + to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";"); } else { @@ -1796,7 +1877,7 @@ void CompilerHLSL::emit_buffer_block(const SPIRVariable &var) } else { - if (options.shader_model < 51) + if (hlsl_options.shader_model < 51) SPIRV_CROSS_THROW( "Need ConstantBuffer to use arrays of UBOs, but this is only supported in SM 5.1."); @@ -1857,7 +1938,7 @@ void CompilerHLSL::emit_push_constant_block(const SPIRVariable &var) auto backup_name = get_member_name(type.self, i); auto member_name = to_member_name(type, i); set_member_name(type.self, constant_index, - sanitize_underscores(join(to_name(type.self), "_", member_name))); + sanitize_underscores(join(to_name(var.self), "_", member_name))); emit_struct_member(type, member, i, "", layout.start); set_member_name(type.self, constant_index, backup_name); @@ -1894,7 +1975,7 @@ string CompilerHLSL::to_func_call_arg(uint32_t id) { string arg_str = CompilerGLSL::to_func_call_arg(id); - if (options.shader_model <= 30) + if (hlsl_options.shader_model <= 30) return arg_str; // Manufacture automatic sampler arg if the arg is a SampledImage texture and we're in modern HLSL. @@ -1909,7 +1990,7 @@ string CompilerHLSL::to_func_call_arg(uint32_t id) return arg_str; } -void CompilerHLSL::emit_function_prototype(SPIRFunction &func, uint64_t return_flags) +void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) { if (func.self != entry_point) add_function_overload(func); @@ -1974,12 +2055,13 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, uint64_t return_f // Flatten a combined sampler to two separate arguments in modern HLSL. auto &arg_type = get(arg.type); - if (options.shader_model > 30 && arg_type.basetype == SPIRType::SampledImage && arg_type.image.dim != DimBuffer) + if (hlsl_options.shader_model > 30 && arg_type.basetype == SPIRType::SampledImage && + arg_type.image.dim != DimBuffer) { // Manufacture automatic sampler arg for SampledImage texture decl += ", "; - decl += - join(arg_type.image.depth ? "SamplerComparisonState " : "SamplerState ", to_sampler_expression(arg.id)); + decl += join(image_is_comparison(arg_type, arg.id) ? "SamplerComparisonState " : "SamplerState ", + to_sampler_expression(arg.id), type_to_array_glsl(arg_type)); } if (&arg != &func.arguments.back()) @@ -2009,7 +2091,7 @@ void CompilerHLSL::emit_hlsl_entry_point() { auto &var = id.get(); auto &type = get(var.basetype); - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); if (var.storage != StorageClassInput && var.storage != StorageClassOutput) continue; @@ -2052,7 +2134,7 @@ void CompilerHLSL::emit_hlsl_entry_point() break; } case ExecutionModelFragment: - if (execution.flags & (1ull << ExecutionModeEarlyFragmentTests)) + if (execution.flags.get(ExecutionModeEarlyFragmentTests)) statement("[earlydepthstencil]"); break; default: @@ -2061,14 +2143,10 @@ void CompilerHLSL::emit_hlsl_entry_point() statement(require_output ? "SPIRV_Cross_Output " : "void ", "main(", merge(arguments), ")"); begin_scope(); - bool legacy = options.shader_model <= 30; + bool legacy = hlsl_options.shader_model <= 30; // Copy builtins from entry point arguments to globals. - for (uint32_t i = 0; i < 64; i++) - { - if (!(active_input_builtins & (1ull << i))) - continue; - + active_input_builtins.for_each_bit([&](uint32_t i) { auto builtin = builtin_to_glsl(static_cast(i), StorageClassInput); switch (static_cast(i)) { @@ -2092,6 +2170,70 @@ void CompilerHLSL::emit_hlsl_entry_point() case BuiltInNumWorkgroups: case BuiltInPointCoord: + case BuiltInSubgroupSize: + case BuiltInSubgroupLocalInvocationId: + break; + + case BuiltInSubgroupEqMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("gl_SubgroupEqMask = 1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96));"); + statement("if (WaveGetLaneIndex() >= 32) gl_SubgroupEqMask.x = 0;"); + statement("if (WaveGetLaneIndex() >= 64 || WaveGetLaneIndex() < 32) gl_SubgroupEqMask.y = 0;"); + statement("if (WaveGetLaneIndex() >= 96 || WaveGetLaneIndex() < 64) gl_SubgroupEqMask.z = 0;"); + statement("if (WaveGetLaneIndex() < 96) gl_SubgroupEqMask.w = 0;"); + break; + + case BuiltInSubgroupGeMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("gl_SubgroupGeMask = ~((1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u);"); + statement("if (WaveGetLaneIndex() >= 32) gl_SubgroupGeMask.x = 0u;"); + statement("if (WaveGetLaneIndex() >= 64) gl_SubgroupGeMask.y = 0u;"); + statement("if (WaveGetLaneIndex() >= 96) gl_SubgroupGeMask.z = 0u;"); + statement("if (WaveGetLaneIndex() < 32) gl_SubgroupGeMask.y = ~0u;"); + statement("if (WaveGetLaneIndex() < 64) gl_SubgroupGeMask.z = ~0u;"); + statement("if (WaveGetLaneIndex() < 96) gl_SubgroupGeMask.w = ~0u;"); + break; + + case BuiltInSubgroupGtMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("uint gt_lane_index = WaveGetLaneIndex() + 1;"); + statement("gl_SubgroupGtMask = ~((1u << (gt_lane_index - uint4(0, 32, 64, 96))) - 1u);"); + statement("if (gt_lane_index >= 32) gl_SubgroupGtMask.x = 0u;"); + statement("if (gt_lane_index >= 64) gl_SubgroupGtMask.y = 0u;"); + statement("if (gt_lane_index >= 96) gl_SubgroupGtMask.z = 0u;"); + statement("if (gt_lane_index >= 128) gl_SubgroupGtMask.w = 0u;"); + statement("if (gt_lane_index < 32) gl_SubgroupGtMask.y = ~0u;"); + statement("if (gt_lane_index < 64) gl_SubgroupGtMask.z = ~0u;"); + statement("if (gt_lane_index < 96) gl_SubgroupGtMask.w = ~0u;"); + break; + + case BuiltInSubgroupLeMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("uint le_lane_index = WaveGetLaneIndex() + 1;"); + statement("gl_SubgroupLeMask = (1u << (le_lane_index - uint4(0, 32, 64, 96))) - 1u;"); + statement("if (le_lane_index >= 32) gl_SubgroupLeMask.x = ~0u;"); + statement("if (le_lane_index >= 64) gl_SubgroupLeMask.y = ~0u;"); + statement("if (le_lane_index >= 96) gl_SubgroupLeMask.z = ~0u;"); + statement("if (le_lane_index >= 128) gl_SubgroupLeMask.w = ~0u;"); + statement("if (le_lane_index < 32) gl_SubgroupLeMask.y = 0u;"); + statement("if (le_lane_index < 64) gl_SubgroupLeMask.z = 0u;"); + statement("if (le_lane_index < 96) gl_SubgroupLeMask.w = 0u;"); + break; + + case BuiltInSubgroupLtMask: + // Emulate these ... + // No 64-bit in HLSL, so have to do it in 32-bit and unroll. + statement("gl_SubgroupLtMask = (1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u;"); + statement("if (WaveGetLaneIndex() >= 32) gl_SubgroupLtMask.x = ~0u;"); + statement("if (WaveGetLaneIndex() >= 64) gl_SubgroupLtMask.y = ~0u;"); + statement("if (WaveGetLaneIndex() >= 96) gl_SubgroupLtMask.z = ~0u;"); + statement("if (WaveGetLaneIndex() < 32) gl_SubgroupLtMask.y = 0u;"); + statement("if (WaveGetLaneIndex() < 64) gl_SubgroupLtMask.z = 0u;"); + statement("if (WaveGetLaneIndex() < 96) gl_SubgroupLtMask.w = 0u;"); break; case BuiltInClipDistance: @@ -2110,7 +2252,7 @@ void CompilerHLSL::emit_hlsl_entry_point() statement(builtin, " = stage_input.", builtin, ";"); break; } - } + }); // Copy from stage input struct to globals. for (auto &id : ids) @@ -2119,7 +2261,7 @@ void CompilerHLSL::emit_hlsl_entry_point() { auto &var = id.get(); auto &type = get(var.basetype); - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); if (var.storage != StorageClassInput) continue; @@ -2169,7 +2311,7 @@ void CompilerHLSL::emit_hlsl_entry_point() { auto &var = id.get(); auto &type = get(var.basetype); - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); if (var.storage != StorageClassOutput) continue; @@ -2189,14 +2331,10 @@ void CompilerHLSL::emit_hlsl_entry_point() statement("SPIRV_Cross_Output stage_output;"); // Copy builtins from globals to return struct. - for (uint32_t i = 0; i < 64; i++) - { - if (!(active_output_builtins & (1ull << i))) - continue; - + active_output_builtins.for_each_bit([&](uint32_t i) { // PointSize doesn't exist in HLSL. if (i == BuiltInPointSize) - continue; + return; switch (static_cast(i)) { @@ -2219,7 +2357,7 @@ void CompilerHLSL::emit_hlsl_entry_point() break; } } - } + }); for (auto &id : ids) { @@ -2227,7 +2365,7 @@ void CompilerHLSL::emit_hlsl_entry_point() { auto &var = id.get(); auto &type = get(var.basetype); - bool block = (meta[type.self].decoration.decoration_flags & (1ull << DecorationBlock)) != 0; + bool block = meta[type.self].decoration.decoration_flags.get(DecorationBlock); if (var.storage != StorageClassOutput) continue; @@ -2252,7 +2390,7 @@ void CompilerHLSL::emit_fixup() if (get_entry_point().model == ExecutionModelVertex) { // Do various mangling on the gl_Position. - if (options.shader_model <= 30) + if (hlsl_options.shader_model <= 30) { statement("gl_Position.x = gl_Position.x - gl_HalfPixel.x * " "gl_Position.w;"); @@ -2260,9 +2398,9 @@ void CompilerHLSL::emit_fixup() "gl_Position.w;"); } - if (CompilerGLSL::options.vertex.flip_vert_y) + if (options.vertex.flip_vert_y) statement("gl_Position.y = -gl_Position.y;"); - if (CompilerGLSL::options.vertex.fixup_clipspace) + if (options.vertex.fixup_clipspace) statement("gl_Position.z = (gl_Position.z + gl_Position.w) * 0.5;"); } } @@ -2276,6 +2414,8 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) if (i.offset + length > spirv.size()) SPIRV_CROSS_THROW("Compiler::parse() opcode out of range."); + vector inherited_expressions; + uint32_t result_type = ops[0]; uint32_t id = ops[1]; uint32_t img = ops[2]; @@ -2288,6 +2428,8 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) auto *combined_image = maybe_get(img); auto img_expr = to_expression(combined_image ? combined_image->image : img); + inherited_expressions.push_back(coord); + switch (op) { case OpImageSampleDrefImplicitLod: @@ -2361,6 +2503,9 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) break; } + if (dref) + inherited_expressions.push_back(dref); + if (proj) coord_components++; if (imgtype.image.arrayed) @@ -2387,6 +2532,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) if (length && (flags & flag)) { v = *opt++; + inherited_expressions.push_back(v); length--; } }; @@ -2405,7 +2551,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) if (op == OpImageFetch) { - if (options.shader_model < 40) + if (hlsl_options.shader_model < 40) { SPIRV_CROSS_THROW("texelFetch is not supported in HLSL shader model 2/3."); } @@ -2425,11 +2571,11 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) SPIRV_CROSS_THROW("Sampling non-float textures is not supported in HLSL."); } - if (options.shader_model >= 40) + if (hlsl_options.shader_model >= 40) { texop += img_expr; - if (imgtype.image.depth) + if (image_is_comparison(imgtype, img)) { if (gather) { @@ -2446,7 +2592,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) else if (gather) { uint32_t comp_num = get(comp).scalar(); - if (options.shader_model >= 50) + if (hlsl_options.shader_model >= 50) { switch (comp_num) { @@ -2524,7 +2670,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) expr += texop; expr += "("; - if (options.shader_model < 40) + if (hlsl_options.shader_model < 40) { if (combined_image) SPIRV_CROSS_THROW("Separate images/samplers are not supported in HLSL shader model 2/3."); @@ -2572,7 +2718,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) coord_expr = "SPIRV_Cross_projectTextureCoordinate(" + coord_expr + ")"; } - if (options.shader_model < 40 && lod) + if (hlsl_options.shader_model < 40 && lod) { auto &coordtype = expression_type(coord); string coord_filler; @@ -2583,7 +2729,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) coord_expr = "float4(" + coord_expr + coord_filler + ", " + to_expression(lod) + ")"; } - if (options.shader_model < 40 && bias) + if (hlsl_options.shader_model < 40 && bias) { auto &coordtype = expression_type(coord); string coord_filler; @@ -2597,8 +2743,9 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) if (op == OpImageFetch) { auto &coordtype = expression_type(coord); - if (imgtype.image.dim != DimBuffer) - coord_expr = join("int", coordtype.vecsize + 1, "(", coord_expr, ", ", to_expression(lod), ")"); + if (imgtype.image.dim != DimBuffer && !imgtype.image.ms) + coord_expr = + join("int", coordtype.vecsize + 1, "(", coord_expr, ", ", lod ? to_expression(lod) : string("0"), ")"); } else expr += ", "; @@ -2621,14 +2768,14 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) expr += to_expression(grad_y); } - if (!dref && lod && options.shader_model >= 40 && op != OpImageFetch) + if (!dref && lod && hlsl_options.shader_model >= 40 && op != OpImageFetch) { forward = forward && should_forward(lod); expr += ", "; expr += to_expression(lod); } - if (!dref && bias && options.shader_model >= 40) + if (!dref && bias && hlsl_options.shader_model >= 40) { forward = forward && should_forward(bias); expr += ", "; @@ -2671,6 +2818,23 @@ void CompilerHLSL::emit_texture_op(const Instruction &i) { emit_op(result_type, id, expr, forward, false); } + + for (auto &inherit : inherited_expressions) + inherit_expression_dependencies(id, inherit); + + switch (op) + { + case OpImageSampleDrefImplicitLod: + case OpImageSampleImplicitLod: + case OpImageSampleProjImplicitLod: + case OpImageSampleProjDrefImplicitLod: + case OpImageQueryLod: + register_control_dependent_expression(id); + break; + + default: + break; + } } string CompilerHLSL::to_resource_binding(const SPIRVariable &var) @@ -2708,8 +2872,8 @@ string CompilerHLSL::to_resource_binding(const SPIRVariable &var) { if (has_decoration(type.self, DecorationBufferBlock)) { - uint64_t flags = get_buffer_block_flags(var); - bool is_readonly = (flags & (1ull << DecorationNonWritable)) != 0; + Bitset flags = get_buffer_block_flags(var); + bool is_readonly = flags.get(DecorationNonWritable); space = is_readonly ? 't' : 'u'; // UAV } else if (has_decoration(type.self, DecorationBlock)) @@ -2745,7 +2909,7 @@ string CompilerHLSL::to_resource_binding_sampler(const SPIRVariable &var) string CompilerHLSL::to_resource_register(char space, uint32_t binding, uint32_t space_set) { - if (options.shader_model >= 51) + if (hlsl_options.shader_model >= 51) return join(" : register(", space, binding, ", space", space_set, ")"); else return join(" : register(", space, binding, ")"); @@ -2759,13 +2923,17 @@ void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var) case SPIRType::SampledImage: case SPIRType::Image: { - statement(image_type_hlsl_modern(type), " ", to_name(var.self), type_to_array_glsl(type), - to_resource_binding(var), ";"); + bool is_coherent = false; + if (type.basetype == SPIRType::Image && type.image.sampled == 2) + is_coherent = has_decoration(var.self, DecorationCoherent); + + statement(is_coherent ? "globallycoherent " : "", image_type_hlsl_modern(type, var.self), " ", + to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";"); if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer) { // For combined image samplers, also emit a combined image sampler. - if (type.image.depth) + if (image_is_comparison(type, var.self)) statement("SamplerComparisonState ", to_sampler_expression(var.self), type_to_array_glsl(type), to_resource_binding_sampler(var), ";"); else @@ -2776,7 +2944,7 @@ void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var) } case SPIRType::Sampler: - if (comparison_samplers.count(var.self)) + if (comparison_ids.count(var.self)) statement("SamplerComparisonState ", to_name(var.self), type_to_array_glsl(type), to_resource_binding(var), ";"); else @@ -2807,7 +2975,7 @@ void CompilerHLSL::emit_legacy_uniform(const SPIRVariable &var) void CompilerHLSL::emit_uniform(const SPIRVariable &var) { add_resource_name(var.self); - if (options.shader_model >= 40) + if (hlsl_options.shader_model >= 40) emit_modern_uniform(var); else emit_legacy_uniform(var); @@ -2839,6 +3007,24 @@ string CompilerHLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &i return "asdouble"; else if (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::UInt64) return "asdouble"; + else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UInt && in_type.vecsize == 1) + { + if (!requires_explicit_fp16_packing) + { + requires_explicit_fp16_packing = true; + force_recompile = true; + } + return "SPIRV_Cross_unpackFloat2x16"; + } + else if (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Half && in_type.vecsize == 2) + { + if (!requires_explicit_fp16_packing) + { + requires_explicit_fp16_packing = true; + force_recompile = true; + } + return "SPIRV_Cross_packFloat2x16"; + } else return ""; } @@ -2857,6 +3043,14 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, emit_unary_func_op(result_type, id, args[0], "frac"); break; + case GLSLstd450RoundEven: + SPIRV_CROSS_THROW("roundEven is not supported on HLSL."); + + case GLSLstd450Acosh: + case GLSLstd450Asinh: + case GLSLstd450Atanh: + SPIRV_CROSS_THROW("Inverse hyperbolics are not supported on HLSL."); + case GLSLstd450FMix: case GLSLstd450IMix: emit_trinary_func_op(result_type, id, args[0], args[1], args[2], "lerp"); @@ -3335,14 +3529,8 @@ void CompilerHLSL::emit_access_chain(const Instruction &instruction) else base = to_expression(ops[2]); - auto *basetype = &type; - // Start traversing type hierarchy at the proper non-pointer types. - while (basetype->pointer) - { - assert(basetype->parent_type); - basetype = &get(basetype->parent_type); - } + auto *basetype = &get_non_pointer_type(type); // Traverse the type hierarchy down to the actual buffer types. for (uint32_t i = 0; i < to_plain_buffer_length; i++) @@ -3467,31 +3655,196 @@ void CompilerHLSL::emit_atomic(const uint32_t *ops, uint32_t length, spv::Op op) register_read(ops[1], ops[2], should_forward(ops[2])); } +void CompilerHLSL::emit_subgroup_op(const Instruction &i) +{ + if (hlsl_options.shader_model < 60) + SPIRV_CROSS_THROW("Wave ops requires SM 6.0 or higher."); + + const uint32_t *ops = stream(i); + auto op = static_cast(i.op); + + uint32_t result_type = ops[0]; + uint32_t id = ops[1]; + + auto scope = static_cast(get(ops[2]).scalar()); + if (scope != ScopeSubgroup) + SPIRV_CROSS_THROW("Only subgroup scope is supported."); + + const auto make_inclusive_Sum = [&](const string &expr) -> string { + return join(expr, " + ", to_expression(ops[4])); + }; + + const auto make_inclusive_Product = [&](const string &expr) -> string { + return join(expr, " * ", to_expression(ops[4])); + }; + +#define make_inclusive_BitAnd(expr) "" +#define make_inclusive_BitOr(expr) "" +#define make_inclusive_BitXor(expr) "" +#define make_inclusive_Min(expr) "" +#define make_inclusive_Max(expr) "" + + switch (op) + { + case OpGroupNonUniformElect: + emit_op(result_type, id, "WaveIsFirstLane()", true); + break; + + case OpGroupNonUniformBroadcast: + emit_binary_func_op(result_type, id, ops[3], ops[4], "WaveReadLaneAt"); + break; + + case OpGroupNonUniformBroadcastFirst: + emit_unary_func_op(result_type, id, ops[3], "WaveReadLaneFirst"); + break; + + case OpGroupNonUniformBallot: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveBallot"); + break; + + case OpGroupNonUniformInverseBallot: + SPIRV_CROSS_THROW("Cannot trivially implement InverseBallot in HLSL."); + break; + + case OpGroupNonUniformBallotBitExtract: + SPIRV_CROSS_THROW("Cannot trivially implement BallotBitExtract in HLSL."); + break; + + case OpGroupNonUniformBallotFindLSB: + SPIRV_CROSS_THROW("Cannot trivially implement BallotFindLSB in HLSL."); + break; + + case OpGroupNonUniformBallotFindMSB: + SPIRV_CROSS_THROW("Cannot trivially implement BallotFindMSB in HLSL."); + break; + + case OpGroupNonUniformBallotBitCount: + { + auto operation = static_cast(ops[3]); + if (operation == GroupOperationReduce) + { + bool forward = should_forward(ops[4]); + auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x) + countbits(", + to_enclosed_expression(ops[4]), ".y)"); + auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z) + countbits(", + to_enclosed_expression(ops[4]), ".w)"); + emit_op(result_type, id, join(left, " + ", right), forward); + inherit_expression_dependencies(id, ops[4]); + } + else if (operation == GroupOperationInclusiveScan) + SPIRV_CROSS_THROW("Cannot trivially implement BallotBitCount Inclusive Scan in HLSL."); + else if (operation == GroupOperationExclusiveScan) + SPIRV_CROSS_THROW("Cannot trivially implement BallotBitCount Exclusive Scan in HLSL."); + else + SPIRV_CROSS_THROW("Invalid BitCount operation."); + break; + } + + case OpGroupNonUniformShuffle: + SPIRV_CROSS_THROW("Cannot trivially implement Shuffle in HLSL."); + case OpGroupNonUniformShuffleXor: + SPIRV_CROSS_THROW("Cannot trivially implement ShuffleXor in HLSL."); + case OpGroupNonUniformShuffleUp: + SPIRV_CROSS_THROW("Cannot trivially implement ShuffleUp in HLSL."); + case OpGroupNonUniformShuffleDown: + SPIRV_CROSS_THROW("Cannot trivially implement ShuffleDown in HLSL."); + + case OpGroupNonUniformAll: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveAllTrue"); + break; + + case OpGroupNonUniformAny: + emit_unary_func_op(result_type, id, ops[3], "WaveActiveAnyTrue"); + break; + + case OpGroupNonUniformAllEqual: + { + auto &type = get(result_type); + emit_unary_func_op(result_type, id, ops[3], + type.basetype == SPIRType::Boolean ? "WaveActiveAllEqualBool" : "WaveActiveAllEqual"); + break; + } + + // clang-format off +#define HLSL_GROUP_OP(op, hlsl_op, supports_scan) \ +case OpGroupNonUniform##op: \ + { \ + auto operation = static_cast(ops[3]); \ + if (operation == GroupOperationReduce) \ + emit_unary_func_op(result_type, id, ops[4], "WaveActive" #hlsl_op); \ + else if (operation == GroupOperationInclusiveScan && supports_scan) \ + { \ + bool forward = should_forward(ops[4]); \ + emit_op(result_type, id, make_inclusive_##hlsl_op (join("WavePrefix" #hlsl_op, "(", to_expression(ops[4]), ")")), forward); \ + inherit_expression_dependencies(id, ops[4]); \ + } \ + else if (operation == GroupOperationExclusiveScan && supports_scan) \ + emit_unary_func_op(result_type, id, ops[4], "WavePrefix" #hlsl_op); \ + else if (operation == GroupOperationClusteredReduce) \ + SPIRV_CROSS_THROW("Cannot trivially implement ClusteredReduce in HLSL."); \ + else \ + SPIRV_CROSS_THROW("Invalid group operation."); \ + break; \ + } + HLSL_GROUP_OP(FAdd, Sum, true) + HLSL_GROUP_OP(FMul, Product, true) + HLSL_GROUP_OP(FMin, Min, false) + HLSL_GROUP_OP(FMax, Max, false) + HLSL_GROUP_OP(IAdd, Sum, true) + HLSL_GROUP_OP(IMul, Product, true) + HLSL_GROUP_OP(SMin, Min, false) + HLSL_GROUP_OP(SMax, Max, false) + HLSL_GROUP_OP(UMin, Min, false) + HLSL_GROUP_OP(UMax, Max, false) + HLSL_GROUP_OP(BitwiseAnd, BitAnd, false) + HLSL_GROUP_OP(BitwiseOr, BitOr, false) + HLSL_GROUP_OP(BitwiseXor, BitXor, false) +#undef HLSL_GROUP_OP + // clang-format on + + case OpGroupNonUniformQuadSwap: + { + uint32_t direction = get(ops[4]).scalar(); + if (direction == 0) + emit_unary_func_op(result_type, id, ops[3], "QuadReadAcrossX"); + else if (direction == 1) + emit_unary_func_op(result_type, id, ops[3], "QuadReadAcrossY"); + else if (direction == 2) + emit_unary_func_op(result_type, id, ops[3], "QuadReadAcrossDiagonal"); + else + SPIRV_CROSS_THROW("Invalid quad swap direction."); + break; + } + + case OpGroupNonUniformQuadBroadcast: + { + emit_binary_func_op(result_type, id, ops[3], ops[4], "QuadReadLaneAt"); + break; + } + + default: + SPIRV_CROSS_THROW("Invalid opcode for subgroup."); + } + + register_control_dependent_expression(id); +} + void CompilerHLSL::emit_instruction(const Instruction &instruction) { auto ops = stream(instruction); auto opcode = static_cast(instruction.op); -#undef BOP -#undef BOP_CAST -#undef UOP -#undef QFOP -#undef TFOP -#undef BFOP -#undef BFOP_CAST -#undef BFOP -#undef UFOP -#define BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) -#define BOP_CAST(op, type) \ +#define HLSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) +#define HLSL_BOP_CAST(op, type) \ emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, hlsl_opcode_is_sign_invariant(opcode)) -#define UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) -#define QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) -#define TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) -#define BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) -#define BFOP_CAST(op, type) \ +#define HLSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) +#define HLSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) +#define HLSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) +#define HLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define HLSL_BFOP_CAST(op, type) \ emit_binary_func_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, hlsl_opcode_is_sign_invariant(opcode)) -#define BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) -#define UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) +#define HLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define HLSL_UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) switch (opcode) { @@ -3560,27 +3913,40 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) } case OpDPdx: - UFOP(ddx); + HLSL_UFOP(ddx); + register_control_dependent_expression(ops[1]); break; case OpDPdy: - UFOP(ddy); + HLSL_UFOP(ddy); + register_control_dependent_expression(ops[1]); break; case OpDPdxFine: - UFOP(ddx_fine); + HLSL_UFOP(ddx_fine); + register_control_dependent_expression(ops[1]); break; case OpDPdyFine: - UFOP(ddy_fine); + HLSL_UFOP(ddy_fine); + register_control_dependent_expression(ops[1]); break; case OpDPdxCoarse: - UFOP(ddx_coarse); + HLSL_UFOP(ddx_coarse); + register_control_dependent_expression(ops[1]); break; case OpDPdyCoarse: - UFOP(ddy_coarse); + HLSL_UFOP(ddy_coarse); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + HLSL_UFOP(fwidth); + register_control_dependent_expression(ops[1]); break; case OpLogicalNot: @@ -3592,7 +3958,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (type.vecsize > 1) emit_unrolled_unary_op(result_type, id, ops[2], "!"); else - UOP(!); + HLSL_UOP(!); break; } @@ -3604,7 +3970,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "=="); else - BOP_CAST(==, SPIRType::Int); + HLSL_BOP_CAST(==, SPIRType::Int); break; } @@ -3617,7 +3983,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "=="); else - BOP(==); + HLSL_BOP(==); break; } @@ -3629,7 +3995,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!="); else - BOP_CAST(!=, SPIRType::Int); + HLSL_BOP_CAST(!=, SPIRType::Int); break; } @@ -3642,7 +4008,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "!="); else - BOP(!=); + HLSL_BOP(!=); break; } @@ -3656,7 +4022,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">"); else - BOP_CAST(>, type); + HLSL_BOP_CAST(>, type); break; } @@ -3668,7 +4034,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">"); else - BOP(>); + HLSL_BOP(>); break; } @@ -3682,7 +4048,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">="); else - BOP_CAST(>=, type); + HLSL_BOP_CAST(>=, type); break; } @@ -3694,7 +4060,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], ">="); else - BOP(>=); + HLSL_BOP(>=); break; } @@ -3708,7 +4074,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<"); else - BOP_CAST(<, type); + HLSL_BOP_CAST(<, type); break; } @@ -3720,7 +4086,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<"); else - BOP(<); + HLSL_BOP(<); break; } @@ -3734,7 +4100,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<="); else - BOP_CAST(<=, type); + HLSL_BOP_CAST(<=, type); break; } @@ -3746,7 +4112,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (expression_type(ops[2]).vecsize > 1) emit_unrolled_binary_op(result_type, id, ops[2], ops[3], "<="); else - BOP(<=); + HLSL_BOP(<=); break; } @@ -3824,7 +4190,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) if (subpass_data) { - if (options.shader_model < 40) + if (hlsl_options.shader_model < 40) SPIRV_CROSS_THROW("Subpass loads are not supported in HLSL shader model 2/3."); // Similar to GLSL, implement subpass loads using texelFetch. @@ -3865,6 +4231,10 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) } else emit_op(result_type, id, imgexpr, false); + + inherit_expression_dependencies(id, ops[2]); + if (type.image.ms) + inherit_expression_dependencies(id, ops[5]); break; } @@ -3935,6 +4305,12 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) semantics = get(ops[2]).scalar(); } + if (memory == ScopeSubgroup) + { + // No Wave-barriers in HLSL. + break; + } + // We only care about these flags, acquire/release and friends are not relevant to GLSL. semantics = mask_relevant_memory_semantics(semantics); @@ -3983,7 +4359,11 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) // We are synchronizing some memory or syncing execution, // so we cannot forward any loads beyond the memory barrier. if (semantics || opcode == OpControlBarrier) + { + assert(current_emitting_block); + flush_control_dependent_expressions(current_emitting_block->self); flush_all_active_variables(); + } if (opcode == OpControlBarrier) { @@ -4037,18 +4417,18 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction) } if (opcode == OpBitFieldSExtract) - TFOP(SPIRV_Cross_bitfieldSExtract); + HLSL_TFOP(SPIRV_Cross_bitfieldSExtract); else - TFOP(SPIRV_Cross_bitfieldUExtract); + HLSL_TFOP(SPIRV_Cross_bitfieldUExtract); break; } case OpBitCount: - UFOP(countbits); + HLSL_UFOP(countbits); break; case OpBitReverse: - UFOP(reversebits); + HLSL_UFOP(reversebits); break; default: @@ -4125,7 +4505,7 @@ uint32_t CompilerHLSL::remap_num_workgroups_builtin() { update_active_builtins(); - if ((active_input_builtins & (1ull << BuiltInNumWorkgroups)) == 0) + if (!active_input_builtins.get(BuiltInNumWorkgroups)) return 0; // Create a new, fake UBO. @@ -4170,11 +4550,12 @@ uint32_t CompilerHLSL::remap_num_workgroups_builtin() string CompilerHLSL::compile() { // Do not deal with ES-isms like precision, older extensions and such. - CompilerGLSL::options.es = false; - CompilerGLSL::options.version = 450; - CompilerGLSL::options.vulkan_semantics = true; + options.es = false; + options.version = 450; + options.vulkan_semantics = true; backend.float_literal_suffix = true; backend.double_literal_suffix = false; + backend.half_literal_suffix = nullptr; backend.long_long_literal_suffix = true; backend.uint32_t_literal_suffix = true; backend.basic_int_type = "int"; @@ -4191,12 +4572,13 @@ string CompilerHLSL::compile() backend.can_declare_arrays_inline = false; backend.can_return_array = false; + build_function_control_flow_graphs_and_analyze(); update_active_builtins(); analyze_image_and_sampler_usage(); // Subpass input needs SV_Position. if (need_subpass_input) - active_input_builtins |= 1ull << BuiltInFragCoord; + active_input_builtins.set(BuiltInFragCoord); uint32_t pass_count = 0; do @@ -4212,7 +4594,7 @@ string CompilerHLSL::compile() emit_header(); emit_resources(); - emit_function(get(entry_point), 0); + emit_function(get(entry_point), Bitset()); emit_hlsl_entry_point(); pass_count++; @@ -4223,3 +4605,24 @@ string CompilerHLSL::compile() return buffer->str(); } + +void CompilerHLSL::emit_block_hints(const SPIRBlock &block) +{ + switch (block.hint) + { + case SPIRBlock::HintFlatten: + statement("[flatten]"); + break; + case SPIRBlock::HintDontFlatten: + statement("[branch]"); + break; + case SPIRBlock::HintUnroll: + statement("[unroll]"); + break; + case SPIRBlock::HintDontUnroll: + statement("[loop]"); + break; + default: + break; + } +} diff --git a/deps/SPIRV-Cross/spirv_hlsl.hpp b/deps/SPIRV-Cross/spirv_hlsl.hpp index 0de72408e0..bcc82b1043 100644 --- a/deps/SPIRV-Cross/spirv_hlsl.hpp +++ b/deps/SPIRV-Cross/spirv_hlsl.hpp @@ -66,14 +66,26 @@ public: { } + SPIRV_CROSS_DEPRECATED("CompilerHLSL::get_options() is obsolete, use get_hlsl_options() instead.") const Options &get_options() const { - return options; + return hlsl_options; } + const Options &get_hlsl_options() const + { + return hlsl_options; + } + + SPIRV_CROSS_DEPRECATED("CompilerHLSL::get_options() is obsolete, use set_hlsl_options() instead.") void set_options(Options &opts) { - options = opts; + hlsl_options = opts; + } + + void set_hlsl_options(const Options &opts) + { + hlsl_options = opts; } // Optionally specify a custom root constant layout. @@ -106,10 +118,10 @@ public: private: std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override; - std::string image_type_hlsl(const SPIRType &type); - std::string image_type_hlsl_modern(const SPIRType &type); - std::string image_type_hlsl_legacy(const SPIRType &type); - void emit_function_prototype(SPIRFunction &func, uint64_t return_flags) override; + std::string image_type_hlsl(const SPIRType &type, uint32_t id); + std::string image_type_hlsl_modern(const SPIRType &type, uint32_t id); + std::string image_type_hlsl_legacy(const SPIRType &type, uint32_t id); + void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; void emit_hlsl_entry_point(); void emit_header() override; void emit_resources(); @@ -131,7 +143,7 @@ private: void emit_fixup() override; std::string builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage) override; std::string layout_for_member(const SPIRType &type, uint32_t index) override; - std::string to_interpolation_qualifiers(uint64_t flags) override; + std::string to_interpolation_qualifiers(const Bitset &flags) override; std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override; std::string to_func_call_arg(uint32_t id) override; std::string to_sampler_expression(uint32_t id); @@ -145,16 +157,20 @@ private: void write_access_chain(const SPIRAccessChain &chain, uint32_t value); void emit_store(const Instruction &instruction); void emit_atomic(const uint32_t *ops, uint32_t length, spv::Op op); + void emit_subgroup_op(const Instruction &i) override; + void emit_block_hints(const SPIRBlock &block) override; void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const std::string &qualifier, uint32_t base_offset = 0) override; const char *to_storage_qualifiers_glsl(const SPIRVariable &var) override; + void replace_illegal_names() override; - Options options; + Options hlsl_options; bool requires_op_fmod = false; bool requires_textureProj = false; bool requires_fp16_packing = false; + bool requires_explicit_fp16_packing = false; bool requires_unorm8_packing = false; bool requires_snorm8_packing = false; bool requires_unorm16_packing = false; @@ -206,6 +222,6 @@ private: // when translating push constant ranges. std::vector root_constants_layout; }; -} +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_msl.cpp b/deps/SPIRV-Cross/spirv_msl.cpp index c4814d2d50..3f8de118b1 100644 --- a/deps/SPIRV-Cross/spirv_msl.cpp +++ b/deps/SPIRV-Cross/spirv_msl.cpp @@ -25,7 +25,7 @@ using namespace spv; using namespace spirv_cross; using namespace std; -static const uint32_t k_unknown_location = ~0; +static const uint32_t k_unknown_location = ~0u; CompilerMSL::CompilerMSL(vector spirv_, vector *p_vtx_attrs, vector *p_res_bindings) @@ -104,16 +104,163 @@ void CompilerMSL::build_implicit_builtins() } } +static string create_sampler_address(const char *prefix, MSLSamplerAddress addr) +{ + switch (addr) + { + case MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE: + return join(prefix, "address::clamp_to_edge"); + case MSL_SAMPLER_ADDRESS_CLAMP_TO_ZERO: + return join(prefix, "address::clamp_to_zero"); + case MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER: + return join(prefix, "address::clamp_to_border"); + case MSL_SAMPLER_ADDRESS_REPEAT: + return join(prefix, "address::repeat"); + case MSL_SAMPLER_ADDRESS_MIRRORED_REPEAT: + return join(prefix, "address::mirrored_repeat"); + default: + SPIRV_CROSS_THROW("Invalid sampler addressing mode."); + } +} + +void CompilerMSL::emit_entry_point_declarations() +{ + // FIXME: Get test coverage here ... + + // Emit constexpr samplers here. + for (auto &samp : constexpr_samplers) + { + auto &var = get(samp.first); + auto &type = get(var.basetype); + if (type.basetype == SPIRType::Sampler) + add_resource_name(samp.first); + + vector args; + auto &s = samp.second; + + if (s.coord != MSL_SAMPLER_COORD_NORMALIZED) + args.push_back("coord::pixel"); + + if (s.min_filter == s.mag_filter) + { + if (s.min_filter != MSL_SAMPLER_FILTER_NEAREST) + args.push_back("filter::linear"); + } + else + { + if (s.min_filter != MSL_SAMPLER_FILTER_NEAREST) + args.push_back("min_filter::linear"); + if (s.mag_filter != MSL_SAMPLER_FILTER_NEAREST) + args.push_back("mag_filter::linear"); + } + + switch (s.mip_filter) + { + case MSL_SAMPLER_MIP_FILTER_NONE: + // Default + break; + case MSL_SAMPLER_MIP_FILTER_NEAREST: + args.push_back("mip_filter::nearest"); + break; + case MSL_SAMPLER_MIP_FILTER_LINEAR: + args.push_back("mip_filter::linear"); + break; + default: + SPIRV_CROSS_THROW("Invalid mip filter."); + } + + if (s.s_address == s.t_address && s.s_address == s.r_address) + { + if (s.s_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("", s.s_address)); + } + else + { + if (s.s_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("s_", s.s_address)); + if (s.t_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("t_", s.t_address)); + if (s.r_address != MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE) + args.push_back(create_sampler_address("r_", s.r_address)); + } + + if (s.compare_enable) + { + switch (s.compare_func) + { + case MSL_SAMPLER_COMPARE_FUNC_ALWAYS: + args.push_back("compare_func::always"); + break; + case MSL_SAMPLER_COMPARE_FUNC_NEVER: + args.push_back("compare_func::never"); + break; + case MSL_SAMPLER_COMPARE_FUNC_EQUAL: + args.push_back("compare_func::equal"); + break; + case MSL_SAMPLER_COMPARE_FUNC_NOT_EQUAL: + args.push_back("compare_func::not_equal"); + break; + case MSL_SAMPLER_COMPARE_FUNC_LESS: + args.push_back("compare_func::less"); + break; + case MSL_SAMPLER_COMPARE_FUNC_LESS_EQUAL: + args.push_back("compare_func::less_equal"); + break; + case MSL_SAMPLER_COMPARE_FUNC_GREATER: + args.push_back("compare_func::greater"); + break; + case MSL_SAMPLER_COMPARE_FUNC_GREATER_EQUAL: + args.push_back("compare_func::greater_equal"); + break; + default: + SPIRV_CROSS_THROW("Invalid sampler compare function."); + } + } + + if (s.s_address == MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER || s.t_address == MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER || + s.r_address == MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER) + { + switch (s.border_color) + { + case MSL_SAMPLER_BORDER_COLOR_OPAQUE_BLACK: + args.push_back("border_color::opaque_black"); + break; + case MSL_SAMPLER_BORDER_COLOR_OPAQUE_WHITE: + args.push_back("border_color::opaque_white"); + break; + case MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK: + args.push_back("border_color::transparent_black"); + break; + default: + SPIRV_CROSS_THROW("Invalid sampler border color."); + } + } + + if (s.anisotropy_enable) + args.push_back(join("max_anisotropy(", s.max_anisotropy, ")")); + if (s.lod_clamp_enable) + { + args.push_back( + join("lod_clamp(", convert_to_string(s.lod_clamp_min), ", ", convert_to_string(s.lod_clamp_max), ")")); + } + + statement("constexpr sampler ", + type.basetype == SPIRType::SampledImage ? to_sampler_expression(samp.first) : to_name(samp.first), + "(", merge(args), ");"); + } +} + string CompilerMSL::compile() { // Force a classic "C" locale, reverts when function returns ClassicLocale classic_locale; // Do not deal with GLES-isms like precision, older extensions and such. - CompilerGLSL::options.vulkan_semantics = true; - CompilerGLSL::options.es = false; - CompilerGLSL::options.version = 450; + options.vulkan_semantics = true; + options.es = false; + options.version = 450; backend.float_literal_suffix = false; + backend.half_literal_suffix = "h"; backend.uint32_t_literal_suffix = true; backend.basic_int_type = "int"; backend.basic_uint_type = "uint"; @@ -131,9 +278,9 @@ string CompilerMSL::compile() replace_illegal_names(); - non_stage_in_input_var_ids.clear(); struct_member_padding.clear(); + build_function_control_flow_graphs_and_analyze(); update_active_builtins(); analyze_image_and_sampler_usage(); build_implicit_builtins(); @@ -145,10 +292,11 @@ string CompilerMSL::compile() // Preprocess OpCodes to extract the need to output additional header content preprocess_op_codes(); - // Create structs to hold input, output and uniform variables + // Create structs to hold input, output and uniform variables. + // Do output first to ensure out. is declared at top of entry function. qual_pos_var_name = ""; - stage_in_var_id = add_interface_block(StorageClassInput); stage_out_var_id = add_interface_block(StorageClassOutput); + stage_in_var_id = add_interface_block(StorageClassInput); stage_uniforms_var_id = add_interface_block(StorageClassUniformConstant); // Convert the use of global variables to recursively-passed function parameters @@ -160,7 +308,7 @@ string CompilerMSL::compile() // Metal does not allow dynamic array lengths. // Resolve any specialization constants that are used for array lengths. - if (options.resolve_specialized_array_lengths) + if (msl_options.resolve_specialized_array_lengths) resolve_specialized_array_lengths(); uint32_t pass_count = 0; @@ -180,7 +328,7 @@ string CompilerMSL::compile() emit_specialization_constants(); emit_resources(); emit_custom_functions(); - emit_function(get(entry_point), 0); + emit_function(get(entry_point), Bitset()); pass_count++; } while (force_recompile); @@ -210,15 +358,13 @@ string CompilerMSL::compile(vector *p_vtx_attrs, vector *p_vtx_attrs, vector *p_res_bindings) { - options = msl_cfg; + msl_options = msl_cfg; return compile(p_vtx_attrs, p_res_bindings); } // Register the need to output any custom functions. void CompilerMSL::preprocess_op_codes() { - spv_function_implementations.clear(); - OpCodePreprocessor preproc(*this); traverse_all_reachable_opcodes(get(entry_point), preproc); @@ -244,7 +390,6 @@ void CompilerMSL::localize_global_variables() auto &var = get(v_id); if (var.storage == StorageClassPrivate || var.storage == StorageClassWorkgroup) { - var.storage = StorageClassFunction; entry_func.add_local_variable(v_id); iter = global_variables.erase(iter); } @@ -272,7 +417,6 @@ void CompilerMSL::resolve_specialized_array_lengths() // extract that variable and add it as an argument to that function. void CompilerMSL::extract_global_variables_from_functions() { - // Uniforms unordered_set global_var_ids; for (auto &id : ids) @@ -280,19 +424,20 @@ void CompilerMSL::extract_global_variables_from_functions() if (id.get_type() == TypeVariable) { auto &var = id.get(); - if (var.storage == StorageClassInput || var.storage == StorageClassUniform || - var.storage == StorageClassUniformConstant || var.storage == StorageClassPushConstant || - var.storage == StorageClassStorageBuffer) + if (var.storage == StorageClassInput || var.storage == StorageClassOutput || + var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant || + var.storage == StorageClassPushConstant || var.storage == StorageClassStorageBuffer) { global_var_ids.insert(var.self); } } } - // Local vars that are declared in the main function and accessed directy by a function + // Local vars that are declared in the main function and accessed directly by a function auto &entry_func = get(entry_point); for (auto &var : entry_func.local_variables) - global_var_ids.insert(var); + if (get(var).storage != StorageClassFunction) + global_var_ids.insert(var); std::set added_arg_ids; unordered_set processed_func_ids; @@ -347,6 +492,7 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: break; } + case OpFunctionCall: { // First see if any of the function call args are globals @@ -366,9 +512,21 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: break; } + case OpStore: + { + uint32_t base_id = ops[0]; + if (global_var_ids.find(base_id) != global_var_ids.end()) + added_arg_ids.insert(base_id); + break; + } + default: break; } + + // TODO: Add all other operations which can affect memory. + // We should consider a more unified system here to reduce boiler-plate. + // This kind of analysis is done in several places ... } } @@ -377,19 +535,44 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std:: // Add the global variables as arguments to the function if (func_id != entry_point) { - uint32_t next_id = increase_bound_by(uint32_t(added_arg_ids.size())); for (uint32_t arg_id : added_arg_ids) { - auto var = get(arg_id); + auto &var = get(arg_id); uint32_t type_id = var.basetype; - func.add_parameter(type_id, next_id, true); - set(next_id, type_id, StorageClassFunction, 0, arg_id); + auto *p_type = &get(type_id); - // Ensure the existing variable has a valid name and the new variable has all the same meta info - set_name(arg_id, ensure_valid_name(to_name(arg_id), "v")); - meta[next_id] = meta[arg_id]; + if (is_builtin_variable(var) && p_type->basetype == SPIRType::Struct) + { + // Get the non-pointer type + type_id = get_non_pointer_type_id(type_id); + p_type = &get(type_id); - next_id++; + uint32_t mbr_idx = 0; + for (auto &mbr_type_id : p_type->member_types) + { + BuiltIn builtin; + bool is_builtin = is_member_builtin(*p_type, mbr_idx, &builtin); + if (is_builtin && has_active_builtin(builtin, var.storage)) + { + // Add a arg variable with the same type and decorations as the member + uint32_t next_id = increase_bound_by(1); + func.add_parameter(mbr_type_id, next_id, true); + set(next_id, mbr_type_id, StorageClassFunction); + meta[next_id].decoration = meta[type_id].members[mbr_idx]; + } + mbr_idx++; + } + } + else + { + uint32_t next_id = increase_bound_by(1); + func.add_parameter(type_id, next_id, true); + set(next_id, type_id, StorageClassFunction, 0, arg_id); + + // Ensure the existing variable has a valid name and the new variable has all the same meta info + set_name(arg_id, ensure_valid_name(to_name(arg_id), "v")); + meta[next_id] = meta[arg_id]; + } } } } @@ -438,6 +621,11 @@ void CompilerMSL::mark_as_packable(SPIRType &type) uint32_t mbr_type_id = type.member_types[mbr_idx]; auto &mbr_type = get(mbr_type_id); mark_as_packable(mbr_type); + if (mbr_type.type_alias) + { + auto &mbr_type_alias = get(mbr_type.type_alias); + mark_as_packable(mbr_type_alias); + } } } } @@ -502,9 +690,9 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage) { ib_var_ref = stage_out_var_name; - // Add the output interface struct as a local variable to the entry function, - // and force the entry function to return the output interface struct from - // any blocks that perform a function return. + // Add the output interface struct as a local variable to the entry function, force + // the entry function to return the output interface struct from any blocks that perform + // a function return, and indicate the output var requires early initialization auto &entry_func = get(entry_point); entry_func.add_local_variable(ib_var_id); for (auto &blk_id : entry_func.blocks) @@ -513,6 +701,7 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage) if (blk.terminator == SPIRBlock::Return) blk.return_value = ib_var_id; } + vars_needing_early_declaration.push_back(ib_var_id); break; } @@ -527,7 +716,7 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage) break; } - set_name(ib_type_id, get_entry_point_name() + "_" + ib_var_ref); + set_name(ib_type_id, to_name(entry_point) + "_" + ib_var_ref); set_name(ib_var_id, ib_var_ref); for (auto p_var : vars) @@ -543,10 +732,7 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage) BuiltIn builtin; bool is_builtin = is_member_builtin(type, mbr_idx, &builtin); - if (should_move_to_input_buffer(mbr_type_id, is_builtin, storage)) - move_member_to_input_buffer(type, mbr_idx); - - else if (!is_builtin || has_active_builtin(builtin, storage)) + if (!is_builtin || has_active_builtin(builtin, storage)) { // Add a reference to the member to the interface struct. uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); @@ -592,203 +778,135 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage) else if (type.basetype == SPIRType::Boolean || type.basetype == SPIRType::Char || type.basetype == SPIRType::Int || type.basetype == SPIRType::UInt || type.basetype == SPIRType::Int64 || type.basetype == SPIRType::UInt64 || - type.basetype == SPIRType::Float || type.basetype == SPIRType::Double || - type.basetype == SPIRType::Boolean) + type_is_floating_point(type) || type.basetype == SPIRType::Boolean) { bool is_builtin = is_builtin_variable(*p_var); BuiltIn builtin = BuiltIn(get_decoration(p_var->self, DecorationBuiltIn)); - if (should_move_to_input_buffer(type_id, is_builtin, storage)) - move_to_input_buffer(*p_var); - - else if (!is_builtin || has_active_builtin(builtin, storage)) + if (!is_builtin || has_active_builtin(builtin, storage)) { - // Add a reference to the variable type to the interface struct. - uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); - type_id = ensure_correct_builtin_type(type_id, builtin); - p_var->basetype = type_id; - ib_type.member_types.push_back(type_id); - - // Give the member a name - string mbr_name = ensure_valid_name(to_expression(p_var->self), "m"); - set_member_name(ib_type_id, ib_mbr_idx, mbr_name); - - // Update the original variable reference to include the structure reference - string qual_var_name = ib_var_ref + "." + mbr_name; - meta[p_var->self].decoration.qualified_alias = qual_var_name; - - // Copy the variable location from the original variable to the member - if (get_decoration_mask(p_var->self) & (1ull << DecorationLocation)) + // MSL does not allow matrices or arrays in input or output variables, so need to handle it specially. + if (!is_builtin && (storage == StorageClassInput || storage == StorageClassOutput) && + (is_matrix(type) || is_array(type))) { - uint32_t locn = get_decoration(p_var->self, DecorationLocation); - set_member_decoration(ib_type_id, ib_mbr_idx, DecorationLocation, locn); - mark_location_as_used_by_shader(locn, storage); + uint32_t elem_cnt = 0; + + if (is_matrix(type)) + { + if (is_array(type)) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-matrices in input and output variables."); + + elem_cnt = type.columns; + } + else if (is_array(type)) + { + if (type.array.size() != 1) + SPIRV_CROSS_THROW("MSL cannot emit arrays-of-arrays in input and output variables."); + + elem_cnt = type.array_size_literal.back() ? type.array.back() : + get(type.array.back()).scalar(); + } + + auto *usable_type = &type; + while (is_array(*usable_type) || is_matrix(*usable_type)) + usable_type = &get(usable_type->parent_type); + + auto &entry_func = get(entry_point); + entry_func.add_local_variable(p_var->self); + + // We need to declare the variable early and at entry-point scope. + vars_needing_early_declaration.push_back(p_var->self); + + for (uint32_t i = 0; i < elem_cnt; i++) + { + // Add a reference to the variable type to the interface struct. + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + ib_type.member_types.push_back(usable_type->self); + + // Give the member a name + string mbr_name = ensure_valid_name(join(to_expression(p_var->self), "_", i), "m"); + set_member_name(ib_type_id, ib_mbr_idx, mbr_name); + + // There is no qualified alias since we need to flatten the internal array on return. + if (get_decoration_bitset(p_var->self).get(DecorationLocation)) + { + uint32_t locn = get_decoration(p_var->self, DecorationLocation) + i; + set_member_decoration(ib_type_id, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, storage); + } + + if (get_decoration_bitset(p_var->self).get(DecorationIndex)) + { + uint32_t index = get_decoration(p_var->self, DecorationIndex); + set_member_decoration(ib_type_id, ib_mbr_idx, DecorationIndex, index); + } + + switch (storage) + { + case StorageClassInput: + entry_func.fixup_statements_in.push_back( + join(to_name(p_var->self), "[", i, "] = ", ib_var_ref, ".", mbr_name, ";")); + break; + + case StorageClassOutput: + entry_func.fixup_statements_out.push_back( + join(ib_var_ref, ".", mbr_name, " = ", to_name(p_var->self), "[", i, "];")); + break; + + default: + break; + } + } } - - // Mark the member as builtin if needed - if (is_builtin) + else { - set_member_decoration(ib_type_id, ib_mbr_idx, DecorationBuiltIn, builtin); - if (builtin == BuiltInPosition) - qual_pos_var_name = qual_var_name; + // Add a reference to the variable type to the interface struct. + uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); + type_id = ensure_correct_builtin_type(type_id, builtin); + p_var->basetype = type_id; + ib_type.member_types.push_back(type_id); + + // Give the member a name + string mbr_name = ensure_valid_name(to_expression(p_var->self), "m"); + set_member_name(ib_type_id, ib_mbr_idx, mbr_name); + + // Update the original variable reference to include the structure reference + string qual_var_name = ib_var_ref + "." + mbr_name; + meta[p_var->self].decoration.qualified_alias = qual_var_name; + + // Copy the variable location from the original variable to the member + if (get_decoration_bitset(p_var->self).get(DecorationLocation)) + { + uint32_t locn = get_decoration(p_var->self, DecorationLocation); + set_member_decoration(ib_type_id, ib_mbr_idx, DecorationLocation, locn); + mark_location_as_used_by_shader(locn, storage); + } + + if (get_decoration_bitset(p_var->self).get(DecorationIndex)) + { + uint32_t index = get_decoration(p_var->self, DecorationIndex); + set_member_decoration(ib_type_id, ib_mbr_idx, DecorationIndex, index); + } + + // Mark the member as builtin if needed + if (is_builtin) + { + set_member_decoration(ib_type_id, ib_mbr_idx, DecorationBuiltIn, builtin); + if (builtin == BuiltInPosition) + qual_pos_var_name = qual_var_name; + } } } } } // Sort the members of the structure by their locations. - // Oddly, Metal handles inputs better if they are sorted in reverse order. - MemberSorter::SortAspect sort_aspect = - (storage == StorageClassInput) ? MemberSorter::LocationReverse : MemberSorter::Location; - MemberSorter member_sorter(ib_type, meta[ib_type_id], sort_aspect); + MemberSorter member_sorter(ib_type, meta[ib_type_id], MemberSorter::Location); member_sorter.sort(); return ib_var_id; } -// Returns whether a variable of type and storage class should be moved from an interface -// block to a secondary input buffer block. -// This is the case for matrixes and arrays that appear in the stage_in interface block -// of a vertex function, and true is returned. -// Other types do not need to move, and false is returned. -// Matrices and arrays are not permitted in the output of a vertex function or the input -// or output of a fragment function, and in those cases, an exception is thrown. -bool CompilerMSL::should_move_to_input_buffer(uint32_t type_id, bool is_builtin, StorageClass storage) -{ - auto &type = get(type_id); - - if ((is_matrix(type) || is_array(type)) && !is_builtin) - { - auto &execution = get_entry_point(); - - if (execution.model == ExecutionModelVertex) - { - if (storage == StorageClassInput) - return true; - - if (storage == StorageClassOutput) - SPIRV_CROSS_THROW("The vertex function output structure may not include a matrix or array."); - } - else if (execution.model == ExecutionModelFragment) - { - if (storage == StorageClassInput) - SPIRV_CROSS_THROW("The fragment function stage_in structure may not include a matrix or array."); - - if (storage == StorageClassOutput) - SPIRV_CROSS_THROW("The fragment function output structure may not include a matrix or array."); - } - } - - return false; -} - -// Excludes the specified variable from an interface block structure. -// Instead, for the variable is added to a block variable corresponding to a secondary MSL buffer. -// The use case for this is when a vertex stage_in variable contains a matrix or array. -void CompilerMSL::move_to_input_buffer(SPIRVariable &var) -{ - uint32_t var_id = var.self; - - if (!has_decoration(var_id, DecorationLocation)) - return; - - uint32_t mbr_type_id = var.basetype; - string mbr_name = ensure_valid_name(to_expression(var_id), "m"); - uint32_t mbr_locn = get_decoration(var_id, DecorationLocation); - meta[var_id].decoration.qualified_alias = add_input_buffer_block_member(mbr_type_id, mbr_name, mbr_locn); -} - -// Excludes the specified type member from the stage_in block structure. -// Instead, for the variable is added to a block variable corresponding to a secondary MSL buffer. -// The use case for this is when a vertex stage_in variable contains a matrix or array. -void CompilerMSL::move_member_to_input_buffer(const SPIRType &type, uint32_t index) -{ - uint32_t type_id = type.self; - - if (!has_member_decoration(type_id, index, DecorationLocation)) - return; - - uint32_t mbr_type_id = type.member_types[index]; - string mbr_name = ensure_valid_name(to_qualified_member_name(type, index), "m"); - uint32_t mbr_locn = get_member_decoration(type_id, index, DecorationLocation); - string qual_name = add_input_buffer_block_member(mbr_type_id, mbr_name, mbr_locn); - set_member_qualified_name(type_id, index, qual_name); -} - -// Adds a member to the input buffer block that corresponds to the MTLBuffer used by an attribute location -string CompilerMSL::add_input_buffer_block_member(uint32_t mbr_type_id, string mbr_name, uint32_t mbr_locn) -{ - mark_location_as_used_by_shader(mbr_locn, StorageClassInput); - - MSLVertexAttr *p_va = vtx_attrs_by_location[mbr_locn]; - if (!p_va) - return ""; - - if (p_va->per_instance) - needs_instance_idx_arg = true; - else - needs_vertex_idx_arg = true; - - // The variable that is the block struct. - // Record the stride of this struct in its offset decoration. - uint32_t ib_var_id = get_input_buffer_block_var_id(p_va->msl_buffer); - auto &ib_var = get(ib_var_id); - uint32_t ib_type_id = ib_var.basetype; - auto &ib_type = get(ib_type_id); - set_decoration(ib_type_id, DecorationOffset, p_va->msl_stride); - - // Add a reference to the variable type to the interface struct. - uint32_t ib_mbr_idx = uint32_t(ib_type.member_types.size()); - ib_type.member_types.push_back(mbr_type_id); - - // Give the member a name - set_member_name(ib_type_id, ib_mbr_idx, mbr_name); - - // Set MSL buffer and offset decorations, and indicate no valid attribute location - set_member_decoration(ib_type_id, ib_mbr_idx, DecorationBinding, p_va->msl_buffer); - set_member_decoration(ib_type_id, ib_mbr_idx, DecorationOffset, p_va->msl_offset); - set_member_decoration(ib_type_id, ib_mbr_idx, DecorationLocation, k_unknown_location); - - // Update the original variable reference to include the structure and index reference - string idx_var_name = - builtin_to_glsl(p_va->per_instance ? BuiltInInstanceIndex : BuiltInVertexIndex, StorageClassInput); - return get_name(ib_var_id) + "[" + idx_var_name + "]." + mbr_name; -} - -// Returns the ID of the input block that will use the specified MSL buffer index, -// lazily creating an input block variable and type if needed. -// -// The use of this block applies only to input variables that have been excluded from the stage_in -// block, which typically only occurs if an attempt to pass a matrix in the stage_in block. -uint32_t CompilerMSL::get_input_buffer_block_var_id(uint32_t msl_buffer) -{ - uint32_t ib_var_id = non_stage_in_input_var_ids[msl_buffer]; - if (!ib_var_id) - { - // No interface block exists yet. Create a new typed variable for this interface block. - // The initializer expression is allocated here, but populated when the function - // declaraion is emitted, because it is cleared after each compilation pass. - uint32_t next_id = increase_bound_by(3); - uint32_t ib_type_id = next_id++; - auto &ib_type = set(ib_type_id); - ib_type.basetype = SPIRType::Struct; - ib_type.storage = StorageClassInput; - set_decoration(ib_type_id, DecorationBlock); - - ib_var_id = next_id++; - auto &var = set(ib_var_id, ib_type_id, StorageClassInput, 0); - var.initializer = next_id++; - - string ib_var_name = stage_in_var_name + convert_to_string(msl_buffer); - set_name(ib_var_id, ib_var_name); - set_name(ib_type_id, get_entry_point_name() + "_" + ib_var_name); - - // Add the variable to the map of buffer blocks, accessed by the Metal buffer index. - non_stage_in_input_var_ids[msl_buffer] = ib_var_id; - } - return ib_var_id; -} - // Ensure that the type is compatible with the builtin. // If it is, simply return the given type ID. // Otherwise, create a new type, and return it's ID. @@ -991,7 +1109,7 @@ void CompilerMSL::emit_custom_functions() statement("template"); statement("T radians(T d)"); begin_scope(); - statement("return d * 0.01745329251;"); + statement("return d * T(0.01745329251);"); end_scope(); statement(""); break; @@ -1001,7 +1119,7 @@ void CompilerMSL::emit_custom_functions() statement("template"); statement("T degrees(T r)"); begin_scope(); - statement("return r * 57.2957795131;"); + statement("return r * T(57.2957795131);"); end_scope(); statement(""); break; @@ -1056,6 +1174,18 @@ void CompilerMSL::emit_custom_functions() statement(""); break; + case SPVFuncImplTexelBufferCoords: + { + string tex_width_str = convert_to_string(msl_options.texel_buffer_texture_width); + statement("// Returns 2D texture coords corresponding to 1D texel buffer coords"); + statement("uint2 spvTexelBufferCoord(uint tc)"); + begin_scope(); + statement(join("return uint2(tc % ", tex_width_str, ", tc / ", tex_width_str, ");")); + end_scope(); + statement(""); + break; + } + case SPVFuncImplInverse4x4: statement("// Returns the determinant of a 2x2 matrix."); statement("inline float spvDet2x2(float a1, float a2, float b1, float b2)"); @@ -1342,46 +1472,57 @@ void CompilerMSL::emit_resources() declare_undefined_values(); // Output interface structs. - emit_interface_block(stage_in_var_id); - for (auto &nsi_var : non_stage_in_input_var_ids) - emit_interface_block(nsi_var.second); - emit_interface_block(stage_out_var_id); + emit_interface_block(stage_in_var_id); emit_interface_block(stage_uniforms_var_id); } // Emit declarations for the specialization Metal function constants void CompilerMSL::emit_specialization_constants() { - const vector spec_consts = get_specialization_constants(); - SpecializationConstant wg_x, wg_y, wg_z; uint32_t workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z); + bool emitted = false; - for (auto &sc : spec_consts) + for (auto &id : ids) { - // If WorkGroupSize is a specialization constant, it will be declared explicitly below. - if (sc.id == workgroup_size_id) - continue; - - auto &type = expression_type(sc.id); - string sc_type_name = type_to_glsl(type); - string sc_name = to_name(sc.id); - string sc_tmp_name = to_name(sc.id) + "_tmp"; - - if (type.vecsize == 1 && type.columns == 1 && type.basetype != SPIRType::Struct && type.array.empty()) + if (id.get_type() == TypeConstant) { - // Only scalar, non-composite values can be function constants. - statement("constant ", sc_type_name, " ", sc_tmp_name, " [[function_constant(", - convert_to_string(sc.constant_id), ")]];"); - statement("constant ", sc_type_name, " ", sc_name, " = is_function_constant_defined(", sc_tmp_name, ") ? ", - sc_tmp_name, " : ", constant_expression(get(sc.id)), ";"); + auto &c = id.get(); + if (!c.specialization) + continue; + + // If WorkGroupSize is a specialization constant, it will be declared explicitly below. + if (c.self == workgroup_size_id) + continue; + + auto &type = get(c.constant_type); + string sc_type_name = type_to_glsl(type); + string sc_name = to_name(c.self); + string sc_tmp_name = sc_name + "_tmp"; + + if (has_decoration(c.self, DecorationSpecId)) + { + uint32_t constant_id = get_decoration(c.self, DecorationSpecId); + // Only scalar, non-composite values can be function constants. + statement("constant ", sc_type_name, " ", sc_tmp_name, " [[function_constant(", constant_id, ")]];"); + statement("constant ", sc_type_name, " ", sc_name, " = is_function_constant_defined(", sc_tmp_name, + ") ? ", sc_tmp_name, " : ", constant_expression(c), ";"); + } + else + { + // Composite specialization constants must be built from other specialization constants. + statement("constant ", sc_type_name, " ", sc_name, " = ", constant_expression(c), ";"); + } + emitted = true; } - else + else if (id.get_type() == TypeConstantOp) { - // Composite specialization constants must be built from other specialization constants. - statement("constant ", sc_type_name, " ", sc_name, " = ", constant_expression(get(sc.id)), - ";"); + auto &c = id.get(); + auto &type = get(c.basetype); + auto name = to_name(c.self); + statement("constant ", variable_decl(type, name), " = ", constant_op_expression(c), ";"); + emitted = true; } } @@ -1389,33 +1530,30 @@ void CompilerMSL::emit_specialization_constants() // the work group size at compile time in SPIR-V, and [[threads_per_threadgroup]] would need to be passed around as a global. // The work group size may be a specialization constant. if (workgroup_size_id) + { statement("constant uint3 ", builtin_to_glsl(BuiltInWorkgroupSize, StorageClassWorkgroup), " = ", constant_expression(get(workgroup_size_id)), ";"); + emitted = true; + } - if (!spec_consts.empty() || workgroup_size_id) + if (emitted) statement(""); } // Override for MSL-specific syntax instructions void CompilerMSL::emit_instruction(const Instruction &instruction) { -#undef BOP -#undef BOP_CAST -#undef UOP -#undef QFOP -#undef TFOP -#undef BFOP -#undef BFOP_CAST -#define BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) -#define BOP_CAST(op, type) \ + +#define MSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op) +#define MSL_BOP_CAST(op, type) \ emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode)) -#define UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) -#define QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) -#define TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) -#define BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) -#define BFOP_CAST(op, type) \ +#define MSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op) +#define MSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op) +#define MSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op) +#define MSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op) +#define MSL_BFOP_CAST(op, type) \ emit_binary_func_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode)) -#define UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) +#define MSL_UFOP(op) emit_unary_func_op(ops[0], ops[1], ops[2], #op) auto ops = stream(instruction); auto opcode = static_cast(instruction.op); @@ -1427,72 +1565,81 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) case OpIEqual: case OpLogicalEqual: case OpFOrdEqual: - BOP(==); + MSL_BOP(==); break; case OpINotEqual: case OpLogicalNotEqual: case OpFOrdNotEqual: - BOP(!=); + MSL_BOP(!=); break; case OpUGreaterThan: case OpSGreaterThan: case OpFOrdGreaterThan: - BOP(>); + MSL_BOP(>); break; case OpUGreaterThanEqual: case OpSGreaterThanEqual: case OpFOrdGreaterThanEqual: - BOP(>=); + MSL_BOP(>=); break; case OpULessThan: case OpSLessThan: case OpFOrdLessThan: - BOP(<); + MSL_BOP(<); break; case OpULessThanEqual: case OpSLessThanEqual: case OpFOrdLessThanEqual: - BOP(<=); + MSL_BOP(<=); break; // Derivatives case OpDPdx: case OpDPdxFine: case OpDPdxCoarse: - UFOP(dfdx); + MSL_UFOP(dfdx); + register_control_dependent_expression(ops[1]); break; case OpDPdy: case OpDPdyFine: case OpDPdyCoarse: - UFOP(dfdy); + MSL_UFOP(dfdy); + register_control_dependent_expression(ops[1]); + break; + + case OpFwidth: + case OpFwidthCoarse: + case OpFwidthFine: + MSL_UFOP(fwidth); + register_control_dependent_expression(ops[1]); break; // Bitfield case OpBitFieldInsert: - QFOP(insert_bits); + MSL_QFOP(insert_bits); break; case OpBitFieldSExtract: case OpBitFieldUExtract: - TFOP(extract_bits); + MSL_TFOP(extract_bits); break; case OpBitReverse: - UFOP(reverse_bits); + MSL_UFOP(reverse_bits); break; case OpBitCount: - UFOP(popcount); + MSL_UFOP(popcount); break; case OpFRem: - BFOP(fmod); + MSL_BFOP(fmod); break; // Atomics @@ -1508,7 +1655,6 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) } case OpAtomicCompareExchange: - case OpAtomicCompareExchangeWeak: { uint32_t result_type = ops[0]; uint32_t id = ops[1]; @@ -1522,6 +1668,9 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) break; } + case OpAtomicCompareExchangeWeak: + SPIRV_CROSS_THROW("OpAtomicCompareExchangeWeak is only supported in kernel profile."); + case OpAtomicLoad: { uint32_t result_type = ops[0]; @@ -1543,7 +1692,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) break; } -#define AFMOImpl(op, valsrc) \ +#define MSL_AFMO_IMPL(op, valsrc) \ do \ { \ uint32_t result_type = ops[0]; \ @@ -1554,45 +1703,45 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val); \ } while (false) -#define AFMO(op) AFMOImpl(op, ops[5]) -#define AFMIO(op) AFMOImpl(op, 1) +#define MSL_AFMO(op) MSL_AFMO_IMPL(op, ops[5]) +#define MSL_AFMIO(op) MSL_AFMO_IMPL(op, 1) case OpAtomicIIncrement: - AFMIO(add); + MSL_AFMIO(add); break; case OpAtomicIDecrement: - AFMIO(sub); + MSL_AFMIO(sub); break; case OpAtomicIAdd: - AFMO(add); + MSL_AFMO(add); break; case OpAtomicISub: - AFMO(sub); + MSL_AFMO(sub); break; case OpAtomicSMin: case OpAtomicUMin: - AFMO(min); + MSL_AFMO(min); break; case OpAtomicSMax: case OpAtomicUMax: - AFMO(max); + MSL_AFMO(max); break; case OpAtomicAnd: - AFMO(and); + MSL_AFMO(and); break; case OpAtomicOr: - AFMO(or); + MSL_AFMO(or); break; case OpAtomicXor: - AFMO (xor); + MSL_AFMO (xor); break; // Images @@ -1716,7 +1865,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) break; } -#define ImgQry(qrytype) \ +#define MSL_ImgQry(qrytype) \ do \ { \ uint32_t rslt_type_id = ops[0]; \ @@ -1729,11 +1878,11 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) } while (false) case OpImageQueryLevels: - ImgQry(mip_levels); + MSL_ImgQry(mip_levels); break; case OpImageQuerySamples: - ImgQry(samples); + MSL_ImgQry(samples); break; // Casting @@ -1802,11 +1951,20 @@ void CompilerMSL::emit_instruction(const Instruction &instruction) if (e && e->need_transpose && (t.columns == t.vecsize || is_packed)) { e->need_transpose = false; + + // This is important for matrices. Packed matrices + // are generally transposed, so unpacking using a constructor argument + // will result in an error. + // The simplest solution for now is to just avoid unpacking the matrix in this operation. + unset_decoration(mtx_id, DecorationCPacked); + emit_binary_op(ops[0], ops[1], ops[3], ops[2], "*"); + if (is_packed) + set_decoration(mtx_id, DecorationCPacked); e->need_transpose = true; } else - BOP(*); + MSL_BOP(*); break; } @@ -1839,7 +1997,7 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin else bar_stmt += "mem_none"; - if (options.is_ios() && options.supports_msl_version(2)) + if (msl_options.is_ios() && msl_options.supports_msl_version(2)) { bar_stmt += ", "; @@ -1869,6 +2027,10 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin bar_stmt += ");"; statement(bar_stmt); + + assert(current_emitting_block); + flush_control_dependent_expressions(current_emitting_block->self); + flush_all_active_variables(); } // Since MSL does not allow structs to be nested within the stage_in struct, the original input @@ -1948,6 +2110,11 @@ bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs) return false; auto *var = maybe_get(id_lhs); + + // Is this a remapped, static constant? Don't do anything. + if (var->remapped_variable && var->statically_assigned) + return true; + if (ids[id_rhs].get_type() == TypeConstant && var && var->deferred_declaration) { // Special case, if we end up declaring a variable when assigning the constant array, @@ -1977,52 +2144,62 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, { forced_temporaries.insert(result_id); - bool fwd_obj = should_forward(obj); - bool fwd_op1 = op1 ? should_forward(op1) : true; - bool fwd_op2 = op2 ? should_forward(op2) : true; - - bool forward = fwd_obj && fwd_op1 && fwd_op2; - string exp = string(op) + "("; auto &type = expression_type(obj); exp += "(volatile "; - exp += "device"; + auto *var = maybe_get_backing_variable(obj); + if (!var) + SPIRV_CROSS_THROW("No backing variable for atomic operation."); + exp += get_argument_address_space(*var); exp += " atomic_"; exp += type_to_glsl(type); exp += "*)"; - exp += "&("; - exp += to_expression(obj); - exp += ")"; + exp += "&"; + exp += to_enclosed_expression(obj); - if (op1) + bool is_atomic_compare_exchange_strong = op1_is_pointer && op1; + + if (is_atomic_compare_exchange_strong) { - if (op1_is_pointer) - { - statement(declare_temporary(expression_type(op2).self, op1), to_expression(op1), ";"); - exp += ", &(" + to_name(op1) + ")"; - } - else - exp += ", " + to_expression(op1); + assert(strcmp(op, "atomic_compare_exchange_weak_explicit") == 0); + assert(op2); + assert(has_mem_order_2); + exp += ", &"; + exp += to_name(result_id); + exp += ", "; + exp += to_expression(op2); + exp += ", "; + exp += get_memory_order(mem_order_1); + exp += ", "; + exp += get_memory_order(mem_order_2); + exp += ")"; + + // MSL only supports the weak atomic compare exchange, + // so emit a CAS loop here. + statement(variable_decl(type, to_name(result_id)), ";"); + statement("do"); + begin_scope(); + statement(to_name(result_id), " = ", to_expression(op1), ";"); + end_scope_decl(join("while (!", exp, ")")); + set(result_id, to_name(result_id), result_type, true); } + else + { + assert(strcmp(op, "atomic_compare_exchange_weak_explicit") != 0); + if (op1) + exp += ", " + to_expression(op1); + if (op2) + exp += ", " + to_expression(op2); - if (op2) - exp += ", " + to_expression(op2); + exp += string(", ") + get_memory_order(mem_order_1); + if (has_mem_order_2) + exp += string(", ") + get_memory_order(mem_order_2); - exp += string(", ") + get_memory_order(mem_order_1); - - if (has_mem_order_2) - exp += string(", ") + get_memory_order(mem_order_2); - - exp += ")"; - emit_op(result_type, result_id, exp, forward); - - inherit_expression_dependencies(result_id, obj); - if (op1) - inherit_expression_dependencies(result_id, op1); - if (op2) - inherit_expression_dependencies(result_id, op2); + exp += ")"; + emit_op(result_type, result_id, exp, false); + } flush_all_atomic_capable_variables(); } @@ -2069,9 +2246,14 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, case GLSLstd450PackUnorm2x16: emit_unary_func_op(result_type, id, args[0], "pack_float_to_unorm2x16"); break; + case GLSLstd450PackHalf2x16: - emit_unary_func_op(result_type, id, args[0], "unsupported_GLSLstd450PackHalf2x16"); // Currently unsupported + { + auto expr = join("as_type(half2(", to_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); break; + } case GLSLstd450UnpackSnorm4x8: emit_unary_func_op(result_type, id, args[0], "unpack_snorm4x8_to_float"); @@ -2085,9 +2267,14 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, case GLSLstd450UnpackUnorm2x16: emit_unary_func_op(result_type, id, args[0], "unpack_unorm2x16_to_float"); break; + case GLSLstd450UnpackHalf2x16: - emit_unary_func_op(result_type, id, args[0], "unsupported_GLSLstd450UnpackHalf2x16"); // Currently unsupported + { + auto expr = join("float2(as_type(", to_expression(args[0]), "))"); + emit_op(result_type, id, expr, should_forward(args[0])); + inherit_expression_dependencies(id, args[0]); break; + } case GLSLstd450PackDouble2x32: emit_unary_func_op(result_type, id, args[0], "unsupported_GLSLstd450PackDouble2x32"); // Currently unsupported @@ -2142,7 +2329,7 @@ void CompilerMSL::emit_interface_block(uint32_t ib_var_id) // Emits the declaration signature of the specified function. // If this is the entry point function, Metal-specific return value and function arguments are added. -void CompilerMSL::emit_function_prototype(SPIRFunction &func, uint64_t) +void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &) { if (func.self != entry_point) add_function_overload(func); @@ -2183,14 +2370,17 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, uint64_t) { decl += entry_point_args(!func.arguments.empty()); - // If entry point function has a output interface struct, set its initializer. - // This is done at this late stage because the initialization expression is - // cleared after each compilation pass. - if (stage_out_var_id) + // If entry point function has variables that require early declaration, + // ensure they each have an empty initializer, creating one if needed. + // This is done at this late stage because the initialization expression + // is cleared after each compilation pass. + for (auto var_id : vars_needing_early_declaration) { - auto &so_var = get(stage_out_var_id); - auto &so_type = get(so_var.basetype); - set(so_var.initializer, "{}", so_type.self, true); + auto &ed_var = get(var_id); + if (!ed_var.initializer) + ed_var.initializer = increase_bound_by(1); + + set(ed_var.initializer, "{}", ed_var.basetype, true); } } @@ -2213,7 +2403,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, uint64_t) // Manufacture automatic sampler arg for SampledImage texture auto &arg_type = get(arg.type); if (arg_type.basetype == SPIRType::SampledImage && arg_type.image.dim != DimBuffer) - decl += ", thread const sampler& " + to_sampler_expression(arg.id); + decl += join(", thread const ", sampler_type(arg_type), " ", to_sampler_expression(arg.id)); if (&arg != &func.arguments.back()) decl += ", "; @@ -2258,7 +2448,7 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool bool forward = should_forward(coord); auto coord_expr = to_enclosed_expression(coord); auto &coord_type = expression_type(coord); - bool coord_is_fp = (coord_type.basetype == SPIRType::Float) || (coord_type.basetype == SPIRType::Double); + bool coord_is_fp = type_is_floating_point(coord_type); bool is_cube_fetch = false; string tex_coords = coord_expr; @@ -2282,8 +2472,9 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool if (coord_type.vecsize > 1) tex_coords += ".x"; + // Metal texel buffer textures are 2D, so convert 1D coord to 2D. if (is_fetch) - tex_coords = "uint2(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ", 0)"; // Metal textures are 2D + tex_coords = "spvTexelBufferCoord(" + round_fp_tex_coords(tex_coords, coord_is_fp) + ")"; alt_coord = ".y"; @@ -2349,11 +2540,23 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool // If fetch from cube, add face explicitly if (is_cube_fetch) - farg_str += ", uint(" + round_fp_tex_coords(coord_expr + ".z", coord_is_fp) + ")"; + { + // Special case for cube arrays, face and layer are packed in one dimension. + if (imgtype.image.arrayed) + farg_str += ", uint(" + join(coord_expr, ".z) % 6u"); + else + farg_str += ", uint(" + round_fp_tex_coords(coord_expr + ".z", coord_is_fp) + ")"; + } // If array, use alt coord if (imgtype.image.arrayed) - farg_str += ", uint(" + round_fp_tex_coords(coord_expr + alt_coord, coord_is_fp) + ")"; + { + // Special case for cube arrays, face and layer are packed in one dimension. + if (imgtype.image.dim == DimCube && is_fetch) + farg_str += ", uint(" + join(coord_expr, ".z) / 6u"); + else + farg_str += ", uint(" + round_fp_tex_coords(coord_expr + alt_coord, coord_is_fp) + ")"; + } // Depth compare reference value if (dref) @@ -2364,13 +2567,15 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool } // LOD Options - if (bias) + // Metal does not support LOD for 1D textures. + if (bias && imgtype.image.dim != Dim1D) { forward = forward && should_forward(bias); farg_str += ", bias(" + to_expression(bias) + ")"; } - if (lod) + // Metal does not support LOD for 1D textures. + if (lod && imgtype.image.dim != Dim1D) { forward = forward && should_forward(lod); if (is_fetch) @@ -2382,8 +2587,16 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool farg_str += ", level(" + to_expression(lod) + ")"; } } + else if (is_fetch && !lod && imgtype.image.dim != Dim1D && imgtype.image.dim != DimBuffer && !imgtype.image.ms && + imgtype.image.sampled != 2) + { + // Lod argument is optional in OpImageFetch, but we require a LOD value, pick 0 as the default. + // Check for sampled type as well, because is_fetch is also used for OpImageRead in MSL. + farg_str += ", 0"; + } - if (grad_x || grad_y) + // Metal does not support LOD for 1D textures. + if ((grad_x || grad_y) && imgtype.image.dim != Dim1D) { forward = forward && should_forward(grad_x); forward = forward && should_forward(grad_y); @@ -2425,14 +2638,14 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool { case Dim2D: if (coord_type.vecsize > 2) - offset_expr += ".xy"; + offset_expr = enclose_expression(offset_expr) + ".xy"; farg_str += ", " + offset_expr; break; case Dim3D: if (coord_type.vecsize > 3) - offset_expr += ".xyz"; + offset_expr = enclose_expression(offset_expr) + ".xyz"; farg_str += ", " + offset_expr; break; @@ -2444,6 +2657,10 @@ string CompilerMSL::to_function_args(uint32_t img, const SPIRType &imgtype, bool if (comp) { + // If 2D has gather component, ensure it also has an offset arg + if (imgtype.image.dim == Dim2D && offset_expr.empty()) + farg_str += ", int2(0)"; + forward = forward && should_forward(comp); farg_str += ", " + to_component_argument(comp); } @@ -2508,14 +2725,9 @@ string CompilerMSL::to_func_call_arg(uint32_t id) string arg_str = CompilerGLSL::to_func_call_arg(id); // Manufacture automatic sampler arg if the arg is a SampledImage texture. - Variant &id_v = ids[id]; - if (id_v.get_type() == TypeVariable) - { - auto &var = id_v.get(); - auto &type = get(var.basetype); - if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer) - arg_str += ", " + to_sampler_expression(id); - } + auto &type = expression_type(id); + if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer) + arg_str += ", " + to_sampler_expression(id); return arg_str; } @@ -2525,8 +2737,18 @@ string CompilerMSL::to_func_call_arg(uint32_t id) // by appending a suffix to the expression constructed from the ID. string CompilerMSL::to_sampler_expression(uint32_t id) { + auto expr = to_expression(id); + auto index = expr.find_first_of('['); uint32_t samp_id = meta[id].sampler; - return samp_id ? to_expression(samp_id) : to_expression(id) + sampler_name_suffix; + + if (index == string::npos) + return samp_id ? to_expression(samp_id) : expr + sampler_name_suffix; + else + { + auto image_expr = expr.substr(0, index); + auto array_expr = expr.substr(index); + return samp_id ? to_expression(samp_id) : (image_expr + sampler_name_suffix + array_expr); + } } // Checks whether the ID is a row_major matrix that requires conversion before use @@ -2537,7 +2759,7 @@ bool CompilerMSL::is_non_native_row_major_matrix(uint32_t id) return false; // Non-matrix or column-major matrix types do not need to be converted. - if (!(meta[id].decoration.decoration_flags & (1ull << DecorationRowMajor))) + if (!meta[id].decoration.decoration_flags.get(DecorationRowMajor)) return false; // Generate a function that will swap matrix elements from row-major to column-major. @@ -2559,7 +2781,7 @@ bool CompilerMSL::member_is_non_native_row_major_matrix(const SPIRType &type, ui return false; // Non-matrix or column-major matrix types do not need to be converted. - if (!has_member_decoration(type.self, index, DecorationRowMajor)) + if (!combined_decoration_for_member(type, index).get(DecorationRowMajor)) return false; // Generate a function that will swap matrix elements from row-major to column-major. @@ -2596,7 +2818,10 @@ void CompilerMSL::add_convert_row_major_matrix_function(uint32_t cols, uint32_t auto rslt = spv_function_implementations.insert(spv_func); if (rslt.second) + { add_pragma_line("#pragma clang diagnostic ignored \"-Wmissing-prototypes\""); + force_recompile = true; + } } // Wraps the expression string in a function call that converts the @@ -2623,11 +2848,11 @@ void CompilerMSL::emit_fixup() if ((execution.model == ExecutionModelVertex) && stage_out_var_id && !qual_pos_var_name.empty()) { - if (CompilerGLSL::options.vertex.fixup_clipspace) + if (options.vertex.fixup_clipspace) statement(qual_pos_var_name, ".z = (", qual_pos_var_name, ".z + ", qual_pos_var_name, ".w) * 0.5; // Adjust clip-space for Metal"); - if (CompilerGLSL::options.vertex.flip_vert_y) + if (options.vertex.flip_vert_y) statement(qual_pos_var_name, ".y = -(", qual_pos_var_name, ".y);", " // Invert Y-axis for Metal"); } } @@ -2712,7 +2937,7 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in // Some shaders may include a PointSize builtin even when used to render // non-point topologies, and Metal will reject this builtin when compiling // the shader into a render pipeline that uses a non-point topology. - return options.enable_point_size_builtin ? (string(" [[") + builtin_qualifier(builtin) + "]]") : ""; + return msl_options.enable_point_size_builtin ? (string(" [[") + builtin_qualifier(builtin) + "]]") : ""; case BuiltInPosition: case BuiltInLayer: @@ -2768,8 +2993,15 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in } } uint32_t locn = get_ordered_member_location(type.self, index); - if (locn != k_unknown_location) - return string(" [[color(") + convert_to_string(locn) + ")]]"; + if (locn != k_unknown_location && has_member_decoration(type.self, index, DecorationIndex)) + return join(" [[color(", locn, "), index(", get_member_decoration(type.self, index, DecorationIndex), + ")]]"); + else if (locn != k_unknown_location) + return join(" [[color(", locn, ")]]"); + else if (has_member_decoration(type.self, index, DecorationIndex)) + return join(" [[index(", get_member_decoration(type.self, index, DecorationIndex), ")]]"); + else + return ""; } // Compute function inputs @@ -2805,7 +3037,7 @@ uint32_t CompilerMSL::get_ordered_member_location(uint32_t type_id, uint32_t ind if (index < m.members.size()) { auto &dec = m.members[index]; - if (dec.decoration_flags & (1ull << DecorationLocation)) + if (dec.decoration_flags.get(DecorationLocation)) return dec.location; } @@ -2871,9 +3103,8 @@ string CompilerMSL::func_type_decl(SPIRType &type) entry_type = "vertex"; break; case ExecutionModelFragment: - entry_type = (execution.flags & (1ull << ExecutionModeEarlyFragmentTests)) ? - "fragment [[ early_fragment_tests ]]" : - "fragment"; + entry_type = + execution.flags.get(ExecutionModeEarlyFragmentTests) ? "fragment [[ early_fragment_tests ]]" : "fragment"; break; case ExecutionModelGLCompute: case ExecutionModelKernel: @@ -2898,17 +3129,25 @@ string CompilerMSL::get_argument_address_space(const SPIRVariable &argument) return "threadgroup"; case StorageClassStorageBuffer: - return "device"; + { + auto flags = get_buffer_block_flags(argument); + return flags.get(DecorationNonWritable) ? "const device" : "device"; + } case StorageClassUniform: case StorageClassUniformConstant: case StorageClassPushConstant: if (type.basetype == SPIRType::Struct) - return ((meta[type.self].decoration.decoration_flags & (1ull << DecorationBufferBlock)) != 0 && - (meta[argument.self].decoration.decoration_flags & (1ull << DecorationNonWritable)) == 0) ? - "device" : - "constant"; - + { + bool ssbo = has_decoration(type.self, DecorationBufferBlock); + if (!ssbo) + return "constant"; + else + { + bool readonly = get_buffer_block_flags(argument).get(DecorationNonWritable); + return readonly ? "const device" : "device"; + } + } break; default: @@ -2935,19 +3174,6 @@ string CompilerMSL::entry_point_args(bool append_comma) ep_args += type_to_glsl(type) + " " + to_name(var.self) + " [[stage_in]]"; } - // Non-stage-in vertex attribute structures - for (auto &nsi_var : non_stage_in_input_var_ids) - { - auto &var = get(nsi_var.second); - auto &type = get(var.basetype); - - if (!ep_args.empty()) - ep_args += ", "; - - ep_args += "device " + type_to_glsl(type) + "* " + to_name(var.self) + " [[buffer(" + - convert_to_string(nsi_var.first) + ")]]"; - } - // Output resources, sorted by resource index & type // We need to sort to work around a bug on macOS 10.13 with NVidia drivers where switching between shaders // with different order of buffers can result in issues with buffer assignments inside the driver. @@ -2979,12 +3205,15 @@ string CompilerMSL::entry_point_args(bool append_comma) resources.push_back( { &id, to_name(var_id), SPIRType::Image, get_metal_resource_index(var, SPIRType::Image) }); - if (type.image.dim != DimBuffer) + if (type.image.dim != DimBuffer && constexpr_samplers.count(var_id) == 0) + { resources.push_back({ &id, to_sampler_expression(var_id), SPIRType::Sampler, get_metal_resource_index(var, SPIRType::Sampler) }); + } } - else + else if (constexpr_samplers.count(var_id) == 0) { + // constexpr samplers are not declared as resources. resources.push_back( { &id, to_name(var_id), type.basetype, get_metal_resource_index(var, type.basetype) }); } @@ -3019,13 +3248,13 @@ string CompilerMSL::entry_point_args(bool append_comma) case SPIRType::Sampler: if (!ep_args.empty()) ep_args += ", "; - ep_args += "sampler " + r.name; + ep_args += sampler_type(type) + " " + r.name; ep_args += " [[sampler(" + convert_to_string(r.index) + ")]]"; break; case SPIRType::Image: if (!ep_args.empty()) ep_args += ", "; - ep_args += type_to_glsl(type, var_id) + " " + r.name; + ep_args += image_type_glsl(type, var_id) + " " + r.name; ep_args += " [[texture(" + convert_to_string(r.index) + ")]]"; break; default: @@ -3098,24 +3327,36 @@ uint32_t CompilerMSL::get_metal_resource_index(SPIRVariable &var, SPIRType::Base } } + // If there is no explicit mapping of bindings to MSL, use the declared binding. + if (has_decoration(var.self, DecorationBinding)) + return get_decoration(var.self, DecorationBinding); + + uint32_t binding_stride = 1; + auto &type = get(var.basetype); + for (uint32_t i = 0; i < uint32_t(type.array.size()); i++) + binding_stride *= type.array_size_literal[i] ? type.array[i] : get(type.array[i]).scalar(); + // If a binding has not been specified, revert to incrementing resource indices + uint32_t resource_index; switch (basetype) { case SPIRType::Struct: - return next_metal_resource_index.msl_buffer++; + resource_index = next_metal_resource_index.msl_buffer; + next_metal_resource_index.msl_buffer += binding_stride; + break; case SPIRType::Image: - return next_metal_resource_index.msl_texture++; + resource_index = next_metal_resource_index.msl_texture; + next_metal_resource_index.msl_texture += binding_stride; + break; case SPIRType::Sampler: - return next_metal_resource_index.msl_sampler++; + resource_index = next_metal_resource_index.msl_sampler; + next_metal_resource_index.msl_sampler += binding_stride; + break; default: - return 0; + resource_index = 0; + break; } -} - -// Returns the name of the entry point of this shader -string CompilerMSL::get_entry_point_name() -{ - return to_name(entry_point); + return resource_index; } string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) @@ -3124,6 +3365,13 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) auto &type = expression_type(arg.id); bool constref = !arg.alias_global_variable && (!type.pointer || arg.write_count == 0); + bool type_is_image = type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage || + type.basetype == SPIRType::Sampler; + + // Arrays of images/samplers in MSL are always const. + if (!type.array.empty() && type_is_image) + constref = true; + // TODO: Check if this arg is an uniform pointer bool pointer = type.storage == StorageClassUniformConstant; @@ -3136,7 +3384,8 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg) else decl += type_to_glsl(type, arg.id); - if (is_array(type)) + // Arrays of images and samplers are special cased. + if (is_array(type) && !type_is_image) { decl += " (&"; decl += to_expression(var.self); @@ -3196,9 +3445,10 @@ string CompilerMSL::ensure_valid_name(string name, string pfx) // Replace all names that match MSL keywords or Metal Standard Library functions. void CompilerMSL::replace_illegal_names() { + // FIXME: MSL and GLSL are doing two different things here. + // Agree on convention and remove this override. static const unordered_set keywords = { - "kernel", - "bias", + "kernel", "vertex", "fragment", "compute", "bias", }; static const unordered_set illegal_func_names = { @@ -3252,6 +3502,8 @@ void CompilerMSL::replace_illegal_names() // Always write this because entry point might have been renamed earlier. meta[entry.first].decoration.alias = ep_name; } + + CompilerGLSL::replace_illegal_names(); } string CompilerMSL::to_qualifiers_glsl(uint32_t id) @@ -3285,7 +3537,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) return image_type_glsl(type, id); case SPIRType::Sampler: - return "sampler"; + return sampler_type(type); case SPIRType::Void: return "void"; @@ -3312,8 +3564,11 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) case SPIRType::UInt64: type_name = "size_t"; break; + case SPIRType::Half: + type_name = "half"; + break; case SPIRType::Float: - type_name = (type.width == 16 ? "half" : "float"); + type_name = "float"; break; case SPIRType::Double: type_name = "double"; // Currently unsupported @@ -3334,16 +3589,57 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id) return type_name; } +std::string CompilerMSL::sampler_type(const SPIRType &type) +{ + if (!type.array.empty()) + { + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("MSL 2.0 or greater is required for arrays of samplers."); + + // Arrays of samplers in MSL must be declared with a special array syntax ala C++11 std::array. + uint32_t array_size = + type.array_size_literal.back() ? type.array.back() : get(type.array.back()).scalar(); + if (array_size == 0) + SPIRV_CROSS_THROW("Unsized array of samplers is not supported in MSL."); + + auto &parent = get(get_non_pointer_type(type).parent_type); + return join("array<", sampler_type(parent), ", ", array_size, ">"); + } + else + return "sampler"; +} + // Returns an MSL string describing the SPIR-V image type string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id) { + auto *var = maybe_get(id); + if (var && var->basevariable) + { + // For comparison images, check against the base variable, + // and not the fake ID which might have been generated for this variable. + id = var->basevariable; + } + + if (!type.array.empty()) + { + if (!msl_options.supports_msl_version(2)) + SPIRV_CROSS_THROW("MSL 2.0 or greater is required for arrays of textures."); + + // Arrays of images in MSL must be declared with a special array syntax ala C++11 std::array. + uint32_t array_size = + type.array_size_literal.back() ? type.array.back() : get(type.array.back()).scalar(); + if (array_size == 0) + SPIRV_CROSS_THROW("Unsized array of images is not supported in MSL."); + + auto &parent = get(get_non_pointer_type(type).parent_type); + return join("array<", image_type_glsl(parent, id), ", ", array_size, ">"); + } + string img_type_name; // Bypass pointers because we need the real image struct auto &img_type = get(type.self).image; - bool shadow_image = comparison_images.count(id) != 0; - - if (img_type.depth || shadow_image) + if (image_is_comparison(type, id)) { switch (img_type.dim) { @@ -3450,7 +3746,9 @@ string CompilerMSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in (out_type.basetype == SPIRType::Int64 && in_type.basetype == SPIRType::Double) || (out_type.basetype == SPIRType::UInt64 && in_type.basetype == SPIRType::Double) || (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::Int64) || - (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::UInt64)) + (out_type.basetype == SPIRType::Double && in_type.basetype == SPIRType::UInt64) || + (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UInt) || + (out_type.basetype == SPIRType::UInt && in_type.basetype == SPIRType::Half)) return "as_type<" + type_to_glsl(out_type) + ">"; return ""; @@ -3535,9 +3833,9 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin) // Fragment function out case BuiltInFragDepth: - if (execution.flags & (1ull << ExecutionModeDepthGreater)) + if (execution.flags.get(ExecutionModeDepthGreater)) return "depth(greater)"; - else if (execution.flags & (1ull << ExecutionModeDepthLess)) + else if (execution.flags.get(ExecutionModeDepthLess)) return "depth(less)"; else return "depth(any)"; @@ -3772,14 +4070,15 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o auto &return_type = compiler.get(args[0]); if (!return_type.array.empty()) return SPVFuncImplArrayCopy; - else - return SPVFuncImplNone; + + break; } case OpStore: { // Get the result type of the RHS. Since this is run as a pre-processing stage, // we must extract the result type directly from the Instruction, rather than the ID. + uint32_t id_lhs = args[0]; uint32_t id_rhs = args[1]; const SPIRType *type = nullptr; @@ -3791,14 +4090,30 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o else { // Or ... an expression. - if (result_types[id_rhs] != 0) - type = &compiler.get(result_types[id_rhs]); + uint32_t tid = result_types[id_rhs]; + if (tid) + type = &compiler.get(tid); } - if (type && compiler.is_array(*type)) + auto *var = compiler.maybe_get(id_lhs); + + // Are we simply assigning to a statically assigned variable which takes a constant? + // Don't bother emitting this function. + bool static_expression_lhs = + var && var->storage == StorageClassFunction && var->statically_assigned && var->remapped_variable; + if (type && compiler.is_array(*type) && !static_expression_lhs) return SPVFuncImplArrayCopy; - else - return SPVFuncImplNone; + + break; + } + + case OpImageFetch: + { + // Retrieve the image type, and if it's a Buffer, emit a texel coordinate function + uint32_t tid = result_types[args[2]]; + if (tid && compiler.get(tid).image.dim == DimBuffer) + return SPVFuncImplTexelBufferCoords; + break; } @@ -3906,3 +4221,34 @@ CompilerMSL::MemberSorter::MemberSorter(SPIRType &t, Meta &m, SortAspect sa) // Ensure enough meta info is available meta.members.resize(max(type.member_types.size(), meta.members.size())); } + +void CompilerMSL::remap_constexpr_sampler(uint32_t id, const MSLConstexprSampler &sampler) +{ + auto &type = get(get(id).basetype); + if (type.basetype != SPIRType::SampledImage && type.basetype != SPIRType::Sampler) + SPIRV_CROSS_THROW("Can only remap SampledImage and Sampler type."); + if (!type.array.empty()) + SPIRV_CROSS_THROW("Can not remap array of samplers."); + constexpr_samplers[id] = sampler; +} + +// MSL always declares builtins with their SPIR-V type. +void CompilerMSL::bitcast_from_builtin_load(uint32_t, std::string &, const SPIRType &) +{ +} + +void CompilerMSL::bitcast_to_builtin_store(uint32_t, std::string &, const SPIRType &) +{ +} + +std::string CompilerMSL::to_initializer_expression(const SPIRVariable &var) +{ + // We risk getting an array initializer here with MSL. If we have an array. + // FIXME: We cannot handle non-constant arrays being initialized. + // We will need to inject spvArrayCopy here somehow ... + auto &type = get(var.basetype); + if (ids[var.initializer].get_type() == TypeConstant && (!type.array.empty() || type.basetype == SPIRType::Struct)) + return constant_expression(get(var.initializer)); + else + return CompilerGLSL::to_initializer_expression(var); +} diff --git a/deps/SPIRV-Cross/spirv_msl.hpp b/deps/SPIRV-Cross/spirv_msl.hpp index 92af8c10e8..4d412ace00 100644 --- a/deps/SPIRV-Cross/spirv_msl.hpp +++ b/deps/SPIRV-Cross/spirv_msl.hpp @@ -60,6 +60,73 @@ struct MSLResourceBinding bool used_by_shader = false; }; +enum MSLSamplerCoord +{ + MSL_SAMPLER_COORD_NORMALIZED, + MSL_SAMPLER_COORD_PIXEL +}; + +enum MSLSamplerFilter +{ + MSL_SAMPLER_FILTER_NEAREST, + MSL_SAMPLER_FILTER_LINEAR +}; + +enum MSLSamplerMipFilter +{ + MSL_SAMPLER_MIP_FILTER_NONE, + MSL_SAMPLER_MIP_FILTER_NEAREST, + MSL_SAMPLER_MIP_FILTER_LINEAR, +}; + +enum MSLSamplerAddress +{ + MSL_SAMPLER_ADDRESS_CLAMP_TO_ZERO, + MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE, + MSL_SAMPLER_ADDRESS_CLAMP_TO_BORDER, + MSL_SAMPLER_ADDRESS_REPEAT, + MSL_SAMPLER_ADDRESS_MIRRORED_REPEAT +}; + +enum MSLSamplerCompareFunc +{ + MSL_SAMPLER_COMPARE_FUNC_NEVER, + MSL_SAMPLER_COMPARE_FUNC_LESS, + MSL_SAMPLER_COMPARE_FUNC_LESS_EQUAL, + MSL_SAMPLER_COMPARE_FUNC_GREATER, + MSL_SAMPLER_COMPARE_FUNC_GREATER_EQUAL, + MSL_SAMPLER_COMPARE_FUNC_EQUAL, + MSL_SAMPLER_COMPARE_FUNC_NOT_EQUAL, + MSL_SAMPLER_COMPARE_FUNC_ALWAYS +}; + +enum MSLSamplerBorderColor +{ + MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK, + MSL_SAMPLER_BORDER_COLOR_OPAQUE_BLACK, + MSL_SAMPLER_BORDER_COLOR_OPAQUE_WHITE +}; + +struct MSLConstexprSampler +{ + MSLSamplerCoord coord = MSL_SAMPLER_COORD_NORMALIZED; + MSLSamplerFilter min_filter = MSL_SAMPLER_FILTER_NEAREST; + MSLSamplerFilter mag_filter = MSL_SAMPLER_FILTER_NEAREST; + MSLSamplerMipFilter mip_filter = MSL_SAMPLER_MIP_FILTER_NONE; + MSLSamplerAddress s_address = MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE; + MSLSamplerAddress t_address = MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE; + MSLSamplerAddress r_address = MSL_SAMPLER_ADDRESS_CLAMP_TO_EDGE; + MSLSamplerCompareFunc compare_func = MSL_SAMPLER_COMPARE_FUNC_NEVER; + MSLSamplerBorderColor border_color = MSL_SAMPLER_BORDER_COLOR_TRANSPARENT_BLACK; + float lod_clamp_min = 0.0f; + float lod_clamp_max = 1000.0f; + int max_anisotropy = 1; + + bool compare_enable = false; + bool lod_clamp_enable = false; + bool anisotropy_enable = false; +}; + // Tracks the type ID and member index of a struct member using MSLStructMemberKey = uint64_t; @@ -78,13 +145,15 @@ public: // Options for compiling to Metal Shading Language struct Options { - typedef enum { + typedef enum + { iOS, macOS, } Platform; Platform platform = macOS; uint32_t msl_version = make_msl_version(1, 2); + uint32_t texel_buffer_texture_width = 4096; // Width of 2D Metal textures used as 1D texel buffers bool enable_point_size_builtin = true; bool resolve_specialized_array_lengths = true; @@ -114,14 +183,26 @@ public: } }; + SPIRV_CROSS_DEPRECATED("CompilerMSL::get_options() is obsolete, use get_msl_options() instead.") const Options &get_options() const { - return options; + return msl_options; } + const Options &get_msl_options() const + { + return msl_options; + } + + SPIRV_CROSS_DEPRECATED("CompilerMSL::set_options() is obsolete, use set_msl_options() instead.") void set_options(Options &opts) { - options = opts; + msl_options = opts; + } + + void set_msl_options(const Options &opts) + { + msl_options = opts; } // An enum of SPIR-V functions that are implemented in additional @@ -136,6 +217,7 @@ public: SPVFuncImplFindSMsb, SPVFuncImplFindUMsb, SPVFuncImplArrayCopy, + SPVFuncImplTexelBufferCoords, SPVFuncImplInverse4x4, SPVFuncImplInverse3x3, SPVFuncImplInverse2x2, @@ -175,22 +257,31 @@ public: // This legacy method is deprecated. typedef Options MSLConfiguration; - SPIRV_CROSS_DEPRECATED("Please use get_options() and set_options() instead.") + SPIRV_CROSS_DEPRECATED("Please use get_msl_options() and set_msl_options() instead.") std::string compile(MSLConfiguration &msl_cfg, std::vector *p_vtx_attrs = nullptr, std::vector *p_res_bindings = nullptr); + // Remap a sampler with ID to a constexpr sampler. + // Older iOS targets must use constexpr samplers in certain cases (PCF), + // so a static sampler must be used. + // The sampler will not consume a binding, but be declared in the entry point as a constexpr sampler. + // This can be used on both combined image/samplers (sampler2D) or standalone samplers. + // The remapped sampler must not be an array of samplers. + void remap_constexpr_sampler(uint32_t id, const MSLConstexprSampler &sampler); + protected: void emit_instruction(const Instruction &instr) override; void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args, uint32_t count) override; void emit_header() override; - void emit_function_prototype(SPIRFunction &func, uint64_t return_flags) override; + void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags) override; void emit_sampled_image_op(uint32_t result_type, uint32_t result_id, uint32_t image_id, uint32_t samp_id) override; void emit_fixup() override; void emit_struct_member(const SPIRType &type, uint32_t member_type_id, uint32_t index, const std::string &qualifier = "", uint32_t base_offset = 0) override; std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override; std::string image_type_glsl(const SPIRType &type, uint32_t id = 0) override; + std::string sampler_type(const SPIRType &type); std::string builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage) override; std::string constant_expression(const SPIRConstant &c) override; size_t get_declared_struct_member_size(const SPIRType &struct_type, uint32_t index) const override; @@ -203,6 +294,7 @@ protected: uint32_t coord, uint32_t coord_components, uint32_t dref, uint32_t grad_x, uint32_t grad_y, uint32_t lod, uint32_t coffset, uint32_t offset, uint32_t bias, uint32_t comp, uint32_t sample, bool *p_forward) override; + std::string to_initializer_expression(const SPIRVariable &var) override; std::string unpack_expression_type(std::string expr_str, const SPIRType &type) override; std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override; bool skip_argument(uint32_t id) const override; @@ -239,7 +331,6 @@ protected: std::string func_type_decl(SPIRType &type); std::string entry_point_args(bool append_comma); - std::string get_entry_point_name(); std::string to_qualified_member_name(const SPIRType &type, uint32_t index); std::string ensure_valid_name(std::string name, std::string pfx); std::string to_sampler_expression(uint32_t id); @@ -253,11 +344,6 @@ protected: uint32_t get_ordered_member_location(uint32_t type_id, uint32_t index); size_t get_declared_struct_member_alignment(const SPIRType &struct_type, uint32_t index) const; std::string to_component_argument(uint32_t id); - bool should_move_to_input_buffer(uint32_t type_id, bool is_builtin, spv::StorageClass storage); - void move_to_input_buffer(SPIRVariable &var); - void move_member_to_input_buffer(const SPIRType &type, uint32_t index); - std::string add_input_buffer_block_member(uint32_t mbr_type_id, std::string mbr_name, uint32_t mbr_locn); - uint32_t get_input_buffer_block_var_id(uint32_t msl_buffer); void align_struct(SPIRType &ib_type); bool is_member_packable(SPIRType &ib_type, uint32_t index); MSLStructMemberKey get_struct_member_key(uint32_t type_id, uint32_t index); @@ -271,15 +357,19 @@ protected: void emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uint32_t id_mem_sem); void emit_array_copy(const std::string &lhs, uint32_t rhs_id) override; void build_implicit_builtins(); + void emit_entry_point_declarations() override; uint32_t builtin_frag_coord_id = 0; - Options options; + void bitcast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) override; + void bitcast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type) override; + + Options msl_options; std::set spv_function_implementations; std::unordered_map vtx_attrs_by_location; - std::map non_stage_in_input_var_ids; std::unordered_map struct_member_padding; std::set pragma_lines; std::set typedef_lines; + std::vector vars_needing_early_declaration; std::vector resource_bindings; MSLResourceBinding next_metal_resource_index; uint32_t stage_in_var_id = 0; @@ -294,6 +384,8 @@ protected: std::string sampler_name_suffix = "Smplr"; spv::Op previous_instruction_opcode = spv::OpNop; + std::unordered_map constexpr_samplers; + // OpcodeHandler that handles several MSL preprocessing operations. struct OpCodePreprocessor : OpcodeHandler { @@ -334,6 +426,6 @@ protected: SortAspect sort_aspect; }; }; -} +} // namespace spirv_cross #endif diff --git a/deps/SPIRV-Cross/spirv_reflect.cpp b/deps/SPIRV-Cross/spirv_reflect.cpp new file mode 100644 index 0000000000..c322d972bd --- /dev/null +++ b/deps/SPIRV-Cross/spirv_reflect.cpp @@ -0,0 +1,573 @@ +/* + * Copyright 2018 Bradley Austin Davis + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "spirv_reflect.hpp" +#include "spirv_glsl.hpp" +#include + +using namespace spv; +using namespace spirv_cross; +using namespace std; + +namespace simple_json +{ +enum class Type +{ + Object, + Array, +}; + +using State = std::pair; +using Stack = std::stack; + +class Stream +{ + Stack stack; + std::ostringstream buffer; + uint32_t indent{ 0 }; + +public: + void begin_json_object(); + void end_json_object(); + void emit_json_key(const std::string &key); + void emit_json_key_value(const std::string &key, const std::string &value); + void emit_json_key_value(const std::string &key, bool value); + void emit_json_key_value(const std::string &key, uint32_t value); + void emit_json_key_value(const std::string &key, int32_t value); + void emit_json_key_value(const std::string &key, float value); + void emit_json_key_object(const std::string &key); + void emit_json_key_array(const std::string &key); + + void begin_json_array(); + void end_json_array(); + void emit_json_array_value(const std::string &value); + void emit_json_array_value(uint32_t value); + + std::string str() const + { + return buffer.str(); + } + +private: + inline void statement_indent() + { + for (uint32_t i = 0; i < indent; i++) + buffer << " "; + } + + template + inline void statement_inner(T &&t) + { + buffer << std::forward(t); + } + + template + inline void statement_inner(T &&t, Ts &&... ts) + { + buffer << std::forward(t); + statement_inner(std::forward(ts)...); + } + + template + inline void statement(Ts &&... ts) + { + statement_indent(); + statement_inner(std::forward(ts)...); + buffer << '\n'; + } + + template + void statement_no_return(Ts &&... ts) + { + statement_indent(); + statement_inner(std::forward(ts)...); + } +}; +} // namespace simple_json + +using namespace simple_json; + +// Hackery to emit JSON without using nlohmann/json C++ library (which requires a +// higher level of compiler compliance than is required by SPIRV-Cross +void Stream::begin_json_array() +{ + if (!stack.empty() && stack.top().second) + { + statement_inner(",\n"); + } + statement("["); + ++indent; + stack.emplace(Type::Array, false); +} + +void Stream::end_json_array() +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + { + statement_inner("\n"); + } + --indent; + statement_no_return("]"); + stack.pop(); + if (!stack.empty()) + { + stack.top().second = true; + } +} + +void Stream::emit_json_array_value(const std::string &value) +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + + if (stack.top().second) + statement_inner(",\n"); + + statement_no_return("\"", value, "\""); + stack.top().second = true; +} + +void Stream::emit_json_array_value(uint32_t value) +{ + if (stack.empty() || stack.top().first != Type::Array) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + statement_inner(",\n"); + statement_no_return(std::to_string(value)); + stack.top().second = true; +} + +void Stream::begin_json_object() +{ + if (!stack.empty() && stack.top().second) + { + statement_inner(",\n"); + } + statement("{"); + ++indent; + stack.emplace(Type::Object, false); +} + +void Stream::end_json_object() +{ + if (stack.empty() || stack.top().first != Type::Object) + SPIRV_CROSS_THROW("Invalid JSON state"); + if (stack.top().second) + { + statement_inner("\n"); + } + --indent; + statement_no_return("}"); + stack.pop(); + if (!stack.empty()) + { + stack.top().second = true; + } +} + +void Stream::emit_json_key(const std::string &key) +{ + if (stack.empty() || stack.top().first != Type::Object) + SPIRV_CROSS_THROW("Invalid JSON state"); + + if (stack.top().second) + statement_inner(",\n"); + statement_no_return("\"", key, "\" : "); + stack.top().second = true; +} + +void Stream::emit_json_key_value(const std::string &key, const std::string &value) +{ + emit_json_key(key); + statement_inner("\"", value, "\""); +} + +void Stream::emit_json_key_value(const std::string &key, uint32_t value) +{ + emit_json_key(key); + statement_inner(value); +} + +void Stream::emit_json_key_value(const std::string &key, int32_t value) +{ + emit_json_key(key); + statement_inner(value); +} + +void Stream::emit_json_key_value(const std::string &key, float value) +{ + emit_json_key(key); + statement_inner(value); +} + +void Stream::emit_json_key_value(const std::string &key, bool value) +{ + emit_json_key(key); + statement_inner(value ? "true" : "false"); +} + +void Stream::emit_json_key_object(const std::string &key) +{ + emit_json_key(key); + statement_inner("{\n"); + ++indent; + stack.emplace(Type::Object, false); +} + +void Stream::emit_json_key_array(const std::string &key) +{ + emit_json_key(key); + statement_inner("[\n"); + ++indent; + stack.emplace(Type::Array, false); +} + +void CompilerReflection::set_format(const std::string &format) +{ + if (format != "json") + { + SPIRV_CROSS_THROW("Unsupported format"); + } +} + +string CompilerReflection::compile() +{ + // Force a classic "C" locale, reverts when function returns + ClassicLocale classic_locale; + + // Move constructor for this type is broken on GCC 4.9 ... + json_stream = std::make_shared(); + json_stream->begin_json_object(); + emit_entry_points(); + emit_types(); + emit_resources(); + emit_specialization_constants(); + json_stream->end_json_object(); + return json_stream->str(); +} + +void CompilerReflection::emit_types() +{ + bool emitted_open_tag = false; + for (auto &id : ids) + { + auto idType = id.get_type(); + if (idType == TypeType) + { + auto &type = id.get(); + if (type.basetype == SPIRType::Struct && !type.pointer && type.array.empty()) + { + emit_type(type, emitted_open_tag); + } + } + } + + if (emitted_open_tag) + { + json_stream->end_json_object(); + } +} + +void CompilerReflection::emit_type(const SPIRType &type, bool &emitted_open_tag) +{ + auto name = type_to_glsl(type); + + if (type.type_alias != 0) + return; + + if (!emitted_open_tag) + { + json_stream->emit_json_key_object("types"); + emitted_open_tag = true; + } + json_stream->emit_json_key_object("_" + std::to_string(type.self)); + json_stream->emit_json_key_value("name", name); + json_stream->emit_json_key_array("members"); + // FIXME ideally we'd like to emit the size of a structure as a + // convenience to people parsing the reflected JSON. The problem + // is that there's no implicit size for a type. It's final size + // will be determined by the top level declaration in which it's + // included. So there might be one size for the struct if it's + // included in a std140 uniform block and another if it's included + // in a std430 uniform block. + // The solution is to include *all* potential sizes as a map of + // layout type name to integer, but that will probably require + // some additional logic being written in this class, or in the + // parent CompilerGLSL class. + auto size = type.member_types.size(); + for (uint32_t i = 0; i < size; ++i) + { + emit_type_member(type, i); + } + json_stream->end_json_array(); + json_stream->end_json_object(); +} + +void CompilerReflection::emit_type_member(const SPIRType &type, uint32_t index) +{ + auto &membertype = get(type.member_types[index]); + json_stream->begin_json_object(); + auto name = to_member_name(type, index); + // FIXME we'd like to emit the offset of each member, but such offsets are + // context dependent. See the comment above regarding structure sizes + json_stream->emit_json_key_value("name", name); + if (membertype.basetype == SPIRType::Struct) + { + json_stream->emit_json_key_value("type", "_" + std::to_string(membertype.self)); + } + else + { + json_stream->emit_json_key_value("type", type_to_glsl(membertype)); + } + emit_type_member_qualifiers(type, index); + json_stream->end_json_object(); +} + +void CompilerReflection::emit_type_array(const SPIRType &type) +{ + if (!type.array.empty()) + { + json_stream->emit_json_key_array("array"); + // Note that we emit the zeros here as a means of identifying + // unbounded arrays. This is necessary as otherwise there would + // be no way of differentiating between float[4] and float[4][] + for (const auto &value : type.array) + json_stream->emit_json_array_value(value); + json_stream->end_json_array(); + } +} + +void CompilerReflection::emit_type_member_qualifiers(const SPIRType &type, uint32_t index) +{ + auto flags = combined_decoration_for_member(type, index); + if (flags.get(DecorationRowMajor)) + json_stream->emit_json_key_value("row_major", true); + + auto &membertype = get(type.member_types[index]); + emit_type_array(membertype); + auto &memb = meta[type.self].members; + if (index < memb.size()) + { + auto &dec = memb[index]; + if (dec.decoration_flags.get(DecorationLocation)) + json_stream->emit_json_key_value("location", dec.location); + if (dec.decoration_flags.get(DecorationOffset)) + json_stream->emit_json_key_value("offset", dec.offset); + } +} + +string CompilerReflection::execution_model_to_str(spv::ExecutionModel model) +{ + switch (model) + { + case spv::ExecutionModelVertex: + return "vert"; + case spv::ExecutionModelTessellationControl: + return "tesc"; + case ExecutionModelTessellationEvaluation: + return "tese"; + case ExecutionModelGeometry: + return "geom"; + case ExecutionModelFragment: + return "frag"; + case ExecutionModelGLCompute: + return "comp"; + default: + return "???"; + } +} + +// FIXME include things like the local_size dimensions, geometry output vertex count, etc +void CompilerReflection::emit_entry_points() +{ + auto entries = get_entry_points_and_stages(); + if (!entries.empty()) + { + json_stream->emit_json_key_array("entryPoints"); + for (auto &e : entries) + { + json_stream->begin_json_object(); + json_stream->emit_json_key_value("name", e.name); + json_stream->emit_json_key_value("mode", execution_model_to_str(e.execution_model)); + json_stream->end_json_object(); + } + json_stream->end_json_array(); + } +} + +void CompilerReflection::emit_resources() +{ + auto res = get_shader_resources(); + emit_resources("subpass_inputs", res.subpass_inputs); + emit_resources("inputs", res.stage_inputs); + emit_resources("outputs", res.stage_outputs); + emit_resources("textures", res.sampled_images); + emit_resources("separate_images", res.separate_images); + emit_resources("separate_samplers", res.separate_samplers); + emit_resources("images", res.storage_images); + emit_resources("ssbos", res.storage_buffers); + emit_resources("ubos", res.uniform_buffers); + emit_resources("push_constants", res.push_constant_buffers); + emit_resources("counters", res.atomic_counters); +} + +void CompilerReflection::emit_resources(const char *tag, const vector &resources) +{ + if (resources.empty()) + { + return; + } + + json_stream->emit_json_key_array(tag); + for (auto &res : resources) + { + auto &type = get_type(res.type_id); + auto typeflags = meta[type.self].decoration.decoration_flags; + auto &mask = get_decoration_bitset(res.id); + + // 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. + bool is_push_constant = get_storage_class(res.id) == StorageClassPushConstant; + bool is_block = get_decoration_bitset(type.self).get(DecorationBlock) || + get_decoration_bitset(type.self).get(DecorationBufferBlock); + + uint32_t fallback_id = !is_push_constant && is_block ? res.base_type_id : res.id; + + json_stream->begin_json_object(); + + if (type.basetype == SPIRType::Struct) + { + json_stream->emit_json_key_value("type", "_" + std::to_string(res.base_type_id)); + } + else + { + json_stream->emit_json_key_value("type", type_to_glsl(type)); + } + + json_stream->emit_json_key_value("name", !res.name.empty() ? res.name : get_fallback_name(fallback_id)); + { + bool ssbo_block = type.storage == StorageClassStorageBuffer || + (type.storage == StorageClassUniform && typeflags.get(DecorationBufferBlock)); + if (ssbo_block) + { + auto buffer_flags = get_buffer_block_flags(res.id); + if (buffer_flags.get(DecorationNonReadable)) + json_stream->emit_json_key_value("writeonly", true); + if (buffer_flags.get(DecorationNonWritable)) + json_stream->emit_json_key_value("readonly", true); + if (buffer_flags.get(DecorationRestrict)) + json_stream->emit_json_key_value("restrict", true); + if (buffer_flags.get(DecorationCoherent)) + json_stream->emit_json_key_value("coherent", true); + } + } + + emit_type_array(type); + + { + bool is_sized_block = is_block && (get_storage_class(res.id) == StorageClassUniform || + get_storage_class(res.id) == StorageClassUniformConstant); + if (is_sized_block) + { + uint32_t block_size = uint32_t(get_declared_struct_size(get_type(res.base_type_id))); + json_stream->emit_json_key_value("block_size", block_size); + } + } + + if (type.storage == StorageClassPushConstant) + json_stream->emit_json_key_value("push_constant", true); + if (mask.get(DecorationLocation)) + json_stream->emit_json_key_value("location", get_decoration(res.id, DecorationLocation)); + if (mask.get(DecorationRowMajor)) + json_stream->emit_json_key_value("row_major", true); + if (mask.get(DecorationColMajor)) + json_stream->emit_json_key_value("column_major", true); + if (mask.get(DecorationIndex)) + json_stream->emit_json_key_value("index", get_decoration(res.id, DecorationIndex)); + if (type.storage != StorageClassPushConstant && mask.get(DecorationDescriptorSet)) + json_stream->emit_json_key_value("set", get_decoration(res.id, DecorationDescriptorSet)); + if (mask.get(DecorationBinding)) + json_stream->emit_json_key_value("binding", get_decoration(res.id, DecorationBinding)); + if (mask.get(DecorationInputAttachmentIndex)) + json_stream->emit_json_key_value("input_attachment_index", + get_decoration(res.id, DecorationInputAttachmentIndex)); + if (mask.get(DecorationOffset)) + json_stream->emit_json_key_value("offset", get_decoration(res.id, DecorationOffset)); + + // For images, the type itself adds a layout qualifer. + // Only emit the format for storage images. + if (type.basetype == SPIRType::Image && type.image.sampled == 2) + { + const char *fmt = format_to_glsl(type.image.format); + if (fmt != nullptr) + json_stream->emit_json_key_value("format", std::string(fmt)); + } + json_stream->end_json_object(); + } + json_stream->end_json_array(); +} + +void CompilerReflection::emit_specialization_constants() +{ + auto specialization_constants = get_specialization_constants(); + if (specialization_constants.empty()) + return; + + json_stream->emit_json_key_array("specialization_constants"); + for (const auto spec_const : specialization_constants) + { + auto &c = get(spec_const.id); + auto type = get(c.constant_type); + json_stream->begin_json_object(); + json_stream->emit_json_key_value("id", spec_const.constant_id); + json_stream->emit_json_key_value("type", type_to_glsl(type)); + switch (type.basetype) + { + case SPIRType::UInt: + json_stream->emit_json_key_value("default_value", c.scalar()); + break; + + case SPIRType::Int: + json_stream->emit_json_key_value("default_value", c.scalar_i32()); + break; + + case SPIRType::Float: + json_stream->emit_json_key_value("default_value", c.scalar_f32()); + break; + + case SPIRType::Boolean: + json_stream->emit_json_key_value("default_value", c.scalar() != 0); + break; + + default: + break; + } + json_stream->end_json_object(); + } + json_stream->end_json_array(); +} + +string CompilerReflection::to_member_name(const SPIRType &type, uint32_t index) const +{ + auto &memb = meta[type.self].members; + if (index < memb.size() && !memb[index].alias.empty()) + return memb[index].alias; + else + return join("_m", index); +} diff --git a/deps/SPIRV-Cross/spirv_reflect.hpp b/deps/SPIRV-Cross/spirv_reflect.hpp new file mode 100644 index 0000000000..e402fa8fb9 --- /dev/null +++ b/deps/SPIRV-Cross/spirv_reflect.hpp @@ -0,0 +1,72 @@ +/* + * Copyright 2018 Bradley Austin Davis + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef SPIRV_CROSS_REFLECT_HPP +#define SPIRV_CROSS_REFLECT_HPP + +#include "spirv_glsl.hpp" +#include +#include + +namespace simple_json +{ +class Stream; +} + +namespace spirv_cross +{ +class CompilerReflection : public CompilerGLSL +{ + using Parent = CompilerGLSL; + +public: + CompilerReflection(std::vector spirv_) + : Parent(move(spirv_)) + { + options.vulkan_semantics = true; + } + + CompilerReflection(const uint32_t *ir, size_t word_count) + : Parent(ir, word_count) + { + options.vulkan_semantics = true; + } + + void set_format(const std::string &format); + std::string compile() override; + +private: + static std::string execution_model_to_str(spv::ExecutionModel model); + + void emit_entry_points(); + void emit_types(); + void emit_resources(); + void emit_specialization_constants(); + + void emit_type(const SPIRType &type, bool &emitted_open_tag); + void emit_type_member(const SPIRType &type, uint32_t index); + void emit_type_member_qualifiers(const SPIRType &type, uint32_t index); + void emit_type_array(const SPIRType &type); + void emit_resources(const char *tag, const std::vector &resources); + + std::string to_member_name(const SPIRType &type, uint32_t index) const; + + std::shared_ptr json_stream; +}; + +} // namespace spirv_cross + +#endif diff --git a/deps/SPIRV-Cross/test_shaders.py b/deps/SPIRV-Cross/test_shaders.py index 1ca8f9af5f..40e1c2e2c3 100755 --- a/deps/SPIRV-Cross/test_shaders.py +++ b/deps/SPIRV-Cross/test_shaders.py @@ -11,8 +11,23 @@ import hashlib import shutil import argparse import codecs +import json +import multiprocessing +import errno +from functools import partial -force_no_external_validation = False +backend = 'glsl' +args = {} + +def remove_file(path): + #print('Removing file:', path) + os.remove(path) + +def create_temporary(suff = ''): + f, path = tempfile.mkstemp(suffix = suff) + os.close(f) + #print('Creating temporary:', path) + return path def parse_stats(stats): m = re.search('([0-9]+) work registers', stats) @@ -49,12 +64,11 @@ def get_shader_type(shader): return '' def get_shader_stats(shader): - f, path = tempfile.mkstemp() + path = create_temporary() - os.close(f) p = subprocess.Popen(['malisc', get_shader_type(shader), '--core', 'Mali-T760', '-V', shader], stdout = subprocess.PIPE, stderr = subprocess.PIPE) stdout, stderr = p.communicate() - os.remove(path) + remove_file(path) if p.returncode != 0: print(stderr.decode('utf-8')) @@ -69,40 +83,49 @@ def print_msl_compiler_version(): subprocess.check_call(['xcrun', '--sdk', 'iphoneos', 'metal', '--version']) print('...are the Metal compiler characteristics.\n') # display after so xcrun FNF is silent except OSError as e: - if (e.errno != os.errno.ENOENT): # Ignore xcrun not found error + if (e.errno != errno.ENOENT): # Ignore xcrun not found error raise def validate_shader_msl(shader, opt): msl_path = reference_path(shader[0], shader[1], opt) + msl2 = '.msl2.' in msl_path try: msl_os = 'macosx' # msl_os = 'iphoneos' - subprocess.check_call(['xcrun', '--sdk', msl_os, 'metal', '-x', 'metal', '-std=osx-metal1.2', '-Werror', '-Wno-unused-variable', msl_path]) + subprocess.check_call(['xcrun', '--sdk', msl_os, 'metal', '-x', 'metal', '-std=osx-metal{}'.format('2.0' if msl2 else '1.2'), '-Werror', '-Wno-unused-variable', msl_path]) print('Compiled Metal shader: ' + msl_path) # display after so xcrun FNF is silent except OSError as oe: - if (oe.errno != os.errno.ENOENT): # Ignore xcrun not found error + if (oe.errno != errno.ENOENT): # Ignore xcrun not found error raise except subprocess.CalledProcessError: print('Error compiling Metal shader: ' + msl_path) sys.exit(1) def cross_compile_msl(shader, spirv, opt): - spirv_f, spirv_path = tempfile.mkstemp() - msl_f, msl_path = tempfile.mkstemp(suffix = os.path.basename(shader)) - os.close(spirv_f) - os.close(msl_f) + msl2 = '.msl2.' in shader + spirv_path = create_temporary() + msl_path = create_temporary(os.path.basename(shader)) if spirv: subprocess.check_call(['spirv-as', '-o', spirv_path, shader]) else: - subprocess.check_call(['glslangValidator', '-V', '-o', spirv_path, shader]) + subprocess.check_call(['glslangValidator', '--target-env', 'vulkan1.1', '-V', '-o', spirv_path, shader]) if opt: subprocess.check_call(['spirv-opt', '-O', '-o', spirv_path, spirv_path]) spirv_cross_path = './spirv-cross' - subprocess.check_call([spirv_cross_path, '--entry', 'main', '--output', msl_path, spirv_path, '--msl']) - subprocess.check_call(['spirv-val', spirv_path]) + + msl_args = [spirv_cross_path, '--entry', 'main', '--output', msl_path, spirv_path, '--msl'] + if msl2: + msl_args.append('--msl-version') + msl_args.append('20000') + + subprocess.check_call(msl_args) + + if not shader_is_invalid_spirv(msl_path): + subprocess.check_call(['spirv-val', '--target-env', 'vulkan1.1', spirv_path]) + return (spirv_path, msl_path) def shader_model_hlsl(shader): @@ -122,29 +145,35 @@ def shader_to_win_path(shader): stdout_data, stderr_data = f.communicate() return stdout_data.decode('utf-8') except OSError as oe: - if (oe.errno != os.errno.ENOENT): # Ignore not found errors + if (oe.errno != errno.ENOENT): # Ignore not found errors return shader except subprocess.CalledProcessError: raise return shader +ignore_fxc = False def validate_shader_hlsl(shader): - subprocess.check_call(['glslangValidator', '-e', 'main', '-D', '-V', shader]) + subprocess.check_call(['glslangValidator', '-e', 'main', '-D', '--target-env', 'vulkan1.1', '-V', shader]) is_no_fxc = '.nofxc.' in shader - if (not force_no_external_validation) and (not is_no_fxc): + global ignore_fxc + if (not ignore_fxc) and (not args.force_no_external_validation) and (not is_no_fxc): try: win_path = shader_to_win_path(shader) subprocess.check_call(['fxc', '-nologo', shader_model_hlsl(shader), win_path]) except OSError as oe: - if (oe.errno != os.errno.ENOENT): # Ignore not found errors + if (oe.errno != errno.ENOENT): # Ignore not found errors raise + else: + ignore_fxc = True except subprocess.CalledProcessError: print('Failed compiling HLSL shader:', shader, 'with FXC.') sys.exit(1) def shader_to_sm(shader): - if '.sm51.' in shader: + if '.sm60.' in shader: + return '60' + elif '.sm51.' in shader: return '51' elif '.sm20.' in shader: return '20' @@ -152,15 +181,13 @@ def shader_to_sm(shader): return '50' def cross_compile_hlsl(shader, spirv, opt): - spirv_f, spirv_path = tempfile.mkstemp() - hlsl_f, hlsl_path = tempfile.mkstemp(suffix = os.path.basename(shader)) - os.close(spirv_f) - os.close(hlsl_f) + spirv_path = create_temporary() + hlsl_path = create_temporary(os.path.basename(shader)) if spirv: subprocess.check_call(['spirv-as', '-o', spirv_path, shader]) else: - subprocess.check_call(['glslangValidator', '-V', '-o', spirv_path, shader]) + subprocess.check_call(['glslangValidator', '--target-env', 'vulkan1.1', '-V', '-o', spirv_path, shader]) if opt: subprocess.check_call(['spirv-opt', '-O', '-o', spirv_path, spirv_path]) @@ -169,38 +196,55 @@ def cross_compile_hlsl(shader, spirv, opt): sm = shader_to_sm(shader) subprocess.check_call([spirv_cross_path, '--entry', 'main', '--output', hlsl_path, spirv_path, '--hlsl-enable-compat', '--hlsl', '--shader-model', sm]) - subprocess.check_call(['spirv-val', spirv_path]) + + if not shader_is_invalid_spirv(hlsl_path): + subprocess.check_call(['spirv-val', '--target-env', 'vulkan1.1', spirv_path]) validate_shader_hlsl(hlsl_path) return (spirv_path, hlsl_path) -def validate_shader(shader, vulkan): - if vulkan: - subprocess.check_call(['glslangValidator', '-V', shader]) - else: - subprocess.check_call(['glslangValidator', shader]) - -def cross_compile(shader, vulkan, spirv, invalid_spirv, eliminate, is_legacy, flatten_ubo, sso, flatten_dim, opt): - spirv_f, spirv_path = tempfile.mkstemp() - glsl_f, glsl_path = tempfile.mkstemp(suffix = os.path.basename(shader)) - os.close(spirv_f) - os.close(glsl_f) - - if vulkan or spirv: - vulkan_glsl_f, vulkan_glsl_path = tempfile.mkstemp(suffix = os.path.basename(shader)) - os.close(vulkan_glsl_f) +def cross_compile_reflect(shader, spirv, opt): + spirv_path = create_temporary() + reflect_path = create_temporary(os.path.basename(shader)) if spirv: subprocess.check_call(['spirv-as', '-o', spirv_path, shader]) else: - subprocess.check_call(['glslangValidator', '-V', '-o', spirv_path, shader]) + subprocess.check_call(['glslangValidator', '--target-env', 'vulkan1.1', '-V', '-o', spirv_path, shader]) + + if opt: + subprocess.check_call(['spirv-opt', '-O', '-o', spirv_path, spirv_path]) + + spirv_cross_path = './spirv-cross' + + sm = shader_to_sm(shader) + subprocess.check_call([spirv_cross_path, '--entry', 'main', '--output', reflect_path, spirv_path, '--reflect']) + return (spirv_path, reflect_path) + +def validate_shader(shader, vulkan): + if vulkan: + subprocess.check_call(['glslangValidator', '--target-env', 'vulkan1.1', '-V', shader]) + else: + subprocess.check_call(['glslangValidator', shader]) + +def cross_compile(shader, vulkan, spirv, invalid_spirv, eliminate, is_legacy, flatten_ubo, sso, flatten_dim, opt): + spirv_path = create_temporary() + glsl_path = create_temporary(os.path.basename(shader)) + + if vulkan or spirv: + vulkan_glsl_path = create_temporary('vk' + os.path.basename(shader)) + + if spirv: + subprocess.check_call(['spirv-as', '-o', spirv_path, shader]) + else: + subprocess.check_call(['glslangValidator', '--target-env', 'vulkan1.1', '-V', '-o', spirv_path, shader]) if opt and (not invalid_spirv): subprocess.check_call(['spirv-opt', '-O', '-o', spirv_path, spirv_path]) if not invalid_spirv: - subprocess.check_call(['spirv-val', spirv_path]) + subprocess.check_call(['spirv-val', '--target-env', 'vulkan1.1', spirv_path]) extra_args = [] if eliminate: @@ -215,15 +259,21 @@ def cross_compile(shader, vulkan, spirv, invalid_spirv, eliminate, is_legacy, fl extra_args += ['--flatten-multidimensional-arrays'] spirv_cross_path = './spirv-cross' - subprocess.check_call([spirv_cross_path, '--entry', 'main', '--output', glsl_path, spirv_path] + extra_args) # A shader might not be possible to make valid GLSL from, skip validation for this case. - if (not ('nocompat' in glsl_path)) and (not spirv): + if not ('nocompat' in glsl_path): + subprocess.check_call([spirv_cross_path, '--entry', 'main', '--output', glsl_path, spirv_path] + extra_args) validate_shader(glsl_path, False) + else: + remove_file(glsl_path) + glsl_path = None if vulkan or spirv: subprocess.check_call([spirv_cross_path, '--entry', 'main', '--vulkan-semantics', '--output', vulkan_glsl_path, spirv_path] + extra_args) validate_shader(vulkan_glsl_path, True) + # SPIR-V shaders might just want to validate Vulkan GLSL output, we don't always care about the output. + if not vulkan: + remove_file(vulkan_glsl_path) return (spirv_path, glsl_path, vulkan_glsl_path if vulkan else None) @@ -250,6 +300,58 @@ def reference_path(directory, relpath, opt): reference_dir = os.path.join(reference_dir, split_paths[1]) return os.path.join(reference_dir, relpath) +def json_ordered(obj): + if isinstance(obj, dict): + return sorted((k, json_ordered(v)) for k, v in obj.items()) + if isinstance(obj, list): + return sorted(json_ordered(x) for x in obj) + else: + return obj + +def json_compare(json_a, json_b): + return json_ordered(json_a) == json_ordered(json_b) + +def regression_check_reflect(shader, json_file, update, keep, opt): + reference = reference_path(shader[0], shader[1], opt) + '.json' + joined_path = os.path.join(shader[0], shader[1]) + print('Reference shader reflection path:', reference) + if os.path.exists(reference): + actual = '' + expected = '' + with open(json_file) as f: + actual_json = f.read(); + actual = json.loads(actual_json) + with open(reference) as f: + expected = json.load(f) + if (json_compare(actual, expected) != True): + if update: + print('Generated reflection json has changed for {}!'.format(reference)) + # If we expect changes, update the reference file. + if os.path.exists(reference): + remove_file(reference) + make_reference_dir(reference) + shutil.move(json_file, reference) + else: + print('Generated reflection json in {} does not match reference {}!'.format(json_file, reference)) + with open(json_file, 'r') as f: + print('') + print('Generated:') + print('======================') + print(f.read()) + print('======================') + print('') + + # Otherwise, fail the test. Keep the shader file around so we can inspect. + if not keep: + remove_file(json_file) + sys.exit(1) + else: + remove_file(json_file) + else: + print('Found new shader {}. Placing generated source code in {}'.format(joined_path, reference)) + make_reference_dir(reference) + shutil.move(json_file, reference) + def regression_check(shader, glsl, update, keep, opt): reference = reference_path(shader[0], shader[1], opt) joined_path = os.path.join(shader[0], shader[1]) @@ -261,7 +363,7 @@ def regression_check(shader, glsl, update, keep, opt): print('Generated source code has changed for {}!'.format(reference)) # If we expect changes, update the reference file. if os.path.exists(reference): - os.remove(reference) + remove_file(reference) make_reference_dir(reference) shutil.move(glsl, reference) else: @@ -276,10 +378,10 @@ def regression_check(shader, glsl, update, keep, opt): # Otherwise, fail the test. Keep the shader file around so we can inspect. if not keep: - os.remove(glsl) + remove_file(glsl) sys.exit(1) else: - os.remove(glsl) + remove_file(glsl) else: print('Found new shader {}. Placing generated source code in {}'.format(joined_path, reference)) make_reference_dir(reference) @@ -335,10 +437,12 @@ def test_shader(stats, shader, update, keep, opt): if stats and (not vulkan) and (not is_spirv) and (not desktop): cross_stats = get_shader_stats(glsl) - regression_check(shader, glsl, update, keep, opt) + if glsl: + regression_check(shader, glsl, update, keep, opt) if vulkan_glsl: regression_check((shader[0], shader[1] + '.vk'), vulkan_glsl, update, keep, opt) - os.remove(spirv) + + remove_file(spirv) if stats and (not vulkan) and (not is_spirv) and (not desktop): pristine_stats = get_shader_stats(joined_path) @@ -367,40 +471,64 @@ def test_shader_msl(stats, shader, update, keep, opt): # executable from Xcode using args: `--msl --entry main --output msl_path spirv_path`. # print('SPRIV shader: ' + spirv) - if not force_no_external_validation: + if not args.force_no_external_validation: validate_shader_msl(shader, opt) - os.remove(spirv) + remove_file(spirv) def test_shader_hlsl(stats, shader, update, keep, opt): joined_path = os.path.join(shader[0], shader[1]) print('Testing HLSL shader:', joined_path) is_spirv = shader_is_spirv(shader[1]) noopt = shader_is_noopt(shader[1]) - spirv, msl = cross_compile_hlsl(joined_path, is_spirv, opt and (not noopt)) - regression_check(shader, msl, update, keep, opt) - os.remove(spirv) + spirv, hlsl = cross_compile_hlsl(joined_path, is_spirv, opt and (not noopt)) + regression_check(shader, hlsl, update, keep, opt) + remove_file(spirv) -def test_shaders_helper(stats, shader_dir, update, malisc, keep, opt, backend): - for root, dirs, files in os.walk(os.path.join(shader_dir)): +def test_shader_reflect(stats, shader, update, keep, opt): + joined_path = os.path.join(shader[0], shader[1]) + print('Testing shader reflection:', joined_path) + is_spirv = shader_is_spirv(shader[1]) + noopt = shader_is_noopt(shader[1]) + spirv, reflect = cross_compile_reflect(joined_path, is_spirv, opt and (not noopt)) + regression_check_reflect(shader, reflect, update, keep, opt) + remove_file(spirv) + +def test_shader_file(relpath, stats, shader_dir, update, keep, opt, backend): + if backend == 'msl': + test_shader_msl(stats, (shader_dir, relpath), update, keep, opt) + elif backend == 'hlsl': + test_shader_hlsl(stats, (shader_dir, relpath), update, keep, opt) + elif backend == 'reflect': + test_shader_reflect(stats, (shader_dir, relpath), update, keep, opt) + else: + test_shader(stats, (shader_dir, relpath), update, keep, opt) + +def test_shaders_helper(stats): + all_files = [] + for root, dirs, files in os.walk(os.path.join(args.folder)): files = [ f for f in files if not f.startswith(".") ] #ignore system files (esp OSX) for i in files: path = os.path.join(root, i) - relpath = os.path.relpath(path, shader_dir) - if backend == 'msl': - test_shader_msl(stats, (shader_dir, relpath), update, keep, opt) - elif backend == 'hlsl': - test_shader_hlsl(stats, (shader_dir, relpath), update, keep, opt) - else: - test_shader(stats, (shader_dir, relpath), update, keep, opt) + relpath = os.path.relpath(path, args.folder) + all_files.append(relpath) -def test_shaders(shader_dir, update, malisc, keep, opt, backend): - if malisc: + # The child processes in parallel execution mode don't have the proper state for the global args variable, so + # at this point we need to switch to explicit arguments + if args.parallel: + pool = multiprocessing.Pool(multiprocessing.cpu_count()) + pool.map(partial(test_shader_file, stats=stats, shader_dir=args.folder, update=args.update, keep=args.keep, opt=args.opt, backend=backend), all_files) + else: + for i in all_files: + test_shader_file(i, stats, args.folder, args.update, args.keep, args.opt, backend) + +def test_shaders(): + if args.malisc: with open('stats.csv', 'w') as stats: print('Shader,OrigRegs,OrigUniRegs,OrigALUShort,OrigLSShort,OrigTEXShort,OrigALULong,OrigLSLong,OrigTEXLong,CrossRegs,CrossUniRegs,CrossALUShort,CrossLSShort,CrossTEXShort,CrossALULong,CrossLSLong,CrossTEXLong', file = stats) - test_shaders_helper(stats, shader_dir, update, malisc, keep, backend) + test_shaders_helper(stats) else: - test_shaders_helper(None, shader_dir, update, malisc, keep, opt, backend) + test_shaders_helper(None) def main(): parser = argparse.ArgumentParser(description = 'Script for regression testing.') @@ -430,19 +558,35 @@ def main(): parser.add_argument('--opt', action = 'store_true', help = 'Run SPIRV-Tools optimization passes as well.') + parser.add_argument('--reflect', + action = 'store_true', + help = 'Test reflection backend.') + parser.add_argument('--parallel', + action = 'store_true', + help = 'Execute tests in parallel. Useful for doing regression quickly, but bad for debugging and stat output.') + + global args args = parser.parse_args() - if not args.folder: sys.stderr.write('Need shader folder.\n') sys.exit(1) + if (args.parallel and (args.malisc or args.force_no_external_validation or args.update)): + sys.stderr.write('Parallel execution is disabled when using the flags --update, --malisc or --force-no-external-validation\n') + args.parallel = False + if args.msl: print_msl_compiler_version() - global force_no_external_validation - force_no_external_validation = args.force_no_external_validation + global backend + if (args.msl or args.metal): + backend = 'msl' + elif args.hlsl: + backend = 'hlsl' + elif args.reflect: + backend = 'reflect' - test_shaders(args.folder, args.update, args.malisc, args.keep, args.opt, 'msl' if (args.msl or args.metal) else ('hlsl' if args.hlsl else 'glsl')) + test_shaders() if args.malisc: print('Stats in stats.csv!') print('Tests completed!') diff --git a/deps/SPIRV-Cross/test_shaders.sh b/deps/SPIRV-Cross/test_shaders.sh index a3608730b9..8a43afb4df 100755 --- a/deps/SPIRV-Cross/test_shaders.sh +++ b/deps/SPIRV-Cross/test_shaders.sh @@ -9,9 +9,12 @@ echo "Using spirv-opt in: $(which spirv-opt)." ./test_shaders.py shaders || exit 1 ./test_shaders.py shaders --opt || exit 1 +./test_shaders.py shaders-no-opt || exit 1 ./test_shaders.py shaders-msl --msl || exit 1 ./test_shaders.py shaders-msl --msl --opt || exit 1 ./test_shaders.py shaders-msl-no-opt --msl || exit 1 ./test_shaders.py shaders-hlsl --hlsl || exit 1 ./test_shaders.py shaders-hlsl --hlsl --opt || exit 1 +./test_shaders.py shaders-hlsl-no-opt --hlsl || exit 1 +./test_shaders.py shaders-reflection --reflect || exit 1 diff --git a/deps/SPIRV-Cross/tests-other/hlsl_wave_mask.cpp b/deps/SPIRV-Cross/tests-other/hlsl_wave_mask.cpp new file mode 100644 index 0000000000..de11dd9fe0 --- /dev/null +++ b/deps/SPIRV-Cross/tests-other/hlsl_wave_mask.cpp @@ -0,0 +1,73 @@ +// Ad-hoc test that the wave op masks work as expected. +#include +#include + +using namespace glm; + +static uvec4 gl_SubgroupEqMask; +static uvec4 gl_SubgroupGeMask; +static uvec4 gl_SubgroupGtMask; +static uvec4 gl_SubgroupLeMask; +static uvec4 gl_SubgroupLtMask; +using uint4 = uvec4; + +static void test_main(unsigned wave_index) +{ + const auto WaveGetLaneIndex = [&]() { return wave_index; }; + + gl_SubgroupEqMask = 1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96)); + if (WaveGetLaneIndex() >= 32) gl_SubgroupEqMask.x = 0; + if (WaveGetLaneIndex() >= 64 || WaveGetLaneIndex() < 32) gl_SubgroupEqMask.y = 0; + if (WaveGetLaneIndex() >= 96 || WaveGetLaneIndex() < 64) gl_SubgroupEqMask.z = 0; + if (WaveGetLaneIndex() < 96) gl_SubgroupEqMask.w = 0; + gl_SubgroupGeMask = ~((1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u); + if (WaveGetLaneIndex() >= 32) gl_SubgroupGeMask.x = 0u; + if (WaveGetLaneIndex() >= 64) gl_SubgroupGeMask.y = 0u; + if (WaveGetLaneIndex() >= 96) gl_SubgroupGeMask.z = 0u; + if (WaveGetLaneIndex() < 32) gl_SubgroupGeMask.y = ~0u; + if (WaveGetLaneIndex() < 64) gl_SubgroupGeMask.z = ~0u; + if (WaveGetLaneIndex() < 96) gl_SubgroupGeMask.w = ~0u; + uint gt_lane_index = WaveGetLaneIndex() + 1; + gl_SubgroupGtMask = ~((1u << (gt_lane_index - uint4(0, 32, 64, 96))) - 1u); + if (gt_lane_index >= 32) gl_SubgroupGtMask.x = 0u; + if (gt_lane_index >= 64) gl_SubgroupGtMask.y = 0u; + if (gt_lane_index >= 96) gl_SubgroupGtMask.z = 0u; + if (gt_lane_index >= 128) gl_SubgroupGtMask.w = 0u; + if (gt_lane_index < 32) gl_SubgroupGtMask.y = ~0u; + if (gt_lane_index < 64) gl_SubgroupGtMask.z = ~0u; + if (gt_lane_index < 96) gl_SubgroupGtMask.w = ~0u; + uint le_lane_index = WaveGetLaneIndex() + 1; + gl_SubgroupLeMask = (1u << (le_lane_index - uint4(0, 32, 64, 96))) - 1u; + if (le_lane_index >= 32) gl_SubgroupLeMask.x = ~0u; + if (le_lane_index >= 64) gl_SubgroupLeMask.y = ~0u; + if (le_lane_index >= 96) gl_SubgroupLeMask.z = ~0u; + if (le_lane_index >= 128) gl_SubgroupLeMask.w = ~0u; + if (le_lane_index < 32) gl_SubgroupLeMask.y = 0u; + if (le_lane_index < 64) gl_SubgroupLeMask.z = 0u; + if (le_lane_index < 96) gl_SubgroupLeMask.w = 0u; + gl_SubgroupLtMask = (1u << (WaveGetLaneIndex() - uint4(0, 32, 64, 96))) - 1u; + if (WaveGetLaneIndex() >= 32) gl_SubgroupLtMask.x = ~0u; + if (WaveGetLaneIndex() >= 64) gl_SubgroupLtMask.y = ~0u; + if (WaveGetLaneIndex() >= 96) gl_SubgroupLtMask.z = ~0u; + if (WaveGetLaneIndex() < 32) gl_SubgroupLtMask.y = 0u; + if (WaveGetLaneIndex() < 64) gl_SubgroupLtMask.z = 0u; + if (WaveGetLaneIndex() < 96) gl_SubgroupLtMask.w = 0u; +} + +int main() +{ + for (unsigned subgroup_id = 0; subgroup_id < 128; subgroup_id++) + { + test_main(subgroup_id); + + for (unsigned bit = 0; bit < 128; bit++) + { + assert(bool(gl_SubgroupEqMask[bit / 32] & (1u << (bit & 31))) == (bit == subgroup_id)); + assert(bool(gl_SubgroupGtMask[bit / 32] & (1u << (bit & 31))) == (bit > subgroup_id)); + assert(bool(gl_SubgroupGeMask[bit / 32] & (1u << (bit & 31))) == (bit >= subgroup_id)); + assert(bool(gl_SubgroupLtMask[bit / 32] & (1u << (bit & 31))) == (bit < subgroup_id)); + assert(bool(gl_SubgroupLeMask[bit / 32] & (1u << (bit & 31))) == (bit <= subgroup_id)); + } + } +} + diff --git a/deps/SPIRV-Cross/update_test_shaders.sh b/deps/SPIRV-Cross/update_test_shaders.sh index 712c3eec5d..1582c6c3f3 100755 --- a/deps/SPIRV-Cross/update_test_shaders.sh +++ b/deps/SPIRV-Cross/update_test_shaders.sh @@ -9,9 +9,13 @@ echo "Using spirv-opt in: $(which spirv-opt)." ./test_shaders.py shaders --update || exit 1 ./test_shaders.py shaders --update --opt || exit 1 -./test_shaders.py shaders-msl --msl --update || exit 1 -./test_shaders.py shaders-msl --msl --update --opt || exit 1 -./test_shaders.py shaders-msl-no-opt --msl --update || exit 1 -./test_shaders.py shaders-hlsl --hlsl --update || exit 1 -./test_shaders.py shaders-hlsl --hlsl --update --opt || exit 1 +./test_shaders.py shaders-no-opt --update || exit 1 +./test_shaders.py shaders-msl --update --msl || exit 1 +./test_shaders.py shaders-msl --update --msl --opt || exit 1 +./test_shaders.py shaders-msl-no-opt --update --msl || exit 1 +./test_shaders.py shaders-hlsl --update --hlsl || exit 1 +./test_shaders.py shaders-hlsl --update --hlsl --opt || exit 1 +./test_shaders.py shaders-hlsl-no-opt --update --hlsl || exit 1 +./test_shaders.py shaders-reflection --reflect --update || exit 1 + diff --git a/deps/discord-rpc/.clang-format b/deps/discord-rpc/.clang-format new file mode 100644 index 0000000000..1be83906c7 --- /dev/null +++ b/deps/discord-rpc/.clang-format @@ -0,0 +1,92 @@ +--- +AccessModifierOffset: -4 +AlignAfterOpenBracket: true +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: Left +AlignOperands: false +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: InlineOnly +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: true +BinPackArguments: false +BinPackParameters: false +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Stroustrup +BreakBeforeInheritanceComma: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeComma +BreakStringLiterals: true +ColumnLimit: 100 +CommentPragmas: '' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +FixNamespaceComments: true +ForEachMacros: [] +IndentCaseLabels: false +IncludeCategories: + - Regex: '^("|<)stdafx\.h(pp)?("|>)' + Priority: -1 + - Regex: '^<(W|w)indows.h>' + Priority: 1 + - Regex: '^<' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '(_test|_win|_linux|_mac|_ios|_osx|_null)?$' +IndentCaseLabels: false +IndentWidth: 4 +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +PenaltyBreakAssignment: 0 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 9999999 +PointerAlignment: Left +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: true +SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: true +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +TabWidth: 4 +UseTab: Never +--- +Language: Cpp +--- +Language: ObjC +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: false +--- +Language: Java +BasedOnStyle: Google +BreakAfterJavaFieldAnnotations: true +... diff --git a/deps/discord-rpc/.gitignore b/deps/discord-rpc/.gitignore new file mode 100644 index 0000000000..223c07d706 --- /dev/null +++ b/deps/discord-rpc/.gitignore @@ -0,0 +1,5 @@ +/build*/ +/.vscode/ +/thirdparty/ +.vs/ +.DS_Store \ No newline at end of file diff --git a/deps/discord-rpc/.travis.yml b/deps/discord-rpc/.travis.yml new file mode 100644 index 0000000000..5d091317cd --- /dev/null +++ b/deps/discord-rpc/.travis.yml @@ -0,0 +1,47 @@ +language: cpp + +env: + global: + - CLANG_FORMAT_SUFFIX="-dummy" # don't use formatting on Travis, this is + # needed not to use default 3.5 version + # which is too old. + +matrix: + include: + - os: linux + env: MATRIX_EVAL="CC=gcc-5 && CXX=g++-5" + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-5 + - os: linux + env: MATRIX_EVAL="CC=clang-4.0 && CXX=clang++-4.0" + addons: + apt: + sources: + - llvm-toolchain-trusty-4.0 + packages: + - clang-4.0 + - os: linux + env: MATRIX_EVAL="CC=clang-5.0 && CXX=clang++-5.0" + addons: + apt: + sources: + - llvm-toolchain-trusty-5.0 + packages: + - clang-5.0 + - os: osx + osx_image: xcode9 + +# prevent Travis from overwriting our CXX variables +before_install: + - eval "${MATRIX_EVAL}" + - echo $CXX + +script: + - mkdir build + - cd build + - cmake -DCLANG_FORMAT_SUFFIX=$CLANG_FORMAT_SUFFIX --config Release .. + - cmake --build . -- -j2 diff --git a/deps/discord-rpc/CMakeLists.txt b/deps/discord-rpc/CMakeLists.txt new file mode 100644 index 0000000000..5dad9e9f6d --- /dev/null +++ b/deps/discord-rpc/CMakeLists.txt @@ -0,0 +1,56 @@ +cmake_minimum_required (VERSION 3.2.0) +project (DiscordRPC) + +include(GNUInstallDirs) + +option(BUILD_EXAMPLES "Build example apps" ON) + +# format +file(GLOB_RECURSE ALL_SOURCE_FILES + examples/*.cpp examples/*.h examples/*.c + include/*.h + src/*.cpp src/*.h src/*.c +) + +# Set CLANG_FORMAT_SUFFIX if you are using custom clang-format, e.g. clang-format-5.0 +find_program(CLANG_FORMAT_CMD clang-format${CLANG_FORMAT_SUFFIX}) + +if (CLANG_FORMAT_CMD) + add_custom_target( + clangformat + COMMAND ${CLANG_FORMAT_CMD} + -i -style=file -fallback-style=none + ${ALL_SOURCE_FILES} + DEPENDS + ${ALL_SOURCE_FILES} + ) +endif(CLANG_FORMAT_CMD) + +# thirdparty stuff +execute_process( + COMMAND mkdir ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty + ERROR_QUIET +) + +find_file(RAPIDJSONTEST NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH) +if (NOT RAPIDJSONTEST) + message("no rapidjson, download") + set(RJ_TAR_FILE ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/v1.1.0.tar.gz) + file(DOWNLOAD https://github.com/miloyip/rapidjson/archive/v1.1.0.tar.gz ${RJ_TAR_FILE}) + execute_process( + COMMAND ${CMAKE_COMMAND} -E tar xzf ${RJ_TAR_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty + ) + file(REMOVE ${RJ_TAR_FILE}) +endif(NOT RAPIDJSONTEST) + +find_file(RAPIDJSON NAMES rapidjson rapidjson-1.1.0 PATHS ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty CMAKE_FIND_ROOT_PATH_BOTH) + +add_library(rapidjson STATIC IMPORTED ${RAPIDJSON}) + +# add subdirs + +add_subdirectory(src) +if (BUILD_EXAMPLES) + add_subdirectory(examples/send-presence) +endif(BUILD_EXAMPLES) diff --git a/deps/discord-rpc/LICENSE b/deps/discord-rpc/LICENSE new file mode 100644 index 0000000000..17fca3d50f --- /dev/null +++ b/deps/discord-rpc/LICENSE @@ -0,0 +1,19 @@ +Copyright 2017 Discord, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/discord-rpc/README.md b/deps/discord-rpc/README.md new file mode 100644 index 0000000000..011c961755 --- /dev/null +++ b/deps/discord-rpc/README.md @@ -0,0 +1,91 @@ +# Discord RPC + +This is a library for interfacing your game with a locally running Discord desktop client. It's known to work on Windows, macOS, and Linux. You can use the lib directly if you like, or use it as a guide to writing your own if it doesn't suit your game as is. PRs/feedback welcome if you have an improvement everyone might want, or can describe how this doesn't meet your needs. + +Included here are some quick demos that implement the very minimal subset to show current status, and +have callbacks for where a more complete game would do more things (joining, spectating, etc). + +## Documentation + +The most up to date documentation for Rich Presence can always be found on our [developer site](https://discordapp.com/developers/docs/rich-presence/how-to)! If you're interested in rolling your own native implementation of Rich Presence via IPC sockets instead of using our SDK—hey, you've got free time, right?—check out the ["Hard Mode" documentation](https://github.com/discordapp/discord-rpc/blob/master/documentation/hard-mode.md). + +## Basic Usage + +Zeroith, you should be set up to build things because you are a game developer, right? + +First, head on over to the [Discord developers site](https://discordapp.com/developers/applications/me) and make yourself an app. Keep track of `Client ID` -- you'll need it here to pass to the init function. + +### From package + +Download a release package for your platform(s) -- they have subdirs with various prebuilt options, select the one you need add `/include` to your compile includes, `/lib` to your linker paths, and link with `discord-rpc`. For the dynamically linked builds, you'll need to ship the associated file along with your game. + +### From repo + +First-eth, you'll want `CMake`. There's a few different ways to install it on your system, and you should refer to [their website](https://cmake.org/install/). Many package managers provide ways of installing CMake as well. + +To make sure it's installed correctly, type `cmake --version` into your flavor of terminal/cmd. If you get a response with a version number, you're good to go! + +There's a [CMake](https://cmake.org/download/) file that should be able to generate the lib for you; Sometimes I use it like this: +```sh + cd + mkdir build + cd build + cmake .. -DCMAKE_INSTALL_PREFIX= + cmake --build . --config Release --target install +``` +There is a wrapper build script `build.py` that runs `cmake` with a few different options. + +Usually, I run `build.py` to get things started, then use the generated project files as I work on things. It does depend on `click` library, so do a quick `pip install click` to make sure you have it if you want to run `build.py`. + +There are some CMake options you might care about: + +| flag | default | does | +|------|---------|------| +| `ENABLE_IO_THREAD` | `ON` | When enabled, we start up a thread to do io processing, if disabled you should call `Discord_UpdateConnection` yourself. +| `USE_STATIC_CRT` | `OFF` | (Windows) Enable to statically link the CRT, avoiding requiring users install the redistributable package. (The prebuilt binaries enable this option) +| [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/v3.7/variable/BUILD_SHARED_LIBS.html) | `OFF` | Build library as a DLL +| `WARNINGS_AS_ERRORS` | `OFF` | When enabled, compiles with `-Werror` (on *nix platforms). | + +## Continuous Builds + +Why do we have three of these? Three times the fun! + +| CI | badge | +|----|-------| +| TravisCI | [![Build status](https://travis-ci.org/discordapp/discord-rpc.svg?branch=master)](https://travis-ci.org/discordapp/discord-rpc) +| AppVeyor | [![Build status](https://ci.appveyor.com/api/projects/status/qvkoc0w1c4f4b8tj?svg=true)](https://ci.appveyor.com/project/crmarsh/discord-rpc) +| Buildkite (internal) | [![Build status](https://badge.buildkite.com/e103d79d247f6776605a15246352a04b8fd83d69211b836111.svg)](https://buildkite.com/discord/discord-rpc) + +## Sample: send-presence + +This is a text adventure "game" that inits/deinits the connection to Discord, and sends a presence update on each command. + +## Sample: button-clicker + +This is a sample [Unity](https://unity3d.com/) project that wraps a DLL version of the library, and sends presence updates when you click on a button. Run `python build.py unity` in the root directory to build the correct library files and place them in their respective folders. + +## Sample: unrealstatus + +This is a sample [Unreal](https://www.unrealengine.com) project that wraps the DLL version of the library with an Unreal plugin, exposes a blueprint class for interacting with it, and uses that to make a very simple UI. Run `python build.py unreal` in the root directory to build the correct library files and place them in their respective folders. + +## Wrappers and Implementations + +Below is a table of unofficial, community-developed wrappers for and implementations of Rich Presence in various languages. If you would like to have yours added, please make a pull request adding your repository to the table. The repository should include: + +- The code +- A brief ReadMe of how to use it +- A working example + +###### Rich Presence Wrappers and Implementations + +| Name | Language | +|------|----------| +| [DerelictDiscordRPC](https://github.com/voidblaster/DerelictDiscordRPC) | [D](https://dlang.org/) | +| [discord-rpc.jar](https://github.com/Vatuu/discord-rpc "Discord-RPC.jar") | Java | +| [java-discord-rpc](https://github.com/MinnDevelopment/java-discord-rpc) | Java | +| [Discord-IPC](https://github.com/jagrosh/DiscordIPC) | Java | +| [Discord Rich Presence](https://npmjs.org/discord-rich-presence) | JavaScript | +| [drpc4k](https://github.com/Bluexin/drpc4k) | [Kotlin](https://kotlinlang.org/) | +| [lua-discordRPC](https://github.com/pfirsich/lua-discordRPC) | LuaJIT (FFI) | +| [pypresence](https://github.com/qwertyquerty/pypresence) | [Python](https://python.org/) | +| [SwordRPC](https://github.com/Azoy/SwordRPC) | [Swift](https://swift.org) | diff --git a/deps/discord-rpc/appveyor.yml b/deps/discord-rpc/appveyor.yml new file mode 100644 index 0000000000..1c328b8787 --- /dev/null +++ b/deps/discord-rpc/appveyor.yml @@ -0,0 +1,17 @@ +version: '{build}' +install: + - python -m pip install click + +build_script: + - mkdir examples\unrealstatus\Plugins\discordrpc\Binaries\ThirdParty\discordrpcLibrary\Win64 + - python build.py + +artifacts: +- path: builds\install\win32-dynamic + name: win32-dynamic +- path: builds\install\win32-static + name: win32-static +- path: builds\install\win64-dynamic + name: win64-dynamic +- path: builds\install\win64-static + name: win64-static diff --git a/deps/discord-rpc/build.py b/deps/discord-rpc/build.py new file mode 100755 index 0000000000..215d3586b3 --- /dev/null +++ b/deps/discord-rpc/build.py @@ -0,0 +1,304 @@ +#!/usr/bin/env python + +import os +import subprocess +import sys +import shutil +import zipfile +from contextlib import contextmanager +import click + + +def get_platform(): + """ a name for the platform """ + if sys.platform.startswith('win'): + return 'win' + elif sys.platform == 'darwin': + return 'osx' + elif sys.platform.startswith('linux'): + return 'linux' + raise Exception('Unsupported platform ' + sys.platform) + + +SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) +# we use Buildkite which sets this env variable by default +IS_BUILD_MACHINE = os.environ.get('CI', '') == 'true' +PLATFORM = get_platform() +INSTALL_ROOT = os.path.join(SCRIPT_PATH, 'builds', 'install') + + +def get_signtool(): + """ get path to code signing tool """ + if PLATFORM == 'win': + sdk_dir = 'c:\\Program Files (x86)\\Windows Kits\\10' # os.environ['WindowsSdkDir'] + return os.path.join(sdk_dir, 'bin', 'x86', 'signtool.exe') + elif PLATFORM == 'osx': + return '/usr/bin/codesign' + + +@contextmanager +def cd(new_dir): + """ Temporarily change current directory """ + if new_dir: + old_dir = os.getcwd() + os.chdir(new_dir) + yield + if new_dir: + os.chdir(old_dir) + + +def mkdir_p(path): + """ mkdir -p """ + if not os.path.isdir(path): + click.secho('Making ' + path, fg='yellow') + os.makedirs(path) + + +@click.group(invoke_without_command=True) +@click.pass_context +@click.option('--clean', is_flag=True) +def cli(ctx, clean): + """ click wrapper for command line stuff """ + if ctx.invoked_subcommand is None: + ctx.invoke(libs, clean=clean) + if IS_BUILD_MACHINE: + ctx.invoke(sign) + ctx.invoke(archive) + + +@cli.command() +@click.pass_context +def unity(ctx): + """ build just dynamic libs for use in unity project """ + ctx.invoke(libs, clean=False, static=False, shared=True, skip_formatter=True, just_release=True) + BUILDS = [] + + click.echo('--- Copying libs and header into unity example') + UNITY_PROJECT_PATH = os.path.join(SCRIPT_PATH, 'examples', 'button-clicker', 'Assets', 'Plugins') + + if sys.platform.startswith('win'): + LIBRARY_NAME = 'discord-rpc.dll' + BUILD_64_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win64-dynamic', 'src', 'Release') + UNITY_64_DLL_PATH = os.path.join(UNITY_PROJECT_PATH, 'x86_64') + BUILDS.append({BUILD_64_BASE_PATH: UNITY_64_DLL_PATH}) + + BUILD_32_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win32-dynamic', 'src', 'Release') + UNITY_32_DLL_PATH = os.path.join(UNITY_PROJECT_PATH, 'x86') + BUILDS.append({BUILD_32_BASE_PATH: UNITY_32_DLL_PATH}) + + elif sys.platform == 'darwin': + LIBRARY_NAME = 'discord-rpc.bundle' + BUILD_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'osx-dynamic', 'src') + UNITY_DLL_PATH = UNITY_PROJECT_PATH + os.rename( + os.path.join(BUILD_BASE_PATH, 'libdiscord-rpc.dylib'), os.path.join(BUILD_BASE_PATH, 'discord-rpc.bundle')) + + BUILDS.append({BUILD_BASE_PATH: UNITY_DLL_PATH}) + + elif sys.platform.startswith('linux'): + LIBRARY_NAME = 'discord-rpc.so' + BUILD_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'linux-dynamic', 'src') + UNITY_DLL_PATH = os.path.join(UNITY_PROJECT_PATH, 'x86') + os.rename(os.path.join(BUILD_BASE_PATH, 'libdiscord-rpc.so'), os.path.join(BUILD_BASE_PATH, 'discord-rpc.so')) + + BUILDS.append({BUILD_BASE_PATH: UNITY_DLL_PATH}) + + else: + raise Exception('Unsupported platform ' + sys.platform) + + for build in BUILDS: + for i in build: + mkdir_p(build[i]) + shutil.copy(os.path.join(i, LIBRARY_NAME), build[i]) + + +@cli.command() +@click.pass_context +def unreal(ctx): + """ build libs and copy them into the unreal project """ + ctx.invoke(libs, clean=False, static=False, shared=True, skip_formatter=True, just_release=True) + BUILDS = [] + + click.echo('--- Copying libs and header into unreal example') + UNREAL_PROJECT_PATH = os.path.join(SCRIPT_PATH, 'examples', 'unrealstatus', 'Plugins', 'discordrpc') + UNREAL_INCLUDE_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Include') + mkdir_p(UNREAL_INCLUDE_PATH) + shutil.copy(os.path.join(SCRIPT_PATH, 'include', 'discord_rpc.h'), UNREAL_INCLUDE_PATH) + + if sys.platform.startswith('win'): + LIBRARY_NAME = 'discord-rpc.lib' + BUILD_64_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win64-dynamic', 'src', 'Release') + UNREAL_64_DLL_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Win64') + BUILDS.append({BUILD_64_BASE_PATH: UNREAL_64_DLL_PATH}) + + BUILD_32_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win32-dynamic', 'src', 'Release') + UNREAL_32_DLL_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Win32') + BUILDS.append({BUILD_32_BASE_PATH: UNREAL_32_DLL_PATH}) + + elif sys.platform == 'darwin': + LIBRARY_NAME = 'libdiscord-rpc.dylib' + BUILD_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'osx-dynamic', 'src') + UNREAL_DLL_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Mac') + + BUILDS.append({BUILD_BASE_PATH: UNREAL_DLL_PATH}) + + elif sys.platform.startswith('linux'): + LIBRARY_NAME = 'libdiscord-rpc.so' + BUILD_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'linux-dynamic', 'src') + UNREAL_DLL_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Linux') + + BUILDS.append({BUILD_BASE_PATH: UNREAL_DLL_PATH}) + + else: + raise Exception('Unsupported platform ' + sys.platform) + + for build in BUILDS: + for i in build: + mkdir_p(build[i]) + shutil.copy(os.path.join(i, LIBRARY_NAME), build[i]) + + +def build_lib(build_name, generator, options, just_release): + """ Create a dir under builds, run build and install in it """ + build_path = os.path.join(SCRIPT_PATH, 'builds', build_name) + install_path = os.path.join(INSTALL_ROOT, build_name) + mkdir_p(build_path) + mkdir_p(install_path) + with cd(build_path): + initial_cmake = ['cmake', SCRIPT_PATH, '-DCMAKE_INSTALL_PREFIX=%s' % os.path.join('..', 'install', build_name)] + if generator: + initial_cmake.extend(['-G', generator]) + for key in options: + val = options[key] + if type(val) is bool: + val = 'ON' if val else 'OFF' + initial_cmake.append('-D%s=%s' % (key, val)) + click.echo('--- Building ' + build_name) + subprocess.check_call(initial_cmake) + if not just_release: + subprocess.check_call(['cmake', '--build', '.', '--config', 'Debug']) + subprocess.check_call(['cmake', '--build', '.', '--config', 'Release', '--target', 'install']) + + +@cli.command() +def archive(): + """ create zip of install dir """ + click.echo('--- Archiving') + archive_file_path = os.path.join(SCRIPT_PATH, 'builds', 'discord-rpc-%s.zip' % get_platform()) + archive_file = zipfile.ZipFile(archive_file_path, 'w', zipfile.ZIP_DEFLATED) + archive_src_base_path = INSTALL_ROOT + archive_dst_base_path = 'discord-rpc' + with cd(archive_src_base_path): + for path, _, filenames in os.walk('.'): + for fname in filenames: + fpath = os.path.join(path, fname) + dst_path = os.path.normpath(os.path.join(archive_dst_base_path, fpath)) + click.echo('Adding ' + dst_path) + archive_file.write(fpath, dst_path) + + +@cli.command() +def sign(): + """ Do code signing within install directory using our cert """ + tool = get_signtool() + signable_extensions = set() + if PLATFORM == 'win': + signable_extensions.add('.dll') + sign_command_base = [ + tool, + 'sign', + '/n', + 'Discord Inc.', + '/a', + '/tr', + 'http://timestamp.digicert.com/rfc3161', + '/as', + '/td', + 'sha256', + '/fd', + 'sha256', + ] + elif PLATFORM == 'osx': + signable_extensions.add('.dylib') + sign_command_base = [ + tool, + '--keychain', + os.path.expanduser('~/Library/Keychains/login.keychain'), + '-vvvv', + '--deep', + '--force', + '--sign', + 'Developer ID Application: Hammer & Chisel Inc. (53Q6R32WPB)', + ] + else: + click.secho('Not signing things on this platform yet', fg='red') + return + + click.echo('--- Signing') + for path, _, filenames in os.walk(INSTALL_ROOT): + for fname in filenames: + ext = os.path.splitext(fname)[1] + if ext not in signable_extensions: + continue + fpath = os.path.join(path, fname) + click.echo('Sign ' + fpath) + sign_command = sign_command_base + [fpath] + subprocess.check_call(sign_command) + + +@cli.command() +@click.option('--clean', is_flag=True) +@click.option('--static', is_flag=True) +@click.option('--shared', is_flag=True) +@click.option('--skip_formatter', is_flag=True) +@click.option('--just_release', is_flag=True) +def libs(clean, static, shared, skip_formatter, just_release): + """ Do all the builds for this platform """ + if clean: + shutil.rmtree('builds', ignore_errors=True) + + mkdir_p('builds') + + if not (static or shared): + static = True + shared = True + + static_options = {} + dynamic_options = { + 'BUILD_SHARED_LIBS': True, + 'USE_STATIC_CRT': True, + } + + if skip_formatter or IS_BUILD_MACHINE: + static_options['CLANG_FORMAT_SUFFIX'] = 'none' + dynamic_options['CLANG_FORMAT_SUFFIX'] = 'none' + + if IS_BUILD_MACHINE: + just_release = True + static_options['WARNINGS_AS_ERRORS'] = True + dynamic_options['WARNINGS_AS_ERRORS'] = True + + if PLATFORM == 'win': + generator32 = 'Visual Studio 14 2015' + generator64 = 'Visual Studio 14 2015 Win64' + if static: + build_lib('win32-static', generator32, static_options, just_release) + build_lib('win64-static', generator64, static_options, just_release) + if shared: + build_lib('win32-dynamic', generator32, dynamic_options, just_release) + build_lib('win64-dynamic', generator64, dynamic_options, just_release) + elif PLATFORM == 'osx': + if static: + build_lib('osx-static', None, static_options, just_release) + if shared: + build_lib('osx-dynamic', None, dynamic_options, just_release) + elif PLATFORM == 'linux': + if static: + build_lib('linux-static', None, static_options, just_release) + if shared: + build_lib('linux-dynamic', None, dynamic_options, just_release) + + +if __name__ == '__main__': + os.chdir(SCRIPT_PATH) + sys.exit(cli()) diff --git a/deps/discord-rpc/documentation/hard-mode.md b/deps/discord-rpc/documentation/hard-mode.md new file mode 100644 index 0000000000..35042cbcbe --- /dev/null +++ b/deps/discord-rpc/documentation/hard-mode.md @@ -0,0 +1,164 @@ +# Hard Mode: Roll Your Own Client + +Discord's Rich Presence feature is designed as an obfuscated addition to our existing [RPC infrastructure](https://discordapp.com/developers/docs/topics/rpc). The standalone library and header files make it easy for any dev to drop it into their game. + +Our library communicates with Discord over the local Discord RPC socket. We've already done the work in connecting properly, handling disconnects and reconnects, and other RPC intracacies, but those who have done this implementation for our private alpha Voice and Chat SDK can simply make use of the new RPC commands and events to implement Rich Presence. + +## Hark! A warning! + +By committing to an RPC-only integration, you decide to forego the work our library and header file have done for you in the way of error handling, state storage, disconnecting and reconnecting, and other quality of life abstractions. While simply implementing the new RPC command and events will enable Rich Presence for your game, we highly suggest that you do your best to mimic the functionality of the SDK the most that you can. It ensure not only code quality on your part, but also an excellent experience on the part of your players. + +## Application Protocol Registration + +One thing that cannot be explicitly done over RPC is registering an application protocol for your game. If you choose to do an RPC-only implementation, you will have to register your application protocol yourself in the format of `discord-[your_app_id]://`. You can use `Discord_Register()` as a good(?) example of how to properly register an application protocol for use with Discord. For OSX and Linux it is probably simpler to handle the protocol registration as part of your install/packaging. + +## New RPC Command + +The new RPC command for Rich Presence is `SET_ACTIVITY`. The fields are similar to what is outlined in the SDK; we've combined similar fields into objects for the sake of less data on the wire. + +The one major difference is the `party.size` field. It is an array with a size of two. The first element is the current party size, `partySize` from the main documentation. The second element is the maximum party size, `partyMax` from the main documentation. + +Below is a full example of a `SET_ACTIVITY` command. Field restrictions like size are the same as outlined in the main documentation. + +``` +{ + "cmd": "SET_ACTIVITY", + "args": { + "pid": 9999, // Your application's process id - required field + "activity": { + "state": "In a Group", + "details": "Competitive | In a Match", + "timestamps": { + "start": time(nullptr), + "end": time(nullptr) + ((60 * 5) + 23) + }, + "assets": { + "large_image": "numbani_map", + "large_text": "Numbani", + "small_image": "pharah_profile", + "small_text": "Pharah" + }, + "party": { + "id": GameEngine.GetPartyId(), + "size": [3, 6] + }, + "secrets": { + "join": "025ed05c71f639de8bfaa0d679d7c94b2fdce12f", + "spectate": "e7eb30d2ee025ed05c71ea495f770b76454ee4e0", + "match": "4b2fdce12f639de8bfa7e3591b71a0d679d7c93f" + }, + "instance": true + } + }, + "nonce": "647d814a-4cf8-4fbb-948f-898abd24f55b" +} +``` + +## New RPC Events + +The three new RPC events for Rich Presence power the ability to join and spectate your friends' games. + +First is the `ACTIVITY_JOIN` event: + +```json +{ + "cmd": "DISPATCH", + "data": { + "secret": "025ed05c71f639de8bfaa0d679d7c94b2fdce12f" + }, + "evt": "ACTIVITY_JOIN" +} +``` + +Second is the `ACTIVITY_SPECTATE` event: + +```json +{ + "cmd": "DISPATCH", + "data": { + "secret": "e7eb30d2ee025ed05c71ea495f770b76454ee4e0" + }, + "evt": "ACTIVITY_SPECTATE" +} +``` + +And third is the `ACTIVITY_JOIN_REQUEST` event: + +```json +{ + "cmd": "DISPATCH", + "data": { + "user": { + "id": "53908232506183680", + "username": "Mason", + "discriminator": "1337", + "avatar": "a_bab14f271d565501444b2ca3be944b25" + } + }, + "evt": "ACTIVITY_JOIN_REQUEST" +} +``` + +In order to receive these events, you need to [subscribe](https://discordapp.com/developers/docs/topics/rpc#subscribe) to them like so: + +```json +{ + "nonce": "be9a6de3-31d0-4767-a8e9-4818c5690015", + "evt": "ACTIVITY_JOIN", + "cmd": "SUBSCRIBE" +} +``` + +```json +{ + "nonce": "ae9qdde3-31d0-8989-a8e9-dnakwy174he", + "evt": "ACTIVITY_SPECTATE", + "cmd": "SUBSCRIBE" +} +``` + +```json +{ + "nonce": "5dc0c062-98c6-47a0-8922-bbb52e9d6afa", + "evt": "ACTIVITY_JOIN_REQUEST", + "cmd": "SUBSCRIBE" +} +``` + +To unsubscribe from these events, resend with the command `UNSUBSCRIBE` + +## Responding +A discord user will request access to the game. If the ACTIVITY_JOIN_REQUEST has been subscribed too, the ACTIVITY_JOIN_REQUEST event will be sent to the host's game. Accept it with following model: +```json +{ + "nonce": "5dc0c062-98c6-47a0-8922-15aerg126", + "cmd": "SEND_ACTIVITY_JOIN_INVITE", + "args": + { + "user_id": "53908232506183680" + } +} +``` + +To reject the request, use `CLOSE_ACTIVITY_REQUEST`: +```json +{ + "nonce": "5dc0c062-98c6-47a0-8922-dasg256eafg", + "cmd": "CLOSE_ACTIVITY_REQUEST", + "args": + { + "user_id": "53908232506183680" + } +} +``` + +## Notes +Here are just some quick notes to help with some common troubleshooting problems. +* IPC will echo back every command you send as a response. Use this as a lock-step feature to avoid flooding messages. Can be used to validate messages such as the Presence or Subscribes. +* The pipe expects for frames to be written in a single byte array. You cannot do multiple `stream.Write(opcode);` `stream.Write(length);` as it will break the pipe. Instead create a buffer, write the data to the buffer, then send the entire buffer to the stream. +* Discord can be on any pipe ranging from `discord-ipc-0` to `discord-ipc-9`. It is a good idea to try and connect to each one and keeping the first one you connect too. For multiple clients (eg Discord and Canary), you might want to add a feature to manually select the pipe so you can more easily debug the application. +* All enums are `lower_snake_case`. +* The opcode and length in the header are `Little Endian Unsigned Integers (32bits)`. In some languages, you must convert them as they can be architecture specific. +* [Discord Rich Presence How-To](https://discordapp.com/developers/docs/rich-presence/how-to) contains a lot of the information this document doesn't. For example, it will tell you about the response payload. +* In the documentation, DISCORD_REPLY_IGNORE is just implemented the same as DISCORD_REPLY_NO. +* You can test the Join / Spectate feature by enabling them in your profile and whitelisting a test account. Use Canary to run 2 accounts on the same machine. diff --git a/deps/discord-rpc/documentation/images/rp-dev-dashboard.png b/deps/discord-rpc/documentation/images/rp-dev-dashboard.png new file mode 100644 index 0000000000..f246cfb2dd Binary files /dev/null and b/deps/discord-rpc/documentation/images/rp-dev-dashboard.png differ diff --git a/deps/discord-rpc/documentation/images/rp-profile-view.png b/deps/discord-rpc/documentation/images/rp-profile-view.png new file mode 100644 index 0000000000..f9ddc31304 Binary files /dev/null and b/deps/discord-rpc/documentation/images/rp-profile-view.png differ diff --git a/deps/discord-rpc/documentation/images/rp-secret-example.png b/deps/discord-rpc/documentation/images/rp-secret-example.png new file mode 100644 index 0000000000..4ff21b093f Binary files /dev/null and b/deps/discord-rpc/documentation/images/rp-secret-example.png differ diff --git a/deps/discord-rpc/examples/button-clicker/.gitignore b/deps/discord-rpc/examples/button-clicker/.gitignore new file mode 100644 index 0000000000..2695047f5d --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/.gitignore @@ -0,0 +1,8 @@ +/Library/ +/Temp/ +/obj/ +/Assets/Plugins/ +/Assets/Plugins.meta +*.sln +*.csproj +*.userprefs diff --git a/deps/discord-rpc/examples/button-clicker/Assets/DiscordController.cs b/deps/discord-rpc/examples/button-clicker/Assets/DiscordController.cs new file mode 100644 index 0000000000..182d31d8a1 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/DiscordController.cs @@ -0,0 +1,129 @@ +using UnityEngine; + +[System.Serializable] +public class DiscordJoinEvent : UnityEngine.Events.UnityEvent { } + +[System.Serializable] +public class DiscordSpectateEvent : UnityEngine.Events.UnityEvent { } + +[System.Serializable] +public class DiscordJoinRequestEvent : UnityEngine.Events.UnityEvent { } + +public class DiscordController : MonoBehaviour +{ + public DiscordRpc.RichPresence presence = new DiscordRpc.RichPresence(); + public string applicationId; + public string optionalSteamId; + public int callbackCalls; + public int clickCounter; + public DiscordRpc.DiscordUser joinRequest; + public UnityEngine.Events.UnityEvent onConnect; + public UnityEngine.Events.UnityEvent onDisconnect; + public UnityEngine.Events.UnityEvent hasResponded; + public DiscordJoinEvent onJoin; + public DiscordJoinEvent onSpectate; + public DiscordJoinRequestEvent onJoinRequest; + + DiscordRpc.EventHandlers handlers; + + public void OnClick() + { + Debug.Log("Discord: on click!"); + clickCounter++; + + presence.details = string.Format("Button clicked {0} times", clickCounter); + + DiscordRpc.UpdatePresence(presence); + } + + public void RequestRespondYes() + { + Debug.Log("Discord: responding yes to Ask to Join request"); + DiscordRpc.Respond(joinRequest.userId, DiscordRpc.Reply.Yes); + hasResponded.Invoke(); + } + + public void RequestRespondNo() + { + Debug.Log("Discord: responding no to Ask to Join request"); + DiscordRpc.Respond(joinRequest.userId, DiscordRpc.Reply.No); + hasResponded.Invoke(); + } + + public void ReadyCallback(ref DiscordRpc.DiscordUser connectedUser) + { + ++callbackCalls; + Debug.Log(string.Format("Discord: connected to {0}#{1}: {2}", connectedUser.username, connectedUser.discriminator, connectedUser.userId)); + onConnect.Invoke(); + } + + public void DisconnectedCallback(int errorCode, string message) + { + ++callbackCalls; + Debug.Log(string.Format("Discord: disconnect {0}: {1}", errorCode, message)); + onDisconnect.Invoke(); + } + + public void ErrorCallback(int errorCode, string message) + { + ++callbackCalls; + Debug.Log(string.Format("Discord: error {0}: {1}", errorCode, message)); + } + + public void JoinCallback(string secret) + { + ++callbackCalls; + Debug.Log(string.Format("Discord: join ({0})", secret)); + onJoin.Invoke(secret); + } + + public void SpectateCallback(string secret) + { + ++callbackCalls; + Debug.Log(string.Format("Discord: spectate ({0})", secret)); + onSpectate.Invoke(secret); + } + + public void RequestCallback(ref DiscordRpc.DiscordUser request) + { + ++callbackCalls; + Debug.Log(string.Format("Discord: join request {0}#{1}: {2}", request.username, request.discriminator, request.userId)); + joinRequest = request; + onJoinRequest.Invoke(request); + } + + void Start() + { + } + + void Update() + { + DiscordRpc.RunCallbacks(); + } + + void OnEnable() + { + Debug.Log("Discord: init"); + callbackCalls = 0; + + handlers = new DiscordRpc.EventHandlers(); + handlers.readyCallback = ReadyCallback; + handlers.disconnectedCallback += DisconnectedCallback; + handlers.errorCallback += ErrorCallback; + handlers.joinCallback += JoinCallback; + handlers.spectateCallback += SpectateCallback; + handlers.requestCallback += RequestCallback; + DiscordRpc.Initialize(applicationId, ref handlers, true, optionalSteamId); + } + + void OnDisable() + { + Debug.Log("Discord: shutdown"); + DiscordRpc.Shutdown(); + } + + void OnDestroy() + { + + } +} diff --git a/deps/discord-rpc/examples/button-clicker/Assets/DiscordController.cs.meta b/deps/discord-rpc/examples/button-clicker/Assets/DiscordController.cs.meta new file mode 100644 index 0000000000..ee24c7e484 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/DiscordController.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 27f0a5f59ffffa84c86547736e2e730a +timeCreated: 1501697692 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/deps/discord-rpc/examples/button-clicker/Assets/DiscordRpc.cs b/deps/discord-rpc/examples/button-clicker/Assets/DiscordRpc.cs new file mode 100644 index 0000000000..dec1ade0f5 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/DiscordRpc.cs @@ -0,0 +1,220 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +public class DiscordRpc +{ + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ReadyCallback(ref DiscordUser connectedUser); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void DisconnectedCallback(int errorCode, string message); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void ErrorCallback(int errorCode, string message); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void JoinCallback(string secret); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void SpectateCallback(string secret); + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void RequestCallback(ref DiscordUser request); + + public struct EventHandlers + { + public ReadyCallback readyCallback; + public DisconnectedCallback disconnectedCallback; + public ErrorCallback errorCallback; + public JoinCallback joinCallback; + public SpectateCallback spectateCallback; + public RequestCallback requestCallback; + } + + [Serializable, StructLayout(LayoutKind.Sequential)] + public struct RichPresenceStruct + { + public IntPtr state; /* max 128 bytes */ + public IntPtr details; /* max 128 bytes */ + public long startTimestamp; + public long endTimestamp; + public IntPtr largeImageKey; /* max 32 bytes */ + public IntPtr largeImageText; /* max 128 bytes */ + public IntPtr smallImageKey; /* max 32 bytes */ + public IntPtr smallImageText; /* max 128 bytes */ + public IntPtr partyId; /* max 128 bytes */ + public int partySize; + public int partyMax; + public IntPtr matchSecret; /* max 128 bytes */ + public IntPtr joinSecret; /* max 128 bytes */ + public IntPtr spectateSecret; /* max 128 bytes */ + public bool instance; + } + + [Serializable] + public struct DiscordUser + { + public string userId; + public string username; + public string discriminator; + public string avatar; + } + + public enum Reply + { + No = 0, + Yes = 1, + Ignore = 2 + } + + [DllImport("discord-rpc", EntryPoint = "Discord_Initialize", CallingConvention = CallingConvention.Cdecl)] + public static extern void Initialize(string applicationId, ref EventHandlers handlers, bool autoRegister, string optionalSteamId); + + [DllImport("discord-rpc", EntryPoint = "Discord_Shutdown", CallingConvention = CallingConvention.Cdecl)] + public static extern void Shutdown(); + + [DllImport("discord-rpc", EntryPoint = "Discord_RunCallbacks", CallingConvention = CallingConvention.Cdecl)] + public static extern void RunCallbacks(); + + [DllImport("discord-rpc", EntryPoint = "Discord_UpdatePresence", CallingConvention = CallingConvention.Cdecl)] + private static extern void UpdatePresenceNative(ref RichPresenceStruct presence); + + [DllImport("discord-rpc", EntryPoint = "Discord_ClearPresence", CallingConvention = CallingConvention.Cdecl)] + public static extern void ClearPresence(); + + [DllImport("discord-rpc", EntryPoint = "Discord_Respond", CallingConvention = CallingConvention.Cdecl)] + public static extern void Respond(string userId, Reply reply); + + [DllImport("discord-rpc", EntryPoint = "Discord_UpdateHandlers", CallingConvention = CallingConvention.Cdecl)] + public static extern void UpdateHandlers(ref EventHandlers handlers); + + public static void UpdatePresence(RichPresence presence) + { + var presencestruct = presence.GetStruct(); + UpdatePresenceNative(ref presencestruct); + presence.FreeMem(); + } + + public class RichPresence + { + private RichPresenceStruct _presence; + private readonly List _buffers = new List(10); + + public string state; /* max 128 bytes */ + public string details; /* max 128 bytes */ + public long startTimestamp; + public long endTimestamp; + public string largeImageKey; /* max 32 bytes */ + public string largeImageText; /* max 128 bytes */ + public string smallImageKey; /* max 32 bytes */ + public string smallImageText; /* max 128 bytes */ + public string partyId; /* max 128 bytes */ + public int partySize; + public int partyMax; + public string matchSecret; /* max 128 bytes */ + public string joinSecret; /* max 128 bytes */ + public string spectateSecret; /* max 128 bytes */ + public bool instance; + + /// + /// Get the reprensentation of this instance + /// + /// reprensentation of this instance + internal RichPresenceStruct GetStruct() + { + if (_buffers.Count > 0) + { + FreeMem(); + } + + _presence.state = StrToPtr(state, 128); + _presence.details = StrToPtr(details, 128); + _presence.startTimestamp = startTimestamp; + _presence.endTimestamp = endTimestamp; + _presence.largeImageKey = StrToPtr(largeImageKey, 32); + _presence.largeImageText = StrToPtr(largeImageText, 128); + _presence.smallImageKey = StrToPtr(smallImageKey, 32); + _presence.smallImageText = StrToPtr(smallImageText, 128); + _presence.partyId = StrToPtr(partyId, 128); + _presence.partySize = partySize; + _presence.partyMax = partyMax; + _presence.matchSecret = StrToPtr(matchSecret, 128); + _presence.joinSecret = StrToPtr(joinSecret, 128); + _presence.spectateSecret = StrToPtr(spectateSecret, 128); + _presence.instance = instance; + + return _presence; + } + + /// + /// Returns a pointer to a representation of the given string with a size of maxbytes + /// + /// String to convert + /// Max number of bytes to use + /// Pointer to the UTF-8 representation of + private IntPtr StrToPtr(string input, int maxbytes) + { + if (string.IsNullOrEmpty(input)) return IntPtr.Zero; + var convstr = StrClampBytes(input, maxbytes); + var convbytecnt = Encoding.UTF8.GetByteCount(convstr); + var buffer = Marshal.AllocHGlobal(convbytecnt); + _buffers.Add(buffer); + Marshal.Copy(Encoding.UTF8.GetBytes(convstr), 0, buffer, convbytecnt); + return buffer; + } + + /// + /// Convert string to UTF-8 and add null termination + /// + /// string to convert + /// UTF-8 representation of with added null termination + private static string StrToUtf8NullTerm(string toconv) + { + var str = toconv.Trim(); + var bytes = Encoding.Default.GetBytes(str); + if (bytes.Length > 0 && bytes[bytes.Length - 1] != 0) + { + str += "\0\0"; + } + return Encoding.UTF8.GetString(Encoding.UTF8.GetBytes(str)); + } + + /// + /// Clamp the string to the given byte length preserving null termination + /// + /// string to clamp + /// max bytes the resulting string should have (including null termination) + /// null terminated string with a byte length less or equal to + private static string StrClampBytes(string toclamp, int maxbytes) + { + var str = StrToUtf8NullTerm(toclamp); + var strbytes = Encoding.UTF8.GetBytes(str); + + if (strbytes.Length <= maxbytes) + { + return str; + } + + var newstrbytes = new byte[] { }; + Array.Copy(strbytes, 0, newstrbytes, 0, maxbytes - 1); + newstrbytes[newstrbytes.Length - 1] = 0; + newstrbytes[newstrbytes.Length - 2] = 0; + + return Encoding.UTF8.GetString(newstrbytes); + } + + /// + /// Free the allocated memory for conversion to + /// + internal void FreeMem() + { + for (var i = _buffers.Count - 1; i >= 0; i--) + { + Marshal.FreeHGlobal(_buffers[i]); + _buffers.RemoveAt(i); + } + } + } +} \ No newline at end of file diff --git a/deps/discord-rpc/examples/button-clicker/Assets/DiscordRpc.cs.meta b/deps/discord-rpc/examples/button-clicker/Assets/DiscordRpc.cs.meta new file mode 100644 index 0000000000..acd04b102f --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/DiscordRpc.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: b4474a677de9d80409e98c5393ec5b1e +timeCreated: 1501697692 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/deps/discord-rpc/examples/button-clicker/Assets/Editor/BuildHelper.cs b/deps/discord-rpc/examples/button-clicker/Assets/Editor/BuildHelper.cs new file mode 100644 index 0000000000..977745312c --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/Editor/BuildHelper.cs @@ -0,0 +1,101 @@ +using UnityEditor; +using System.Diagnostics; +using System.IO; + +[InitializeOnLoad] +public class ScriptBatch +{ + static ScriptBatch() + { + EnsureDLL(); + } + + public static bool FileExists(string filename) + { + return new FileInfo(filename).Exists; + } + + public static bool RunRpcBuildScript() + { + UnityEngine.Debug.Log("Try to run build script"); + + Process proc = new Process(); +#if UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX + proc.StartInfo.UseShellExecute = false; + // brew installs cmake in /usr/local/bin, which Unity seems to strip from PATH? + string newPath = proc.StartInfo.EnvironmentVariables["PATH"] + ":/usr/local/bin"; + proc.StartInfo.EnvironmentVariables["PATH"] = newPath; +#endif + proc.StartInfo.FileName = "python"; + proc.StartInfo.Arguments = "build.py unity"; + proc.StartInfo.WorkingDirectory = "../.."; + proc.Start(); + proc.WaitForExit(); + return proc.ExitCode == 0; + } + + public static void EnsureDLL() + { + #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN + string[] dstDirs = { "Assets/Plugins", "Assets/Plugins/x86", "Assets/Plugins/x86_64" }; + string[] dstDlls = { "Assets/Plugins/x86/discord-rpc.dll", "Assets/Plugins/x86_64/discord-rpc.dll" }; + string[] srcDlls = { "../../builds/install/win64-dynamic/bin/discord-rpc.dll", "../../builds/install/win64-dynamic/bin/discord-rpc.dll" }; + #elif UNITY_STANDALONE_OSX || UNITY_EDITOR_OSX + string[] dstDirs = { "Assets/Plugins" }; + string[] dstDlls = { "Assets/Plugins/discord-rpc.bundle" }; + string[] srcDlls = { "../../builds/install/osx-dynamic/lib/libdiscord-rpc.dylib" }; + #else + string[] dstDirs = { "Assets/Plugins", "Assets/Plugins/x86", "Assets/Plugins/x86_64" }; + string[] dstDlls = { "Assets/Plugins/discord-rpc.so" }; + string[] srcDlls = { "../../builds/install/linux-dynamic/lib/libdiscord-rpc.so" }; + #endif + + Debug.Assert(dstDlls.Length == srcDlls.Length); + + bool exists = true; + foreach (string fname in dstDlls) + { + if (!FileExists(fname)) + { + exists = false; + break; + } + } + + if (exists) + { + return; + } + + exists = true; + foreach (string fname in srcDlls) + { + if (!FileExists(fname)) + { + exists = false; + break; + } + } + + if (!exists) + { + if (!RunRpcBuildScript()) + { + UnityEngine.Debug.LogError("Build failed"); + return; + } + } + + // make sure the dirs exist + foreach (string dirname in dstDirs) + { + Directory.CreateDirectory(dirname); + } + + // Copy dlls + for (int i = 0; i < dstDlls.Length; ++i) + { + FileUtil.CopyFileOrDirectory(srcDlls[i], dstDlls[i]); + } + } +} \ No newline at end of file diff --git a/deps/discord-rpc/examples/button-clicker/Assets/Editor/BuildHelper.cs.meta b/deps/discord-rpc/examples/button-clicker/Assets/Editor/BuildHelper.cs.meta new file mode 100644 index 0000000000..c14e1e8b94 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/Editor/BuildHelper.cs.meta @@ -0,0 +1,13 @@ +fileFormatVersion: 2 +guid: e5aecc4633e5f594b85eaa39f49bb402 +timeCreated: 1512071254 +licenseType: Free +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/deps/discord-rpc/examples/button-clicker/Assets/main.unity b/deps/discord-rpc/examples/button-clicker/Assets/main.unity new file mode 100644 index 0000000000..c5074d5555 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/main.unity @@ -0,0 +1,1278 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 8 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_TemporalCoherenceThreshold: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 9 + m_Resolution: 2 + m_BakeResolution: 40 + m_TextureWidth: 1024 + m_TextureHeight: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 0 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 500 + m_PVRBounces: 2 + m_PVRFiltering: 0 + m_PVRFilteringMode: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousColorSigma: 1 + m_PVRFilteringAtrousNormalSigma: 1 + m_PVRFilteringAtrousPositionSigma: 1 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &134146651 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 134146656} + - component: {fileID: 134146655} + - component: {fileID: 134146654} + - component: {fileID: 134146653} + - component: {fileID: 134146652} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &134146652 +AudioListener: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 134146651} + m_Enabled: 1 +--- !u!124 &134146653 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 134146651} + m_Enabled: 1 +--- !u!92 &134146654 +Behaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 134146651} + m_Enabled: 1 +--- !u!20 &134146655 +Camera: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 134146651} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 + m_StereoMirrorMode: 0 +--- !u!4 &134146656 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 134146651} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &359174702 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 359174703} + - component: {fileID: 359174705} + - component: {fileID: 359174704} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &359174703 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 359174702} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1032248339} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &359174704 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 359174702} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Button +--- !u!222 &359174705 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 359174702} +--- !u!1 &520806049 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 520806050} + - component: {fileID: 520806052} + - component: {fileID: 520806051} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &520806050 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 520806049} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 806911717} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &520806051 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 520806049} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Yes +--- !u!222 &520806052 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 520806049} +--- !u!1 &657463235 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 657463238} + - component: {fileID: 657463237} + - component: {fileID: 657463236} + m_Layer: 5 + m_Name: IsConnectedLabel + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &657463236 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 657463235} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.89518255, g: 0.9338235, b: 0.23345588, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 24 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 2 + m_MaxSize: 40 + m_Alignment: 0 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: Discord Disconnected +--- !u!222 &657463237 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 657463235} +--- !u!224 &657463238 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 657463235} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1766020814} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 16, y: -19.00003} + m_SizeDelta: {x: 239.20001, y: 37.799988} + m_Pivot: {x: 0, y: 1} +--- !u!1 &806911716 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 806911717} + - component: {fileID: 806911720} + - component: {fileID: 806911719} + - component: {fileID: 806911718} + m_Layer: 5 + m_Name: ButtonRespondYes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &806911717 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 806911716} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 520806050} + m_Father: {fileID: 1766020814} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -129.1, y: -116.3} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &806911718 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 806911716} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 0 + m_TargetGraphic: {fileID: 806911719} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1929635629} + m_MethodName: RequestRespondYes + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &806911719 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 806911716} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &806911720 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 806911716} +--- !u!1 &1032248338 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1032248339} + - component: {fileID: 1032248342} + - component: {fileID: 1032248341} + - component: {fileID: 1032248340} + m_Layer: 5 + m_Name: Button + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1032248339 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1032248338} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 359174703} + m_Father: {fileID: 1766020814} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1032248340 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1032248338} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 1032248341} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1929635629} + m_MethodName: OnClick + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1032248341 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1032248338} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1032248342 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1032248338} +--- !u!1 &1238162986 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1238162987} + - component: {fileID: 1238162989} + - component: {fileID: 1238162988} + m_Layer: 5 + m_Name: JoinRequestInfo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1238162987 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1238162986} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1766020814} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -0.0000085831, y: -66.9} + m_SizeDelta: {x: 323.38, y: 55.29} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1238162988 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1238162986} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 0.88965523, b: 0, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 1 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: No requests yet +--- !u!222 &1238162989 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1238162986} +--- !u!1 &1470895131 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1470895134} + - component: {fileID: 1470895133} + - component: {fileID: 1470895132} + m_Layer: 0 + m_Name: EventSystem + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1470895132 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1470895131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1077351063, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalAxis: Horizontal + m_VerticalAxis: Vertical + m_SubmitButton: Submit + m_CancelButton: Cancel + m_InputActionsPerSecond: 10 + m_RepeatDelay: 0.5 + m_ForceModuleActive: 0 +--- !u!114 &1470895133 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1470895131} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -619905303, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_FirstSelected: {fileID: 0} + m_sendNavigationEvents: 1 + m_DragThreshold: 5 +--- !u!4 &1470895134 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1470895131} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1766020810 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1766020814} + - component: {fileID: 1766020813} + - component: {fileID: 1766020812} + - component: {fileID: 1766020811} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1766020811 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1766020810} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1301386320, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!114 &1766020812 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1766020810} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1980459831, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 +--- !u!223 &1766020813 +Canvas: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1766020810} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!224 &1766020814 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1766020810} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0, y: 0, z: 0} + m_Children: + - {fileID: 1032248339} + - {fileID: 657463238} + - {fileID: 806911717} + - {fileID: 1858885002} + - {fileID: 1238162987} + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 0} +--- !u!1 &1858885001 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1858885002} + - component: {fileID: 1858885005} + - component: {fileID: 1858885004} + - component: {fileID: 1858885003} + m_Layer: 5 + m_Name: ButtonRespondNo + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1858885002 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1858885001} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1958982062} + m_Father: {fileID: 1766020814} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 128.7, y: -116.3} + m_SizeDelta: {x: 160, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1858885003 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1858885001} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 1392445389, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_DisabledTrigger: Disabled + m_Interactable: 0 + m_TargetGraphic: {fileID: 1858885004} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1929635629} + m_MethodName: RequestRespondNo + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, + Culture=neutral, PublicKeyToken=null +--- !u!114 &1858885004 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1858885001} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: -765806418, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 +--- !u!222 &1858885005 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1858885001} +--- !u!1 &1929635628 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1929635630} + - component: {fileID: 1929635629} + m_Layer: 0 + m_Name: Discord + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1929635629 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1929635628} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 27f0a5f59ffffa84c86547736e2e730a, type: 3} + m_Name: + m_EditorClassIdentifier: + presence: + state: Button clicking + details: Best game ever + startTimestamp: 0 + endTimestamp: 0 + largeImageKey: stable-large + largeImageText: + smallImageKey: canary-small + smallImageText: + partyId: abcdefg + partySize: 1 + partyMax: 10 + matchSecret: match_secret + joinSecret: join_secret + spectateSecret: spectate_secret + instance: 1 + applicationId: 345229890980937739 + optionalSteamId: + callbackCalls: 0 + clickCounter: 0 + joinRequest: + userId: + username: + discriminator: + avatar: + onConnect: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 657463236} + m_MethodName: set_text + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Discord Connected + m_BoolArgument: 1 + m_CallState: 2 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + onDisconnect: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 657463236} + m_MethodName: set_text + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Discord Disconnected + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + hasResponded: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1238162988} + m_MethodName: set_text + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: No requests yet + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 806911718} + m_MethodName: set_interactable + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 1858885003} + m_MethodName: set_interactable + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + onJoin: + m_PersistentCalls: + m_Calls: [] + m_TypeName: DiscordJoinEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + onSpectate: + m_PersistentCalls: + m_Calls: [] + m_TypeName: DiscordJoinEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null + onJoinRequest: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 1238162988} + m_MethodName: set_text + m_Mode: 5 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: Someone asked to join! + m_BoolArgument: 0 + m_CallState: 2 + - m_Target: {fileID: 806911718} + m_MethodName: set_interactable + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + - m_Target: {fileID: 1858885003} + m_MethodName: set_interactable + m_Mode: 6 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 1 + m_CallState: 2 + m_TypeName: DiscordJoinRequestEvent, Assembly-CSharp, Version=0.0.0.0, Culture=neutral, + PublicKeyToken=null +--- !u!4 &1929635630 +Transform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1929635628} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1958982061 +GameObject: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + serializedVersion: 5 + m_Component: + - component: {fileID: 1958982062} + - component: {fileID: 1958982064} + - component: {fileID: 1958982063} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1958982062 +RectTransform: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1958982061} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1858885002} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1958982063 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1958982061} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 708705254, guid: f5f67c52d1564df4a8936ccd202a3bd8, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_RaycastTarget: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, + Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + m_FontData: + m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} + m_FontSize: 14 + m_FontStyle: 0 + m_BestFit: 0 + m_MinSize: 10 + m_MaxSize: 40 + m_Alignment: 4 + m_AlignByGeometry: 0 + m_RichText: 1 + m_HorizontalOverflow: 0 + m_VerticalOverflow: 0 + m_LineSpacing: 1 + m_Text: No +--- !u!222 &1958982064 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 0} + m_GameObject: {fileID: 1958982061} diff --git a/deps/discord-rpc/examples/button-clicker/Assets/main.unity.meta b/deps/discord-rpc/examples/button-clicker/Assets/main.unity.meta new file mode 100644 index 0000000000..75654f195f --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/Assets/main.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3b03d21bb25fa494e8694cd6e4b6d769 +timeCreated: 1501696924 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/AudioManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/AudioManager.asset new file mode 100644 index 0000000000..da6112576a --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/AudioManager.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!11 &1 +AudioManager: + m_ObjectHideFlags: 0 + m_Volume: 1 + Rolloff Scale: 1 + Doppler Factor: 1 + Default Speaker Mode: 2 + m_SampleRate: 0 + m_DSPBufferSize: 0 + m_VirtualVoiceCount: 512 + m_RealVoiceCount: 32 + m_SpatializerPlugin: + m_AmbisonicDecoderPlugin: + m_DisableAudio: 0 + m_VirtualizeEffects: 1 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/ClusterInputManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/ClusterInputManager.asset new file mode 100644 index 0000000000..e7886b266a --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/ClusterInputManager.asset @@ -0,0 +1,6 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!236 &1 +ClusterInputManager: + m_ObjectHideFlags: 0 + m_Inputs: [] diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/DynamicsManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/DynamicsManager.asset new file mode 100644 index 0000000000..0be3d787c2 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/DynamicsManager.asset @@ -0,0 +1,20 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!55 &1 +PhysicsManager: + m_ObjectHideFlags: 0 + serializedVersion: 3 + m_Gravity: {x: 0, y: -9.81, z: 0} + m_DefaultMaterial: {fileID: 0} + m_BounceThreshold: 2 + m_SleepThreshold: 0.005 + m_DefaultContactOffset: 0.01 + m_DefaultSolverIterations: 6 + m_DefaultSolverVelocityIterations: 1 + m_QueriesHitBackfaces: 0 + m_QueriesHitTriggers: 1 + m_EnableAdaptiveForce: 0 + m_EnablePCM: 1 + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_AutoSimulation: 1 + m_AutoSyncTransforms: 1 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/EditorBuildSettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/EditorBuildSettings.asset new file mode 100644 index 0000000000..d8fda84837 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/EditorBuildSettings.asset @@ -0,0 +1,10 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1045 &1 +EditorBuildSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Scenes: + - enabled: 1 + path: Assets/main.unity + guid: 3b03d21bb25fa494e8694cd6e4b6d769 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/EditorSettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/EditorSettings.asset new file mode 100644 index 0000000000..c0c814fdf9 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/EditorSettings.asset @@ -0,0 +1,16 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!159 &1 +EditorSettings: + m_ObjectHideFlags: 0 + serializedVersion: 4 + m_ExternalVersionControlSupport: Visible Meta Files + m_SerializationMode: 2 + m_DefaultBehaviorMode: 1 + m_SpritePackerMode: 4 + m_SpritePackerPaddingPower: 1 + m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd + m_ProjectGenerationRootNamespace: + m_UserGeneratedProjectSuffix: + m_CollabEditorSettings: + inProgressEnabled: 1 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/GraphicsSettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/GraphicsSettings.asset new file mode 100644 index 0000000000..74d7b532b0 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/GraphicsSettings.asset @@ -0,0 +1,61 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!30 &1 +GraphicsSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_Deferred: + m_Mode: 1 + m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} + m_DeferredReflections: + m_Mode: 1 + m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} + m_ScreenSpaceShadows: + m_Mode: 1 + m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} + m_LegacyDeferred: + m_Mode: 1 + m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} + m_DepthNormals: + m_Mode: 1 + m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} + m_MotionVectors: + m_Mode: 1 + m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} + m_LightHalo: + m_Mode: 1 + m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} + m_LensFlare: + m_Mode: 1 + m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} + m_AlwaysIncludedShaders: + - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} + m_PreloadedShaders: [] + m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, + type: 0} + m_CustomRenderPipeline: {fileID: 0} + m_TransparencySortMode: 0 + m_TransparencySortAxis: {x: 0, y: 0, z: 1} + m_DefaultRenderingPath: 1 + m_DefaultMobileRenderingPath: 1 + m_TierSettings: [] + m_LightmapStripping: 0 + m_FogStripping: 0 + m_InstancingStripping: 0 + m_LightmapKeepPlain: 1 + m_LightmapKeepDirCombined: 1 + m_LightmapKeepDynamicPlain: 1 + m_LightmapKeepDynamicDirCombined: 1 + m_LightmapKeepShadowMask: 1 + m_LightmapKeepSubtractive: 1 + m_FogKeepLinear: 1 + m_FogKeepExp: 1 + m_FogKeepExp2: 1 + m_AlbedoSwatchInfos: [] + m_LightsUseLinearIntensity: 0 + m_LightsUseColorTemperature: 0 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/InputManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/InputManager.asset new file mode 100644 index 0000000000..17c8f538e2 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/InputManager.asset @@ -0,0 +1,295 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!13 &1 +InputManager: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Axes: + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: left + positiveButton: right + altNegativeButton: a + altPositiveButton: d + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: down + positiveButton: up + altNegativeButton: s + altPositiveButton: w + gravity: 3 + dead: 0.001 + sensitivity: 3 + snap: 1 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left ctrl + altNegativeButton: + altPositiveButton: mouse 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left alt + altNegativeButton: + altPositiveButton: mouse 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: left shift + altNegativeButton: + altPositiveButton: mouse 2 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: space + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse X + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse Y + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Mouse ScrollWheel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0 + sensitivity: 0.1 + snap: 0 + invert: 0 + type: 1 + axis: 2 + joyNum: 0 + - serializedVersion: 3 + m_Name: Horizontal + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 0 + type: 2 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Vertical + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: + altNegativeButton: + altPositiveButton: + gravity: 0 + dead: 0.19 + sensitivity: 1 + snap: 0 + invert: 1 + type: 2 + axis: 1 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire1 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 0 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire2 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 1 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Fire3 + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 2 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Jump + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: joystick button 3 + altNegativeButton: + altPositiveButton: + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: return + altNegativeButton: + altPositiveButton: joystick button 0 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Submit + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: enter + altNegativeButton: + altPositiveButton: space + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 + - serializedVersion: 3 + m_Name: Cancel + descriptiveName: + descriptiveNegativeName: + negativeButton: + positiveButton: escape + altNegativeButton: + altPositiveButton: joystick button 1 + gravity: 1000 + dead: 0.001 + sensitivity: 1000 + snap: 0 + invert: 0 + type: 0 + axis: 0 + joyNum: 0 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/NavMeshAreas.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/NavMeshAreas.asset new file mode 100644 index 0000000000..6dd520f63a --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/NavMeshAreas.asset @@ -0,0 +1,89 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!126 &1 +NavMeshProjectSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + areas: + - name: Walkable + cost: 1 + - name: Not Walkable + cost: 1 + - name: Jump + cost: 2 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + - name: + cost: 1 + m_LastAgentTypeID: -887442657 + m_Settings: + - serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.75 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + m_SettingNames: + - Humanoid diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/NetworkManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/NetworkManager.asset new file mode 100644 index 0000000000..5dc6a831d9 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/NetworkManager.asset @@ -0,0 +1,8 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!149 &1 +NetworkManager: + m_ObjectHideFlags: 0 + m_DebugLevel: 0 + m_Sendrate: 15 + m_AssetToPrefab: {} diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/Physics2DSettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/Physics2DSettings.asset new file mode 100644 index 0000000000..132ee6bc86 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/Physics2DSettings.asset @@ -0,0 +1,37 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!19 &1 +Physics2DSettings: + m_ObjectHideFlags: 0 + serializedVersion: 3 + m_Gravity: {x: 0, y: -9.81} + m_DefaultMaterial: {fileID: 0} + m_VelocityIterations: 8 + m_PositionIterations: 3 + m_VelocityThreshold: 1 + m_MaxLinearCorrection: 0.2 + m_MaxAngularCorrection: 8 + m_MaxTranslationSpeed: 100 + m_MaxRotationSpeed: 360 + m_BaumgarteScale: 0.2 + m_BaumgarteTimeOfImpactScale: 0.75 + m_TimeToSleep: 0.5 + m_LinearSleepTolerance: 0.01 + m_AngularSleepTolerance: 2 + m_DefaultContactOffset: 0.01 + m_AutoSimulation: 1 + m_QueriesHitTriggers: 1 + m_QueriesStartInColliders: 1 + m_ChangeStopsCallbacks: 0 + m_CallbacksOnDisable: 1 + m_AutoSyncTransforms: 1 + m_AlwaysShowColliders: 0 + m_ShowColliderSleep: 1 + m_ShowColliderContacts: 0 + m_ShowColliderAABB: 0 + m_ContactArrowScale: 0.2 + m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} + m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} + m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} + m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} + m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/ProjectSettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/ProjectSettings.asset new file mode 100644 index 0000000000..f60fe83aa9 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/ProjectSettings.asset @@ -0,0 +1,610 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!129 &1 +PlayerSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + productGUID: 5eccc60d3e382a346a65f512d6b81b84 + AndroidProfiler: 0 + AndroidFilterTouchesWhenObscured: 0 + defaultScreenOrientation: 4 + targetDevice: 2 + useOnDemandResources: 0 + accelerometerFrequency: 60 + companyName: Discord Inc. + productName: button-clicker + defaultCursor: {fileID: 0} + cursorHotspot: {x: 0, y: 0} + m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} + m_ShowUnitySplashScreen: 1 + m_ShowUnitySplashLogo: 1 + m_SplashScreenOverlayOpacity: 1 + m_SplashScreenAnimation: 1 + m_SplashScreenLogoStyle: 1 + m_SplashScreenDrawMode: 0 + m_SplashScreenBackgroundAnimationZoom: 1 + m_SplashScreenLogoAnimationZoom: 1 + m_SplashScreenBackgroundLandscapeAspect: 1 + m_SplashScreenBackgroundPortraitAspect: 1 + m_SplashScreenBackgroundLandscapeUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenBackgroundPortraitUvs: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + m_SplashScreenLogos: [] + m_VirtualRealitySplashScreen: {fileID: 0} + m_HolographicTrackingLossScreen: {fileID: 0} + defaultScreenWidth: 1024 + defaultScreenHeight: 768 + defaultScreenWidthWeb: 960 + defaultScreenHeightWeb: 600 + m_StereoRenderingPath: 0 + m_ActiveColorSpace: 0 + m_MTRendering: 1 + m_StackTraceTypes: 010000000100000001000000010000000100000001000000 + iosShowActivityIndicatorOnLoading: -1 + androidShowActivityIndicatorOnLoading: -1 + tizenShowActivityIndicatorOnLoading: -1 + iosAppInBackgroundBehavior: 0 + displayResolutionDialog: 1 + iosAllowHTTPDownload: 1 + allowedAutorotateToPortrait: 1 + allowedAutorotateToPortraitUpsideDown: 1 + allowedAutorotateToLandscapeRight: 1 + allowedAutorotateToLandscapeLeft: 1 + useOSAutorotation: 1 + use32BitDisplayBuffer: 1 + disableDepthAndStencilBuffers: 0 + androidBlitType: 0 + defaultIsFullScreen: 1 + defaultIsNativeResolution: 1 + macRetinaSupport: 1 + runInBackground: 0 + captureSingleScreen: 0 + muteOtherAudioSources: 0 + Prepare IOS For Recording: 0 + Force IOS Speakers When Recording: 0 + submitAnalytics: 1 + usePlayerLog: 1 + bakeCollisionMeshes: 0 + forceSingleInstance: 0 + resizableWindow: 0 + useMacAppStoreValidation: 0 + macAppStoreCategory: public.app-category.games + gpuSkinning: 0 + graphicsJobs: 0 + xboxPIXTextureCapture: 0 + xboxEnableAvatar: 0 + xboxEnableKinect: 0 + xboxEnableKinectAutoTracking: 0 + xboxEnableFitness: 0 + visibleInBackground: 1 + allowFullscreenSwitch: 1 + graphicsJobMode: 0 + macFullscreenMode: 2 + d3d9FullscreenMode: 1 + d3d11FullscreenMode: 1 + xboxSpeechDB: 0 + xboxEnableHeadOrientation: 0 + xboxEnableGuest: 0 + xboxEnablePIXSampling: 0 + metalFramebufferOnly: 0 + n3dsDisableStereoscopicView: 0 + n3dsEnableSharedListOpt: 1 + n3dsEnableVSync: 0 + ignoreAlphaClear: 0 + xboxOneResolution: 0 + xboxOneMonoLoggingLevel: 0 + xboxOneLoggingLevel: 1 + xboxOneDisableEsram: 0 + xboxOnePresentImmediateThreshold: 0 + videoMemoryForVertexBuffers: 0 + psp2PowerMode: 0 + psp2AcquireBGM: 1 + wiiUTVResolution: 0 + wiiUGamePadMSAA: 1 + wiiUSupportsNunchuk: 0 + wiiUSupportsClassicController: 0 + wiiUSupportsBalanceBoard: 0 + wiiUSupportsMotionPlus: 0 + wiiUSupportsProController: 0 + wiiUAllowScreenCapture: 1 + wiiUControllerCount: 0 + m_SupportedAspectRatios: + 4:3: 1 + 5:4: 1 + 16:10: 1 + 16:9: 1 + Others: 1 + bundleVersion: 1.0 + preloadedAssets: [] + metroInputSource: 0 + m_HolographicPauseOnTrackingLoss: 1 + xboxOneDisableKinectGpuReservation: 0 + xboxOneEnable7thCore: 0 + vrSettings: + cardboard: + depthFormat: 0 + enableTransitionView: 0 + daydream: + depthFormat: 0 + useSustainedPerformanceMode: 0 + enableVideoLayer: 0 + useProtectedVideoMemory: 0 + hololens: + depthFormat: 1 + protectGraphicsMemory: 0 + useHDRDisplay: 0 + m_ColorGamuts: 00000000 + targetPixelDensity: 0 + resolutionScalingMode: 0 + androidSupportedAspectRatio: 1 + androidMaxAspectRatio: 2.1 + applicationIdentifier: {} + buildNumber: {} + AndroidBundleVersionCode: 1 + AndroidMinSdkVersion: 16 + AndroidTargetSdkVersion: 0 + AndroidPreferredInstallLocation: 1 + aotOptions: + stripEngineCode: 1 + iPhoneStrippingLevel: 0 + iPhoneScriptCallOptimization: 0 + ForceInternetPermission: 0 + ForceSDCardPermission: 0 + CreateWallpaper: 0 + APKExpansionFiles: 0 + keepLoadedShadersAlive: 0 + StripUnusedMeshComponents: 0 + VertexChannelCompressionMask: + serializedVersion: 2 + m_Bits: 238 + iPhoneSdkVersion: 988 + iOSTargetOSVersionString: 7.0 + tvOSSdkVersion: 0 + tvOSRequireExtendedGameController: 0 + tvOSTargetOSVersionString: 9.0 + uIPrerenderedIcon: 0 + uIRequiresPersistentWiFi: 0 + uIRequiresFullScreen: 1 + uIStatusBarHidden: 1 + uIExitOnSuspend: 0 + uIStatusBarStyle: 0 + iPhoneSplashScreen: {fileID: 0} + iPhoneHighResSplashScreen: {fileID: 0} + iPhoneTallHighResSplashScreen: {fileID: 0} + iPhone47inSplashScreen: {fileID: 0} + iPhone55inPortraitSplashScreen: {fileID: 0} + iPhone55inLandscapeSplashScreen: {fileID: 0} + iPadPortraitSplashScreen: {fileID: 0} + iPadHighResPortraitSplashScreen: {fileID: 0} + iPadLandscapeSplashScreen: {fileID: 0} + iPadHighResLandscapeSplashScreen: {fileID: 0} + appleTVSplashScreen: {fileID: 0} + tvOSSmallIconLayers: [] + tvOSLargeIconLayers: [] + tvOSTopShelfImageLayers: [] + tvOSTopShelfImageWideLayers: [] + iOSLaunchScreenType: 0 + iOSLaunchScreenPortrait: {fileID: 0} + iOSLaunchScreenLandscape: {fileID: 0} + iOSLaunchScreenBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreenFillPct: 100 + iOSLaunchScreenSize: 100 + iOSLaunchScreenCustomXibPath: + iOSLaunchScreeniPadType: 0 + iOSLaunchScreeniPadImage: {fileID: 0} + iOSLaunchScreeniPadBackgroundColor: + serializedVersion: 2 + rgba: 0 + iOSLaunchScreeniPadFillPct: 100 + iOSLaunchScreeniPadSize: 100 + iOSLaunchScreeniPadCustomXibPath: + iOSDeviceRequirements: [] + iOSURLSchemes: [] + iOSBackgroundModes: 0 + iOSMetalForceHardShadows: 0 + metalEditorSupport: 1 + metalAPIValidation: 1 + iOSRenderExtraFrameOnPause: 0 + appleDeveloperTeamID: + iOSManualSigningProvisioningProfileID: + tvOSManualSigningProvisioningProfileID: + appleEnableAutomaticSigning: 0 + AndroidTargetDevice: 0 + AndroidSplashScreenScale: 0 + androidSplashScreen: {fileID: 0} + AndroidKeystoreName: + AndroidKeyaliasName: + AndroidTVCompatibility: 1 + AndroidIsGame: 1 + AndroidEnableTango: 0 + androidEnableBanner: 1 + androidUseLowAccuracyLocation: 0 + m_AndroidBanners: + - width: 320 + height: 180 + banner: {fileID: 0} + androidGamepadSupportLevel: 0 + resolutionDialogBanner: {fileID: 0} + m_BuildTargetIcons: [] + m_BuildTargetBatching: [] + m_BuildTargetGraphicsAPIs: [] + m_BuildTargetVRSettings: [] + m_BuildTargetEnableVuforiaSettings: [] + openGLRequireES31: 0 + openGLRequireES31AEP: 0 + m_TemplateCustomTags: {} + mobileMTRendering: + Android: 1 + iPhone: 1 + tvOS: 1 + wiiUTitleID: 0005000011000000 + wiiUGroupID: 00010000 + wiiUCommonSaveSize: 4096 + wiiUAccountSaveSize: 2048 + wiiUOlvAccessKey: 0 + wiiUTinCode: 0 + wiiUJoinGameId: 0 + wiiUJoinGameModeMask: 0000000000000000 + wiiUCommonBossSize: 0 + wiiUAccountBossSize: 0 + wiiUAddOnUniqueIDs: [] + wiiUMainThreadStackSize: 3072 + wiiULoaderThreadStackSize: 1024 + wiiUSystemHeapSize: 128 + wiiUTVStartupScreen: {fileID: 0} + wiiUGamePadStartupScreen: {fileID: 0} + wiiUDrcBufferDisabled: 0 + wiiUProfilerLibPath: + playModeTestRunnerEnabled: 0 + actionOnDotNetUnhandledException: 1 + enableInternalProfiler: 0 + logObjCUncaughtExceptions: 1 + enableCrashReportAPI: 0 + cameraUsageDescription: + locationUsageDescription: + microphoneUsageDescription: + switchNetLibKey: + switchSocketMemoryPoolSize: 6144 + switchSocketAllocatorPoolSize: 128 + switchSocketConcurrencyLimit: 14 + switchScreenResolutionBehavior: 2 + switchUseCPUProfiler: 0 + switchApplicationID: 0x01004b9000490000 + switchNSODependencies: + switchTitleNames_0: + switchTitleNames_1: + switchTitleNames_2: + switchTitleNames_3: + switchTitleNames_4: + switchTitleNames_5: + switchTitleNames_6: + switchTitleNames_7: + switchTitleNames_8: + switchTitleNames_9: + switchTitleNames_10: + switchTitleNames_11: + switchPublisherNames_0: + switchPublisherNames_1: + switchPublisherNames_2: + switchPublisherNames_3: + switchPublisherNames_4: + switchPublisherNames_5: + switchPublisherNames_6: + switchPublisherNames_7: + switchPublisherNames_8: + switchPublisherNames_9: + switchPublisherNames_10: + switchPublisherNames_11: + switchIcons_0: {fileID: 0} + switchIcons_1: {fileID: 0} + switchIcons_2: {fileID: 0} + switchIcons_3: {fileID: 0} + switchIcons_4: {fileID: 0} + switchIcons_5: {fileID: 0} + switchIcons_6: {fileID: 0} + switchIcons_7: {fileID: 0} + switchIcons_8: {fileID: 0} + switchIcons_9: {fileID: 0} + switchIcons_10: {fileID: 0} + switchIcons_11: {fileID: 0} + switchSmallIcons_0: {fileID: 0} + switchSmallIcons_1: {fileID: 0} + switchSmallIcons_2: {fileID: 0} + switchSmallIcons_3: {fileID: 0} + switchSmallIcons_4: {fileID: 0} + switchSmallIcons_5: {fileID: 0} + switchSmallIcons_6: {fileID: 0} + switchSmallIcons_7: {fileID: 0} + switchSmallIcons_8: {fileID: 0} + switchSmallIcons_9: {fileID: 0} + switchSmallIcons_10: {fileID: 0} + switchSmallIcons_11: {fileID: 0} + switchManualHTML: + switchAccessibleURLs: + switchLegalInformation: + switchMainThreadStackSize: 1048576 + switchPresenceGroupId: 0x01004b9000490000 + switchLogoHandling: 0 + switchReleaseVersion: 0 + switchDisplayVersion: 1.0.0 + switchStartupUserAccount: 0 + switchTouchScreenUsage: 0 + switchSupportedLanguagesMask: 0 + switchLogoType: 0 + switchApplicationErrorCodeCategory: + switchUserAccountSaveDataSize: 0 + switchUserAccountSaveDataJournalSize: 0 + switchApplicationAttribute: 0 + switchCardSpecSize: 4 + switchCardSpecClock: 25 + switchRatingsMask: 0 + switchRatingsInt_0: 0 + switchRatingsInt_1: 0 + switchRatingsInt_2: 0 + switchRatingsInt_3: 0 + switchRatingsInt_4: 0 + switchRatingsInt_5: 0 + switchRatingsInt_6: 0 + switchRatingsInt_7: 0 + switchRatingsInt_8: 0 + switchRatingsInt_9: 0 + switchRatingsInt_10: 0 + switchRatingsInt_11: 0 + switchLocalCommunicationIds_0: 0x01004b9000490000 + switchLocalCommunicationIds_1: + switchLocalCommunicationIds_2: + switchLocalCommunicationIds_3: + switchLocalCommunicationIds_4: + switchLocalCommunicationIds_5: + switchLocalCommunicationIds_6: + switchLocalCommunicationIds_7: + switchParentalControl: 0 + switchAllowsScreenshot: 1 + switchDataLossConfirmation: 0 + switchSupportedNpadStyles: 3 + switchSocketConfigEnabled: 0 + switchTcpInitialSendBufferSize: 32 + switchTcpInitialReceiveBufferSize: 64 + switchTcpAutoSendBufferSizeMax: 256 + switchTcpAutoReceiveBufferSizeMax: 256 + switchUdpSendBufferSize: 9 + switchUdpReceiveBufferSize: 42 + switchSocketBufferEfficiency: 4 + switchSocketInitializeEnabled: 1 + switchNetworkInterfaceManagerInitializeEnabled: 1 + switchPlayerConnectionEnabled: 1 + ps4NPAgeRating: 12 + ps4NPTitleSecret: + ps4NPTrophyPackPath: + ps4ParentalLevel: 11 + ps4ContentID: ED1633-NPXX51362_00-0000000000000000 + ps4Category: 0 + ps4MasterVersion: 01.00 + ps4AppVersion: 01.00 + ps4AppType: 0 + ps4ParamSfxPath: + ps4VideoOutPixelFormat: 0 + ps4VideoOutInitialWidth: 1920 + ps4VideoOutBaseModeInitialWidth: 1920 + ps4VideoOutReprojectionRate: 120 + ps4PronunciationXMLPath: + ps4PronunciationSIGPath: + ps4BackgroundImagePath: + ps4StartupImagePath: + ps4SaveDataImagePath: + ps4SdkOverride: + ps4BGMPath: + ps4ShareFilePath: + ps4ShareOverlayImagePath: + ps4PrivacyGuardImagePath: + ps4NPtitleDatPath: + ps4RemotePlayKeyAssignment: -1 + ps4RemotePlayKeyMappingDir: + ps4PlayTogetherPlayerCount: 0 + ps4EnterButtonAssignment: 1 + ps4ApplicationParam1: 0 + ps4ApplicationParam2: 0 + ps4ApplicationParam3: 0 + ps4ApplicationParam4: 0 + ps4DownloadDataSize: 0 + ps4GarlicHeapSize: 2048 + ps4ProGarlicHeapSize: 2560 + ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ + ps4pnSessions: 1 + ps4pnPresence: 1 + ps4pnFriends: 1 + ps4pnGameCustomData: 1 + playerPrefsSupport: 0 + restrictedAudioUsageRights: 0 + ps4UseResolutionFallback: 0 + ps4ReprojectionSupport: 0 + ps4UseAudio3dBackend: 0 + ps4SocialScreenEnabled: 0 + ps4ScriptOptimizationLevel: 0 + ps4Audio3dVirtualSpeakerCount: 14 + ps4attribCpuUsage: 0 + ps4PatchPkgPath: + ps4PatchLatestPkgPath: + ps4PatchChangeinfoPath: + ps4PatchDayOne: 0 + ps4attribUserManagement: 0 + ps4attribMoveSupport: 0 + ps4attrib3DSupport: 0 + ps4attribShareSupport: 0 + ps4attribExclusiveVR: 0 + ps4disableAutoHideSplash: 0 + ps4videoRecordingFeaturesUsed: 0 + ps4contentSearchFeaturesUsed: 0 + ps4attribEyeToEyeDistanceSettingVR: 0 + ps4IncludedModules: [] + monoEnv: + psp2Splashimage: {fileID: 0} + psp2NPTrophyPackPath: + psp2NPSupportGBMorGJP: 0 + psp2NPAgeRating: 12 + psp2NPTitleDatPath: + psp2NPCommsID: + psp2NPCommunicationsID: + psp2NPCommsPassphrase: + psp2NPCommsSig: + psp2ParamSfxPath: + psp2ManualPath: + psp2LiveAreaGatePath: + psp2LiveAreaBackroundPath: + psp2LiveAreaPath: + psp2LiveAreaTrialPath: + psp2PatchChangeInfoPath: + psp2PatchOriginalPackage: + psp2PackagePassword: F69AzBlax3CF3EDNhm3soLBPh71Yexui + psp2KeystoneFile: + psp2MemoryExpansionMode: 0 + psp2DRMType: 0 + psp2StorageType: 0 + psp2MediaCapacity: 0 + psp2DLCConfigPath: + psp2ThumbnailPath: + psp2BackgroundPath: + psp2SoundPath: + psp2TrophyCommId: + psp2TrophyPackagePath: + psp2PackagedResourcesPath: + psp2SaveDataQuota: 10240 + psp2ParentalLevel: 1 + psp2ShortTitle: Not Set + psp2ContentID: IV0000-ABCD12345_00-0123456789ABCDEF + psp2Category: 0 + psp2MasterVersion: 01.00 + psp2AppVersion: 01.00 + psp2TVBootMode: 0 + psp2EnterButtonAssignment: 2 + psp2TVDisableEmu: 0 + psp2AllowTwitterDialog: 1 + psp2Upgradable: 0 + psp2HealthWarning: 0 + psp2UseLibLocation: 0 + psp2InfoBarOnStartup: 0 + psp2InfoBarColor: 0 + psp2ScriptOptimizationLevel: 0 + psmSplashimage: {fileID: 0} + splashScreenBackgroundSourceLandscape: {fileID: 0} + splashScreenBackgroundSourcePortrait: {fileID: 0} + spritePackerPolicy: + webGLMemorySize: 256 + webGLExceptionSupport: 1 + webGLNameFilesAsHashes: 0 + webGLDataCaching: 0 + webGLDebugSymbols: 0 + webGLEmscriptenArgs: + webGLModulesDirectory: + webGLTemplate: APPLICATION:Default + webGLAnalyzeBuildSize: 0 + webGLUseEmbeddedResources: 0 + webGLUseWasm: 0 + webGLCompressionFormat: 1 + scriptingDefineSymbols: {} + platformArchitecture: {} + scriptingBackend: {} + incrementalIl2cppBuild: {} + additionalIl2CppArgs: + scriptingRuntimeVersion: 0 + apiCompatibilityLevelPerPlatform: {} + m_RenderingPath: 1 + m_MobileRenderingPath: 1 + metroPackageName: button-clicker + metroPackageVersion: + metroCertificatePath: + metroCertificatePassword: + metroCertificateSubject: + metroCertificateIssuer: + metroCertificateNotAfter: 0000000000000000 + metroApplicationDescription: button-clicker + wsaImages: {} + metroTileShortName: + metroCommandLineArgsFile: + metroTileShowName: 0 + metroMediumTileShowName: 0 + metroLargeTileShowName: 0 + metroWideTileShowName: 0 + metroDefaultTileSize: 1 + metroTileForegroundText: 2 + metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} + metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, + a: 1} + metroSplashScreenUseBackgroundColor: 0 + platformCapabilities: {} + metroFTAName: + metroFTAFileTypes: [] + metroProtocolName: + metroCompilationOverrides: 1 + tizenProductDescription: + tizenProductURL: + tizenSigningProfileName: + tizenGPSPermissions: 0 + tizenMicrophonePermissions: 0 + tizenDeploymentTarget: + tizenDeploymentTargetType: -1 + tizenMinOSVersion: 1 + n3dsUseExtSaveData: 0 + n3dsCompressStaticMem: 1 + n3dsExtSaveDataNumber: 0x12345 + n3dsStackSize: 131072 + n3dsTargetPlatform: 2 + n3dsRegion: 7 + n3dsMediaSize: 0 + n3dsLogoStyle: 3 + n3dsTitle: GameName + n3dsProductCode: + n3dsApplicationId: 0xFF3FF + stvDeviceAddress: + stvProductDescription: + stvProductAuthor: + stvProductAuthorEmail: + stvProductLink: + stvProductCategory: 0 + XboxOneProductId: + XboxOneUpdateKey: + XboxOneSandboxId: + XboxOneContentId: + XboxOneTitleId: + XboxOneSCId: + XboxOneGameOsOverridePath: + XboxOnePackagingOverridePath: + XboxOneAppManifestOverridePath: + XboxOnePackageEncryption: 0 + XboxOnePackageUpdateGranularity: 2 + XboxOneDescription: + XboxOneLanguage: + - enus + XboxOneCapability: [] + XboxOneGameRating: {} + XboxOneIsContentPackage: 0 + XboxOneEnableGPUVariability: 0 + XboxOneSockets: {} + XboxOneSplashScreen: {fileID: 0} + XboxOneAllowedProductIds: [] + XboxOnePersistentLocalStorageSize: 0 + xboxOneScriptCompiler: 0 + vrEditorSettings: + daydream: + daydreamIconForeground: {fileID: 0} + daydreamIconBackground: {fileID: 0} + cloudServicesEnabled: {} + facebookSdkVersion: 7.9.4 + apiCompatibilityLevel: 2 + cloudProjectId: + projectName: + organizationId: + cloudEnabled: 0 + enableNativePlatformBackendsForNewInputSystem: 0 + disableOldInputManagerSupport: 0 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/ProjectVersion.txt b/deps/discord-rpc/examples/button-clicker/ProjectSettings/ProjectVersion.txt new file mode 100644 index 0000000000..7a6fffb8be --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/ProjectVersion.txt @@ -0,0 +1 @@ +m_EditorVersion: 2017.2.0f3 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/QualitySettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/QualitySettings.asset new file mode 100644 index 0000000000..86c047f26e --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/QualitySettings.asset @@ -0,0 +1,193 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!47 &1 +QualitySettings: + m_ObjectHideFlags: 0 + serializedVersion: 5 + m_CurrentQuality: 5 + m_QualitySettings: + - serializedVersion: 2 + name: Very Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 15 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 1 + textureQuality: 1 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.3 + maximumLODLevel: 0 + particleRaycastBudget: 4 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Low + pixelLightCount: 0 + shadows: 0 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 0 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 0 + lodBias: 0.4 + maximumLODLevel: 0 + particleRaycastBudget: 16 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Medium + pixelLightCount: 1 + shadows: 1 + shadowResolution: 0 + shadowProjection: 1 + shadowCascades: 1 + shadowDistance: 20 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 0 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 0 + realtimeReflectionProbes: 0 + billboardsFaceCameraPosition: 0 + vSyncCount: 1 + lodBias: 0.7 + maximumLODLevel: 0 + particleRaycastBudget: 64 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: High + pixelLightCount: 2 + shadows: 2 + shadowResolution: 1 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 40 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 2 + textureQuality: 0 + anisotropicTextures: 1 + antiAliasing: 0 + softParticles: 0 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1 + maximumLODLevel: 0 + particleRaycastBudget: 256 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Very High + pixelLightCount: 3 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 2 + shadowDistance: 70 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 1.5 + maximumLODLevel: 0 + particleRaycastBudget: 1024 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + - serializedVersion: 2 + name: Ultra + pixelLightCount: 4 + shadows: 2 + shadowResolution: 2 + shadowProjection: 1 + shadowCascades: 4 + shadowDistance: 150 + shadowNearPlaneOffset: 3 + shadowCascade2Split: 0.33333334 + shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} + shadowmaskMode: 1 + blendWeights: 4 + textureQuality: 0 + anisotropicTextures: 2 + antiAliasing: 2 + softParticles: 1 + softVegetation: 1 + realtimeReflectionProbes: 1 + billboardsFaceCameraPosition: 1 + vSyncCount: 1 + lodBias: 2 + maximumLODLevel: 0 + particleRaycastBudget: 4096 + asyncUploadTimeSlice: 2 + asyncUploadBufferSize: 4 + resolutionScalingFixedDPIFactor: 1 + excludedTargetPlatforms: [] + m_PerPlatformDefaultQuality: + Android: 2 + Nintendo 3DS: 5 + Nintendo Switch: 5 + PS4: 5 + PSM: 5 + PSP2: 2 + Samsung TV: 2 + Standalone: 5 + Tizen: 2 + Web: 5 + WebGL: 3 + WiiU: 5 + Windows Store Apps: 5 + XboxOne: 5 + iPhone: 2 + tvOS: 2 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/TagManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/TagManager.asset new file mode 100644 index 0000000000..1c92a7840e --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/TagManager.asset @@ -0,0 +1,43 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!78 &1 +TagManager: + serializedVersion: 2 + tags: [] + layers: + - Default + - TransparentFX + - Ignore Raycast + - + - Water + - UI + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + m_SortingLayers: + - name: Default + uniqueID: 0 + locked: 0 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/TimeManager.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/TimeManager.asset new file mode 100644 index 0000000000..558a017e1f --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/TimeManager.asset @@ -0,0 +1,9 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!5 &1 +TimeManager: + m_ObjectHideFlags: 0 + Fixed Timestep: 0.02 + Maximum Allowed Timestep: 0.33333334 + m_TimeScale: 1 + Maximum Particle Timestep: 0.03 diff --git a/deps/discord-rpc/examples/button-clicker/ProjectSettings/UnityConnectSettings.asset b/deps/discord-rpc/examples/button-clicker/ProjectSettings/UnityConnectSettings.asset new file mode 100644 index 0000000000..1cc5485b8a --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/ProjectSettings/UnityConnectSettings.asset @@ -0,0 +1,34 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!310 &1 +UnityConnectSettings: + m_ObjectHideFlags: 0 + m_Enabled: 0 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + m_TestInitMode: 0 + CrashReportingSettings: + m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes + m_Enabled: 0 + m_CaptureEditorExceptions: 1 + UnityPurchasingSettings: + m_Enabled: 0 + m_TestMode: 0 + UnityAnalyticsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_TestEventUrl: + m_TestConfigUrl: + UnityAdsSettings: + m_Enabled: 0 + m_InitializeOnStartup: 1 + m_TestMode: 0 + m_EnabledPlatforms: 4294967295 + m_IosGameId: + m_AndroidGameId: + m_GameIds: {} + m_GameId: + PerformanceReportingSettings: + m_Enabled: 0 diff --git a/deps/discord-rpc/examples/button-clicker/UnityPackageManager/manifest.json b/deps/discord-rpc/examples/button-clicker/UnityPackageManager/manifest.json new file mode 100644 index 0000000000..526aca6057 --- /dev/null +++ b/deps/discord-rpc/examples/button-clicker/UnityPackageManager/manifest.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +} diff --git a/deps/discord-rpc/examples/send-presence/CMakeLists.txt b/deps/discord-rpc/examples/send-presence/CMakeLists.txt new file mode 100644 index 0000000000..8a67d472ee --- /dev/null +++ b/deps/discord-rpc/examples/send-presence/CMakeLists.txt @@ -0,0 +1,21 @@ +include_directories(${PROJECT_SOURCE_DIR}/include) +add_executable( + send-presence + MACOSX_BUNDLE + send-presence.c +) +set_target_properties(send-presence PROPERTIES + MACOSX_BUNDLE_BUNDLE_NAME "Send Presence" + MACOSX_BUNDLE_GUI_IDENTIFIER "com.discordapp.examples.send-presence" +) +target_link_libraries(send-presence discord-rpc) + +install( + TARGETS send-presence + RUNTIME + DESTINATION "bin" + CONFIGURATIONS Release + BUNDLE + DESTINATION "bin" + CONFIGURATIONS Release +) \ No newline at end of file diff --git a/deps/discord-rpc/examples/send-presence/send-presence.c b/deps/discord-rpc/examples/send-presence/send-presence.c new file mode 100644 index 0000000000..5449cf86fc --- /dev/null +++ b/deps/discord-rpc/examples/send-presence/send-presence.c @@ -0,0 +1,205 @@ +/* + This is a simple example in C of using the rich presence API asynchronously. +*/ + +#define _CRT_SECURE_NO_WARNINGS /* thanks Microsoft */ + +#include +#include +#include +#include + +#include "discord_rpc.h" + +static const char* APPLICATION_ID = "345229890980937739"; +static int FrustrationLevel = 0; +static int64_t StartTime; +static int SendPresence = 1; + +static int prompt(char* line, size_t size) +{ + int res; + char* nl; + printf("\n> "); + fflush(stdout); + res = fgets(line, (int)size, stdin) ? 1 : 0; + line[size - 1] = 0; + nl = strchr(line, '\n'); + if (nl) { + *nl = 0; + } + return res; +} + +static void updateDiscordPresence() +{ + if (SendPresence) { + char buffer[256]; + DiscordRichPresence discordPresence; + memset(&discordPresence, 0, sizeof(discordPresence)); + discordPresence.state = "West of House"; + sprintf(buffer, "Frustration level: %d", FrustrationLevel); + discordPresence.details = buffer; + discordPresence.startTimestamp = StartTime; + discordPresence.endTimestamp = time(0) + 5 * 60; + discordPresence.largeImageKey = "canary-large"; + discordPresence.smallImageKey = "ptb-small"; + discordPresence.partyId = "party1234"; + discordPresence.partySize = 1; + discordPresence.partyMax = 6; + discordPresence.matchSecret = "xyzzy"; + discordPresence.joinSecret = "join"; + discordPresence.spectateSecret = "look"; + discordPresence.instance = 0; + Discord_UpdatePresence(&discordPresence); + } + else { + Discord_ClearPresence(); + } +} + +static void handleDiscordReady(const DiscordUser* connectedUser) +{ + printf("\nDiscord: connected to user %s#%s - %s\n", + connectedUser->username, + connectedUser->discriminator, + connectedUser->userId); +} + +static void handleDiscordDisconnected(int errcode, const char* message) +{ + printf("\nDiscord: disconnected (%d: %s)\n", errcode, message); +} + +static void handleDiscordError(int errcode, const char* message) +{ + printf("\nDiscord: error (%d: %s)\n", errcode, message); +} + +static void handleDiscordJoin(const char* secret) +{ + printf("\nDiscord: join (%s)\n", secret); +} + +static void handleDiscordSpectate(const char* secret) +{ + printf("\nDiscord: spectate (%s)\n", secret); +} + +static void handleDiscordJoinRequest(const DiscordUser* request) +{ + int response = -1; + char yn[4]; + printf("\nDiscord: join request from %s#%s - %s\n", + request->username, + request->discriminator, + request->userId); + do { + printf("Accept? (y/n)"); + if (!prompt(yn, sizeof(yn))) { + break; + } + + if (!yn[0]) { + continue; + } + + if (yn[0] == 'y') { + response = DISCORD_REPLY_YES; + break; + } + + if (yn[0] == 'n') { + response = DISCORD_REPLY_NO; + break; + } + } while (1); + if (response != -1) { + Discord_Respond(request->userId, response); + } +} + +static void discordInit() +{ + DiscordEventHandlers handlers; + memset(&handlers, 0, sizeof(handlers)); + handlers.ready = handleDiscordReady; + handlers.disconnected = handleDiscordDisconnected; + handlers.errored = handleDiscordError; + handlers.joinGame = handleDiscordJoin; + handlers.spectateGame = handleDiscordSpectate; + handlers.joinRequest = handleDiscordJoinRequest; + Discord_Initialize(APPLICATION_ID, &handlers, 1, NULL); +} + +static void gameLoop() +{ + char line[512]; + char* space; + + StartTime = time(0); + + printf("You are standing in an open field west of a white house.\n"); + while (prompt(line, sizeof(line))) { + if (line[0]) { + if (line[0] == 'q') { + break; + } + + if (line[0] == 't') { + printf("Shutting off Discord.\n"); + Discord_Shutdown(); + continue; + } + + if (line[0] == 'c') { + if (SendPresence) { + printf("Clearing presence information.\n"); + SendPresence = 0; + } + else { + printf("Restoring presence information.\n"); + SendPresence = 1; + } + updateDiscordPresence(); + continue; + } + + if (line[0] == 'y') { + printf("Reinit Discord.\n"); + discordInit(); + continue; + } + + if (time(NULL) & 1) { + printf("I don't understand that.\n"); + } + else { + space = strchr(line, ' '); + if (space) { + *space = 0; + } + printf("I don't know the word \"%s\".\n", line); + } + + ++FrustrationLevel; + + updateDiscordPresence(); + } + +#ifdef DISCORD_DISABLE_IO_THREAD + Discord_UpdateConnection(); +#endif + Discord_RunCallbacks(); + } +} + +int main(int argc, char* argv[]) +{ + discordInit(); + + gameLoop(); + + Discord_Shutdown(); + return 0; +} diff --git a/deps/discord-rpc/examples/unrealstatus/.gitignore b/deps/discord-rpc/examples/unrealstatus/.gitignore new file mode 100644 index 0000000000..bd472d50ae --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/.gitignore @@ -0,0 +1,78 @@ +# Visual Studio 2015 user specific files +.vs/ + +# Visual Studio 2015 database file +*.VC.db + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app +*.ipa + +# These project files can be generated by the engine +*.xcodeproj +*.xcworkspace +*.sln +*.suo +*.opensdf +*.sdf +*.VC.db +*.VC.opendb + +# Precompiled Assets +SourceArt/**/*.png +SourceArt/**/*.tga + +# Binary Files +Binaries/ + +# Builds +Build/* + +# Whitelist PakBlacklist-.txt files +!Build/*/ +Build/*/** +!Build/*/PakBlacklist*.txt + +# Don't ignore icon files in Build +!Build/**/*.ico + +# Built data for maps +*_BuiltData.uasset + +# Configuration files generated by the Editor +Saved/* + +# Compiled source files for the engine to use +Intermediate/ + +# Cache files for the editor to use +DerivedDataCache/ + +# Library headers must be copied automatically by the build script (build.py unreal) +Plugins/DiscordRpc/Source/ThirdParty/DiscordRpcLibrary/Include diff --git a/deps/discord-rpc/examples/unrealstatus/Config/DefaultEditor.ini b/deps/discord-rpc/examples/unrealstatus/Config/DefaultEditor.ini new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/discord-rpc/examples/unrealstatus/Config/DefaultEngine.ini b/deps/discord-rpc/examples/unrealstatus/Config/DefaultEngine.ini new file mode 100644 index 0000000000..84c38f3531 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Config/DefaultEngine.ini @@ -0,0 +1,54 @@ +[URL] + +[/Script/HardwareTargeting.HardwareTargetingSettings] +TargetedHardwareClass=Desktop +AppliedTargetedHardwareClass=Desktop +DefaultGraphicsPerformance=Maximum +AppliedDefaultGraphicsPerformance=Maximum + +[/Script/Engine.EndUserSettings] +bSendAnonymousUsageDataToEpic=False + +[/Script/Engine.PhysicsSettings] +DefaultGravityZ=-980.000000 +DefaultTerminalVelocity=4000.000000 +DefaultFluidFriction=0.300000 +SimulateScratchMemorySize=262144 +RagdollAggregateThreshold=4 +TriangleMeshTriangleMinAreaThreshold=5.000000 +bEnableAsyncScene=False +bEnableShapeSharing=False +bEnablePCM=False +bEnableStabilization=False +bWarnMissingLocks=True +bEnable2DPhysics=False +LockedAxis=Invalid +DefaultDegreesOfFreedom=Full3D +BounceThresholdVelocity=200.000000 +FrictionCombineMode=Average +RestitutionCombineMode=Average +MaxAngularVelocity=3600.000000 +MaxDepenetrationVelocity=0.000000 +ContactOffsetMultiplier=0.010000 +MinContactOffset=0.000100 +MaxContactOffset=1.000000 +bSimulateSkeletalMeshOnDedicatedServer=True +DefaultShapeComplexity=CTF_UseSimpleAndComplex +bDefaultHasComplexCollision=True +bSuppressFaceRemapTable=False +bSupportUVFromHitResults=False +bDisableActiveActors=False +bDisableCCD=False +MaxPhysicsDeltaTime=0.033333 +bSubstepping=False +bSubsteppingAsync=False +MaxSubstepDeltaTime=0.016667 +MaxSubsteps=6 +SyncSceneSmoothingFactor=0.000000 +AsyncSceneSmoothingFactor=0.990000 +InitialAverageFrameRate=0.016667 + +[/Script/EngineSettings.GameMapsSettings] +EditorStartupMap=/Game/ShowTheUILevel.ShowTheUILevel +GameDefaultMap=/Game/ShowTheUILevel.ShowTheUILevel + diff --git a/deps/discord-rpc/examples/unrealstatus/Config/DefaultGame.ini b/deps/discord-rpc/examples/unrealstatus/Config/DefaultGame.ini new file mode 100644 index 0000000000..7b5e2dc2f6 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Config/DefaultGame.ini @@ -0,0 +1,7 @@ +[/Script/EngineSettings.GeneralProjectSettings] +ProjectID=E5977A24492699DF20B8ADBF736AF6C6 +ProjectName=Discord RPC Example +CompanyName=Discord Inc. +Homepage="https://discordapp.com/" +CopyrightNotice= + diff --git a/deps/discord-rpc/examples/unrealstatus/Content/MainScreenBP.uasset b/deps/discord-rpc/examples/unrealstatus/Content/MainScreenBP.uasset new file mode 100644 index 0000000000..e903b53830 Binary files /dev/null and b/deps/discord-rpc/examples/unrealstatus/Content/MainScreenBP.uasset differ diff --git a/deps/discord-rpc/examples/unrealstatus/Content/MouseGameModeBP.uasset b/deps/discord-rpc/examples/unrealstatus/Content/MouseGameModeBP.uasset new file mode 100644 index 0000000000..410af19a9c Binary files /dev/null and b/deps/discord-rpc/examples/unrealstatus/Content/MouseGameModeBP.uasset differ diff --git a/deps/discord-rpc/examples/unrealstatus/Content/MousePlayerControllerBP.uasset b/deps/discord-rpc/examples/unrealstatus/Content/MousePlayerControllerBP.uasset new file mode 100644 index 0000000000..0aaf50ba76 Binary files /dev/null and b/deps/discord-rpc/examples/unrealstatus/Content/MousePlayerControllerBP.uasset differ diff --git a/deps/discord-rpc/examples/unrealstatus/Content/ShowTheUILevel.umap b/deps/discord-rpc/examples/unrealstatus/Content/ShowTheUILevel.umap new file mode 100644 index 0000000000..bc0e5b7c48 Binary files /dev/null and b/deps/discord-rpc/examples/unrealstatus/Content/ShowTheUILevel.umap differ diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/DiscordRpc.uplugin b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/DiscordRpc.uplugin new file mode 100644 index 0000000000..309df129cf --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/DiscordRpc.uplugin @@ -0,0 +1,29 @@ +{ + "FileVersion": 3, + "Version": 1, + "VersionName": "1.0", + "FriendlyName": "Discord RPC", + "Description": "Wrap the Discord RPC library.", + "Category": "Messaging", + "CreatedBy": "Chris Marsh ", + "CreatedByURL": "https://discordapp.com/", + "DocsURL": "", + "MarketplaceURL": "", + "SupportURL": "", + "CanContainContent": true, + "IsBetaVersion": true, + "Installed": false, + "Modules": [ + { + "Name": "DiscordRpc", + "Type": "Runtime", + "LoadingPhase": "PreDefault", + "WhitelistPlatforms" : + [ + "Win64", + "Linux", + "Mac" + ] + } + ] +} \ No newline at end of file diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Resources/Icon128.png b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Resources/Icon128.png new file mode 100644 index 0000000000..8b7f8e1c6a Binary files /dev/null and b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Resources/Icon128.png differ diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Resources/discord.png b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Resources/discord.png new file mode 100644 index 0000000000..8b7f8e1c6a Binary files /dev/null and b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Resources/discord.png differ diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/DiscordRpc.Build.cs b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/DiscordRpc.Build.cs new file mode 100644 index 0000000000..4b06325520 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/DiscordRpc.Build.cs @@ -0,0 +1,57 @@ +// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. + +using UnrealBuildTool; +using System.IO; + +public class DiscordRpc : ModuleRules +{ +#if WITH_FORWARDED_MODULE_RULES_CTOR + public DiscordRpc(ReadOnlyTargetRules Target) : base(Target) +#else + public DiscordRpc(TargetInfo Target) +#endif + { + Definitions.Add("DISCORD_DYNAMIC_LIB=1"); + + PublicIncludePaths.AddRange( + new string[] { + "DiscordRpc/Public" + } + ); + + PrivateIncludePaths.AddRange( + new string[] { + "DiscordRpc/Private" + } + ); + + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "DiscordRpcLibrary" + } + ); + + PrivateDependencyModuleNames.AddRange( + new string[] + { + "CoreUObject", + "Engine", + "Slate", + "SlateCore", + "Projects" + } + ); + + DynamicallyLoadedModuleNames.AddRange( + new string[] + { + // ... add any modules that your module loads dynamically here ... + } + ); + + string BaseDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "Source", "ThirdParty", "DiscordRpcLibrary")); + PublicIncludePaths.Add(Path.Combine(BaseDirectory, "Include")); + } +} \ No newline at end of file diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpc.cpp b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpc.cpp new file mode 100644 index 0000000000..d539dab034 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpc.cpp @@ -0,0 +1,76 @@ +// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. + +#include "DiscordRpcPrivatePCH.h" +#include "IPluginManager.h" +#include "ModuleManager.h" + +#define LOCTEXT_NAMESPACE "FDiscordRpcModule" + +void FDiscordRpcModule::StartupModule() +{ +#if !PLATFORM_LINUX +#if defined(DISCORD_DYNAMIC_LIB) + // Get the base directory of this plugin + FString BaseDir = IPluginManager::Get().FindPlugin("DiscordRpc")->GetBaseDir(); + const FString SDKDir = + FPaths::Combine(*BaseDir, TEXT("Source"), TEXT("ThirdParty"), TEXT("DiscordRpcLibrary")); +#if PLATFORM_WINDOWS + const FString LibName = TEXT("discord-rpc"); + const FString LibDir = FPaths::Combine(*SDKDir, TEXT("Win64")); + if (!LoadDependency(LibDir, LibName, DiscordRpcLibraryHandle)) { + FMessageDialog::Open( + EAppMsgType::Ok, + LOCTEXT(LOCTEXT_NAMESPACE, + "Failed to load DiscordRpc plugin. Plug-in will not be functional.")); + FreeDependency(DiscordRpcLibraryHandle); + } +#elif PLATFORM_MAC + const FString LibName = TEXT("libdiscord-rpc"); + const FString LibDir = FPaths::Combine(*SDKDir, TEXT("Mac")); + if (!LoadDependency(LibDir, LibName, DiscordRpcLibraryHandle)) { + FMessageDialog::Open( + EAppMsgType::Ok, + LOCTEXT(LOCTEXT_NAMESPACE, + "Failed to load DiscordRpc plugin. Plug-in will not be functional.")); + FreeDependency(DiscordRpcLibraryHandle); + } +#endif +#endif +#endif +} + +void FDiscordRpcModule::ShutdownModule() +{ + // Free the dll handle +#if !PLATFORM_LINUX +#if defined(DISCORD_DYNAMIC_LIB) + FreeDependency(DiscordRpcLibraryHandle); +#endif +#endif +} + +bool FDiscordRpcModule::LoadDependency(const FString& Dir, const FString& Name, void*& Handle) +{ + FString Lib = Name + TEXT(".") + FPlatformProcess::GetModuleExtension(); + FString Path = Dir.IsEmpty() ? *Lib : FPaths::Combine(*Dir, *Lib); + + Handle = FPlatformProcess::GetDllHandle(*Path); + + if (Handle == nullptr) { + return false; + } + + return true; +} + +void FDiscordRpcModule::FreeDependency(void*& Handle) +{ + if (Handle != nullptr) { + FPlatformProcess::FreeDllHandle(Handle); + Handle = nullptr; + } +} + +#undef LOCTEXT_NAMESPACE + +IMPLEMENT_MODULE(FDiscordRpcModule, DiscordRpc) \ No newline at end of file diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp new file mode 100644 index 0000000000..95388df0b4 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpcBlueprint.cpp @@ -0,0 +1,171 @@ +#include "DiscordRpcPrivatePCH.h" +#include "DiscordRpcBlueprint.h" +#include "discord_rpc.h" + +DEFINE_LOG_CATEGORY(Discord) + +static UDiscordRpc* self = nullptr; + +static void ReadyHandler(const DiscordUser* connectedUser) +{ + FDiscordUserData ud; + ud.userId = ANSI_TO_TCHAR(connectedUser->userId); + ud.username = ANSI_TO_TCHAR(connectedUser->username); + ud.discriminator = ANSI_TO_TCHAR(connectedUser->discriminator); + ud.avatar = ANSI_TO_TCHAR(connectedUser->avatar); + UE_LOG(Discord, + Log, + TEXT("Discord connected to %s - %s#%s"), + *ud.userId, + *ud.username, + *ud.discriminator); + if (self) { + self->IsConnected = true; + self->OnConnected.Broadcast(ud); + } +} + +static void DisconnectHandler(int errorCode, const char* message) +{ + auto msg = FString(message); + UE_LOG(Discord, Log, TEXT("Discord disconnected (%d): %s"), errorCode, *msg); + if (self) { + self->IsConnected = false; + self->OnDisconnected.Broadcast(errorCode, msg); + } +} + +static void ErroredHandler(int errorCode, const char* message) +{ + auto msg = FString(message); + UE_LOG(Discord, Log, TEXT("Discord error (%d): %s"), errorCode, *msg); + if (self) { + self->OnErrored.Broadcast(errorCode, msg); + } +} + +static void JoinGameHandler(const char* joinSecret) +{ + auto secret = FString(joinSecret); + UE_LOG(Discord, Log, TEXT("Discord join %s"), *secret); + if (self) { + self->OnJoin.Broadcast(secret); + } +} + +static void SpectateGameHandler(const char* spectateSecret) +{ + auto secret = FString(spectateSecret); + UE_LOG(Discord, Log, TEXT("Discord spectate %s"), *secret); + if (self) { + self->OnSpectate.Broadcast(secret); + } +} + +static void JoinRequestHandler(const DiscordUser* request) +{ + FDiscordUserData ud; + ud.userId = ANSI_TO_TCHAR(request->userId); + ud.username = ANSI_TO_TCHAR(request->username); + ud.discriminator = ANSI_TO_TCHAR(request->discriminator); + ud.avatar = ANSI_TO_TCHAR(request->avatar); + UE_LOG(Discord, + Log, + TEXT("Discord join request from %s - %s#%s"), + *ud.userId, + *ud.username, + *ud.discriminator); + if (self) { + self->OnJoinRequest.Broadcast(ud); + } +} + +void UDiscordRpc::Initialize(const FString& applicationId, + bool autoRegister, + const FString& optionalSteamId) +{ + self = this; + IsConnected = false; + DiscordEventHandlers handlers{}; + handlers.ready = ReadyHandler; + handlers.disconnected = DisconnectHandler; + handlers.errored = ErroredHandler; + if (OnJoin.IsBound()) { + handlers.joinGame = JoinGameHandler; + } + if (OnSpectate.IsBound()) { + handlers.spectateGame = SpectateGameHandler; + } + if (OnJoinRequest.IsBound()) { + handlers.joinRequest = JoinRequestHandler; + } + auto appId = StringCast(*applicationId); + auto steamId = StringCast(*optionalSteamId); + Discord_Initialize( + (const char*)appId.Get(), &handlers, autoRegister, (const char*)steamId.Get()); +} + +void UDiscordRpc::Shutdown() +{ + Discord_Shutdown(); + self = nullptr; +} + +void UDiscordRpc::RunCallbacks() +{ + Discord_RunCallbacks(); +} + +void UDiscordRpc::UpdatePresence() +{ + DiscordRichPresence rp{}; + + auto state = StringCast(*RichPresence.state); + rp.state = state.Get(); + + auto details = StringCast(*RichPresence.details); + rp.details = details.Get(); + + auto largeImageKey = StringCast(*RichPresence.largeImageKey); + rp.largeImageKey = largeImageKey.Get(); + + auto largeImageText = StringCast(*RichPresence.largeImageText); + rp.largeImageText = largeImageText.Get(); + + auto smallImageKey = StringCast(*RichPresence.smallImageKey); + rp.smallImageKey = smallImageKey.Get(); + + auto smallImageText = StringCast(*RichPresence.smallImageText); + rp.smallImageText = smallImageText.Get(); + + auto partyId = StringCast(*RichPresence.partyId); + rp.partyId = partyId.Get(); + + auto matchSecret = StringCast(*RichPresence.matchSecret); + rp.matchSecret = matchSecret.Get(); + + auto joinSecret = StringCast(*RichPresence.joinSecret); + rp.joinSecret = joinSecret.Get(); + + auto spectateSecret = StringCast(*RichPresence.spectateSecret); + rp.spectateSecret = spectateSecret.Get(); + rp.startTimestamp = RichPresence.startTimestamp; + rp.endTimestamp = RichPresence.endTimestamp; + rp.partySize = RichPresence.partySize; + rp.partyMax = RichPresence.partyMax; + rp.instance = RichPresence.instance; + + Discord_UpdatePresence(&rp); +} + +void UDiscordRpc::ClearPresence() +{ + Discord_ClearPresence(); +} + +void UDiscordRpc::Respond(const FString& userId, int reply) +{ + UE_LOG(Discord, Log, TEXT("Responding %d to join request from %s"), reply, *userId); + FTCHARToUTF8 utf8_userid(*userId); + Discord_Respond(utf8_userid.Get(), reply); +} diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpcPrivatePCH.h b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpcPrivatePCH.h new file mode 100644 index 0000000000..0c66aba443 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Private/DiscordRpcPrivatePCH.h @@ -0,0 +1,2 @@ +#include "Core.h" +#include "DiscordRpc.h" \ No newline at end of file diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Public/DiscordRpc.h b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Public/DiscordRpc.h new file mode 100644 index 0000000000..727833b091 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Public/DiscordRpc.h @@ -0,0 +1,20 @@ +// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "ModuleManager.h" + +class FDiscordRpcModule : public IModuleInterface { +public: + /** IModuleInterface implementation */ + virtual void StartupModule() override; + virtual void ShutdownModule() override; + +private: + /** Handle to the test dll we will load */ + void* DiscordRpcLibraryHandle; + + /** StartupModule is covered with defines, these functions are the place to put breakpoints */ + static bool LoadDependency(const FString& Dir, const FString& Name, void*& Handle); + static void FreeDependency(void*& Handle); +}; \ No newline at end of file diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Public/DiscordRpcBlueprint.h b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Public/DiscordRpcBlueprint.h new file mode 100644 index 0000000000..2d6521124b --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/DiscordRpc/Public/DiscordRpcBlueprint.h @@ -0,0 +1,159 @@ +#pragma once + +#include "CoreMinimal.h" +#include "Engine.h" +#include "DiscordRpcBlueprint.generated.h" + +// unreal's header tool hates clang-format +// clang-format off + +/** +* Ask to join callback data +*/ +USTRUCT(BlueprintType) +struct FDiscordUserData { + GENERATED_USTRUCT_BODY() + + UPROPERTY(BlueprintReadOnly) + FString userId; + UPROPERTY(BlueprintReadOnly) + FString username; + UPROPERTY(BlueprintReadOnly) + FString discriminator; + UPROPERTY(BlueprintReadOnly) + FString avatar; +}; + + +DECLARE_LOG_CATEGORY_EXTERN(Discord, Log, All); + +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordConnected, const FDiscordUserData&, joinRequest); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDiscordDisconnected, int, errorCode, const FString&, errorMessage); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FDiscordErrored, int, errorCode, const FString&, errorMessage); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordJoin, const FString&, joinSecret); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordSpectate, const FString&, spectateSecret); +DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FDiscordJoinRequest, const FDiscordUserData&, joinRequest); + +// clang-format on + +/** + * Rich presence data + */ +USTRUCT(BlueprintType) +struct FDiscordRichPresence { + GENERATED_USTRUCT_BODY() + + UPROPERTY(BlueprintReadWrite) + FString state; + UPROPERTY(BlueprintReadWrite) + FString details; + // todo, timestamps are 64bit, does that even matter? + UPROPERTY(BlueprintReadWrite) + int startTimestamp; + UPROPERTY(BlueprintReadWrite) + int endTimestamp; + UPROPERTY(BlueprintReadWrite) + FString largeImageKey; + UPROPERTY(BlueprintReadWrite) + FString largeImageText; + UPROPERTY(BlueprintReadWrite) + FString smallImageKey; + UPROPERTY(BlueprintReadWrite) + FString smallImageText; + UPROPERTY(BlueprintReadWrite) + FString partyId; + UPROPERTY(BlueprintReadWrite) + int partySize; + UPROPERTY(BlueprintReadWrite) + int partyMax; + UPROPERTY(BlueprintReadWrite) + FString matchSecret; + UPROPERTY(BlueprintReadWrite) + FString joinSecret; + UPROPERTY(BlueprintReadWrite) + FString spectateSecret; + UPROPERTY(BlueprintReadWrite) + bool instance; +}; + +/** + * + */ +UCLASS(BlueprintType, meta = (DisplayName = "Discord RPC"), Category = "Discord") +class DISCORDRPC_API UDiscordRpc : public UObject { + GENERATED_BODY() + +public: + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "Initialize connection", Keywords = "Discord rpc"), + Category = "Discord") + void Initialize(const FString& applicationId, + bool autoRegister, + const FString& optionalSteamId); + + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "Shut down connection", Keywords = "Discord rpc"), + Category = "Discord") + void Shutdown(); + + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "Check for callbacks", Keywords = "Discord rpc"), + Category = "Discord") + void RunCallbacks(); + + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "Send presence", Keywords = "Discord rpc"), + Category = "Discord") + void UpdatePresence(); + + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "Clear presence", Keywords = "Discord rpc"), + Category = "Discord") + void ClearPresence(); + + UFUNCTION(BlueprintCallable, + meta = (DisplayName = "Respond to join request", Keywords = "Discord rpc"), + Category = "Discord") + void Respond(const FString& userId, int reply); + + UPROPERTY(BlueprintReadOnly, + meta = (DisplayName = "Is Discord connected", Keywords = "Discord rpc"), + Category = "Discord") + bool IsConnected; + + UPROPERTY(BlueprintAssignable, + meta = (DisplayName = "On connection", Keywords = "Discord rpc"), + Category = "Discord") + FDiscordConnected OnConnected; + + UPROPERTY(BlueprintAssignable, + meta = (DisplayName = "On disconnection", Keywords = "Discord rpc"), + Category = "Discord") + FDiscordDisconnected OnDisconnected; + + UPROPERTY(BlueprintAssignable, + meta = (DisplayName = "On error message", Keywords = "Discord rpc"), + Category = "Discord") + FDiscordErrored OnErrored; + + UPROPERTY(BlueprintAssignable, + meta = (DisplayName = "When Discord user presses join", Keywords = "Discord rpc"), + Category = "Discord") + FDiscordJoin OnJoin; + + UPROPERTY(BlueprintAssignable, + meta = (DisplayName = "When Discord user presses spectate", Keywords = "Discord rpc"), + Category = "Discord") + FDiscordSpectate OnSpectate; + + UPROPERTY(BlueprintAssignable, + meta = (DisplayName = "When Discord another user sends a join request", + Keywords = "Discord rpc"), + Category = "Discord") + FDiscordJoinRequest OnJoinRequest; + + UPROPERTY(BlueprintReadWrite, + meta = (DisplayName = "Rich presence info", Keywords = "Discord rpc"), + Category = "Discord") + FDiscordRichPresence RichPresence; +}; diff --git a/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/ThirdParty/DiscordRpcLibrary/DiscordRpcLibrary.Build.cs b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/ThirdParty/DiscordRpcLibrary/DiscordRpcLibrary.Build.cs new file mode 100644 index 0000000000..ba8d83499f --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Plugins/discordrpc/Source/ThirdParty/DiscordRpcLibrary/DiscordRpcLibrary.Build.cs @@ -0,0 +1,59 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using System.IO; +using UnrealBuildTool; + +public class DiscordRpcLibrary : ModuleRules +{ +#if WITH_FORWARDED_MODULE_RULES_CTOR + public DiscordRpcLibrary(ReadOnlyTargetRules Target) : base(Target) +#else + public DiscordRpcLibrary(TargetInfo Target) +#endif + { + Type = ModuleType.External; + Definitions.Add("DISCORD_DYNAMIC_LIB=1"); + + string BaseDirectory = Path.GetFullPath(Path.Combine(ModuleDirectory, "..", "..", "ThirdParty", "DiscordRpcLibrary")); + + if (Target.Platform == UnrealTargetPlatform.Win64) + { + string lib = Path.Combine(BaseDirectory, "Win64"); + + // Include headers + PublicIncludePaths.Add(Path.Combine(BaseDirectory, "Include")); + + // Add the import library + PublicLibraryPaths.Add(lib); + PublicAdditionalLibraries.Add(Path.Combine(lib, "discord-rpc.lib")); + + // Dynamic + RuntimeDependencies.Add(new RuntimeDependency(Path.Combine(lib, "discord-rpc.dll"))); + PublicDelayLoadDLLs.Add("discord-rpc.dll"); + } + else if (Target.Platform == UnrealTargetPlatform.Linux) + { + string lib = Path.Combine(BaseDirectory, "Linux", "x86_64-unknown-linux-gnu"); + + // Include headers + PublicIncludePaths.Add(Path.Combine(BaseDirectory, "Include")); + + // Add the import library + PublicLibraryPaths.Add(lib); + PublicAdditionalLibraries.Add(Path.Combine(lib, "libdiscord-rpc.so")); + RuntimeDependencies.Add(new RuntimeDependency(Path.Combine(lib, "libdiscord-rpc.so"))); + } + else if (Target.Platform == UnrealTargetPlatform.Mac) + { + string lib = Path.Combine(BaseDirectory, "Mac"); + + // Include headers + PublicIncludePaths.Add(Path.Combine(BaseDirectory, "Include")); + + // Add the import library + PublicLibraryPaths.Add(lib); + PublicAdditionalLibraries.Add(Path.Combine(lib, "libdiscord-rpc.dylib")); + RuntimeDependencies.Add(new RuntimeDependency(Path.Combine(lib, "libdiscord-rpc.dylib"))); + } + } +} \ No newline at end of file diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus.Target.cs b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus.Target.cs new file mode 100644 index 0000000000..0c7c3c8889 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus.Target.cs @@ -0,0 +1,14 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class unrealstatusTarget : TargetRules +{ + public unrealstatusTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Game; + + ExtraModuleNames.AddRange( new string[] { "unrealstatus" } ); + } +} diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.Build.cs b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.Build.cs new file mode 100644 index 0000000000..9560370eb0 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.Build.cs @@ -0,0 +1,23 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; + +public class unrealstatus : ModuleRules +{ + public unrealstatus(ReadOnlyTargetRules Target) : base(Target) + { + PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; + + PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" }); + + PrivateDependencyModuleNames.AddRange(new string[] { }); + + // Uncomment if you are using Slate UI + // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" }); + + // Uncomment if you are using online features + // PrivateDependencyModuleNames.Add("OnlineSubsystem"); + + // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true + } +} diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.cpp b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.cpp new file mode 100644 index 0000000000..9dd5388652 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.cpp @@ -0,0 +1,6 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "unrealstatus.h" +#include "Modules/ModuleManager.h" + +IMPLEMENT_PRIMARY_GAME_MODULE(FDefaultGameModuleImpl, unrealstatus, "unrealstatus"); diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.h b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.h new file mode 100644 index 0000000000..73407dd15a --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatus.h @@ -0,0 +1,5 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatusGameModeBase.cpp b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatusGameModeBase.cpp new file mode 100644 index 0000000000..1af30948cd --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatusGameModeBase.cpp @@ -0,0 +1,3 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#include "unrealstatusGameModeBase.h" diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatusGameModeBase.h b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatusGameModeBase.h new file mode 100644 index 0000000000..8dd9bd4740 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatus/unrealstatusGameModeBase.h @@ -0,0 +1,15 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "GameFramework/GameModeBase.h" +#include "unrealstatusGameModeBase.generated.h" + +/** + * + */ +UCLASS() +class UNREALSTATUS_API AunrealstatusGameModeBase : public AGameModeBase { + GENERATED_BODY() +}; diff --git a/deps/discord-rpc/examples/unrealstatus/Source/unrealstatusEditor.Target.cs b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatusEditor.Target.cs new file mode 100644 index 0000000000..2e8ad02286 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/Source/unrealstatusEditor.Target.cs @@ -0,0 +1,14 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +using UnrealBuildTool; +using System.Collections.Generic; + +public class unrealstatusEditorTarget : TargetRules +{ + public unrealstatusEditorTarget(TargetInfo Target) : base(Target) + { + Type = TargetType.Editor; + + ExtraModuleNames.AddRange( new string[] { "unrealstatus" } ); + } +} diff --git a/deps/discord-rpc/examples/unrealstatus/unrealstatus.uproject b/deps/discord-rpc/examples/unrealstatus/unrealstatus.uproject new file mode 100644 index 0000000000..8a4a40b4e2 --- /dev/null +++ b/deps/discord-rpc/examples/unrealstatus/unrealstatus.uproject @@ -0,0 +1,19 @@ +{ + "FileVersion": 3, + "EngineAssociation": "4.18", + "Category": "", + "Description": "", + "Modules": [ + { + "Name": "unrealstatus", + "Type": "Runtime", + "LoadingPhase": "Default" + } + ], + "TargetPlatforms": [ + "LinuxNoEditor", + "MacNoEditor", + "WindowsNoEditor", + "AllDesktop" + ] +} \ No newline at end of file diff --git a/deps/discord-rpc/include/discord_register.h b/deps/discord-rpc/include/discord_register.h new file mode 100644 index 0000000000..16fb42f328 --- /dev/null +++ b/deps/discord-rpc/include/discord_register.h @@ -0,0 +1,26 @@ +#pragma once + +#if defined(DISCORD_DYNAMIC_LIB) +#if defined(_WIN32) +#if defined(DISCORD_BUILDING_SDK) +#define DISCORD_EXPORT __declspec(dllexport) +#else +#define DISCORD_EXPORT __declspec(dllimport) +#endif +#else +#define DISCORD_EXPORT __attribute__((visibility("default"))) +#endif +#else +#define DISCORD_EXPORT +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +DISCORD_EXPORT void Discord_Register(const char* applicationId, const char* command); +DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, const char* steamId); + +#ifdef __cplusplus +} +#endif diff --git a/deps/discord-rpc/include/discord_rpc.h b/deps/discord-rpc/include/discord_rpc.h new file mode 100644 index 0000000000..3e1441e058 --- /dev/null +++ b/deps/discord-rpc/include/discord_rpc.h @@ -0,0 +1,87 @@ +#pragma once +#include + +// clang-format off + +#if defined(DISCORD_DYNAMIC_LIB) +# if defined(_WIN32) +# if defined(DISCORD_BUILDING_SDK) +# define DISCORD_EXPORT __declspec(dllexport) +# else +# define DISCORD_EXPORT __declspec(dllimport) +# endif +# else +# define DISCORD_EXPORT __attribute__((visibility("default"))) +# endif +#else +# define DISCORD_EXPORT +#endif + +// clang-format on + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct DiscordRichPresence { + const char* state; /* max 128 bytes */ + const char* details; /* max 128 bytes */ + int64_t startTimestamp; + int64_t endTimestamp; + const char* largeImageKey; /* max 32 bytes */ + const char* largeImageText; /* max 128 bytes */ + const char* smallImageKey; /* max 32 bytes */ + const char* smallImageText; /* max 128 bytes */ + const char* partyId; /* max 128 bytes */ + int partySize; + int partyMax; + const char* matchSecret; /* max 128 bytes */ + const char* joinSecret; /* max 128 bytes */ + const char* spectateSecret; /* max 128 bytes */ + int8_t instance; +} DiscordRichPresence; + +typedef struct DiscordUser { + const char* userId; + const char* username; + const char* discriminator; + const char* avatar; +} DiscordUser; + +typedef struct DiscordEventHandlers { + void (*ready)(const DiscordUser* request); + void (*disconnected)(int errorCode, const char* message); + void (*errored)(int errorCode, const char* message); + void (*joinGame)(const char* joinSecret); + void (*spectateGame)(const char* spectateSecret); + void (*joinRequest)(const DiscordUser* request); +} DiscordEventHandlers; + +#define DISCORD_REPLY_NO 0 +#define DISCORD_REPLY_YES 1 +#define DISCORD_REPLY_IGNORE 2 + +DISCORD_EXPORT void Discord_Initialize(const char* applicationId, + DiscordEventHandlers* handlers, + int autoRegister, + const char* optionalSteamId); +DISCORD_EXPORT void Discord_Shutdown(void); + +/* checks for incoming messages, dispatches callbacks */ +DISCORD_EXPORT void Discord_RunCallbacks(void); + +/* If you disable the lib starting its own io thread, you'll need to call this from your own */ +#ifdef DISCORD_DISABLE_IO_THREAD +DISCORD_EXPORT void Discord_UpdateConnection(void); +#endif + +DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence); +DISCORD_EXPORT void Discord_ClearPresence(void); + +DISCORD_EXPORT void Discord_Respond(const char* userid, /* DISCORD_REPLY_ */ int reply); + +DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* handlers); + +#ifdef __cplusplus +} /* extern "C" */ +#endif diff --git a/deps/discord-rpc/src/CMakeLists.txt b/deps/discord-rpc/src/CMakeLists.txt new file mode 100644 index 0000000000..f9ec2503d2 --- /dev/null +++ b/deps/discord-rpc/src/CMakeLists.txt @@ -0,0 +1,142 @@ +include_directories(${PROJECT_SOURCE_DIR}/include) + +option(ENABLE_IO_THREAD "Start up a separate I/O thread, otherwise I'd need to call an update function" ON) +option(USE_STATIC_CRT "Use /MT[d] for dynamic library" OFF) +option(WARNINGS_AS_ERRORS "When enabled, compiles with `-Werror` (on *nix platforms)." OFF) + +set(CMAKE_CXX_STANDARD 14) + +set(BASE_RPC_SRC + ${PROJECT_SOURCE_DIR}/include/discord_rpc.h + discord_rpc.cpp + ${PROJECT_SOURCE_DIR}/include/discord_register.h + rpc_connection.h + rpc_connection.cpp + serialization.h + serialization.cpp + connection.h + backoff.h + msg_queue.h +) + +if (${BUILD_SHARED_LIBS}) + if(WIN32) + set(BASE_RPC_SRC ${BASE_RPC_SRC} dllmain.cpp) + endif(WIN32) +endif(${BUILD_SHARED_LIBS}) + +if(WIN32) + add_definitions(-DDISCORD_WINDOWS) + set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_win.cpp discord_register_win.cpp) + add_library(discord-rpc ${BASE_RPC_SRC}) + if (MSVC) + if(USE_STATIC_CRT) + foreach(CompilerFlag + CMAKE_CXX_FLAGS + CMAKE_CXX_FLAGS_DEBUG + CMAKE_CXX_FLAGS_RELEASE + CMAKE_C_FLAGS + CMAKE_C_FLAGS_DEBUG + CMAKE_C_FLAGS_RELEASE) + string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}") + endforeach() + endif(USE_STATIC_CRT) + target_compile_options(discord-rpc PRIVATE /EHsc + /Wall + /wd4100 # unreferenced formal parameter + /wd4514 # unreferenced inline + /wd4625 # copy constructor deleted + /wd5026 # move constructor deleted + /wd4626 # move assignment operator deleted + /wd4668 # not defined preprocessor macro + /wd4710 # function not inlined + /wd4711 # function was inlined + /wd4820 # structure padding + /wd4946 # reinterpret_cast used between related classes + /wd5027 # move assignment operator was implicitly defined as deleted + ) + endif(MSVC) + target_link_libraries(discord-rpc PRIVATE psapi advapi32) +endif(WIN32) + +if(UNIX) + set(BASE_RPC_SRC ${BASE_RPC_SRC} connection_unix.cpp) + + if (APPLE) + add_definitions(-DDISCORD_OSX) + set(BASE_RPC_SRC ${BASE_RPC_SRC} discord_register_osx.m) + else (APPLE) + add_definitions(-DDISCORD_LINUX) + set(BASE_RPC_SRC ${BASE_RPC_SRC} discord_register_linux.cpp) + endif(APPLE) + + add_library(discord-rpc ${BASE_RPC_SRC}) + target_link_libraries(discord-rpc PUBLIC pthread) + target_compile_options(discord-rpc PRIVATE + -g + -Wall + -Wextra + -Wpedantic + ) + + if (${WARNINGS_AS_ERRORS}) + target_compile_options(discord-rpc PRIVATE -Werror) + endif (${WARNINGS_AS_ERRORS}) + + target_compile_options(discord-rpc PRIVATE + -Wno-unknown-pragmas # pragma push thing doesn't work on clang + -Wno-old-style-cast # it's fine + -Wno-c++98-compat # that was almost 2 decades ago + -Wno-c++98-compat-pedantic + -Wno-missing-noreturn + -Wno-padded # structure padding + -Wno-covered-switch-default + -Wno-exit-time-destructors # not sure about these + -Wno-global-constructors + ) + + if (${BUILD_SHARED_LIBS}) + target_compile_options(discord-rpc PRIVATE -fPIC) + endif (${BUILD_SHARED_LIBS}) + + if (APPLE) + target_link_libraries(discord-rpc PRIVATE "-framework AppKit") + endif (APPLE) +endif(UNIX) + +target_include_directories(discord-rpc PRIVATE ${RAPIDJSON}/include) + +if (NOT ${ENABLE_IO_THREAD}) + target_compile_definitions(discord-rpc PUBLIC -DDISCORD_DISABLE_IO_THREAD) +endif (NOT ${ENABLE_IO_THREAD}) + +if (${BUILD_SHARED_LIBS}) + target_compile_definitions(discord-rpc PUBLIC -DDISCORD_DYNAMIC_LIB) + target_compile_definitions(discord-rpc PRIVATE -DDISCORD_BUILDING_SDK) +endif(${BUILD_SHARED_LIBS}) + +if (CLANG_FORMAT_CMD) + add_dependencies(discord-rpc clangformat) +endif(CLANG_FORMAT_CMD) + +# install + +install( + TARGETS discord-rpc + EXPORT "discord-rpc" + RUNTIME + DESTINATION "${CMAKE_INSTALL_BINDIR}" + LIBRARY + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE + DESTINATION "${CMAKE_INSTALL_LIBDIR}" + INCLUDES + DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) + +install( + FILES + "../include/discord_rpc.h" + "../include/discord_register.h" + DESTINATION "include" +) diff --git a/deps/discord-rpc/src/backoff.h b/deps/discord-rpc/src/backoff.h new file mode 100644 index 0000000000..a3e736fb7b --- /dev/null +++ b/deps/discord-rpc/src/backoff.h @@ -0,0 +1,40 @@ +#pragma once + +#include +#include +#include +#include + +struct Backoff { + int64_t minAmount; + int64_t maxAmount; + int64_t current; + int fails; + std::mt19937_64 randGenerator; + std::uniform_real_distribution<> randDistribution; + + double rand01() { return randDistribution(randGenerator); } + + Backoff(int64_t min, int64_t max) + : minAmount(min) + , maxAmount(max) + , current(min) + , fails(0) + , randGenerator((uint64_t)time(0)) + { + } + + void reset() + { + fails = 0; + current = minAmount; + } + + int64_t nextDelay() + { + ++fails; + int64_t delay = (int64_t)((double)current * 2.0 * rand01()); + current = std::min(current + delay, maxAmount); + return current; + } +}; diff --git a/deps/discord-rpc/src/connection.h b/deps/discord-rpc/src/connection.h new file mode 100644 index 0000000000..a8f99b9f10 --- /dev/null +++ b/deps/discord-rpc/src/connection.h @@ -0,0 +1,19 @@ +#pragma once + +// This is to wrap the platform specific kinds of connect/read/write. + +#include +#include + +// not really connectiony, but need per-platform +int GetProcessId(); + +struct BaseConnection { + static BaseConnection* Create(); + static void Destroy(BaseConnection*&); + bool isOpen{false}; + bool Open(); + bool Close(); + bool Write(const void* data, size_t length); + bool Read(void* data, size_t length); +}; diff --git a/deps/discord-rpc/src/connection_unix.cpp b/deps/discord-rpc/src/connection_unix.cpp new file mode 100644 index 0000000000..6fe359ea4f --- /dev/null +++ b/deps/discord-rpc/src/connection_unix.cpp @@ -0,0 +1,122 @@ +#include "connection.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +int GetProcessId() +{ + return ::getpid(); +} + +struct BaseConnectionUnix : public BaseConnection { + int sock{-1}; +}; + +static BaseConnectionUnix Connection; +static sockaddr_un PipeAddr{}; +#ifdef MSG_NOSIGNAL +static int MsgFlags = MSG_NOSIGNAL; +#else +static int MsgFlags = 0; +#endif + +static const char* GetTempPath() +{ + const char* temp = getenv("XDG_RUNTIME_DIR"); + temp = temp ? temp : getenv("TMPDIR"); + temp = temp ? temp : getenv("TMP"); + temp = temp ? temp : getenv("TEMP"); + temp = temp ? temp : "/tmp"; + return temp; +} + +/*static*/ BaseConnection* BaseConnection::Create() +{ + PipeAddr.sun_family = AF_UNIX; + return &Connection; +} + +/*static*/ void BaseConnection::Destroy(BaseConnection*& c) +{ + auto self = reinterpret_cast(c); + self->Close(); + c = nullptr; +} + +bool BaseConnection::Open() +{ + const char* tempPath = GetTempPath(); + auto self = reinterpret_cast(this); + self->sock = socket(AF_UNIX, SOCK_STREAM, 0); + if (self->sock == -1) { + return false; + } + fcntl(self->sock, F_SETFL, O_NONBLOCK); +#ifdef SO_NOSIGPIPE + int optval = 1; + setsockopt(self->sock, SOL_SOCKET, SO_NOSIGPIPE, &optval, sizeof(optval)); +#endif + + for (int pipeNum = 0; pipeNum < 10; ++pipeNum) { + snprintf( + PipeAddr.sun_path, sizeof(PipeAddr.sun_path), "%s/discord-ipc-%d", tempPath, pipeNum); + int err = connect(self->sock, (const sockaddr*)&PipeAddr, sizeof(PipeAddr)); + if (err == 0) { + self->isOpen = true; + return true; + } + } + self->Close(); + return false; +} + +bool BaseConnection::Close() +{ + auto self = reinterpret_cast(this); + if (self->sock == -1) { + return false; + } + close(self->sock); + self->sock = -1; + self->isOpen = false; + return true; +} + +bool BaseConnection::Write(const void* data, size_t length) +{ + auto self = reinterpret_cast(this); + + if (self->sock == -1) { + return false; + } + + ssize_t sentBytes = send(self->sock, data, length, MsgFlags); + if (sentBytes < 0) { + Close(); + } + return sentBytes == (ssize_t)length; +} + +bool BaseConnection::Read(void* data, size_t length) +{ + auto self = reinterpret_cast(this); + + if (self->sock == -1) { + return false; + } + + int res = (int)recv(self->sock, data, length, MsgFlags); + if (res < 0) { + if (errno == EAGAIN) { + return false; + } + Close(); + } + return res == (int)length; +} diff --git a/deps/discord-rpc/src/connection_win.cpp b/deps/discord-rpc/src/connection_win.cpp new file mode 100644 index 0000000000..2dd2750c06 --- /dev/null +++ b/deps/discord-rpc/src/connection_win.cpp @@ -0,0 +1,128 @@ +#include "connection.h" + +#define WIN32_LEAN_AND_MEAN +#define NOMCX +#define NOSERVICE +#define NOIME +#include +#include + +int GetProcessId() +{ + return (int)::GetCurrentProcessId(); +} + +struct BaseConnectionWin : public BaseConnection { + HANDLE pipe{INVALID_HANDLE_VALUE}; +}; + +static BaseConnectionWin Connection; + +/*static*/ BaseConnection* BaseConnection::Create() +{ + return &Connection; +} + +/*static*/ void BaseConnection::Destroy(BaseConnection*& c) +{ + auto self = reinterpret_cast(c); + self->Close(); + c = nullptr; +} + +bool BaseConnection::Open() +{ + wchar_t pipeName[]{L"\\\\?\\pipe\\discord-ipc-0"}; + const size_t pipeDigit = sizeof(pipeName) / sizeof(wchar_t) - 2; + pipeName[pipeDigit] = L'0'; + auto self = reinterpret_cast(this); + for (;;) { + self->pipe = ::CreateFileW( + pipeName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr); + if (self->pipe != INVALID_HANDLE_VALUE) { + self->isOpen = true; + return true; + } + + auto lastError = GetLastError(); + if (lastError == ERROR_FILE_NOT_FOUND) { + if (pipeName[pipeDigit] < L'9') { + pipeName[pipeDigit]++; + continue; + } + } + else if (lastError == ERROR_PIPE_BUSY) { + if (!WaitNamedPipeW(pipeName, 10000)) { + return false; + } + continue; + } + return false; + } +} + +bool BaseConnection::Close() +{ + auto self = reinterpret_cast(this); + ::CloseHandle(self->pipe); + self->pipe = INVALID_HANDLE_VALUE; + self->isOpen = false; + return true; +} + +bool BaseConnection::Write(const void* data, size_t length) +{ + if (length == 0) { + return true; + } + auto self = reinterpret_cast(this); + assert(self); + if (!self) { + return false; + } + if (self->pipe == INVALID_HANDLE_VALUE) { + return false; + } + assert(data); + if (!data) { + return false; + } + const DWORD bytesLength = (DWORD)length; + DWORD bytesWritten = 0; + return ::WriteFile(self->pipe, data, bytesLength, &bytesWritten, nullptr) == TRUE && + bytesWritten == bytesLength; +} + +bool BaseConnection::Read(void* data, size_t length) +{ + assert(data); + if (!data) { + return false; + } + auto self = reinterpret_cast(this); + assert(self); + if (!self) { + return false; + } + if (self->pipe == INVALID_HANDLE_VALUE) { + return false; + } + DWORD bytesAvailable = 0; + if (::PeekNamedPipe(self->pipe, nullptr, 0, nullptr, &bytesAvailable, nullptr)) { + if (bytesAvailable >= length) { + DWORD bytesToRead = (DWORD)length; + DWORD bytesRead = 0; + if (::ReadFile(self->pipe, data, bytesToRead, &bytesRead, nullptr) == TRUE) { + assert(bytesToRead == bytesRead); + return true; + } + else { + Close(); + } + } + } + else { + Close(); + } + return false; +} diff --git a/deps/discord-rpc/src/discord_register_linux.cpp b/deps/discord-rpc/src/discord_register_linux.cpp new file mode 100644 index 0000000000..b10f96db66 --- /dev/null +++ b/deps/discord-rpc/src/discord_register_linux.cpp @@ -0,0 +1,100 @@ +#include "discord_rpc.h" +#include "discord_register.h" +#include + +#include +#include +#include +#include +#include +#include + +static bool Mkdir(const char* path) +{ + int result = mkdir(path, 0755); + if (result == 0) { + return true; + } + if (errno == EEXIST) { + return true; + } + return false; +} + +// we want to register games so we can run them from Discord client as discord-:// +extern "C" DISCORD_EXPORT void Discord_Register(const char* applicationId, const char* command) +{ + // Add a desktop file and update some mime handlers so that xdg-open does the right thing. + + const char* home = getenv("HOME"); + if (!home) { + return; + } + + char exePath[1024]; + if (!command || !command[0]) { + if (readlink("/proc/self/exe", exePath, sizeof(exePath)) <= 0) { + return; + } + command = exePath; + } + + const char* destopFileFormat = "[Desktop Entry]\n" + "Name=Game %s\n" + "Exec=%s %%u\n" // note: it really wants that %u in there + "Type=Application\n" + "NoDisplay=true\n" + "Categories=Discord;Games;\n" + "MimeType=x-scheme-handler/discord-%s;\n"; + char desktopFile[2048]; + int fileLen = snprintf( + desktopFile, sizeof(desktopFile), destopFileFormat, applicationId, command, applicationId); + if (fileLen <= 0) { + return; + } + + char desktopFilename[256]; + snprintf(desktopFilename, sizeof(desktopFilename), "/discord-%s.desktop", applicationId); + + char desktopFilePath[1024]; + snprintf(desktopFilePath, sizeof(desktopFilePath), "%s/.local", home); + if (!Mkdir(desktopFilePath)) { + return; + } + strcat(desktopFilePath, "/share"); + if (!Mkdir(desktopFilePath)) { + return; + } + strcat(desktopFilePath, "/applications"); + if (!Mkdir(desktopFilePath)) { + return; + } + strcat(desktopFilePath, desktopFilename); + + FILE* fp = fopen(desktopFilePath, "w"); + if (fp) { + fwrite(desktopFile, 1, fileLen, fp); + fclose(fp); + } + else { + return; + } + + char xdgMimeCommand[1024]; + snprintf(xdgMimeCommand, + sizeof(xdgMimeCommand), + "xdg-mime default discord-%s.desktop x-scheme-handler/discord-%s", + applicationId, + applicationId); + if (system(xdgMimeCommand) < 0) { + fprintf(stderr, "Failed to register mime handler\n"); + } +} + +extern "C" DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, + const char* steamId) +{ + char command[256]; + sprintf(command, "xdg-open steam://rungameid/%s", steamId); + Discord_Register(applicationId, command); +} diff --git a/deps/discord-rpc/src/discord_register_osx.m b/deps/discord-rpc/src/discord_register_osx.m new file mode 100644 index 0000000000..d710102865 --- /dev/null +++ b/deps/discord-rpc/src/discord_register_osx.m @@ -0,0 +1,80 @@ +#include +#include + +#import + +#include "discord_register.h" + +static void RegisterCommand(const char* applicationId, const char* command) +{ + // There does not appear to be a way to register arbitrary commands on OSX, so instead we'll save the command + // to a file in the Discord config path, and when it is needed, Discord can try to load the file there, open + // the command therein (will pass to js's window.open, so requires a url-like thing) + + // Note: will not work for sandboxed apps + NSString *home = NSHomeDirectory(); + if (!home) { + return; + } + + NSString *path = [[[[[[home stringByAppendingPathComponent:@"Library"] + stringByAppendingPathComponent:@"Application Support"] + stringByAppendingPathComponent:@"discord"] + stringByAppendingPathComponent:@"games"] + stringByAppendingPathComponent:[NSString stringWithUTF8String:applicationId]] + stringByAppendingPathExtension:@"json"]; + [[NSFileManager defaultManager] createDirectoryAtPath:[path stringByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:nil]; + + NSString *jsonBuffer = [NSString stringWithFormat:@"{\"command\": \"%s\"}", command]; + [jsonBuffer writeToFile:path atomically:NO encoding:NSUTF8StringEncoding error:nil]; +} + +static void RegisterURL(const char* applicationId) +{ + char url[256]; + snprintf(url, sizeof(url), "discord-%s", applicationId); + CFStringRef cfURL = CFStringCreateWithCString(NULL, url, kCFStringEncodingUTF8); + + NSString* myBundleId = [[NSBundle mainBundle] bundleIdentifier]; + if (!myBundleId) { + fprintf(stderr, "No bundle id found\n"); + return; + } + + NSURL* myURL = [[NSBundle mainBundle] bundleURL]; + if (!myURL) { + fprintf(stderr, "No bundle url found\n"); + return; + } + + OSStatus status = LSSetDefaultHandlerForURLScheme(cfURL, (__bridge CFStringRef)myBundleId); + if (status != noErr) { + fprintf(stderr, "Error in LSSetDefaultHandlerForURLScheme: %d\n", (int)status); + return; + } + + status = LSRegisterURL((__bridge CFURLRef)myURL, true); + if (status != noErr) { + fprintf(stderr, "Error in LSRegisterURL: %d\n", (int)status); + } +} + +void Discord_Register(const char* applicationId, const char* command) +{ + if (command) { + RegisterCommand(applicationId, command); + } + else { + // raii lite + @autoreleasepool { + RegisterURL(applicationId); + } + } +} + +void Discord_RegisterSteamGame(const char* applicationId, const char* steamId) +{ + char command[256]; + snprintf(command, 256, "steam://rungameid/%s", steamId); + Discord_Register(applicationId, command); +} diff --git a/deps/discord-rpc/src/discord_register_win.cpp b/deps/discord-rpc/src/discord_register_win.cpp new file mode 100644 index 0000000000..e441318dd5 --- /dev/null +++ b/deps/discord-rpc/src/discord_register_win.cpp @@ -0,0 +1,185 @@ +#include "discord_rpc.h" +#include "discord_register.h" + +#define WIN32_LEAN_AND_MEAN +#define NOMCX +#define NOSERVICE +#define NOIME +#include +#include +#include +#include + +/** + * Updated fixes for MinGW and WinXP + * This block is written the way it does not involve changing the rest of the code + * Checked to be compiling + * 1) strsafe.h belongs to Windows SDK and cannot be added to MinGW + * #include guarded, functions redirected to substitutes + * 2) RegSetKeyValueW and LSTATUS are not declared in + * The entire function is rewritten + */ +#ifdef __MINGW32__ +/// strsafe.h fixes +static HRESULT StringCbPrintfW(LPWSTR pszDest, size_t cbDest, LPCWSTR pszFormat, ...) +{ + HRESULT ret; + va_list va; + va_start(va, pszFormat); + cbDest /= 2; // Size is divided by 2 to convert from bytes to wide characters - causes segfault + // othervise + ret = vsnwprintf(pszDest, cbDest, pszFormat, va); + pszDest[cbDest - 1] = 0; // Terminate the string in case a buffer overflow; -1 will be returned + va_end(va); + return ret; +} +#else +#include +#endif // __MINGW32__ + +/// winreg.h fixes +#ifndef LSTATUS +#define LSTATUS LONG +#endif +#ifdef RegSetKeyValueW +#undefine RegSetKeyValueW +#endif +#define RegSetKeyValueW regset +static LSTATUS regset(HKEY hkey, + LPCWSTR subkey, + LPCWSTR name, + DWORD type, + const void* data, + DWORD len) +{ + HKEY htkey = hkey, hsubkey = nullptr; + LSTATUS ret; + if (subkey && subkey[0]) { + if ((ret = RegCreateKeyExW(hkey, subkey, 0, 0, 0, KEY_ALL_ACCESS, 0, &hsubkey, 0)) != + ERROR_SUCCESS) + return ret; + htkey = hsubkey; + } + ret = RegSetValueExW(htkey, name, 0, type, (const BYTE*)data, len); + if (hsubkey && hsubkey != hkey) + RegCloseKey(hsubkey); + return ret; +} + +static void Discord_RegisterW(const wchar_t* applicationId, const wchar_t* command) +{ + // https://msdn.microsoft.com/en-us/library/aa767914(v=vs.85).aspx + // we want to register games so we can run them as discord-:// + // Update the HKEY_CURRENT_USER, because it doesn't seem to require special permissions. + + wchar_t exeFilePath[MAX_PATH]; + DWORD exeLen = GetModuleFileNameW(nullptr, exeFilePath, MAX_PATH); + wchar_t openCommand[1024]; + + if (command && command[0]) { + StringCbPrintfW(openCommand, sizeof(openCommand), L"%s", command); + } + else { + // StringCbCopyW(openCommand, sizeof(openCommand), exeFilePath); + StringCbPrintfW(openCommand, sizeof(openCommand), L"%s", exeFilePath); + } + + wchar_t protocolName[64]; + StringCbPrintfW(protocolName, sizeof(protocolName), L"discord-%s", applicationId); + wchar_t protocolDescription[128]; + StringCbPrintfW( + protocolDescription, sizeof(protocolDescription), L"URL:Run game %s protocol", applicationId); + wchar_t urlProtocol = 0; + + wchar_t keyName[256]; + StringCbPrintfW(keyName, sizeof(keyName), L"Software\\Classes\\%s", protocolName); + HKEY key; + auto status = + RegCreateKeyExW(HKEY_CURRENT_USER, keyName, 0, nullptr, 0, KEY_WRITE, nullptr, &key, nullptr); + if (status != ERROR_SUCCESS) { + fprintf(stderr, "Error creating key\n"); + return; + } + DWORD len; + LSTATUS result; + len = (DWORD)lstrlenW(protocolDescription) + 1; + result = + RegSetKeyValueW(key, nullptr, nullptr, REG_SZ, protocolDescription, len * sizeof(wchar_t)); + if (FAILED(result)) { + fprintf(stderr, "Error writing description\n"); + } + + len = (DWORD)lstrlenW(protocolDescription) + 1; + result = RegSetKeyValueW(key, nullptr, L"URL Protocol", REG_SZ, &urlProtocol, sizeof(wchar_t)); + if (FAILED(result)) { + fprintf(stderr, "Error writing description\n"); + } + + result = RegSetKeyValueW( + key, L"DefaultIcon", nullptr, REG_SZ, exeFilePath, (exeLen + 1) * sizeof(wchar_t)); + if (FAILED(result)) { + fprintf(stderr, "Error writing icon\n"); + } + + len = (DWORD)lstrlenW(openCommand) + 1; + result = RegSetKeyValueW( + key, L"shell\\open\\command", nullptr, REG_SZ, openCommand, len * sizeof(wchar_t)); + if (FAILED(result)) { + fprintf(stderr, "Error writing command\n"); + } + RegCloseKey(key); +} + +extern "C" DISCORD_EXPORT void Discord_Register(const char* applicationId, const char* command) +{ + wchar_t appId[32]; + MultiByteToWideChar(CP_UTF8, 0, applicationId, -1, appId, 32); + + wchar_t openCommand[1024]; + const wchar_t* wcommand = nullptr; + if (command && command[0]) { + const auto commandBufferLen = sizeof(openCommand) / sizeof(*openCommand); + MultiByteToWideChar(CP_UTF8, 0, command, -1, openCommand, commandBufferLen); + wcommand = openCommand; + } + + Discord_RegisterW(appId, wcommand); +} + +extern "C" DISCORD_EXPORT void Discord_RegisterSteamGame(const char* applicationId, + const char* steamId) +{ + wchar_t appId[32]; + MultiByteToWideChar(CP_UTF8, 0, applicationId, -1, appId, 32); + + wchar_t wSteamId[32]; + MultiByteToWideChar(CP_UTF8, 0, steamId, -1, wSteamId, 32); + + HKEY key; + auto status = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Valve\\Steam", 0, KEY_READ, &key); + if (status != ERROR_SUCCESS) { + fprintf(stderr, "Error opening Steam key\n"); + return; + } + + wchar_t steamPath[MAX_PATH]; + DWORD pathBytes = sizeof(steamPath); + status = RegQueryValueExW(key, L"SteamExe", nullptr, nullptr, (BYTE*)steamPath, &pathBytes); + RegCloseKey(key); + if (status != ERROR_SUCCESS || pathBytes < 1) { + fprintf(stderr, "Error reading SteamExe key\n"); + return; + } + + DWORD pathChars = pathBytes / sizeof(wchar_t); + for (DWORD i = 0; i < pathChars; ++i) { + if (steamPath[i] == L'/') { + steamPath[i] = L'\\'; + } + } + + wchar_t command[1024]; + StringCbPrintfW(command, sizeof(command), L"\"%s\" steam://rungameid/%s", steamPath, wSteamId); + + Discord_RegisterW(appId, command); +} diff --git a/deps/discord-rpc/src/discord_rpc.cpp b/deps/discord-rpc/src/discord_rpc.cpp new file mode 100644 index 0000000000..dedb3f1539 --- /dev/null +++ b/deps/discord-rpc/src/discord_rpc.cpp @@ -0,0 +1,499 @@ +#include "discord_rpc.h" + +#include "backoff.h" +#include "discord_register.h" +#include "msg_queue.h" +#include "rpc_connection.h" +#include "serialization.h" + +#include +#include +#include + +#ifndef DISCORD_DISABLE_IO_THREAD +#include +#include +#endif + +constexpr size_t MaxMessageSize{16 * 1024}; +constexpr size_t MessageQueueSize{8}; +constexpr size_t JoinQueueSize{8}; + +struct QueuedMessage { + size_t length; + char buffer[MaxMessageSize]; + + void Copy(const QueuedMessage& other) + { + length = other.length; + if (length) { + memcpy(buffer, other.buffer, length); + } + } +}; + +struct User { + // snowflake (64bit int), turned into a ascii decimal string, at most 20 chars +1 null + // terminator = 21 + char userId[32]; + // 32 unicode glyphs is max name size => 4 bytes per glyph in the worst case, +1 for null + // terminator = 129 + char username[344]; + // 4 decimal digits + 1 null terminator = 5 + char discriminator[8]; + // optional 'a_' + md5 hex digest (32 bytes) + null terminator = 35 + char avatar[128]; + // Rounded way up because I'm paranoid about games breaking from future changes in these sizes +}; + +static RpcConnection* Connection{nullptr}; +static DiscordEventHandlers QueuedHandlers{}; +static DiscordEventHandlers Handlers{}; +static std::atomic_bool WasJustConnected{false}; +static std::atomic_bool WasJustDisconnected{false}; +static std::atomic_bool GotErrorMessage{false}; +static std::atomic_bool WasJoinGame{false}; +static std::atomic_bool WasSpectateGame{false}; +static char JoinGameSecret[256]; +static char SpectateGameSecret[256]; +static int LastErrorCode{0}; +static char LastErrorMessage[256]; +static int LastDisconnectErrorCode{0}; +static char LastDisconnectErrorMessage[256]; +static std::mutex PresenceMutex; +static std::mutex HandlerMutex; +static QueuedMessage QueuedPresence{}; +static MsgQueue SendQueue; +static MsgQueue JoinAskQueue; +static User connectedUser; + +// We want to auto connect, and retry on failure, but not as fast as possible. This does expoential +// backoff from 0.5 seconds to 1 minute +static Backoff ReconnectTimeMs(500, 60 * 1000); +static auto NextConnect = std::chrono::system_clock::now(); +static int Pid{0}; +static int Nonce{1}; + +#ifndef DISCORD_DISABLE_IO_THREAD +static void Discord_UpdateConnection(void); +class IoThreadHolder { +private: + std::atomic_bool keepRunning{true}; + std::mutex waitForIOMutex; + std::condition_variable waitForIOActivity; + std::thread ioThread; + +public: + void Start() + { + keepRunning.store(true); + ioThread = std::thread([&]() { + const std::chrono::duration maxWait{500LL}; + while (keepRunning.load()) { + Discord_UpdateConnection(); + std::unique_lock lock(waitForIOMutex); + waitForIOActivity.wait_for(lock, maxWait); + } + }); + } + + void Notify() { waitForIOActivity.notify_all(); } + + void Stop() + { + keepRunning.exchange(false); + Notify(); + if (ioThread.joinable()) { + ioThread.join(); + } + } + + ~IoThreadHolder() { Stop(); } +}; +#else +class IoThreadHolder { +public: + void Start() {} + void Stop() {} + void Notify() {} +}; +#endif // DISCORD_DISABLE_IO_THREAD +static IoThreadHolder* IoThread{nullptr}; + +static void UpdateReconnectTime() +{ + NextConnect = std::chrono::system_clock::now() + + std::chrono::duration{ReconnectTimeMs.nextDelay()}; +} + +#ifdef DISCORD_DISABLE_IO_THREAD +extern "C" DISCORD_EXPORT void Discord_UpdateConnection(void) +#else +static void Discord_UpdateConnection(void) +#endif +{ + if (!Connection) { + return; + } + + if (!Connection->IsOpen()) { + if (std::chrono::system_clock::now() >= NextConnect) { + UpdateReconnectTime(); + Connection->Open(); + } + } + else { + // reads + + for (;;) { + JsonDocument message; + + if (!Connection->Read(message)) { + break; + } + + const char* evtName = GetStrMember(&message, "evt"); + const char* nonce = GetStrMember(&message, "nonce"); + + if (nonce) { + // in responses only -- should use to match up response when needed. + + if (evtName && strcmp(evtName, "ERROR") == 0) { + auto data = GetObjMember(&message, "data"); + LastErrorCode = GetIntMember(data, "code"); + StringCopy(LastErrorMessage, GetStrMember(data, "message", "")); + GotErrorMessage.store(true); + } + } + else { + // should have evt == name of event, optional data + if (evtName == nullptr) { + continue; + } + + auto data = GetObjMember(&message, "data"); + + if (strcmp(evtName, "ACTIVITY_JOIN") == 0) { + auto secret = GetStrMember(data, "secret"); + if (secret) { + StringCopy(JoinGameSecret, secret); + WasJoinGame.store(true); + } + } + else if (strcmp(evtName, "ACTIVITY_SPECTATE") == 0) { + auto secret = GetStrMember(data, "secret"); + if (secret) { + StringCopy(SpectateGameSecret, secret); + WasSpectateGame.store(true); + } + } + else if (strcmp(evtName, "ACTIVITY_JOIN_REQUEST") == 0) { + auto user = GetObjMember(data, "user"); + auto userId = GetStrMember(user, "id"); + auto username = GetStrMember(user, "username"); + auto avatar = GetStrMember(user, "avatar"); + auto joinReq = JoinAskQueue.GetNextAddMessage(); + if (userId && username && joinReq) { + StringCopy(joinReq->userId, userId); + StringCopy(joinReq->username, username); + auto discriminator = GetStrMember(user, "discriminator"); + if (discriminator) { + StringCopy(joinReq->discriminator, discriminator); + } + if (avatar) { + StringCopy(joinReq->avatar, avatar); + } + else { + joinReq->avatar[0] = 0; + } + JoinAskQueue.CommitAdd(); + } + } + } + } + + // writes + if (QueuedPresence.length) { + QueuedMessage local; + { + std::lock_guard guard(PresenceMutex); + local.Copy(QueuedPresence); + QueuedPresence.length = 0; + } + if (!Connection->Write(local.buffer, local.length)) { + // if we fail to send, requeue + std::lock_guard guard(PresenceMutex); + QueuedPresence.Copy(local); + } + } + + while (SendQueue.HavePendingSends()) { + auto qmessage = SendQueue.GetNextSendMessage(); + Connection->Write(qmessage->buffer, qmessage->length); + SendQueue.CommitSend(); + } + } +} + +static void SignalIOActivity() +{ + if (IoThread != nullptr) { + IoThread->Notify(); + } +} + +static bool RegisterForEvent(const char* evtName) +{ + auto qmessage = SendQueue.GetNextAddMessage(); + if (qmessage) { + qmessage->length = + JsonWriteSubscribeCommand(qmessage->buffer, sizeof(qmessage->buffer), Nonce++, evtName); + SendQueue.CommitAdd(); + SignalIOActivity(); + return true; + } + return false; +} + +static bool DeregisterForEvent(const char* evtName) +{ + auto qmessage = SendQueue.GetNextAddMessage(); + if (qmessage) { + qmessage->length = + JsonWriteUnsubscribeCommand(qmessage->buffer, sizeof(qmessage->buffer), Nonce++, evtName); + SendQueue.CommitAdd(); + SignalIOActivity(); + return true; + } + return false; +} + +extern "C" DISCORD_EXPORT void Discord_Initialize(const char* applicationId, + DiscordEventHandlers* handlers, + int autoRegister, + const char* optionalSteamId) +{ + IoThread = new (std::nothrow) IoThreadHolder(); + if (IoThread == nullptr) { + return; + } + + if (autoRegister) { + if (optionalSteamId && optionalSteamId[0]) { + Discord_RegisterSteamGame(applicationId, optionalSteamId); + } + else { + Discord_Register(applicationId, nullptr); + } + } + + Pid = GetProcessId(); + + { + std::lock_guard guard(HandlerMutex); + + if (handlers) { + QueuedHandlers = *handlers; + } + else { + QueuedHandlers = {}; + } + + Handlers = {}; + } + + if (Connection) { + return; + } + + Connection = RpcConnection::Create(applicationId); + Connection->onConnect = [](JsonDocument& readyMessage) { + Discord_UpdateHandlers(&QueuedHandlers); + auto data = GetObjMember(&readyMessage, "data"); + auto user = GetObjMember(data, "user"); + auto userId = GetStrMember(user, "id"); + auto username = GetStrMember(user, "username"); + auto avatar = GetStrMember(user, "avatar"); + if (userId && username) { + StringCopy(connectedUser.userId, userId); + StringCopy(connectedUser.username, username); + auto discriminator = GetStrMember(user, "discriminator"); + if (discriminator) { + StringCopy(connectedUser.discriminator, discriminator); + } + if (avatar) { + StringCopy(connectedUser.avatar, avatar); + } + else { + connectedUser.avatar[0] = 0; + } + } + WasJustConnected.exchange(true); + ReconnectTimeMs.reset(); + }; + Connection->onDisconnect = [](int err, const char* message) { + LastDisconnectErrorCode = err; + StringCopy(LastDisconnectErrorMessage, message); + { + std::lock_guard guard(HandlerMutex); + Handlers = {}; + } + WasJustDisconnected.exchange(true); + UpdateReconnectTime(); + }; + + IoThread->Start(); +} + +extern "C" DISCORD_EXPORT void Discord_Shutdown(void) +{ + if (!Connection) { + return; + } + Connection->onConnect = nullptr; + Connection->onDisconnect = nullptr; + Handlers = {}; + if (IoThread != nullptr) { + IoThread->Stop(); + delete IoThread; + IoThread = nullptr; + } + + RpcConnection::Destroy(Connection); +} + +extern "C" DISCORD_EXPORT void Discord_UpdatePresence(const DiscordRichPresence* presence) +{ + { + std::lock_guard guard(PresenceMutex); + QueuedPresence.length = JsonWriteRichPresenceObj( + QueuedPresence.buffer, sizeof(QueuedPresence.buffer), Nonce++, Pid, presence); + } + SignalIOActivity(); +} + +extern "C" DISCORD_EXPORT void Discord_ClearPresence(void) +{ + Discord_UpdatePresence(nullptr); +} + +extern "C" DISCORD_EXPORT void Discord_Respond(const char* userId, /* DISCORD_REPLY_ */ int reply) +{ + // if we are not connected, let's not batch up stale messages for later + if (!Connection || !Connection->IsOpen()) { + return; + } + auto qmessage = SendQueue.GetNextAddMessage(); + if (qmessage) { + qmessage->length = + JsonWriteJoinReply(qmessage->buffer, sizeof(qmessage->buffer), userId, reply, Nonce++); + SendQueue.CommitAdd(); + SignalIOActivity(); + } +} + +extern "C" DISCORD_EXPORT void Discord_RunCallbacks(void) +{ + // Note on some weirdness: internally we might connect, get other signals, disconnect any number + // of times inbetween calls here. Externally, we want the sequence to seem sane, so any other + // signals are book-ended by calls to ready and disconnect. + + if (!Connection) { + return; + } + + bool wasDisconnected = WasJustDisconnected.exchange(false); + bool isConnected = Connection->IsOpen(); + + if (isConnected) { + // if we are connected, disconnect cb first + std::lock_guard guard(HandlerMutex); + if (wasDisconnected && Handlers.disconnected) { + Handlers.disconnected(LastDisconnectErrorCode, LastDisconnectErrorMessage); + } + } + + if (WasJustConnected.exchange(false)) { + std::lock_guard guard(HandlerMutex); + if (Handlers.ready) { + DiscordUser du{connectedUser.userId, + connectedUser.username, + connectedUser.discriminator, + connectedUser.avatar}; + Handlers.ready(&du); + } + } + + if (GotErrorMessage.exchange(false)) { + std::lock_guard guard(HandlerMutex); + if (Handlers.errored) { + Handlers.errored(LastErrorCode, LastErrorMessage); + } + } + + if (WasJoinGame.exchange(false)) { + std::lock_guard guard(HandlerMutex); + if (Handlers.joinGame) { + Handlers.joinGame(JoinGameSecret); + } + } + + if (WasSpectateGame.exchange(false)) { + std::lock_guard guard(HandlerMutex); + if (Handlers.spectateGame) { + Handlers.spectateGame(SpectateGameSecret); + } + } + + // Right now this batches up any requests and sends them all in a burst; I could imagine a world + // where the implementer would rather sequentially accept/reject each one before the next invite + // is sent. I left it this way because I could also imagine wanting to process these all and + // maybe show them in one common dialog and/or start fetching the avatars in parallel, and if + // not it should be trivial for the implementer to make a queue themselves. + while (JoinAskQueue.HavePendingSends()) { + auto req = JoinAskQueue.GetNextSendMessage(); + { + std::lock_guard guard(HandlerMutex); + if (Handlers.joinRequest) { + DiscordUser du{req->userId, req->username, req->discriminator, req->avatar}; + Handlers.joinRequest(&du); + } + } + JoinAskQueue.CommitSend(); + } + + if (!isConnected) { + // if we are not connected, disconnect message last + std::lock_guard guard(HandlerMutex); + if (wasDisconnected && Handlers.disconnected) { + Handlers.disconnected(LastDisconnectErrorCode, LastDisconnectErrorMessage); + } + } +} + +extern "C" DISCORD_EXPORT void Discord_UpdateHandlers(DiscordEventHandlers* newHandlers) +{ + if (newHandlers) { +#define HANDLE_EVENT_REGISTRATION(handler_name, event) \ + if (!Handlers.handler_name && newHandlers->handler_name) { \ + RegisterForEvent(event); \ + } \ + else if (Handlers.handler_name && !newHandlers->handler_name) { \ + DeregisterForEvent(event); \ + } + + std::lock_guard guard(HandlerMutex); + HANDLE_EVENT_REGISTRATION(joinGame, "ACTIVITY_JOIN") + HANDLE_EVENT_REGISTRATION(spectateGame, "ACTIVITY_SPECTATE") + HANDLE_EVENT_REGISTRATION(joinRequest, "ACTIVITY_JOIN_REQUEST") + +#undef HANDLE_EVENT_REGISTRATION + + Handlers = *newHandlers; + } + else { + std::lock_guard guard(HandlerMutex); + Handlers = {}; + } + return; +} diff --git a/deps/discord-rpc/src/dllmain.cpp b/deps/discord-rpc/src/dllmain.cpp new file mode 100644 index 0000000000..fbfc2950d7 --- /dev/null +++ b/deps/discord-rpc/src/dllmain.cpp @@ -0,0 +1,8 @@ +#include + +// outsmart GCC's missing-declarations warning +BOOL WINAPI DllMain(HMODULE, DWORD, LPVOID); +BOOL WINAPI DllMain(HMODULE, DWORD, LPVOID) +{ + return TRUE; +} diff --git a/deps/discord-rpc/src/msg_queue.h b/deps/discord-rpc/src/msg_queue.h new file mode 100644 index 0000000000..77f380e705 --- /dev/null +++ b/deps/discord-rpc/src/msg_queue.h @@ -0,0 +1,36 @@ +#pragma once + +#include + +// A simple queue. No locks, but only works with a single thread as producer and a single thread as +// a consumer. Mutex up as needed. + +template +class MsgQueue { + ElementType queue_[QueueSize]; + std::atomic_uint nextAdd_{0}; + std::atomic_uint nextSend_{0}; + std::atomic_uint pendingSends_{0}; + +public: + MsgQueue() {} + + ElementType* GetNextAddMessage() + { + // if we are falling behind, bail + if (pendingSends_.load() >= QueueSize) { + return nullptr; + } + auto index = (nextAdd_++) % QueueSize; + return &queue_[index]; + } + void CommitAdd() { ++pendingSends_; } + + bool HavePendingSends() const { return pendingSends_.load() != 0; } + ElementType* GetNextSendMessage() + { + auto index = (nextSend_++) % QueueSize; + return &queue_[index]; + } + void CommitSend() { --pendingSends_; } +}; diff --git a/deps/discord-rpc/src/rpc_connection.cpp b/deps/discord-rpc/src/rpc_connection.cpp new file mode 100644 index 0000000000..bf9e4cc7a4 --- /dev/null +++ b/deps/discord-rpc/src/rpc_connection.cpp @@ -0,0 +1,141 @@ +#include "rpc_connection.h" +#include "serialization.h" + +#include + +static const int RpcVersion = 1; +static RpcConnection Instance; + +/*static*/ RpcConnection* RpcConnection::Create(const char* applicationId) +{ + Instance.connection = BaseConnection::Create(); + StringCopy(Instance.appId, applicationId); + return &Instance; +} + +/*static*/ void RpcConnection::Destroy(RpcConnection*& c) +{ + c->Close(); + BaseConnection::Destroy(c->connection); + c = nullptr; +} + +void RpcConnection::Open() +{ + if (state == State::Connected) { + return; + } + + if (state == State::Disconnected) { + if (connection->Open()) { + } + else { + return; + } + } + + if (state == State::SentHandshake) { + JsonDocument message; + if (Read(message)) { + auto cmd = GetStrMember(&message, "cmd"); + auto evt = GetStrMember(&message, "evt"); + if (cmd && evt && !strcmp(cmd, "DISPATCH") && !strcmp(evt, "READY")) { + state = State::Connected; + if (onConnect) { + onConnect(message); + } + } + } + } + else { + sendFrame.opcode = Opcode::Handshake; + sendFrame.length = (uint32_t)JsonWriteHandshakeObj( + sendFrame.message, sizeof(sendFrame.message), RpcVersion, appId); + + if (connection->Write(&sendFrame, sizeof(MessageFrameHeader) + sendFrame.length)) { + state = State::SentHandshake; + } + else { + Close(); + } + } +} + +void RpcConnection::Close() +{ + if (onDisconnect && (state == State::Connected || state == State::SentHandshake)) { + onDisconnect(lastErrorCode, lastErrorMessage); + } + connection->Close(); + state = State::Disconnected; +} + +bool RpcConnection::Write(const void* data, size_t length) +{ + sendFrame.opcode = Opcode::Frame; + memcpy(sendFrame.message, data, length); + sendFrame.length = (uint32_t)length; + if (!connection->Write(&sendFrame, sizeof(MessageFrameHeader) + length)) { + Close(); + return false; + } + return true; +} + +bool RpcConnection::Read(JsonDocument& message) +{ + if (state != State::Connected && state != State::SentHandshake) { + return false; + } + MessageFrame readFrame; + for (;;) { + bool didRead = connection->Read(&readFrame, sizeof(MessageFrameHeader)); + if (!didRead) { + if (!connection->isOpen) { + lastErrorCode = (int)ErrorCode::PipeClosed; + StringCopy(lastErrorMessage, "Pipe closed"); + Close(); + } + return false; + } + + if (readFrame.length > 0) { + didRead = connection->Read(readFrame.message, readFrame.length); + if (!didRead) { + lastErrorCode = (int)ErrorCode::ReadCorrupt; + StringCopy(lastErrorMessage, "Partial data in frame"); + Close(); + return false; + } + readFrame.message[readFrame.length] = 0; + } + + switch (readFrame.opcode) { + case Opcode::Close: { + message.ParseInsitu(readFrame.message); + lastErrorCode = GetIntMember(&message, "code"); + StringCopy(lastErrorMessage, GetStrMember(&message, "message", "")); + Close(); + return false; + } + case Opcode::Frame: + message.ParseInsitu(readFrame.message); + return true; + case Opcode::Ping: + readFrame.opcode = Opcode::Pong; + if (!connection->Write(&readFrame, sizeof(MessageFrameHeader) + readFrame.length)) { + Close(); + } + break; + case Opcode::Pong: + break; + case Opcode::Handshake: + default: + // something bad happened + lastErrorCode = (int)ErrorCode::ReadCorrupt; + StringCopy(lastErrorMessage, "Bad ipc frame"); + Close(); + return false; + } + } +} diff --git a/deps/discord-rpc/src/rpc_connection.h b/deps/discord-rpc/src/rpc_connection.h new file mode 100644 index 0000000000..bbdd05c792 --- /dev/null +++ b/deps/discord-rpc/src/rpc_connection.h @@ -0,0 +1,59 @@ +#pragma once + +#include "connection.h" +#include "serialization.h" + +// I took this from the buffer size libuv uses for named pipes; I suspect ours would usually be much +// smaller. +constexpr size_t MaxRpcFrameSize = 64 * 1024; + +struct RpcConnection { + enum class ErrorCode : int { + Success = 0, + PipeClosed = 1, + ReadCorrupt = 2, + }; + + enum class Opcode : uint32_t { + Handshake = 0, + Frame = 1, + Close = 2, + Ping = 3, + Pong = 4, + }; + + struct MessageFrameHeader { + Opcode opcode; + uint32_t length; + }; + + struct MessageFrame : public MessageFrameHeader { + char message[MaxRpcFrameSize - sizeof(MessageFrameHeader)]; + }; + + enum class State : uint32_t { + Disconnected, + SentHandshake, + AwaitingResponse, + Connected, + }; + + BaseConnection* connection{nullptr}; + State state{State::Disconnected}; + void (*onConnect)(JsonDocument& message){nullptr}; + void (*onDisconnect)(int errorCode, const char* message){nullptr}; + char appId[64]{}; + int lastErrorCode{0}; + char lastErrorMessage[256]{}; + RpcConnection::MessageFrame sendFrame; + + static RpcConnection* Create(const char* applicationId); + static void Destroy(RpcConnection*&); + + inline bool IsOpen() const { return state == State::Connected; } + + void Open(); + void Close(); + bool Write(const void* data, size_t length); + bool Read(JsonDocument& message); +}; diff --git a/deps/discord-rpc/src/serialization.cpp b/deps/discord-rpc/src/serialization.cpp new file mode 100644 index 0000000000..6cc1e9013d --- /dev/null +++ b/deps/discord-rpc/src/serialization.cpp @@ -0,0 +1,245 @@ +#include "serialization.h" +#include "connection.h" +#include "discord_rpc.h" + +template +void NumberToString(char* dest, T number) +{ + if (!number) { + *dest++ = '0'; + *dest++ = 0; + return; + } + if (number < 0) { + *dest++ = '-'; + number = -number; + } + char temp[32]; + int place = 0; + while (number) { + auto digit = number % 10; + number = number / 10; + temp[place++] = '0' + (char)digit; + } + for (--place; place >= 0; --place) { + *dest++ = temp[place]; + } + *dest = 0; +} + +// it's ever so slightly faster to not have to strlen the key +template +void WriteKey(JsonWriter& w, T& k) +{ + w.Key(k, sizeof(T) - 1); +} + +struct WriteObject { + JsonWriter& writer; + WriteObject(JsonWriter& w) + : writer(w) + { + writer.StartObject(); + } + template + WriteObject(JsonWriter& w, T& name) + : writer(w) + { + WriteKey(writer, name); + writer.StartObject(); + } + ~WriteObject() { writer.EndObject(); } +}; + +struct WriteArray { + JsonWriter& writer; + template + WriteArray(JsonWriter& w, T& name) + : writer(w) + { + WriteKey(writer, name); + writer.StartArray(); + } + ~WriteArray() { writer.EndArray(); } +}; + +template +void WriteOptionalString(JsonWriter& w, T& k, const char* value) +{ + if (value && value[0]) { + w.Key(k, sizeof(T) - 1); + w.String(value); + } +} + +static void JsonWriteNonce(JsonWriter& writer, int nonce) +{ + WriteKey(writer, "nonce"); + char nonceBuffer[32]; + NumberToString(nonceBuffer, nonce); + writer.String(nonceBuffer); +} + +size_t JsonWriteRichPresenceObj(char* dest, + size_t maxLen, + int nonce, + int pid, + const DiscordRichPresence* presence) +{ + JsonWriter writer(dest, maxLen); + + { + WriteObject top(writer); + + JsonWriteNonce(writer, nonce); + + WriteKey(writer, "cmd"); + writer.String("SET_ACTIVITY"); + + { + WriteObject args(writer, "args"); + + WriteKey(writer, "pid"); + writer.Int(pid); + + if (presence != nullptr) { + WriteObject activity(writer, "activity"); + + WriteOptionalString(writer, "state", presence->state); + WriteOptionalString(writer, "details", presence->details); + + if (presence->startTimestamp || presence->endTimestamp) { + WriteObject timestamps(writer, "timestamps"); + + if (presence->startTimestamp) { + WriteKey(writer, "start"); + writer.Int64(presence->startTimestamp); + } + + if (presence->endTimestamp) { + WriteKey(writer, "end"); + writer.Int64(presence->endTimestamp); + } + } + + if ((presence->largeImageKey && presence->largeImageKey[0]) || + (presence->largeImageText && presence->largeImageText[0]) || + (presence->smallImageKey && presence->smallImageKey[0]) || + (presence->smallImageText && presence->smallImageText[0])) { + WriteObject assets(writer, "assets"); + WriteOptionalString(writer, "large_image", presence->largeImageKey); + WriteOptionalString(writer, "large_text", presence->largeImageText); + WriteOptionalString(writer, "small_image", presence->smallImageKey); + WriteOptionalString(writer, "small_text", presence->smallImageText); + } + + if ((presence->partyId && presence->partyId[0]) || presence->partySize || + presence->partyMax) { + WriteObject party(writer, "party"); + WriteOptionalString(writer, "id", presence->partyId); + if (presence->partySize && presence->partyMax) { + WriteArray size(writer, "size"); + writer.Int(presence->partySize); + writer.Int(presence->partyMax); + } + } + + if ((presence->matchSecret && presence->matchSecret[0]) || + (presence->joinSecret && presence->joinSecret[0]) || + (presence->spectateSecret && presence->spectateSecret[0])) { + WriteObject secrets(writer, "secrets"); + WriteOptionalString(writer, "match", presence->matchSecret); + WriteOptionalString(writer, "join", presence->joinSecret); + WriteOptionalString(writer, "spectate", presence->spectateSecret); + } + + writer.Key("instance"); + writer.Bool(presence->instance != 0); + } + } + } + + return writer.Size(); +} + +size_t JsonWriteHandshakeObj(char* dest, size_t maxLen, int version, const char* applicationId) +{ + JsonWriter writer(dest, maxLen); + + { + WriteObject obj(writer); + WriteKey(writer, "v"); + writer.Int(version); + WriteKey(writer, "client_id"); + writer.String(applicationId); + } + + return writer.Size(); +} + +size_t JsonWriteSubscribeCommand(char* dest, size_t maxLen, int nonce, const char* evtName) +{ + JsonWriter writer(dest, maxLen); + + { + WriteObject obj(writer); + + JsonWriteNonce(writer, nonce); + + WriteKey(writer, "cmd"); + writer.String("SUBSCRIBE"); + + WriteKey(writer, "evt"); + writer.String(evtName); + } + + return writer.Size(); +} + +size_t JsonWriteUnsubscribeCommand(char* dest, size_t maxLen, int nonce, const char* evtName) +{ + JsonWriter writer(dest, maxLen); + + { + WriteObject obj(writer); + + JsonWriteNonce(writer, nonce); + + WriteKey(writer, "cmd"); + writer.String("UNSUBSCRIBE"); + + WriteKey(writer, "evt"); + writer.String(evtName); + } + + return writer.Size(); +} + +size_t JsonWriteJoinReply(char* dest, size_t maxLen, const char* userId, int reply, int nonce) +{ + JsonWriter writer(dest, maxLen); + + { + WriteObject obj(writer); + + WriteKey(writer, "cmd"); + if (reply == DISCORD_REPLY_YES) { + writer.String("SEND_ACTIVITY_JOIN_INVITE"); + } + else { + writer.String("CLOSE_ACTIVITY_JOIN_REQUEST"); + } + + WriteKey(writer, "args"); + { + WriteObject args(writer); + + WriteKey(writer, "user_id"); + writer.String(userId); + } + + JsonWriteNonce(writer, nonce); + } + + return writer.Size(); +} diff --git a/deps/discord-rpc/src/serialization.h b/deps/discord-rpc/src/serialization.h new file mode 100644 index 0000000000..9c462dc283 --- /dev/null +++ b/deps/discord-rpc/src/serialization.h @@ -0,0 +1,215 @@ +#pragma once + +#include + +#ifndef __MINGW32__ +#pragma warning(push) + +#pragma warning(disable : 4061) // enum is not explicitly handled by a case label +#pragma warning(disable : 4365) // signed/unsigned mismatch +#pragma warning(disable : 4464) // relative include path contains +#pragma warning(disable : 4668) // is not defined as a preprocessor macro +#pragma warning(disable : 6313) // Incorrect operator +#endif // __MINGW32__ + +#include "rapidjson/document.h" +#include "rapidjson/stringbuffer.h" +#include "rapidjson/writer.h" + +#ifndef __MINGW32__ +#pragma warning(pop) +#endif // __MINGW32__ + +// if only there was a standard library function for this +template +inline size_t StringCopy(char (&dest)[Len], const char* src) +{ + if (!src || !Len) { + return 0; + } + size_t copied; + char* out = dest; + for (copied = 1; *src && copied < Len; ++copied) { + *out++ = *src++; + } + *out = 0; + return copied - 1; +} + +size_t JsonWriteHandshakeObj(char* dest, size_t maxLen, int version, const char* applicationId); + +// Commands +struct DiscordRichPresence; +size_t JsonWriteRichPresenceObj(char* dest, + size_t maxLen, + int nonce, + int pid, + const DiscordRichPresence* presence); +size_t JsonWriteSubscribeCommand(char* dest, size_t maxLen, int nonce, const char* evtName); + +size_t JsonWriteUnsubscribeCommand(char* dest, size_t maxLen, int nonce, const char* evtName); + +size_t JsonWriteJoinReply(char* dest, size_t maxLen, const char* userId, int reply, int nonce); + +// I want to use as few allocations as I can get away with, and to do that with RapidJson, you need +// to supply some of your own allocators for stuff rather than use the defaults + +class LinearAllocator { +public: + char* buffer_; + char* end_; + LinearAllocator() + { + assert(0); // needed for some default case in rapidjson, should not use + } + LinearAllocator(char* buffer, size_t size) + : buffer_(buffer) + , end_(buffer + size) + { + } + static const bool kNeedFree = false; + void* Malloc(size_t size) + { + char* res = buffer_; + buffer_ += size; + if (buffer_ > end_) { + buffer_ = res; + return nullptr; + } + return res; + } + void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) + { + if (newSize == 0) { + return nullptr; + } + // allocate how much you need in the first place + assert(!originalPtr && !originalSize); + // unused parameter warning + (void)(originalPtr); + (void)(originalSize); + return Malloc(newSize); + } + static void Free(void* ptr) + { + /* shrug */ + (void)ptr; + } +}; + +template +class FixedLinearAllocator : public LinearAllocator { +public: + char fixedBuffer_[Size]; + FixedLinearAllocator() + : LinearAllocator(fixedBuffer_, Size) + { + } + static const bool kNeedFree = false; +}; + +// wonder why this isn't a thing already, maybe I missed it +class DirectStringBuffer { +public: + using Ch = char; + char* buffer_; + char* end_; + char* current_; + + DirectStringBuffer(char* buffer, size_t maxLen) + : buffer_(buffer) + , end_(buffer + maxLen) + , current_(buffer) + { + } + + void Put(char c) + { + if (current_ < end_) { + *current_++ = c; + } + } + void Flush() {} + size_t GetSize() const { return (size_t)(current_ - buffer_); } +}; + +using MallocAllocator = rapidjson::CrtAllocator; +using PoolAllocator = rapidjson::MemoryPoolAllocator; +using UTF8 = rapidjson::UTF8; +// Writer appears to need about 16 bytes per nested object level (with 64bit size_t) +using StackAllocator = FixedLinearAllocator<2048>; +constexpr size_t WriterNestingLevels = 2048 / (2 * sizeof(size_t)); +using JsonWriterBase = + rapidjson::Writer; +class JsonWriter : public JsonWriterBase { +public: + DirectStringBuffer stringBuffer_; + StackAllocator stackAlloc_; + + JsonWriter(char* dest, size_t maxLen) + : JsonWriterBase(stringBuffer_, &stackAlloc_, WriterNestingLevels) + , stringBuffer_(dest, maxLen) + , stackAlloc_() + { + } + + size_t Size() const { return stringBuffer_.GetSize(); } +}; + +using JsonDocumentBase = rapidjson::GenericDocument; +class JsonDocument : public JsonDocumentBase { +public: + static const int kDefaultChunkCapacity = 32 * 1024; + // json parser will use this buffer first, then allocate more if needed; I seriously doubt we + // send any messages that would use all of this, though. + char parseBuffer_[32 * 1024]; + MallocAllocator mallocAllocator_; + PoolAllocator poolAllocator_; + StackAllocator stackAllocator_; + JsonDocument() + : JsonDocumentBase(rapidjson::kObjectType, + &poolAllocator_, + sizeof(stackAllocator_.fixedBuffer_), + &stackAllocator_) + , poolAllocator_(parseBuffer_, sizeof(parseBuffer_), kDefaultChunkCapacity, &mallocAllocator_) + , stackAllocator_() + { + } +}; + +using JsonValue = rapidjson::GenericValue; + +inline JsonValue* GetObjMember(JsonValue* obj, const char* name) +{ + if (obj) { + auto member = obj->FindMember(name); + if (member != obj->MemberEnd() && member->value.IsObject()) { + return &member->value; + } + } + return nullptr; +} + +inline int GetIntMember(JsonValue* obj, const char* name, int notFoundDefault = 0) +{ + if (obj) { + auto member = obj->FindMember(name); + if (member != obj->MemberEnd() && member->value.IsInt()) { + return member->value.GetInt(); + } + } + return notFoundDefault; +} + +inline const char* GetStrMember(JsonValue* obj, + const char* name, + const char* notFoundDefault = nullptr) +{ + if (obj) { + auto member = obj->FindMember(name); + if (member != obj->MemberEnd() && member->value.IsString()) { + return member->value.GetString(); + } + } + return notFoundDefault; +} diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitattributes b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitattributes new file mode 100644 index 0000000000..6f598bb7f9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitattributes @@ -0,0 +1,22 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto + +# Explicitly declare text files you want to always be normalized and converted +# to native line endings on checkout. +*.cpp text +*.h text +*.txt text +*.md text +*.cmake text +*.svg text +*.dot text +*.yml text +*.in text +*.sh text +*.autopkg text +Dockerfile text + +# Denote all files that are truly binary and should not be modified. +*.png binary +*.jpg binary +*.json binary \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitignore b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitignore new file mode 100644 index 0000000000..e7e8fba9bb --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitignore @@ -0,0 +1,25 @@ +/bin/* +!/bin/data +!/bin/encodings +!/bin/jsonchecker +!/bin/types +/build +/doc/html +/doc/doxygen_*.db +*.a + +# Temporary files created during CMake build +CMakeCache.txt +CMakeFiles +cmake_install.cmake +CTestTestfile.cmake +Makefile +RapidJSON*.cmake +RapidJSON.pc +Testing +/googletest +install_manifest.txt +Doxyfile +Doxyfile.zh-cn +DartConfiguration.tcl +*.nupkg diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitmodules b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitmodules new file mode 100644 index 0000000000..5e41f7c975 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.gitmodules @@ -0,0 +1,3 @@ +[submodule "thirdparty/gtest"] + path = thirdparty/gtest + url = https://github.com/google/googletest.git diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.travis.yml b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.travis.yml new file mode 100644 index 0000000000..f9319f2edb --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/.travis.yml @@ -0,0 +1,98 @@ +sudo: required +dist: precise + +language: cpp +cache: + - ccache + +env: + global: + - USE_CCACHE=1 + - CCACHE_SLOPPINESS=pch_defines,time_macros + - CCACHE_COMPRESS=1 + - CCACHE_MAXSIZE=100M + - ARCH_FLAGS_x86='-m32' # #266: don't use SSE on 32-bit + - ARCH_FLAGS_x86_64='-msse4.2' # use SSE4.2 on 64-bit + - GITHUB_REPO='miloyip/rapidjson' + - secure: "HrsaCb+N66EG1HR+LWH1u51SjaJyRwJEDzqJGYMB7LJ/bfqb9mWKF1fLvZGk46W5t7TVaXRDD5KHFx9DPWvKn4gRUVkwTHEy262ah5ORh8M6n/6VVVajeV/AYt2C0sswdkDBDO4Xq+xy5gdw3G8s1A4Inbm73pUh+6vx+7ltBbk=" + +before_install: + - sudo apt-add-repository -y ppa:ubuntu-toolchain-r/test + - sudo apt-get update -qq + - sudo apt-get install -y cmake valgrind g++-multilib libc6-dbg:i386 + +matrix: + include: + # gcc + - env: CONF=release ARCH=x86 CXX11=ON + compiler: gcc + - env: CONF=release ARCH=x86_64 CXX11=ON + compiler: gcc + - env: CONF=debug ARCH=x86 CXX11=OFF + compiler: gcc + - env: CONF=debug ARCH=x86_64 CXX11=OFF + compiler: gcc + # clang + - env: CONF=debug ARCH=x86 CXX11=ON CCACHE_CPP2=yes + compiler: clang + - env: CONF=debug ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes + compiler: clang + - env: CONF=debug ARCH=x86 CXX11=OFF CCACHE_CPP2=yes + compiler: clang + - env: CONF=debug ARCH=x86_64 CXX11=OFF CCACHE_CPP2=yes + compiler: clang + - env: CONF=release ARCH=x86 CXX11=ON CCACHE_CPP2=yes + compiler: clang + - env: CONF=release ARCH=x86_64 CXX11=ON CCACHE_CPP2=yes + compiler: clang + # coverage report + - env: CONF=debug ARCH=x86 CXX11=ON GCOV_FLAGS='--coverage' + compiler: gcc + cache: + - ccache + - pip + after_success: + - pip install --user cpp-coveralls + - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h + - env: CONF=debug ARCH=x86_64 GCOV_FLAGS='--coverage' + compiler: gcc + cache: + - ccache + - pip + after_success: + - pip install --user cpp-coveralls + - coveralls -r .. --gcov-options '\-lp' -e thirdparty -e example -e test -e build/CMakeFiles -e include/rapidjson/msinttypes -e include/rapidjson/internal/meta.h -e include/rapidjson/error/en.h + - script: # Documentation task + - cd build + - cmake .. -DRAPIDJSON_HAS_STDSTRING=ON -DCMAKE_VERBOSE_MAKEFILE=ON + - make travis_doc + cache: false + addons: + apt: + packages: + - doxygen + +before_script: + - ccache -s + # hack to avoid Valgrind bug (https://bugs.kde.org/show_bug.cgi?id=326469), + # exposed by merging PR#163 (using -march=native) + # TODO: Since this bug is already fixed. Remove this when valgrind can be upgraded. + - sed -i "s/-march=native//" CMakeLists.txt + - mkdir build + +script: + - if [ "$CXX" = "clang++" ]; then export CXXFLAGS="-stdlib=libc++ ${CXXFLAGS}"; fi + - > + eval "ARCH_FLAGS=\${ARCH_FLAGS_${ARCH}}" ; + (cd build && cmake + -DRAPIDJSON_HAS_STDSTRING=ON + -DRAPIDJSON_BUILD_CXX11=$CXX11 + -DCMAKE_VERBOSE_MAKEFILE=ON + -DCMAKE_BUILD_TYPE=$CONF + -DCMAKE_CXX_FLAGS="$ARCH_FLAGS $GCOV_FLAGS" + -DCMAKE_EXE_LINKER_FLAGS=$GCOV_FLAGS + ..) + - cd build + - make tests -j 2 + - make examples -j 2 + - ctest -j 2 -V `[ "$CONF" = "release" ] || echo "-E perftest"` diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CHANGELOG.md b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CHANGELOG.md new file mode 100644 index 0000000000..0205e7b89f --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CHANGELOG.md @@ -0,0 +1,158 @@ +# Change Log +All notable changes to this project will be documented in this file. +This project adheres to [Semantic Versioning](http://semver.org/). + +## [Unreleased] + +## 1.1.0 - 2016-08-25 + +### Added +* Add GenericDocument ctor overload to specify JSON type (#369) +* Add FAQ (#372, #373, #374, #376) +* Add forward declaration header `fwd.h` +* Add @PlatformIO Library Registry manifest file (#400) +* Implement assignment operator for BigInteger (#404) +* Add comments support (#443) +* Adding coapp definition (#460) +* documenttest.cpp: EXPECT_THROW when checking empty allocator (470) +* GenericDocument: add implicit conversion to ParseResult (#480) +* Use with C++ linkage on Windows ARM (#485) +* Detect little endian for Microsoft ARM targets +* Check Nan/Inf when writing a double (#510) +* Add JSON Schema Implementation (#522) +* Add iostream wrapper (#530) +* Add Jsonx example for converting JSON into JSONx (a XML format) (#531) +* Add optional unresolvedTokenIndex parameter to Pointer::Get() (#532) +* Add encoding validation option for Writer/PrettyWriter (#534) +* Add Writer::SetMaxDecimalPlaces() (#536) +* Support {0, } and {0, m} in Regex (#539) +* Add Value::Get/SetFloat(), Value::IsLossLessFloat/Double() (#540) +* Add stream position check to reader unit tests (#541) +* Add Templated accessors and range-based for (#542) +* Add (Pretty)Writer::RawValue() (#543) +* Add Document::Parse(std::string), Document::Parse(const char*, size_t length) and related APIs. (#553) +* Add move constructor for GenericSchemaDocument (#554) +* Add VS2010 and VS2015 to AppVeyor CI (#555) +* Add parse-by-parts example (#556, #562) +* Support parse number as string (#564, #589) +* Add kFormatSingleLineArray for PrettyWriter (#577) +* Added optional support for trailing commas (#584) +* Added filterkey and filterkeydom examples (#615) +* Added npm docs (#639) +* Allow options for writing and parsing NaN/Infinity (#641) +* Add std::string overload to PrettyWriter::Key() when RAPIDJSON_HAS_STDSTRING is defined (#698) + +### Fixed +* Fix gcc/clang/vc warnings (#350, #394, #397, #444, #447, #473, #515, #582, #589, #595, #667) +* Fix documentation (#482, #511, #550, #557, #614, #635, #660) +* Fix emscripten alignment issue (#535) +* Fix missing allocator to uses of AddMember in document (#365) +* CMake will no longer complain that the minimum CMake version is not specified (#501) +* Make it usable with old VC8 (VS2005) (#383) +* Prohibit C++11 move from Document to Value (#391) +* Try to fix incorrect 64-bit alignment (#419) +* Check return of fwrite to avoid warn_unused_result build failures (#421) +* Fix UB in GenericDocument::ParseStream (#426) +* Keep Document value unchanged on parse error (#439) +* Add missing return statement (#450) +* Fix Document::Parse(const Ch*) for transcoding (#478) +* encodings.h: fix typo in preprocessor condition (#495) +* Custom Microsoft headers are necessary only for Visual Studio 2012 and lower (#559) +* Fix memory leak for invalid regex (26e69ffde95ba4773ab06db6457b78f308716f4b) +* Fix a bug in schema minimum/maximum keywords for 64-bit integer (e7149d665941068ccf8c565e77495521331cf390) +* Fix a crash bug in regex (#605) +* Fix schema "required" keyword cannot handle duplicated keys (#609) +* Fix cmake CMP0054 warning (#612) +* Added missing include guards in istreamwrapper.h and ostreamwrapper.h (#634) +* Fix undefined behaviour (#646) +* Fix buffer overrun using PutN (#673) +* Fix rapidjson::value::Get() may returns wrong data (#681) +* Add Flush() for all value types (#689) +* Handle malloc() fail in PoolAllocator (#691) +* Fix builds on x32 platform. #703 + +### Changed +* Clarify problematic JSON license (#392) +* Move Travis to container based infrastructure (#504, #558) +* Make whitespace array more compact (#513) +* Optimize Writer::WriteString() with SIMD (#544) +* x86-64 48-bit pointer optimization for GenericValue (#546) +* Define RAPIDJSON_HAS_CXX11_RVALUE_REFS directly in clang (#617) +* Make GenericSchemaDocument constructor explicit (#674) +* Optimize FindMember when use std::string (#690) + +## [1.0.2] - 2015-05-14 + +### Added +* Add Value::XXXMember(...) overloads for std::string (#335) + +### Fixed +* Include rapidjson.h for all internal/error headers. +* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342) +* Fix some numbers parsed incorrectly (#336) +* Fix alignment of 64bit platforms (#328) +* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4) + +### Changed +* CMakeLists for include as a thirdparty in projects (#334, #337) +* Change Document::ParseStream() to use stack allocator for Reader (ffbe38614732af8e0b3abdc8b50071f386a4a685) + +## [1.0.1] - 2015-04-25 + +### Added +* Changelog following [Keep a CHANGELOG](https://github.com/olivierlacan/keep-a-changelog) suggestions. + +### Fixed +* Parsing of some numbers (e.g. "1e-00011111111111") causing assertion (#314). +* Visual C++ 32-bit compilation error in `diyfp.h` (#317). + +## [1.0.0] - 2015-04-22 + +### Added +* 100% [Coverall](https://coveralls.io/r/miloyip/rapidjson?branch=master) coverage. +* Version macros (#311) + +### Fixed +* A bug in trimming long number sequence (4824f12efbf01af72b8cb6fc96fae7b097b73015). +* Double quote in unicode escape (#288). +* Negative zero roundtrip (double only) (#289). +* Standardize behavior of `memcpy()` and `malloc()` (0c5c1538dcfc7f160e5a4aa208ddf092c787be5a, #305, 0e8bbe5e3ef375e7f052f556878be0bd79e9062d). + +### Removed +* Remove an invalid `Document::ParseInsitu()` API (e7f1c6dd08b522cfcf9aed58a333bd9a0c0ccbeb). + +## 1.0-beta - 2015-04-8 + +### Added +* RFC 7159 (#101) +* Optional Iterative Parser (#76) +* Deep-copy values (#20) +* Error code and message (#27) +* ASCII Encoding (#70) +* `kParseStopWhenDoneFlag` (#83) +* `kParseFullPrecisionFlag` (881c91d696f06b7f302af6d04ec14dd08db66ceb) +* Add `Key()` to handler concept (#134) +* C++11 compatibility and support (#128) +* Optimized number-to-string and vice versa conversions (#137, #80) +* Short-String Optimization (#131) +* Local stream optimization by traits (#32) +* Travis & Appveyor Continuous Integration, with Valgrind verification (#24, #242) +* Redo all documentation (English, Simplified Chinese) + +### Changed +* Copyright ownership transfered to THL A29 Limited (a Tencent company). +* Migrating from Premake to CMAKE (#192) +* Resolve all warning reports + +### Removed +* Remove other JSON libraries for performance comparison (#180) + +## 0.11 - 2012-11-16 + +## 0.1 - 2011-11-18 + +[Unreleased]: https://github.com/miloyip/rapidjson/compare/v1.1.0...HEAD +[1.1.0]: https://github.com/miloyip/rapidjson/compare/v1.0.2...v1.1.0 +[1.0.2]: https://github.com/miloyip/rapidjson/compare/v1.0.1...v1.0.2 +[1.0.1]: https://github.com/miloyip/rapidjson/compare/v1.0.0...v1.0.1 +[1.0.0]: https://github.com/miloyip/rapidjson/compare/v1.0-beta...v1.0.0 diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CMakeLists.txt b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CMakeLists.txt new file mode 100644 index 0000000000..ceda71b1b6 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CMakeLists.txt @@ -0,0 +1,173 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +if(POLICY CMP0025) + # detect Apple's Clang + cmake_policy(SET CMP0025 NEW) +endif() +if(POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) +endif() + +SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules) + +PROJECT(RapidJSON CXX) + +set(LIB_MAJOR_VERSION "1") +set(LIB_MINOR_VERSION "1") +set(LIB_PATCH_VERSION "0") +set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}") + +# compile in release with debug info mode by default +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) +endif() + +# Build all binaries in a separate directory +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) + +option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON) +option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON) +option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON) +option(RAPIDJSON_BUILD_THIRDPARTY_GTEST + "Use gtest installation in `thirdparty/gtest` by default if available" OFF) + +option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11 (gcc/clang)" ON) + +option(RAPIDJSON_BUILD_ASAN "Build rapidjson with address sanitizer (gcc/clang)" OFF) +option(RAPIDJSON_BUILD_UBSAN "Build rapidjson with undefined behavior sanitizer (gcc/clang)" OFF) + +option(RAPIDJSON_HAS_STDSTRING "" OFF) +if(RAPIDJSON_HAS_STDSTRING) + add_definitions(-DRAPIDJSON_HAS_STDSTRING) +endif() + +find_program(CCACHE_FOUND ccache) +if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics") + endif() +endif(CCACHE_FOUND) + +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror") + if (RAPIDJSON_BUILD_CXX11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + endif() + if (RAPIDJSON_BUILD_ASAN) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0") + message(FATAL_ERROR "GCC < 4.8 doesn't support the address sanitizer") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + endif() + endif() + if (RAPIDJSON_BUILD_UBSAN) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0") + message(FATAL_ERROR "GCC < 4.9 doesn't support the undefined behavior sanitizer") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") + endif() + endif() +elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers") + if (RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() + if (RAPIDJSON_BUILD_ASAN) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address") + endif() + if (RAPIDJSON_BUILD_UBSAN) + if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined") + endif() + endif() +elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + add_definitions(-D_CRT_SECURE_NO_WARNINGS=1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc") +endif() + +#add extra search paths for libraries and includes +SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in") +SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "Directory where lib will install") +SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation") + +IF(UNIX OR CYGWIN) + SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}") +ELSEIF(WIN32) + SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake") +ENDIF() +SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake fiels are installed in") + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) + +if(RAPIDJSON_BUILD_DOC) + add_subdirectory(doc) +endif() + +add_custom_target(travis_doc) +add_custom_command(TARGET travis_doc + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/travis-doxygen.sh) + +if(RAPIDJSON_BUILD_EXAMPLES) + add_subdirectory(example) +endif() + +if(RAPIDJSON_BUILD_TESTS) + if(MSVC11) + # required for VS2012 due to missing support for variadic templates + add_definitions(-D_VARIADIC_MAX=10) + endif(MSVC11) + add_subdirectory(test) + include(CTest) +endif() + +# pkg-config +IF (UNIX OR CYGWIN) + CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + @ONLY) + INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc + DESTINATION "${LIB_INSTALL_DIR}/pkgconfig" + COMPONENT pkgconfig) +ENDIF() + +install(FILES readme.md + DESTINATION "${DOC_INSTALL_DIR}" + COMPONENT doc) + +install(DIRECTORY include/rapidjson + DESTINATION "${INCLUDE_INSTALL_DIR}" + COMPONENT dev) + +install(DIRECTORY example/ + DESTINATION "${DOC_INSTALL_DIR}/examples" + COMPONENT examples + # Following patterns are for excluding the intermediate/object files + # from an install of in-source CMake build. + PATTERN "CMakeFiles" EXCLUDE + PATTERN "Makefile" EXCLUDE + PATTERN "cmake_install.cmake" EXCLUDE) + +# Provide config and version files to be used by other applications +# =============================== + +export(PACKAGE ${PROJECT_NAME}) + +# cmake-modules +CONFIGURE_FILE(${PROJECT_NAME}Config.cmake.in + ${PROJECT_NAME}Config.cmake + @ONLY) +CONFIGURE_FILE(${PROJECT_NAME}ConfigVersion.cmake.in + ${PROJECT_NAME}ConfigVersion.cmake + @ONLY) +INSTALL(FILES + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake + DESTINATION "${CMAKE_INSTALL_DIR}" + COMPONENT dev) diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CMakeModules/FindGTestSrc.cmake b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CMakeModules/FindGTestSrc.cmake new file mode 100644 index 0000000000..f3cb8c9908 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/CMakeModules/FindGTestSrc.cmake @@ -0,0 +1,30 @@ + +SET(GTEST_SEARCH_PATH + "${GTEST_SOURCE_DIR}" + "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest/googletest") + +IF(UNIX) + IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST) + LIST(APPEND GTEST_SEARCH_PATH "/usr/src/gtest") + ELSE() + LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest") + ENDIF() +ENDIF() + +FIND_PATH(GTEST_SOURCE_DIR + NAMES CMakeLists.txt src/gtest_main.cc + PATHS ${GTEST_SEARCH_PATH}) + + +# Debian installs gtest include directory in /usr/include, thus need to look +# for include directory separately from source directory. +FIND_PATH(GTEST_INCLUDE_DIR + NAMES gtest/gtest.h + PATH_SUFFIXES include + HINTS ${GTEST_SOURCE_DIR} + PATHS ${GTEST_SEARCH_PATH}) + +INCLUDE(FindPackageHandleStandardArgs) +find_package_handle_standard_args(GTestSrc DEFAULT_MSG + GTEST_SOURCE_DIR + GTEST_INCLUDE_DIR) diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSON.pc.in b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSON.pc.in new file mode 100644 index 0000000000..7467f9779b --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSON.pc.in @@ -0,0 +1,7 @@ +includedir=@INCLUDE_INSTALL_DIR@ + +Name: @PROJECT_NAME@ +Description: A fast JSON parser/generator for C++ with both SAX/DOM style API +Version: @LIB_VERSION_STRING@ +URL: https://github.com/miloyip/rapidjson +Cflags: -I${includedir} diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSONConfig.cmake.in b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSONConfig.cmake.in new file mode 100644 index 0000000000..9fa12186ab --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSONConfig.cmake.in @@ -0,0 +1,3 @@ +get_filename_component(RAPIDJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) +set(RAPIDJSON_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@") +message(STATUS "RapidJSON found. Headers: ${RAPIDJSON_INCLUDE_DIRS}") diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSONConfigVersion.cmake.in b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSONConfigVersion.cmake.in new file mode 100644 index 0000000000..25741fc097 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/RapidJSONConfigVersion.cmake.in @@ -0,0 +1,10 @@ +SET(PACKAGE_VERSION "@LIB_VERSION_STRING@") + +IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) + SET(PACKAGE_VERSION_EXACT "true") +ENDIF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION) +IF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + SET(PACKAGE_VERSION_COMPATIBLE "true") +ELSE (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) + SET(PACKAGE_VERSION_UNSUITABLE "true") +ENDIF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION) diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/appveyor.yml b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/appveyor.yml new file mode 100644 index 0000000000..dfedf9c297 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/appveyor.yml @@ -0,0 +1,41 @@ +os: Visual Studio 2015 CTP +version: 1.1.0.{build} + +configuration: +- Debug +- Release + +environment: + matrix: + # - VS_VERSION: 9 2008 + # VS_PLATFORM: win32 + # - VS_VERSION: 9 2008 + # VS_PLATFORM: x64 + - VS_VERSION: 10 2010 + VS_PLATFORM: win32 + - VS_VERSION: 10 2010 + VS_PLATFORM: x64 + - VS_VERSION: 11 2012 + VS_PLATFORM: win32 + - VS_VERSION: 11 2012 + VS_PLATFORM: x64 + - VS_VERSION: 12 2013 + VS_PLATFORM: win32 + - VS_VERSION: 12 2013 + VS_PLATFORM: x64 + - VS_VERSION: 14 2015 + VS_PLATFORM: win32 + - VS_VERSION: 14 2015 + VS_PLATFORM: x64 + +before_build: +- git submodule update --init --recursive +- cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=true -Wno-dev + +build: + project: Build\VS\RapidJSON.sln + parallel: true + verbosity: minimal + +test_script: +- cd Build\VS && if %CONFIGURATION%==Debug (ctest --verbose -E perftest --build-config %CONFIGURATION%) else (ctest --verbose --build-config %CONFIGURATION%) diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/glossary.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/glossary.json new file mode 100644 index 0000000000..d6e6ca1507 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/glossary.json @@ -0,0 +1,22 @@ +{ + "glossary": { + "title": "example glossary", + "GlossDiv": { + "title": "S", + "GlossList": { + "GlossEntry": { + "ID": "SGML", + "SortAs": "SGML", + "GlossTerm": "Standard Generalized Markup Language", + "Acronym": "SGML", + "Abbrev": "ISO 8879:1986", + "GlossDef": { + "para": "A meta-markup language, used to create markup languages such as DocBook.", + "GlossSeeAlso": ["GML", "XML"] + }, + "GlossSee": "markup" + } + } + } + } +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/menu.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/menu.json new file mode 100644 index 0000000000..539c3af201 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/menu.json @@ -0,0 +1,27 @@ +{"menu": { + "header": "SVG Viewer", + "items": [ + {"id": "Open"}, + {"id": "OpenNew", "label": "Open New"}, + null, + {"id": "ZoomIn", "label": "Zoom In"}, + {"id": "ZoomOut", "label": "Zoom Out"}, + {"id": "OriginalView", "label": "Original View"}, + null, + {"id": "Quality"}, + {"id": "Pause"}, + {"id": "Mute"}, + null, + {"id": "Find", "label": "Find..."}, + {"id": "FindAgain", "label": "Find Again"}, + {"id": "Copy"}, + {"id": "CopyAgain", "label": "Copy Again"}, + {"id": "CopySVG", "label": "Copy SVG"}, + {"id": "ViewSVG", "label": "View SVG"}, + {"id": "ViewSource", "label": "View Source"}, + {"id": "SaveAs", "label": "Save As"}, + null, + {"id": "Help"}, + {"id": "About", "label": "About Adobe CVG Viewer..."} + ] +}} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/readme.txt b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/readme.txt new file mode 100644 index 0000000000..c53bfb8b72 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/readme.txt @@ -0,0 +1 @@ +sample.json is obtained from http://code.google.com/p/json-test-suite/downloads/detail?name=sample.zip diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/sample.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/sample.json new file mode 100644 index 0000000000..30930e765d --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/sample.json @@ -0,0 +1,3315 @@ +{ + "a": { + "6U閆崬밺뀫颒myj츥휘:$è–ˆmYí–š#rzé£+玭V㭢뾿愴Yî°‘ê–šX亥ᮉ푊\u0006åž¡ã­ë£\"厓ᔧḅ^Sqpv媫\"⤽걒\"˽Ἆ?ꇆ䬔未tv{DV鯀Tἆl凸g\\㈭ĭ즿UH㽤": null, + "b茤z\\î¨.N": [[ + "ZL:ᅣዎ*Y|çŒ«åŠæ«•è¾Oj为1糕쪥æ³S룂w࡛á²â¸¥èš™)", + { + "\"䬰á»wDæ¾V`邀⠕VDãºsH6[칑.:醥葹*뻵倻aD\"": true, + "e浱uî¿£p蔽Crà· JK軵xCʨ<뜡癙Yç©ï½¹é½ˆX/螗唻?<蘡+뷄㩤쳖3å‘犾&\\첊xzå崦ݻé´\"åµ¥B3㰃詤豺嚼aqJ⑆∥韼@\u000b㢊\u0015L臯.샥": false, + "l?Ǩ喳e6㔡$M꼄I,(3á縢,䊀疅뉲B㴔傳䂴\u0088㮰钘ꜵ!ᅛ韽>": -5514085325291784739, + "o㮚?\"춛㵉<\/﬊ࠃ䃪ä£wp6ἀ䱄[s*S嬈貒pᛥ㰉'ë€": [{ + "(QP윤懊FI<ꃣ『䕷[\"ç’å¶®?%Ḭå£à²»ä‡Ÿ0è¤!è—²ë¹bdæµ¶tl\u2049#쯀@僞": {"î—i妾8홫": { + ",Mï£ë§ƒäž›K5nAㆴVNã’Ší–¬$n꩑&êŽæ¤žî·é˜«?/á¹ì„¸ë‰ª1x쥼㻤㪙`\"$쟒薟B煌܀ì¨à­2掳7㙟鴙Xå©¢\u0002": "Vዉèˆï ’᧷⦌kîŒï®žà°ˆnz*ï·œFM\"è­7ê€-VR<\/';ä™E9$䩉\f @s?íªo3^è¡´cî˜à¶Žä§ªaK鼟q䆨c{ä³ 5mᒲՙ蘹ᮩ": { + "Fã²·JGoâ¯Pëµxë’³p䘧☔\"+ꨲå¿JfR㔹)4nç´¬G练Qáž!C|": true, + "p^㫮솎ocî’£.೚A㤠??r\u000f)⾽⌲們M2.䴘䩳:⫭胃\\á¾@Fá­Œ\\K": false, + "蟌Tk愙潦伩": { + "aï‘<\/@ᾛ慂侇瘎": -7271305752851720826, + "艓藬/>á„ṯ,XW~㲆w": {"Eç—§î–郶)㜓ha朗!N赻瞉駠uC\u20adè¾ x퓮⣫P1à «LMMX'M刼唳ë¤": null, + "P쓫晥%k覛ዩIUᇸ滨:å™í˜²lMR5䋈V梗>%å¹½ué –\\)쟟": null, + "eg+昉~矠䧞难\b?gQì­·ç­\\eê® Nl{ಢ哭|]Mn銌╥zê–˜zⱷ⭤ᮜ^": [ + -1.30142114406914976E17, + -1.7555215491128452E-19, + null, + "渾ã¨ß牄귛r?ëŒ?w[âšžÓ»~廩輫㼧/", + -4.5737191805302129E18, + null, + "xyà¿‘M[ocì…’ç«“â’ºx?뜓y䊦>-Dì¼(&&?XKkc꩖ﺸá‹ëµžK伕6à§€)딀PæœyWæ™îž¢?훻魢傎EG碸9類៌g踲C⟌aEX舲:z꒸许", + 3808159498143417627, + null, + {"m試\u20df1{G8&뚈h홯J<\/": { + "3ஸ厠zs#1K7:rᥞoꅔꯧ&ë‡éµ¼éž«6è·œ#赿5l'8{7㕳(b/j\"厢aqç±€êš\u0015厼稥": [ + -2226135764510113982, + true, + null, + { + "h%'ë§žï–±Sì‹…Hs&dï”l슾W0jé¿M×D놯L~S-㇡Rì­¬%": null, + "⟓咔謡칲\u0000孺ꛭx旑檉㶆?": null, + "æ‡I転;￸B2Y`z\\ç“w,ë†æ¿æ’埵䂄)!ä¶¢D=à´­ã´ŸjyY": { + "$ࡘt厛毣ൢIèŠ<겿骫⫦6tr惺a": [ + 6.385779736989334E-20, + false, + true, + true, + [ + -6.891946211462334E-19, + null, + { + "]-\\êŸ1/è–“â§á½Š\\l牑\u0007A郃)阜ᇒᓌ-塯`W峬G}SDb㬨Q臉⮻빌O鞟톴첂B㺱<ƈmu챑J㴹㷳픷Oㆩs": { + "\"â—‰B\"pᶉt骔J꩸ᄇá›iâ•°æ ›K쉷㉯é©!ãˆnì¹äŸ…難>盥yé“¿eà­”è’M貹ヅ8å˜‹í€¯ä‰¶áŒ¥ã¢æ®Šë»³\"絧╿ꉑ䠥?∃蓊{}㣣Gk긔H1哵峱": false, + "6.瀫cN䇮F㧺?\\椯=ÚˆT䘆4â˜ïšŒ8qv": -3.5687501019676885E-19, + "Q?yऴr혴{஀䳘p惭f1ﹸ䅷䕋贲<ྃᄊ繲hq\\b|#QSTî“¶s1c-7(äµ¢\u2069åŒçµ˜ê¯‰:læ¯´ï›æ±žt戀oà·Ÿáµ¶ë®±á£-醇Jx䙬äí–¢0࣫á¡grã„›": "\u0011_xM/蘇Chv;dhA5.嗀绱V爤ﰦiëµ²M", + "â‘[\"ugoy^儣횎~U\\섯겜ï¥l2jw஌yD腅̂\u0019": true, + "ⵯɇä²á«¿à¢š!㯢l샅笶戮1꣖0Xe": null, + "劅fë„€ï‹ï§¼bå®ç„ŠE찓橵G!ʱç“뭔雩괛": [{"p⹣켙[q>燣äƒãž½î›œá©²x:쓤삘7玑퇼0<\/qç’‚á‘[ï ™Z\\3䅵䧳\u0011㤧|妱緒C['ì·“Yꞟ3Z鳱雼P錻BUì”§U`ᢶg蓱>.1Ó§è­«'L_5VäµÐ¦": [ + false, + false, + {"22ä‚盥N霂얢躰îe9â‘©_뵜斌n@B}$ê´»Yá±@ä§‹î´½V\"☒-諯cVë¯Ê ": true, + "Ű螧ᔼæªéŽë•’딜qꄃH뜣<ç§à¥‚CYå“â¸>XQ㵡趌oë¬k픀빯a(ܵç”ë†à­¯/6Nᪧ}æšá†šì§ŒP牰泱鈷^d꣟#Lì‚€\"㕹襻;k㸊\\f+": true, + "쎣\",|⫝̸阊x庿k잣v庅$éˆê´Žç‚”k쬪O_": [ + "ìž©AzZGz3v愠ꉈⵎ?㊱}Så°³à¯p\r2>ì·IP䘈M)w|\u000eE", + -9222726055990423201, + null, + [ + false, + {"´킮'뮤쯽Wxè®V,6ᩪ1ç´²aႈ\u205czD": [ + -930994432421097536, + 3157232031581030121, + "l貚PY䃛5@ä­„ê·»m㎮ç¸fî§¡": 1.0318894506812084E-19, + "࢜⩢Ш䧔1肽씮+༎ᣰ闺馺窃䕨8Mƶqè…½xc(៯å¤J5굄ä•Qj_훨/~価.䢵慯틠퇱豠㼇Qﵘ$DuSp(8Uà¸<\/ಟ룴𥳐ݩ$": 8350772684161555590, + "ㆎQ䄾\u001bpá©­${[諟^^骴᤮b^ã…¥Iâ”§T㉇⾞\"绦rä°‚f矩'-î½7ä¡­æ¡¥Dz兔V9è°¶å±…ãºá”Šä©¯ë².\u001eL0ὅㅷ釣": [{ + "<쯬Jå·^숞u࠯䌗艞R9닪gã¾ë³Ža䂈歖æ„:%é”|ﵤ|y}î¡»>;2,覂⶚啵tb*ä»›8ä¹’ã“¶B࿠㯉戩oX 貘5V嗆렽ë‚߼4hä§›êºM空\\b꿋貼": 8478577078537189402, + "VD*|ï§­z~hè­ºaᯒ": { + "YIì·¢K<\/濳xNne玗rJo쾘3í•°é´Š\"↱AR:ࢷ\"9?\"è‡ï¦¡)?誚êŠe)_D翾W?&F6J@뺾ê°NZ醊Z쾈വHï±å¶¿?炫㷱鬰M겈᭨b,â»éˆµP䕡䀠८ⱄ홎鄣": { + "@?k2é¶–ã‹®\"Oರ K㨇廪儲\u0017ä¾î¿‚J?);\b*묀㗠섳햭1MC V": null, + "UIICP!BUA`î€á¢ˆã‹¸~袩㗪⾒=fBï®´l1ꡛ죘R辂여ҳ7쮡<䩲`熕8é ": 4481809488267626463, + "Y?+8먙ᚔ鋳蜩ï–럶1㥔y璜౩`": [ + null, + 1.2850335807501874E-19, + "~V2", + 2035406654801997866, + { + "<숻1>\"": -8062468865199390827, + "Mã¿£ï€E]}qwG莎Gná¶(ê”™\\D⬲iꇲs寢t駇S뀡ꢜ": false, + "pê¤ãŽ9W%>M;-Uç’fî£(^j1?&RBéš§ å¿“b똊îƒE": "#G?C8.躬ꥯ'?냪#< 渟&헿란zpo왓Kj}é·§XﻘMツbä•–;㪻", + "vE풤幉xz뱕쫥Ug㦲aH} ᣟp:鬼Yá°ŸH3镔ᴚ斦\\é‘r*2橱Gâ¼”F/.j": true, + "RK좬뎂aí™ f*f㱉á®â¦‹æ½™ã¨‹Gu곌SGI3Ië¿\\F',)t`è蘯囯ﮉ裲뇟쥼_ገ驪▵æ’ᕤV": 1.52738225997956557E18, + "^k굲䪿꠹B逤%F㱢漥O披M㽯镞竇霒i꼂焅륓\u00059=皫之눃\u2047娤é–銤唫á•b<\/w踲䔼u솆맚,ä’á³'/it": "B餹饴is権ꖪ怯ꦂẉဎt\"!凢谵⧿ï™0\\<=(uLä·åˆ¨ì‘ª>俆æ“Cy襸Q힆䆭涷<\/á±0î É§îŠ‹䗾䚹\\ኜ?ꄢᇘ`ä´¢{囇}᠈䴥X4퓪檄]ꥷ/3謒ሴn+gé¨X", + "GgG꽬[(å«“ëª6\u0004ê¶宩㙻/>\u0011^è¾dTè…ªhxÇ‘%ꊇk,8(Wâ§‚çµP鬜O": [{ + "Mã´¾c>\\ᓲ\u0019V{>ꤩ혙넪㭪躂TS-痴໸闓âµ/徯O.Mã¥Ê·D囎⧔ì³íœ¤T??鉬뇙=#ꢫ숣BXä­¼<\/d똬졬g榿)eꨋﯪ좇첻\u001a\u0011\";~쓆BH4勿”Š7힪", + "iT:L闞椕윚*æ»›gI≀Wਟඊ'ꢆ縺뱹鮚Nê©á§¬è•¼21줧\\䋯``â\\ã±é³¨": 1927052677739832894, + "ì®ç¼¦è…ƒg]礿Y㬙 fî¼ãƒºSɪ꾾N㞈": [ + null, + null, + { + "!t,çY 1䗉罵?c饃호䉂Cá­ì’˜z(즽sZG㬣sഖE4ï‚뢜㓕äžä¸®Qpç°6EZឪ겛fx'ꩱQ0ç½£i{k锩*㤴㯞r迎jTⲤ渔m炅肳": [ + -3.3325685522591933E18, + [{"ã“5]A䢕1룥Bï²C?Ꙍ`r룔Ⳛ䙡uä¼²+\u0001àµo": [ + null, + 4975309147809803991, + null, + null, + {"T팘8Dﯲ稟MM☻㧚䥧/8ﻥ⥯aXLaH\"顾S☟耲ît7fSà·‰ë†ë®”/ꕼ䓈ìº4\\霶䠴ᩢ<\/t4?죵>uDï›5➶༆쉌럮⢀秙䘥\u20972ETR3æ¿¡æ†vB? ~鸆\u0005": { + "`é––mç’㥉b뜴?Wf;?DV콜\u2020í‰à±“æ“å®ZMj3mJ먡-å‚·ë±™yח㸷꥿ ໘u=Mì!5å­L4v\\?ÇŽ7C홫": null, + "|": false, + "~Ztᛋ䚘\\æ“­ã—傪Wé™–+ã—¶qᵿ蘥ᙄp%䫎)}=â ”6ᮢS湟-èž¾-mXH?cp": 448751162044282216, + "\u209fad놹j檋䇌ᶾ梕ã‰bוּ": {"?è‹´ê© D䋓帘5騱qï±–PF?☸ç—é¡’yU á¡«cb䫎 S@㥚gꮒ쎘泴멖\\:Ié®±TZ듒ᶨQ3+f7캙\"?\fí’¾\\oæžç´Ÿï»½M.âŽï˜¸é‘OP": [ + -2.6990368911551596E18, + [{"ä’–@<á°¿<\/⽬tTrè…ž&G%᳊秩蜰擻f㎳?Sãµ§\r*k뎾-乢겹隷j軛겷0ë£é®ï µ": {")DO0è…¦:ì¶é€¿:1㥨่!è›æ¨‹2": [{ + ",ꌣf侴笾m๫ꆽ?1?U?\u0011ꌈꂇ": { + "xæ—ç” nVqä…¦w`CD⦂惺嘴0I#vỵ} \\ê·‚Së´Dì–¾?Ô’j溯\"v餄a": { + "@ç¿™c⢃趚痋i\u0015OQâlqë†Y0pࢥ3쉨䜩^<8g懥0w)]䊑næ´ºo5ì­QL댊랖L镈Qnt⪟㒅십q헎鳒⮤眉ᔹ梠@O縠u泌ㄘb榚癸Xî©­Þ”Ftj;iC": false, + "I&뱋゘|ï£è“”䔕측瓯%6á—»HW\\N1貇#?åƒá—œghá­ªo'䗈꽹Rcìš/蔳迄à¼!0邔䨷푪8ç–©)[쭶緄㇈୧á": { + "B+:ꉰ`sì¾­)ë¹¼Cç¾A䫊pMgjdxäHf9᥸W0!C樃'ï¤f䫤סи\u0017Jve? è¦f둀⬣퓉Whk\"஼=չï³î•¤çš†ç¬BIW虨쫓F廰饞": -642906201042308791, + "sb,XcZ<\/m㉹ ;ä‘·@cäµ€s奤⬷7`ꘖ蕘戚?Feb#輜}p4nH⬮eKL트}": [ + "RKé³—z=袤Pf|[,u욺", + "Ẏá»ç½¯ë‰‹âº–锅젯㷻{H䰞쬙-ì©“D]~\u0013Oã³¢gb@æ¶è”‰|kᦂâ—!\u001ebMè¤sca쨜襒y⺉룓", + null, + null, + true, + -1.650777344339075E-19, + false, + "☑lꄆs힨꤇]'uTന⌳ë†].1â‹”ê´æ²°\"IWà´©\u0019æ°œ8쟇䔻;3衲æ‹,窌zíŽå–íš—?4?Cë„é—®?ᥙ橭{稻Ⴗ_ì”", + "n?]讇빽å—}1å­…9#ê­¨é¶v\u0014å–ˆ)vw祔}룼쮿I", + -2.7033457331882025E18, + { + ";⚃^㱋x:饬ኡj'ê§µT☽O㔬RO婎?향ᒭæ©$渣y4i;(Q>꿘e8q": "j~錘}0g;Lèº*;á•­ê„®0l潛烢5H▄쳂ê’ï­‹ê™¶T犘≫x閦웧v", + "~î¢æ¯\u2018c4è·ë E~ᑅቚꈂ?nq뎤.:æ…¹`F햘+%鉎Oç€œìŸæ•›è®âŒæµ¢<\/㮺紿P鳆ࠉ8I-o?#jﮨîŸ7v3Dt赻J9": null, + "à£W䌈0êŽqC逖,íš…î·Žcáƒswj;jJSæ«5æ§—OaB>D踾Y": {"ã’°äµF%î©®?59.î„„ãˆcᕨï†í•틎á¸ã‹©B=9IÛⓌ{:9.ywï½å‘°ã†®è‚’᎒tIã¾´62\"ዃ抡C﹬B<\/ì´‹jo朣", + [ + -7675533242647793366, + {"ᙧ呃ï£:[㒺쳀쌡ì‚H稈㢤\u001dá¶—GG-{GHྻຊꡃ哸䵬;$?&d\\⥬ã“Nåœ´ë¤æŒ¨-'ê•®$î“‹PU%?冕눖ié­q騎Q": [ + false, + [[ + 7929823049157504248, + [[ + true, + "Zè™\u0017'eꕤ᱕l,0\\X\u001c[=雿8è ¬L<\/낲긯W99g톉4ퟋbãº\u0007åŠ'!麕Q궈oW:@XáŽïœ¬z蘻m絙璩귓죉+3柚怫tSæ‡è’£ä -æ“¶D[0=퉿8)q0ÙŸ", + "唉\nFA椭穒巯\\䥴䅺鿤S#bè¿…ç˜ ï¶—ê¬˜\\?q1qN犠pX꜅^䤊⛤㢌[⬛휖岺q唻ⳡí‹\"ã™™Eh@oA賑㗠yå¿…Nꊑᗘ", + -2154220236962890773, + -3.2442003245397908E18, + "Wá„¿ç­ :瘫퀩?o貸q⊻(᎞KWf宛尨h^残3[U(='æ©„", + -7857990034281549164, + 1.44283696979059942E18, + null, + {"ꫯAwè·­å–€ ?_ï““9\"Aty背F=9缉ྦྷ@;?^鞀w:uN㘢Rá»": [ + 7.393662029337442E15, + 3564680942654233068, + [ + false, + -5253931502642112194, + "ç…‰\\îš¶î¶è¾Žî›¢à³†ç½5â’­1äªäƒ‘s䎢:[e5}峳ﴱn騎3?è…³Hyêƒè†¼N潭錖,Yá‹ËœYAá“㬠bG렣䰣:", + true, + null, + { + "â’›'P&%죮|:â«¶ì¶ž": -3818336746965687085, + "钖m<\/0ÝŽMtF2Pk=瓰୮洽겎.": [[ + -8757574841556350607, + -3045234949333270161, + null, + { + "áœî…½rè¼³>⫇9hU#î¦#w@ê·ªA\\Cî’¢ é‹ºã˜“ê–æ¢’뒬묹㹻+郸å¬ìœ¤'+g<\/碴,}ꙫ>ì†;情d齆Jä¬àº©æ’›ì±íƒ¹/R澡7剌tꤼ?ặ!`â²ç¤\u00002똥଴âŸ": null, + "\u20f2ܹe\\tAê¥Æ°\\x当뿖ï»ë ‰ç¦›;G檳ﯪï…Sà«°3~㘠#[J<}{奲 5箉⨔{ë†<\/釿抋,åš /曳m&WaOvT赋皺璑ï“í…": [[ + false, + null, + true, + -5.7131445659795661E18, + "è­m䓪D5|3å©à°ž>î‰è ‡æ™¼6nï´ºPp禽羱î¤DS<ç“닫屚ì‚å§¿", + true, + [ + -8759747687917306831, + { + ">ⓛ\t,odKr{䘠?b퓸C嶈=DyEᙬï¿@ᴔ쨺芛髿UT퓻春<\/yê¸>豚W釺N뜨^?꽴﨟5殺ᗃç¿%>í‚ဿ䄸沂Ea;A_\u0005閹殀W+窊?Ꭼd\u0013Pæ±´G5ì“æ˜": 4.342729067882445E-18, + "Q^즾眆@AN\u0011Kb榰냎Y#ä€ê€’ᳺ'q暇çµs\"!3#I⊆畼寤@HxJ9": false, + "⿾D[)袨㇩i]웪䀤ᛰMvR<èŸã£¨": {"v퇓L㪱ꖣ豛톤î£\\ê³±#ï–©kDTN": [{ + "(ì¾´ä¡£,寴ph(C\"ã³¶w\"憳2s馆E!n!&柄<\/0Pꈗſ?㿳Qdéµ”": {"娇堰孹L錮h嵅⛤èºé¡’?CglNæŸ+쨣ﺜ\\MrH": {"çžäŽ‡ë‘ƒá‰²å¼­íŒ­^ꄞ踦涟XK錆쳞ឌ`;੶S炥騞ଋ褂B៎{Ú’ä­·á¶¼éœpIè—è™¶K$": [{"â—–S~躘蒉꫿輜è­Qã½™é—@ᢗ¥Eæ¦iØ¡5┄^B[絮跉ᰥé™PWi3wㄾⵀDJ9!w㞣ᄎ{ë“’ê““b6\\篴??c⼰鶹⟧\\鮇ꮇ": [[ + 654120831325413520, + -1.9562073916357608E-19, + { + "DC(æ˜è¡µá¼¡ê¸™ê°µå§­|Ö›[t": 7.6979110359897907E18, + "Jâ…))嫼â³9Xfd飉j7猬ᩉ+⤻î®çœ—벎Eé°‰Zï¾¶63zá69}Zá¶L崭ᦥ⡦éšâ‹›êŽ¨î´µ~i㨃咊ꧭo䰠阀3C(": -3.5844809362512589E17, + "p꣑팱쒬ꎑ뛡Ꙩ挴æèƒ”&7ᔈ묒4Hdç¡¶í›ãŽ–zꢼè±ã¿¢aሃ=<\/湉鵲Eî„¡Ó…%$F!í¶æ£Œå­¼{Oé§à¨ºgeu+": ")\u001bìž“kÅ€Xì©«Aë°Â®Ú£ç™¦ç‹¢)扔弒p}k縕ꩋ,䃉tࣼi", + "ã‚¡F肿輸<솄G-䢹䛸êŠl`Tqê•—îŠè’ža氷⸅ᴉ蠰]S/{J왲m5{9.uá½³~㕚㣹u>x8Uè®Bëºè¥ªç›ŽQhVS맅킃i识{벂磄Ià·„ä™…xZy/æŠà«­Zï–Šé²î¦š-霳Væ®æŒ¦â„’": null, + "㯛|Nî½™ê¸b7âµb?æ‹ O\u0014Þ†?-(EꞨ4ꕷᄤYᯕï‘OW瞺~螸\"욿ќe㺰\"'㌢ÆW\u0004çž•>0?V鷵엳": true, + "뤥G\\î¡‹è¿‹ä ¿[庩'꼡\u001aiá©®Vì¯á³ªä¦ªÃ”î²…;倱ନë›èªˆ": null, + "쥹䄆䚟Qæ¦äŽá¢­<\/2ã•£p}HW蟔|äƒî‚꿈ꚉ锳2Pb7㙑Tⅹᵅ": { + "Y?Ö­$>#cVBꩨ:>ï†eLè’å‹™": { + "86柡0po äš&-æ‘Ћ祌<\/휃-G*㶢הּì©s㶟餇c걺yu꽎還5*í„§ç°•Ogå©¥Sê": null, + "a+葞h٥ࠆ裈嗫ﵢ5輙퀟ᛜ,QDﹼ⟶Y騠锪E_|x죗jä¾µ;m蜫轘趥?븅w5+miì½›L": { + ";⯭ﱢ!ä¹°Fâ½æŸ¤é¶‚näµ£V㫚墱2ë ¾ELEl⣆": [ + true, + -3.6479311868339015E-18, + -7270785619461995400, + 3.334081886177621E18, + 2.581457786298155E18, + -6.605252412954115E-20, + -3.9232347037744167E-20, + { + "B6㊕.k1": null, + "ZAê„®Jé®·á³±o갘硥鈠䠒츼": { + "á•…}럡}.@y陪é¶r業'æ´î‰°í€‰x䉴ﵴlí˜):씭脴ᥞhiꃰblﲂ䡲엕8߇Mã¶­0燋標æŒ-?PCwe⾕J碻Ᾱ䬈䈥뷰憵賣뵓痬+": {"aì·©v礗X⋈耓áŠfç½…é®!㔽YYᣓwæ¾33⎔芲F|\"äœT↮輦挑6ᓘL侘?ᅥ]ë†1R௯✎餘6ê½<\/௨\\?qå–·ê«j~@ulq": {"嗫欆뾔Xꆹ4H㌋Fåµ§]à Ž]ã –1ꞤT<$më«O i댳0ä²iï—Œ": {"?à·©?\u20cd슮|ꯆjs{?îž…d7?eNs⢚嫥氂䡮쎱:鑵롟2hJꎒﯭ鱢3춲亄:ë¼£v䊭諱Yj択cVmR䩃㘬T\"Ní™*ै%x^F\\_s9ë³´zz4æ·—?q": [ + null, + "?", + 2941869570821073737, + "{5{殇0ä¾ïž¢g6ë°–í‹è‡©ç¶¹R$ä–­j紋釰7î‹‘sXI繳漪행y", + false, + "aH磂?뛡#惇då©…?Fe,ì˜+늵ä˜\"3r瘆唊å‹ï¢Šj⳧࠴ꇓ<\/唕윈x⬌讣䋵%拗ᛆⰿ妴á”M2ã³—å¿…ê§‚æ·²?ゥ젯檢<8ë’ï¶MidXä’3á³»Qî”â–®ä½UT|⤪봦éâŠ", + [[{ + "颉(&뜸귙{yîš’^\"P퟉ì¶á²Ÿä®­î‹ºDé¡¡9=?}Y誱<$bë±£RvO8cH煉@tk~4ǂ⤧â©å±‹Sî›ïž¢S;J{vV#剤餓ᯅc?#a6D,s": [ + -7.8781018564821536E16, + true, + [ + -2.28770899315832371E18, + false, + -1.0863912140143876E-20, + -6282721572097446995, + 6767121921199223078, + -2545487755405567831, + false, + null, + -9065970397975641765, + [ + -5.928721243413937E-20, + {"6ì´Š\u001a홯kB0w撨燠룉{绎6⳹!í„è´‘y▾鱧ժ[;7ᨷ∀*땒䪮1x霆Hᩭ☔\"rî¹›ä7毟á°r惃3ꉭE+>僒æ¾": [ + "Ta쎩aÆt쵯ⰪVb", + [ + -5222472249213580702, + null, + -2851641861541559595, + null, + 4808804630502809099, + 5657671602244269874, + "5犲﨣4mᥣ?yf젫꾯|䋬ìž$`Iⳉﴷ扳å…,'î±c", + false, + [ + null, + { + "DyUIN쎾M仼惀⮥裎岶泭lh扠\u001e礼.tEC癯튻@_Qd4cï…«5S熯A<\/ï¼¼6U윲蹴Q=%푫汹\\\u20614b[௒Câ’¥Xe⊇囙b,ï®æœ3ss땊ë¢i~逇PA쇸1": -2.63273619193485312E17, + "Mq꺋貘k휕=nKç¡ë«žè¼©>㾆~á¼žà¡¹ê¸æ¦µlâ‹™Hw뮢帋M엳뢯î¹…vâ…ƒ^": 1877913476688465125, + "á¶´ë»—`~ç­—å…⚽টW˃â½b犳䓺Iz篤p;乨A\u20efì©?ç–Šmã€ì»©ë«¡b탔鄃ᾈV(é¢ç³=뎲ିeF仢䆡谨8t0醄7㭧瘵⻰컆r厡궥d)a阄á·Ed&c﯄伮1p": null, + "â¯w4曢\"(欷輡": "\"Má­«]䣒頳B\\燧ࠃN㡇j姈g⊸⺌忉ꡥF矉স%^", + "㣡Oᄦ昵⫮Y祎Sì級㭻撥>{I$": -378474210562741663, + "䛒掷留Q%ì“—1*1J*ë“헩ᦢ﫫哉쩧EↅIcê…¡\\?â´Šl귛顮4": false, + "寔愆샠5]ä—„IHï©¥=d﯊/å¶?ॊn%晥D視Nò—˜ˆ'᫂⚦|X쵩넽z질tsî¦kxDQ莮Aoﱻ뛓": true, + "é’£xp?&\u001e侉/yä´¼~?U篔蘚缣/î”›I畚ï—?Q绊": -3034854258736382234, + "꺲໣眀)â¿·J暘î©pИfAVì‚•ì³­Nꯗ4々'唄ⶑ伻㷯騑倭D*Okï¯ê§3bâ½_ï„¡<\/ì±£Xm톰á•䆄`*fl㭀暮滠毡?": [ + "Dç”·p`V뙸擨å¿ë¸ª9c麺`淂⢦Yw⡢+kzÜ–\fY1䬡Hæ­)ë²¾Z♤溊-혰셢?1ï”<-\u0005;æ¢Tále\\ᛵߓﭩ榩è¨-xJ;å·¡8깊è ï»“U$K": { + "Vê•¡è«…æ“W=斸s︪vﲜ츧$)iꡟ싉eî®å¯³?ጭムVથ嵬iæ¥Fg<\/Z|៪ꩆ-5'@ꃱ80!燱R쇤tç³³]罛逇dṌ֣XHiͦ{": true, + "Ya矲Cë©—Q9膲墅æºíœ»c\\ë”¶Gç””<\/.齵휴": -1.1456247877031811E-19, + "z#.OOï¿J": -8263224695871959017, + "å´_3夼ᮟ1Fë¸ë½¯á¦“é´­V豈Ь": [{ + "Nè’¬74": null, + "yuB?厅vK笗!ᔸcXQ旦컶P-ë…«mᄉ麟_": "1R@ 톘xa_|﩯é˜î¥§sæ§žd!d껀筤⬫è–焵먑D{\\ïƒïŽ¿6k共倌☀G~AS_D\"딟쬚뮥馲렓쓠攥WTMÜ­8nX㩴䕅檹E\u0007ï­¨N 2 ℆æ¶ê¥ê µï“3▙玽|ë¨_\u2048", + "æA Cä§©G": {":Mí£5e들\\ê€æ¼á”„é¸|Iï¨$)n": { + "|U䬫㟯SKV6ꛤ㗮\bn봻䲄fXT:㾯쳤'笓0b/à³¢Cì³–?2浓uO.ä°´": "à½ê¼‹e?``,ᚇæ…^8ꜙNM䂱\u0001Iá–™ê§M'vKdꌊH牮r\\O@䊷ᓵ쀆(fî »yè»i툺\"?<\/峧ࣞ⓺ᤤ쵒߯ꎺ騬?)刦\u2072læ…ªy꺜ﲖTjî’•+u", + "뽫hh䈵î”w>1â²ì­V[â…Ž\\헑벑F_ã–⠗㫇hæ½;á¿æ±°á±¼ç€–J옆9RRì…vsZ柺鶶툤r뢱橾/ꉇ囦FGm\"謗ꉦ⨶쒿⥡%]鵩#ᖣ_蹎 u5|祥?O", + null, + 2.0150326776036215E-19, + null, + true, + false, + true, + {"\faá­¶Pæ¤WWcá Ÿf뚉á¬í“—â³€Wç¹5:HXH=q7xì°™X$)모r뚥ᆟ!Jﳸf": [ + -2995806398034583407, + [ + 6441377066589744683, + "Mﶒ醹i)Gἦ廃s6몞 KJ౹礎VZ螺费힀\u0000冺업{è°¥'꡾뱻:.ꘘ굄奉攼Diá·‘Ké¶²y繈욊阓v㻘}枭캗e矮1c?íœ\"4\u0005厑莔뀾墓ë‚⽴洗ṹ䇃糞@b1\u0016즽Yè½¹", + { + "1⽕⌰鉟í”M㤭n⧴ỼD#%é˜âŠ¯ì¿¼ç¨ë¸£ëªç´§á…‡ã“•ᛖcw嬀~ഌ㖓(0r⧦Qä‘•é«à´°é“‚㓻Rå„®\"@ꇱmâˆà¯¿á¦¯é Œ8}㿹犴?xn잆꥽R": 2.07321075750427366E18, + "˳b18㗈䃟柵Z曆VTAu7+㛂cb0﯑Wp執<\/臋뭡뚋刼틮è‹ë²²î·´TLP预庰܈G\\O@VD'鱃#ä¹–ëº*鑪ꬳ?MÞždï­¹{â‡åœ¯ì‡œã¼ž顄︖Y홡g": [{ + "0a,FZ": true, + "2z̬è£î’®ê§¦é©¸\u0006L↛Ḣ4๚뿀'?lcwá„§ã®!蓚䃦-|7.飑挴.樵*+1ﮊ\u0010ꛌ%貨啺/JdM:ë˜ïˆ!FBe?鰴㨗0Oè´¢I藻ʔWAá«“Gì³›u`<\/I": [{ + "$Ï„5Vé´a뾆両環iZp頻යn븃v": -4869131188151215571, + "*즢[⦃b礞Râ—šnΰꕢH=귰燙[yc誘g䆌?ଜ臛": { + "洤湌鲒)⟻\\䥳va}PeAMnï¼®[": "ã³Éª/(軆lZR,Cpæ®È®Nå•·\"3Bå©´?i=r$펽á¤ì€¸", + "阄R4㒿㯔ڀ69ZᲦ2ç™í•Œå™—På´œîž#\\-ì­è¢›îˆµ&é‘/$4ç«¥Vê©‘_ZHAæ¾¢fZ3": {"x;P{긳:Gé–‰:9?æ´»H": [ + "繺漮6?z犞焃슳\">á»[Ⳛ䌜ë…䂹>èµâ¼¶ç…œï’˜Yæ¡¥[泥뚩MvK$4ï‰jtï¾›", + "E#갶霠좭㦻ୗ먵F+䪀oè’ba쮎4X㣵 h", + -335836610224228782, + null, + null, + [ + "r1á«©0>danjYì§¿bs{", + [ + -9.594464059325631E-23, + 1.0456894622831624E-20, + null, + 5.803973284253454E-20, + -8141787905188892123, + true, + -4735305442504973382, + 9.513150514479281E-20, + "7넳$螔忷㶪}䪪lì§´\u0007é¹Pé°šHFéŠZJﳴ/âŽ1ᷓ忉ç‡áœ‹ì“ˆxëµ mä·çª¥á”^\u0019á¶Œå­#ヂt☆áƒpáŽè‡¶äŸ±5ï‰$ä°µ&๵分ìˆ]äˆë‰â™‚åŽ\u0011<>", + "C蒑貑è—lï°°}X喇몛;të°¿O7/᯹f\u0015îµ¼kI嘦<ዴ㟮ᗎZ`GWퟩ瑹࡮ᅴB꿊칈??Ræ ¡s脚", + { + "9çµæˆ¬+AU^洘拻ቒy柭床'ç²™XG鞕᠜繀伪%]hï ¾C,$è¼™?Utä¹–Qmë–šWï¶8઼}~qâ ªrU䤶CQ痗ig@#≲t샌f㈥酧l;yé—¥ZHæ–¦e⸬]j⸗?ঢ拻퀆滌": null, + "畯}ã§¢J罚å¸VX㨑>1ꢶkT⿄蘥ã‘o|<嗸層沈挄GEOM@-äžšä§°$만峬è¼ä ±V✩5宸-æ‚î¡§D'ã—ªyP掶7bâ ŸJã•»SfP?d}v㼂á…'猘": { + "陓y잀v>╪": null, + "鬿L+7:ë‘Y=ç„ U;킻䯌잫!韎ஔ\f": { + "é§«WmGጶ": { + "\\~m6ç‹©K": -2586304199791962143, + "ႜࠀ%Í‘lâ¿…D.ç‘¢Dk%0ç´ªdḨTI픸%뗜☓s榗኉\"?V籄7w髄♲쟗翛歂E䤓皹t ?)ᄟ鬲éœ6Cî³´": { + "_ì·¤a圷1\u000eB-XOy缿請∎$`쳌eZ~æï€§íŠ»/蜞`塣৙\"⪰\"æ²’l}蕌\\ë¡ƒè«æ°Œ.望wZ|o!)Hnçqg}": null, + "kOSܧ䖨钨:಼é‰ê­O醧Sî…¨`ì‹­`ꓭì­ï¯¢N&Et㺪馻ã¢â…³ã¢ºå´¡àºŠèœšé”«\\%ahx켨|ż劻ꎄ㢄ìŸA躊᰹p譞綨Ir쿯\u0016ﵚOd럂*僨郀N*bã•·63z": { + ":Lï œ5r+T㡲": [{ + "VK泓ë²á®™Ry㓤➙Ⱗ38oi}LJቨ7Ó㹡৘*q)1豢⛃e᫛뙪壥镇æž7Gè—¯g㨛oI䄽 孂L缊ꋕ'EN`": -2148138481412096818, + "`â›á˜‘$(खꊲ⤖á„ꤒ䦦3=)]Y㢌跨NĴ驳줟秠++då­³>8ᎊ떩Eê¡£Sv룃 쯫أ?#Eî·°|á­™ãŽ?zv:5ï©^â‹‘V": [ + -1.4691944435285607E-19, + 3.4128661569395795E17, + "ãƒì´—^G9ä½­é¾¶n募8R厞eEw⺡_ㆱ%⼨D뉄퉠2ê©µá›…â³æ¿L팹Là·€n=\"æ…‰ë…á›®y>!`g!í’²î¦ï¨’[/;?[vï®ê²è»‡}⤳â¤í•∌Tã½²R홓é‰ã“¥", + "æ„°_⮹T䓒妒閤둥?0î°šaB@㈧gç„»-#~è·¬x<\/èˆPÝ„ê¡=\\׳P\u0015jᳪá¢qï‹¶;ã¯l%á­—;砢觨â–,è¬ê°Gy?躤O黩í‹Yã’a擯\n7覌똟_䔡]fJ晋IAS", + 4367930106786121250, + -4.9421193149720582E17, + null, + { + ";ᄌ똾柉곟ⰺKpá‡ä±»à¸ºä–{o~h!ï½…ê¿àª»ìš„Úš\u0002y?xUd\u207c悜ꌭ": [ + 1.6010824122815255E-19, + [ + "宨︩9앉檥pr쇷?WxLb", + "æ°‡9】J玚\u000f옛呲~ è¼ 1D嬛,î•*mW3?n휂糊γ虻*á´«ê¾ ?qîžå‡è¶—Ko↦GTé“®", + "ã¶¢ážmOã”k'诔栀Z蛟}GZé’¹D", + false, + -6.366995517736813E-20, + -4894479530745302899, + null, + "V%᫡IIç’…ï»ä…›ä“Ží’¹ï±¢/pU9seë˜ë›žx梔~C)䨧䩻蜺(g㘚R?/á»°[å¿“C뾠ࢤc왈邠买?嫥挤풜隊枕", + ",vç¢å–”㌲쟚蔚톬៓ꭶ", + 3.9625444752577524E-19, + null, + [ + "kO8란뿒䱕馔b臻âŸéš¨\"㜮鲣Yq5mí”K#ꢘug㼈á¦=P^6탲@ä§”%$CqSw铜랊0&m⟭<\/a逎ym\u0013îš¡vᯗ": true, + "æ´«`|XN뤮\u0018詞=ç´©é´˜_sX)㯅鿻á»ì‹¹": 7.168252736947373E-20, + "ꛊ饤ï´è¢(逊+~⽫얢鈮ï«è‰¬O힉7Dç­—S곯wæ“I斞᠈븘蓷x": [[[[ + -7.3136069426336952E18, + -2.13572396712722688E18, + { + "ç¡¢3㇩R:o칢行E<=\u0018á¬YuH!\u00044U%å炼2>\u001eSi$â“·ê’ˆ'ï‘¿ë ¢gᙫ番ꯒ㛹럥嶀澈v;è‘·é„•x蓎\\惩+稘Uî“´Eᖸﳊ㊈壋Nå«¿â¾æŒŽ,袯苷ኢ\\x|3c": 7540762493381776411, + "?!*^á¢çª¯?\u0001ڔꙃw虜ë³îšFgJ?&⨫*uo籤:?}ꃹ=ٴ惨瓜Z媊@ત戹ã”똩Ԛ耦Wtè½\\æž’^\\ꩵ}}}ꀣD\\]6M_⌫)Hè±£:36섘㑜": { + ";í™—á°°U஋㙛`D왔ཿЃS회çˆ\u001b-㢈`ë´†?盂㛣듿ᦾ蒽_AD~EEຆ㊋(eNwk=RÉ å³­qï’«\"5Ἠ婾^>'ls\n8QAK)- Q䲌mo펹L_îŽ¦ì¹æ¨–庫9ê©ìª¹á˜¹ä‘–ç€aK îž?*趤fë­“å»p=磕", + "î“å“‘z懅á¤-ê¹ux쀭", + [ + true, + 3998739591332339511, + "ጻ㙙?᳸aK<\/囩U`B3袗ﱱ?\"/ké”ä§2ï…¤l@쿎VZ쨎/6ꃭ脥|B?31+on颼-ê®§,O嫚m à¡­`KH葦:粘i]aSUì“™$ì‚f+詛頖b", + [{"^<9<ç®&絡;%iï«¡2攑紴\\켉hì“™-柂äšven\u20f7浯-Ꮏ\r^í›ä“ší—¬\u000e?\\ã…¡ÖºJë–·VOt": [{ + "-௄å¶k㘆í˜à®½y⎱㢬sS઄+^瞥h;á¾·jî­;抭\u0003ë°«f<\/5â°§ï§§ï¡™_朻ï—%*[-撵䷮彈-芈": { + "㩩p3篊G|å®®hz䑊oê³¥j^Co0": [ + 653239109285256503, + {"ê¶²?|\":N1Û¿æ°ƒNZ#깩:쇡o8킗ࡊ[\"ë¸Po핇1(6é°$膓}â½*)渽J'DN<ì™ê¸˜æ¯¦ë²Ysì¹–": { + "2Pr?Xjㆠ?æ®/?㓦柖馃5뚣Nᦼ|é“¢rè¡´ã©–\"ç”æ¹—Üæ†": "\"뾯ië‡ç­ç‰»$ç²/4ka $åŒíœ´ï‹è¯‘zbAá©ê‡¸ç‘…&뵲衯ꎀᆿ7@ꈋ'ᶨH@á ´l+", + "7뢽ëšv?4^ꊥ_⪛.>pởr渲<\/⢕疻c\"g䇘vU剺dஔ鮥꒚(dïŸv祴Xâ¼¹\\îºa8y5å†": true, + "o뼄Bìšžç¾hrï·”í˜ë’šâ¿›U5pꪴfg!6\\\"爑ì䢱W<ï¶•î\\í…£ç‡oI/BK뺡'谑♟[Ut븷亮g(\"t⡎有?ꬊ躺ç¿è‰©nl F⤿蠜": 1695826030502619742, + "ÛŠê¹–>ࡹ햹^ⵕ쌾BnN〳2C䌕tʬ]ì° ?ݾ2饺蹳ã¶êŒ­è¨\"â—¹á¬D鯎4e滨T輀ﵣ੃3\u20f3í‚™D瘮g\\擦+泙᧠鬹ﯨַ肋7놷郟lPå†{ß’hà§œr5,ê“‹": null, + "á¿‹N$y{}2\\N﹯ⱙK'8ɜͣwt,.钟廣䎘ꆚk媄_î­®": null, + "䎥eᾆá¦î‘§ì‰,JÞªn岪ã¥sî­•æ–謽䚔5tã¯ï–µï£šã°³ã±ŠZhD䃭f絕s鋡篟îža`Q鬃┦鸳n_é‚(E4è¿ _è§…ë·_宪D(NLî²ç–¶hL追V熑%]vè‚«=惂!㇫5⬒\u001fï²å–º4랪옑": { + "2aè¼85먙R㮧㚪Sm}E2yîŠê†£ê«¨rRymã±è†¶á”¨\\tç¶¾A☰.ç„„ë™—9<쫷챻䒵셴᭛䮜.<\/慌꽒9å»Okä°ŠZ㥪幸k": [ + null, + true, + {"쌞ì": { + "â–ŸGL K2ië›±iï¼±\"Ì .옛1X$}涺]éŽæ‡ Ú¦ëŠ·?tfçŸÝžã‚Ÿ{": 1.227740268699265E-19, + "ê’¶]퓚%ฬKâ…": [{ + "(à·›@Ç®ã£ä§¼äµ¤[aテൖvEnAdUë –ë—ˆ@볓yꈪ,mÔ´|꟢ìº(而첸죕CX4Y믅": "2⯩㳿ꢚ훀~迯?᪑\\啚;4X\u20c2è¥B箹)ä¿£eá»»w䇄", + "75༂f詳䅫ê§é¿ }3\u20b5'∓ä±è™€fè¼î‘”Iq鈆﨤gí©)BFa왢d0뮪痮Mé‹¡nw∵謊;ê§f美箈ḋ*\u001cî±ïœŸ`퇚í‹ä³«$!V#N㹲抗ⱉçŽ(V嵟ï«_bã³…\u0019": null, + "e_m@(i㜀3ꦗ䕯䭰Oc+-ë ¨0뭦⢹苿蟰ê‚SVä°­å‹¢ë¥.ྈ爑Vd,á•¥=í€)vz뱊ꈊB_6듯\"?{ã’²&㵞뵫ç–ë¡ë¯ˆ%Qwé™,?\ræž®\"? N~癃ruà¡—dn&": null, + "㉹&'Pfs䑜공j<\/?|8oc᧨L7\\pXá­ 9᪘": -2.423073789014103E18, + "ä„瑄䢸穊f盈᥸,Bî§§ë¾§í‘—íšµB1쟢f\u001f凄": "é­–âš2儉j꼂긾껢嗎0ࢇ纬xI4]ï„(à©“`蕞;픬\fC\"æ–’\")2æ«·I﹥迧", + "ퟯ詔xæ‚ë ¹+T?Bg⥄섅kOeQí¼ã»´*{Eé¼6æ°¿L缋\u001c둌๶-㥂2==-츫I즃ã ï–˜Lg踞ꙂEG貨鞠\"\u0014d'.ç¼—ï¡gI-lIb䋱ᎂDy缦?": null, + "î’¢ç´Mã¦çŠ¿w浴詟棓쵫G:äœ?V2íž½7N*n&ã–ŠNd-'ຊ?-樹DIv⊜)g䑜9뉂ㄹí‘阉~ê…쵃#R^\u000bïž®B䌎䦾]p.䀳": [{"ϒ爛\"ꄱ︗竒G䃓-î†ã¾å¸³ã‚.j)qguæ‰å¾£à¨Zé¼—A9A鸦甈!kè”å–™:3Tî†%&ã ˜+,ä·ž|ì±½v䚞문H<\/醯rì…“ã¶¾\\a볜åºzEä·_죤ဵ뿰᎟CB": [ + 6233512720017661219, + null, + -1638543730522713294, + false, + -8901187771615024724, + [ + 3891351109509829590, + true, + false, + -1.03836679125188032E18, + { + "j랎:g曞ѕᘼ}链N", + -1.1103819473845426E-19, + true, + [ + true, + null, + -7.9091791735309888E17, + true, + {"}蔰鋈+ê¨å•µ0?g*사%`J?*": [{ + "\"2wG?yn,ç™·BK\\龞䑞x?è ¢": -3.7220345009853505E-19, + ";饹়â€)çš‹`噿焒j(3â¿w>å5Xè–™å©è¿3aFÆÃ": "2,ê“´g?_섦_>Y쪥션钺;=趘F~?D㨫\bX?㹤+>/믟kᠪ멅쬂Uzỵ]$ç§`mé›ç‘Šî’ඖ鯬cꙉ梢f묛bB", + "♽n$YjKiXX*GOè´©éƒè±®ç¥´éžK醞眡}ê—¨v嵎꼷0à­¸+Mè‹eH徸Jîžê£†:â¼æ‚¥B켽迚㯃bè«‚\u000bjꠜ碱逮m8": [ + "푷᣺ﻯd8ﱖ嬇ភHîªé¹Žâ¡±á±…0g:æžœ6$GQ췎{vá·§Yy-è„•xå¹ç ¡ï¨¬â®¸Cï§‚êš=軄H犠Gè°–ES詤Zè ‚3î§™lë´Ÿhï¿’7䦹1GPQG癸숟~[#é§¥8zQ뛣J소obg,", + null, + 1513751096373485652, + null, + -6.851466660824754E-19, + {"ä©‚-â´®2Ù°K솖풄꾚ႻP앳1Hî³é·›wmR䗂皎칄?醜<\/&à §ã¬X濬䵈K`vJ륒Q/IC묛!;$vÏ‘": { + "@-êš—xྐྵ@m瘬\u0010U絨ﮌé©\\켑寛넆T=tQã­¤Lì—°@脸삯e-ï–…î–‘:⩼u㎳VQ㋱襗ຓ<Ⅶ䌸cML3+\u001e_C)r\\9+Jn\\Pﺔ8蠱檾è…Pqé³è¯î¦§Tä„I": -1.80683891195530061E18, + "á·­á‹»U~ཷsgSJ`᪅'%ã–”n5픆桪砳峣3ç®æž¾äŒ·âа呀ïŒ": { + "Ş੉䓰邟自~X耤pl7间懑徛s첦5ਕXexh⬖鎥á€nNr(J컗|ૃF\"Q겮葲놔엞^겄+㈆è¯ã€¾í¬ç´G'E?飕1fâ¼í…¬æ‚šï•¦æ³¬ë¨Uç¬í›¶Qs": false, + "î³…(\u20dag8í½íŠ£>^Y{뤋.袊䂓î†;_ïg]S\u202a꽬L;^'#î—™ë•bႌ?Cç·¡<ä²ä²æ–­ê6\u001asD7IK5Wxo8\u0006på¼Šâ¼‚ê¯æ‰µ\u0003`뵂픋%ꄰ⫙ë¶lå›å°›ïˆ®+ä—…E쟇\\": [ + true, + { + "\n鱿aKã¡â’ã¼™2ì´¹f;`ì¾qIà¡”G}ã·äç“°w늮*ç²…9뒪ㄊCj倡翑閳R渚MiUO~仨䜶RꙀA僈㉋⦋n{ã–¥0딿벑î§é€¦â¥»0î¾®h薓쯴ê»": [ + 5188716534221998369, + 2579413015347802508, + 9.010794400256652E-21, + -6.5327297761238093E17, + 1.11635352494065523E18, + -6656281618760253655, + { + "": ")?", + "TWKLꑙ裑꺔UE俸塑炌Ũ᜕-ï’‚o\"徚#": {"M/癟6!oI51niíš=댡>xê¨\u0004 ?": { + "çš­": {"⢫䋖>u%wî²´ìž¼<ä•ê˜P䋵$é­‹æ‹U䮎緧皇Y훂&|羋ꋕ잿cJ䨈跓齳5\u001a삱籷I꿾뤔S8㌷繖_Yឯ䲱B턼Oæ­µF\\l醴o_欬6ç±=D": [ + false, + true, + {"Mt|êžD|Fê¶£MQ뵕T,ëºk+?ãµi": [ + 7828094884540988137, + false, + { + "!༦鯠,&aﳑ>[euJê½ç¶·æB.h": -7648546591767075632, + "-n켧嘰{7æŒæ¯„Y,>â螵煫乌pv醑Qå¶š!|âŒè²¬0왾ë¢ê…蛨S\\)ç«°'舓Q}A釡5#v": 3344849660672723988, + "8é–ªéºV=鈢1녈幬6棉⪮둌\u207d᚛驉ꛃ'r䆉æƒà¥ˆ|bἧﺢᒙ<=穊强s혧eꮿ慩⌡ \\æ§³W븧J檀C,ᘉì˜0俯퀉M;筷ࣴ瓿{늊埂鄧_4æ¸Nn阼Jੵ˥(社": true, + "oë¼€vwï…®)4A뢵(î¼±a䵢)p姃뛸\u000fK#KiQp\u0005ê…芅ì…îª": null, + "ç ¥$ꥸ┇耽uæ–®Gc{z빔깎밇\\숰\u001eê´·å„㶇쵿_á´„+hç©¢p촀Ნ䃬zäé…³Ó‚31xꔄ1_ç šWë ˜G#2葊P ": [ + -3709692921720865059, + null, + [ + 6669892810652602379, + -135535375466621127, + "뎴iO}Z? 馢녱稹ᄾä©rSt帤넆&7ié¨ë©—ç•–ï”9誧鄜'w{Ͻ^2窭외b㑎粖i矪ꦨ탪跣)KEㆹ\u0015V8[W?⽉>'kc$䨘ᮛ뉻٬M5", + 1.10439588726055846E18, + false, + -4349729830749729097, + null, + [ + false, + "_è ¢ã ^䟪/D녒㡋ỎCä’ˆíŒïŒ¢\u0006àªq@O펢%;é¹ìŒo戥~A[ꡉ濽ỳ&虃᩾è£å”™ï¤£èŒ¨Ig楡꒻M窓冉?", + true, + 2.17220752996421728E17, + -5079714907315156164, + -9.960375974658589E-20, + "ᾎ戞༒", + true, + false, + [[ + "ⶉᖌX⧕홇)g엃⹪xëšç™Ÿ\u0002", + -5185853871623955469, + { + "L㜤9ợㇶKé°â‹“V뽋˖!æ–«as|9"á¬ä†ª?î¾¶7胜&n薑~": -2.11545634977136992E17, + "O8뀩D}캖qè‚6༣ã—䈓煮å½à¨†á޼Dᣘí›;": false, + "YTá¡…^ï—Lã—ŽcbY$pᣞ縿#fh!ꘂb삵玊颟샞ဢ$ä—é¼’ëª~rkH^:닮먖츸륈⪺쒉砉?㙓扫㆕꣒`R䢱Bé…‚?C뇞<5Iޚ讳騕S瞦z": null, + "\\RB?`mG댵鉡å¹ç‰©äµŽæœ‰5*e骄T㌓ᛪç¾é§’Ku\u001a[柆jUq8⋈5鿋츿myï»—?é›ux঴?": 5828963951918205428, + "n0æ™…:黯 î¶·xu씪^퓞cB㎊á¬âº˜Ù¤Öƒ~B岚3㥕擄vᲂ~F?Cä¶–@$mï›~å¿”S왖㲚?챴⊟W#벌{'ã°Iä ç¸s樘\\X뢻9í•¡I6èㄛî‚î«8쯶]wॽ0L\"q": null, + "x增줖j⦦tä¢áŽ™ïŠ­ã›¿Yf鼘~ê«“æ„4惊\u209c": "oOhbᤃ᛽z&Bi犑\\3B㩬劇䄑oÅ쨅孥ë©àº–acA㖫借ãžvg싰샂ãœ#譞⢤@k]鋰嘘䜾L熶塥_<\/â¾å±ˆï®Š_mYè¹t뙺}Ox=wé®®4S1ê©ï¬¾'å·‘", + "㗓蟵ꂾe蠅匳(JPä—à·¸\u0089耀왲": [{ + "ᤃ㵥韎뤽\r?挥O쯡⇔㞚3ä¼–\u0005Pî•⋪\"Dê¶£QLn(⚘罩䩢Ŏv䤘尗뼤ë›O淽鋋î¡é—šrå´©a{4ç®™{煷m6〈": { + "l곺1L": { + "T'ਤ?ç …|੬Km]ä„©\"(à¿¶<\/6U爢䫈倔郴l2ã´±^줣k'Læµ–Lé°„Rp今鎗⒗Cì–¨Mí›ã¡§Î˜X粜뫈N꤇輊㌻켑#㮮샶-ä—룲è ç™œã±V>=\\I尬癤t=": 7648082845323511446, + "鋞EP:<\/_`á§e混ㇹBd⯢㮂驋\\q碽饩跓྿ᴜ+j箿ë ã—‘yK毢宸p謹h䦹乕U媣\\炤": [[ + "3", + [ + true, + 3.4058271399411134E-20, + true, + "æ€+憱f逮@먻BpW曉\u001aã£âŽŠ$n劈D枤㡞좾\u001aá›ïŒƒè‹”౩é—1B䷒Ṋ݋âžê€žêƒç£$t੤_:蘺⮼(#N", + 697483894874368636, + [ + "vᘯ锴)0訶}䳅⩚0O壱韈ߜ\u0018*Ué¾ä–=䧉뽑å•휻ID쿇嘗?ꌸῬ07", + -5.4858784319382006E18, + 7.5467775182251151E18, + -8911128589670029195, + -7531052386005780140, + null, + [ + null, + true, + [[{ + "1欯twG<\/ï†Q:0怯押殃탷è«ì‚¬<ỗꕧ蚨ä¡ï¨î³‰nDꌕ\u001cë…¬~蓩鲃g儊>ê¡l㻿/â‘·*ì±³6㻜W毤緛ﹺᨪ4\u0013뺚J髬e3쳸䘦伧?æª&{L掾p+꬜MäŠd娘6": { + "2p첼양棜h䜢﮶aQ*c扦v︥뮓kC寵횂S銩&Ç{O*य़iH`Uí…à¡“rä©•5ꄸ?`\\á§«?ᮼ?t〟崾훈kè–ì/iy꤃뵰z1<\/AQ#ë¿©8jJ1z@u䕥": 1.82135747285215155E18, + "ZdN &=dë…„á…†'ì‘â…‰:烋5&áŸï”‹á„‚汎æ¥L㯄固{é’§u\\ãŠíŠšeæ‘‘&tå—„ê–„UbâŒ?m䴘熚9EW": [{ + "ଛ{i*a(": -8.0314147546006822E17, + "⫾ꃆY\u000e+W`௸ \"Më’¶+\\ë·lKE}(NTí‚¶Yjé¸ç¯’î©¥ì¶'jNQ硾(똡\\\"逌â´y? IRꜘ὞鄬﨧:M\\fâ ‹Cꚜ쫊ᚴNV^Dä•—ã…–á¼”Iao꿬Câ8": [ + 287156137829026547, + { + "H丞N逕⯲": {"": { + "7-;枮阕梒9á‘„Z": [[[[ + null, + { + "": [[[[ + -7.365909561486078E-19, + 2948694324944243408, + null, + [ + true, + "荒\"并孷䂡쵼9o䀘F\u0002龬7⮹Wz%厖/*? a*R枈㌦ë¾g뒠䤈q딄㺿$쮸tᶎ릑弣^éŽ<\/Y鷇驜L鿽<\/ì¶‹9Mᲆឨ^<\/庲3'lë‚¢", + "c鮦\u001bë‘\\~?眾ಢu݆綑෪蘛轋◜gȃ<\/â´ƒcpkDt誩܅\"Y", + [[ + null, + null, + [ + 3113744396744005402, + true, + "v(y", + { + "AQ幆h쾜O+꺷铀ꛉ練A蚗⼺螔jãŒ3꽂楎䥯뎸먩?": null, + "蠗渗izé±–w]擪E": 1.2927828494783804E-17, + "튷|䀭n*曎b✿~æ¤U]î­¡Gz鄭kW|ã´š#㟗ഠ8u擨": [[ + true, + null, + null, + {"⾪壯톽g7?㥜ώQê‘㦀æƒã§½î“¡ä¼“\\î¦*᧰閖樧뢇赸N휶䎈pIæ°‡ï®é•Šmaᬠ탷#X?î³A+kÐM ༑᩟Ø?5꧎鰜ṚY즫궔 =ঈî³;ﳈ?*s|켦蜌wM笙莔": [ + null, + -3808207793125626469, + [ + -469910450345251234, + 7852761921290328872, + -2.7979740127017492E18, + 1.4458504352519893E-20, + true, + "㽙깹?ë¨ä†¢:ä´ŽÛ»gæ® JBTU⇞}ꄹꗣi#Iî’¡ëµ£é‰r혯~脀ìƒ#釯:场:ä”>ä°®o'ã¼½HZ擓௧nd", + [ + 974441101787238751, + null, + -2.1647718292441327E-19, + 1.03602824249831488E18, + [ + null, + 1.0311977941822604E-17, + false, + true, + { + "": -3.7019778830816707E18, + "Eå³¾æ†èŒ6xLIm縂0n2视֯J-ᤜz+ᨣè·mYDè±ç¹¹â¹ºäŠ“ëª“ï´€E(@è©®(!ï’Y膽#᎙2䟓섣A䈀㟎,囪QbKæ’wcG湎ꤧtGì—xâ¥ä¿Žj'A一ᯥ뛙6ㅑ鬀": 8999803005418087004, + "よ殳\\zDâ§…%Y泥簳Uꈩ*wîRL{3#3FYHା[d岀䉯T稉駅䞘礄P:é—ˆWæ€ElBã¤å–¬èµ”bGä ¼U଄Nw鰯闀楈ePsDꥷ꭬⊊": [ + 6.77723657904486E-20, + null, + [ + "ཚ_뷎꾑è¹q'㾱ꂓ钚蘞慵렜떆`ⴹ⎼櫯]J?[t9Ⓢ !컶躔I᮸uz>3aã •i,錃L$æ°°í…°@7ë…«W㸮?ç¾§W뇧ꃞ,î—‘N鋮숪2ɼì½â”ä²6", + "&y?뢶=킕올Za惻HZk>c\u20b58i?ꦶcfBv잉ETî…9jä¡¡", + "imçŠÕƒbì¹§æ ¡\\뼾쯀", + 9.555715121193197E-20, + true, + { + "<㫚v6腓㨭e1ã•”&&V∌ᗈT奄5Lጥ>탤?튣瑦㳆ꉰ!(ᙪ㿬擇_n쌯IMá¿‹î£ã•¨â°æ«ˆá±·5풔蟹&L.ì²½e鰷쯃劼﫭b#ï­¶í“€7ë·„Wr㢈๧Tʴશ㶑澕é%": -1810142373373748101, + "fg晌o?߲ꗄ;>C>?=鑰監侯Ktêµ…": true, + "䫡蓺ꑷ]C蒹㦘\"1à°ƒ@å‘«\u0014NLä¾egå‘®á³,r$裢k>/\\?ㄤᇰﻛ쉕1஥'ÄŠ\" \\_?쨔\"ʾr: 9Sä˜ç¦ºáª§ê„‚㲄", + [[{ + "*ç¡™^+E쌺I1䀖ju?:⦈Ꞓl๴竣迃xKC/饉:\fl\"XTFᄄ蟭,芢<\/骡軺ëœhê˜\u001f銿<棔햳▨(궆*=ä¹¥b8\\媦ä·€ë«}닶ꇭ(Kej䤑M": [{ + "1á¬?>옿Iâ•…C<ÞŽ?ꊌ冉SV5A㢊㶆z-๎玶绢2F뵨@㉌뀌oå¶”f9-庒茪ç“ë·³4": null, + ";lá°³": "CbB+è‚»aä„·è‹*/볳+/4fq=ã°h6瘉샴4é“¢Yéª.⌖@哼猎㦞+'gꋸ㒕ߤï—ãž‘(ä¶’è·²tiâ‘´aî¥ç¡‚#Noë³”", + "t?/jE幸YHT셵⩎Kî¹!Eq糦ꗣv刴w\"l$ο:=6:ç§»": { + "z]鑪醊嫗J-Xm銌ç¿çµ¨c里ëç‚™Ep㣋é£ë˜¼åšŒä€“GPï¹–cmf4é¹­T䅿꣭姧â¸wy6ꦶ;S&(}ᎧKxᾂQ|tï¹ë»³k\"d6\"|Mlì·†hwLtê¼¼4$&8Պ褵婶鯀9": {"嵃닢ᒯ'î–›dá§«ä³³#Nî‡Xe3-붋鸿î¢à¬¢ë–“î§ž%dK\u0013䲎ê–YV.裸Râ‰rR3蟛\\:ì ¯:å—ĺLʆ넕>|텩鴷矔ꋅⒹ{tå­¶ã“‘4_": [ + true, + null, + [ + false, + "l怨콈lá’", + { + "0wä²å¬§-:`䉅쉇漧\\Ü‚yㄨb%㽄j7ᦶ涶<": 3.7899452730383747E-19, + "ꯛTẀq纤qå¶Vâ¿£?\"g}ი艹(쥯B î­T騠I=仵ë°X": {"KX6颠+&á…ƒ^fç•’y[": { + "H?뱜^?꤂-⦲1a㋞&î‘®êƒç²¾Ii᤾챪咽쬘唂쫷<땡劈훫놡o㥂\\ Kâ´™Dç§¼Fæ°®[{'좴:례晰Iq+Iì­¥_T綺砸GOç…䟪ᚪ`î‘↹l羉qì¼Dê½áœ…훦: vUV": true, + "u^yï³0㱓#[y뜌앸ꊬLã·©?蕶蘾â»KӼ": -7931695755102841701, + "䤬轉車>\u001c鴵惋\"$쯃྆⇻në½€Gæ° Såª]à²²ê¨æ‡Qxኻ椕駔\\9ࣼ﫻ìœç£¡ï©ˆëºªá¶šë³l㕆t+sζ": [[[ + true, + false, + [ + null, + 3363739578828074923, + true, + { + "\"鸣詩 î›ë³°ã‘µgLã¯¦á¿…ì¶æ—«}ED辗ﮈI쀤-ꧤ|ã ¦Z\"娑ᕸ4çˆé¨ã£\"]ì³Af]茛⬻싦oèšk䢯ä©è½3廇喑ޅ": 4.5017999150704666E17, + "TYႇ7ʠ值4챳唤~Zo&Ý›": false, + "`å¡„J袛㭆ëºã³€N㺣`ê½å¶¥Kï¯SVᶔ∲퀠ç¾N딂X\"á¤hNﬨvI": {"\u20bbã­˜I䖵䰼?sw䂷쇪]î(泒f\"~;꼪FÔsá¦": {"p,'ꉂ軿=Aèš¶?bƉãµä…°è«¬'LYKL6B깯⋩겦뎙(ᜭ\u0006噣d꾆㗼Z;ä„äš”cd<情@äž‚3苼㸲U{)<6&ꩻ钛\u001au〷N숨囖愙j=BXWìš•^x芜å á¿™çˆ‚ë›·ê’»t✘Q\b": [[ + "ç±›&ଃ䩹.ꃩ㦔\\C颫#暪&!勹ꇶ놽攺J堬镙~軌C'꾖䣹㮅ï¶å²ƒá™´éµ£", + 4.317829988264744E15, + 6.013585322002147E-20, + false, + true, + null, + null, + -3.084633632357326E-20, + false, + null, + { + "\"짫愔昻 Xï«\"è—£j\"\"ë¨à½…ѻ㘤㬯0晲DU꟒㸃dë²€î¢ìœ’l䦾cà©»*3": null, + "è°ˆWm陧阦咟ฯ歖擓Nå–´ã‹éŠ­rCCnVࢥ^♼Ⅾ젲씗刊Sà¼+_tèµ”\\bäšë‰¨ê¬«6펛cL䊘᜼<\/澤pF懽&H": [ + null, + { + "W\"HDUuΌ퀟M'P4à¿°H똆ⰱﮯ<\/å‡è˜²\"C鴫ﭒж}ꭩ쥾t5yd诪ﮡí‰â´°@?æ°é†³rj4I6Qt": 6.9090159359219891E17, + "絛ﳛ⺂": {"è«°Pã—®î˜è¦`ZQ?ꫦh*à´±cbâ§±}埌茥h{棩렛툽o3é’›5é®l7Q榛6_g)ὄ\u0013kj뤬^爖eO4Ⱈ槞鉨ͺ订%qX0Tì—å«·$?\\\"봅늆'%": [ + -2.348150870600346E-19, + [[ + true, + -6619392047819511778, + false, + [[ + -1.2929189982356161E-20, + 1.7417192219309838E-19, + {"?åµ²2à¿2\u0001啑㷳c縯": [ + null, + [ + false, + true, + 2578060295690793218, + { + "?\"殃呎ïˆ#ã‘‘F": true, + "}F炊_æ®›oU헢兔êˆ,èµ­9703.Bæ•°gTz3â¬": { + "5&t3,í–“Mݸᵣ㴵;꣫ä©â†³#ï¢@ë«·ä …ï¦+W-ࣇzᓃ鿕ಔ梭?T䮑ꥬ旴]u뫵막bBè®:왳둛lEh=숾鱠på’î›î­ˆ$ì§#?gâ¹·á—Švã·µ.æ–ˆu頻\u0018-G.": "ë½™m-ouࣤ஫牷\"`Ksꕞ筼3HlȨvCï¢î›¦å ˆ\"I]㖡玎r먞#'W賜鴇k'c룼髋䆿飉㗆xgå·¤9;芔cáŒ/ax䊨♢í“rå“㸫೼䢗da᩾\"]å±£`", + ":M딪<䢥喠\u0013ã–…x9è•ã‘‚XO]f*Q呰瞊å­VP@9,㨣 D\\穎vˤƩs㜂-曱唅L걬/롬j㈹EB8g<\/ì„©o渀\"u0y&룣": ">æ°ç·©L/ä•‘ë¯êŸ˜îŸ”蕞^aBë’£+0jK⪄瑨痜LXK^힦1qK{æ·št츔X:Vm{2rçB뾄H첚7æ°¥?쉟䨗ꠂv팳圎è¸é½€\\", + "D彤5㢷Gꪻ[lㄆ@὜⓰絳[ଃç½ì®¹â˜’[*0ꑚ㜳": 9022717159376231865, + "Ò–aV銣tW+$é­¿\u20c3ïœäºœ~ë«¡ᙰ禿쨽ã¡fá¹¼zE/h": "5è‡ï’Œã‹‡á²¯ì®º? 昨탰Wム밎#'\"崲钅U?幫뺀â¾@4kh>騧\\0Ò¾EV=çˆî©®ÍŒUæ€%ꉼ 㮋<{j]{R>:gÔ©L\u001c瀈锌ﯲﳡꚒ'â«¿E4æšãŒ—뵉X\"Háœ", + "ᱚגּ;s醒}çŠSἿ㦣&{T$jkB\\\tḮ앾䤹o<é¿(tW": "vb⯽䴪䮢@|)", + "⥒í껉%惀뗌+녣迺顀qæ¢g⚯i⤭ë£Mç¹j̈́⽜A": -8385214638503106917, + "逨ꊶZ<\/W⫟솪㎮ᘇb?ê ”i\"H㧺x෷韒Xꫨฟ|]窽\u001a熑}Agn?Má¶–a9韲4$3á»´^=ì煤áë·2䣃%ï…Žé· /eQ9頸쥎", + 2398360204813891033, + false, + 3.2658897259932633E-19, + null, + "?ꚃ8Nnãž·å¹µd䲳䱲뀙ꪛQ瑓鎴]î’¶ä©‹-é°¾æ¡ï¾ä³¡??掊", + false, + -1309779089385483661, + "ᦲxu_/yecR.6èŠ.áœ‡éŽ ~", + -5658779764160586501, + "ì’Œ:æ› =lìœä¢œwk#s蕚\"互㮉m䉤~0ë“䋙#Gîš¿;h숄옥顇෤勹(C7㢅雚ã¯Lâ …VVç°…<", + null, + -4.664877097240962E18, + -4.1931322262828017E18, + { + ",": { + "v㮟麑䄠뤵g{Më®.\u001bzt뢜뵡0Ǥ龍떟Ᾰ怷ϓRT@Lꀌ樂Uã â¾•e扉|bJg(뵒㠶唺~ꂿ(땉x⻫싉ìŠ;%0鎻V(o\f,NéŠ%nk郼螺": -1.73631993428376141E18, + "쟧摑繮Q@Rᕾ㭚㾣4隅待㓎3è’Ÿ": [ + 4971487283312058201, + 8973067552274458613, + { + "`aæ™á£—î\u0015iBo¸": 4.3236479112537999E18, + "HW&퉡ãåœïŸ†Y?ç‘¡Qyí›q!帰ï©s舠㫸zêš—aSæ­²v`G株巷Jp6킼 (ê·¶é”â¾î‹¥â¡ˆ>Mæ±ãžá‰´ê™²dv@i㳓ᇆ?é»": [ + null, + 4997607199327183467, + "E㻎蠫á¾é«˜ä™Ÿè˜¬æ´¼æ—¾ï« í…›ã‡›?'M$㣒蔸=A_亀绉앭rN帮", + null, + [{ + "Eᑞ)8餧A5u&ã—¾q?": [ + -1.969987519306507E-19, + null, + [ + 3.42437673373841E-20, + true, + "eê±·Må¢\"割Pâ›í§åŽ€R䱜3ï»´Oí“«r﹉⹊", + [ + -8164221302779285367, + [ + true, + null, + "爘y^-î¬?蘞Ⲽꪓaâ…ê¨}I", + 1.4645984996724427E-19, + [{ + "tY좗⧑mrzïºã¿¥â´–᥷jè«…\u0000q賋è­êž„â®±S\nà¡£B/íƒêµª3ZÉ‘å¤o<\/;ë¡‹": null, + "彟hæµ _|V4䦭Dᙣ♞uì¿»=ì‚®ã¦\u001e哀鬌": [{"6횣楠,qʎꗇ鎆빙]ã±­R굋鈌%æ ²j分僅ペ䇰wí¦î¼‹p蛃N溈ê¡ê€?@(GI뉬$ﮄ9èªê“š2e甸ڋ[äº,\u0011\u001cࢃ=\\+衪䷨ᯕ鬸K": [[ + "ㅩ拏鈩勥\u000etgWVî–¨Xs陂è¦p狵w퓼{뮵_i\u0002ퟑႢâ¬d6é‹«F~챿æŸ\u0096äš¼1ۼ칥0꣯å„=鋷牋ⅈêžé¾", + -7283717290969427831, + true, + [ + 4911644391234541055, + { + "Iî¹éˆ’ì²½P릜朸W徨觘-HᎄíŸâ“º>8kr1{ê²µäƒã€›á¬¡Ì¨Oê·‘oä•'쿡鉕p5": "fvç²–RNçž–è›a?q꤄\u001d⸥}'ꣴ犿ꦼ?뤋?鵆쥴ë‹ä¡«s矷̄?à¶£/;괱絢oWfV<\/\u202cC,ã–¦0䑾%nè³¹g&T;|lj_欂N4w", + "짨䠗;䌕u i+rà¹0": [{"9ä¥\\à°©8\"馇z䇔<\/á‚¡Y3e狚ì¡\"ุ6ï°†Zé–c\"Ll:ïŠê®¾ç–£<\/᭙O◌납୕湞9⡳Und㫜\u0018^4pj1;ä§å„‚ä—·à­—>@e톬": { + "aâ‘‚Fé‹»Qèž°'<퇽Qè´ç€§{ᘪ,cP&~䮃Z?gI彃": [ + -1.69158726118025933E18, + [ + "ê¶‚z簽㔛㮨瘥⤜䛖Gℤ逆Y⪾j08î±²Sn昞ꘔ캻禀鴚P謦b{ê“®mNéMᥙ5\"ç2냑I\u0011.L&=?6á„ ë»·X鸌t刑\"#z)o꫚n쳟줋", + null, + 7517598198523963704, + "ኑQp襟`uá©„ræ–¹]*F48ꔵn俺ሙ9뇒", + null, + null, + 6645782462773449868, + 1219168146640438184, + null, + { + ")ယ넌竀Sdä°¾zqâ«£âŒÊ¥\u0010á¿“' |磪&p牢蔑mï³V蘸૰짬꺵;K": [ + -7.539062290108008E-20, + [ + true, + false, + null, + true, + 6574577753576444630, + [[ + 1.2760162530699766E-19, + [ + null, + [ + "顊\\憎zXB,", + [{ + "㇆{CVC9ï¼MN㜋ઘR눽#{h@ퟨ!鼚׼XOvXS\u0017á£=cS+梽៲綆16së½íœy屬?ᇳG2á´­\u00054쫖y룇nKcW̭炦s/鰘ᬽ?J|퓀髣n勌\u0010í™ P>j": false, + "ç®´": [ + false, + "éžj\"ꮾ*엇칬瘫xṬ⭽ì©äƒ³\"-⋵?ᦽ댎Ĝ": true, + "Pg帯佃籛n㔠⭹࠳ë·â‰»à¿Ÿ3ãž±ï“!î—-ì’¾!}쭪䃕!籿næ¶»J5ਲ਼yî˜vy;Rኂ%ᔡጀ裃;M⣼)쵂쑈": 1.80447711803435366E18, + "ꈑC⡂ᑆ㤉壂뎃Xub<\/쀆༈憓قì¨×§\\": [ + 7706977185172797197, + {"": {"K╥踮砆NWࡆFy韣7ä밥{|紒︧䃀榫rᩛꦡTSy잺iH8}ퟴ,M?Ʂ勺ᴹ@T@~꾂=I㙕뾰_涀쑜嫴曣8IY?Ò¿o줫fऒ}\\S\"ᦨ뵼#nDX": { + "♘k6?଱癫d68?㽚乳䬳-Vé¡·\u0005è•?\u0018䞊V{邾zã˜l]é›k臤~ൖHë’iꢥ]g?.G碄懺䔛pR$ä…’X觨lë´œA刊8R梒',}u邩퉕?;91Eî¦a䈈ë¯G⊶芔h袪&廣㺄j;ã¡ç¶½\u001bN頸쳘橆": -2272208444812560733, + "æ‹‘Wﵚî²j鵼駳Oࣿ)#ã¾…é¡‚N傓çºy僱栜'Bê-!KF*ꭇK¦?䈴^:啤wG逭w᧯": "xᣱmYe1Û@霄F$ě꧘푫O䤕í€Pq52憬ꀜ兴㑗ᡚ?ï—ƒLé·íŸî—¼ë­zJê‘™}╆ᅨJB]\"袌㺲u8䯆f", + "꿽á…㔂긱Ǧ?SI": -1669030251960539193, + "ì‡É¨`!葎>瞺瘡驷錶â¤ï»®é…œ=": -6961311505642101651, + "?f7♄꫄Jᡔ훮eì‡îª¼í¾á£ä­´KhखT;Qty}O\\|ë«Iá¿’Ne(5æƒê¥¶ã†·Y9ﮡ\\ oyâ­–-䆩å©m#xë´‰>Y鈕Eç–£s驇↙ᙰm<": {"퉻:dê‚&efᅫ쫢[ï„™\"ëˆëŠ–êº™|Ôå‰1Í–-K:Êšá­•/;ì–㷛]Iç—èŒ4gZ4âœkเꛘZ⥺\\Bʫᇩ鄨魢弞&幟ᓮ2̊盜", + -9006004849098116748, + -3118404930403695681, + { + "_彃Y艘-\"Xx㤩㳷瑃?%2ä¡éµ›o귵옔夘v*탋èŒ&㳈챗|Oé’§": [ + false, + "daꧺdᗹ羞쯧Hã¤é„³é ³<型孒ン냆㹀f4ã¹°\u000f|C*ሟ鰠(O<ꨭ峹ipຠ*yà³§4VQè””hVæ·¬{?ᵌEfrI_", + "j;ꗣ밷é‚副]á—“", + -4299029053086432759, + -5610837526958786727, + [ + null, + [ + -1.3958390678662759E-19, + { + "lh좈T_ë¯Y\"伨\u001cꔌG爔겕ꫳ晚è¸â¿»ìT䯎]~e#฽燇\"5hٔ嶰`泯r;ᗜ쮪Q):/tç­‘,榄&5ï¤ëŽ«ç‹(": [{ + "2áâ“›]r3C攟וּ9è³µsâ›”6'ஂ|\"ⵈ鶆ä¹ç¦3\"痰ࢤéœäµ©ì˜†äŒ€?æ •r7Oç°‚Isd?K᫜`^è®¶}zî°’8?zì–°î§T:X倫⨎ꑹ": -6731128077618251511, + "|︦僰~m漿햭\\Y1'Vvخ굇á‰ì±¢cè¶–": [null] + }], + "虌魿閆5⛔煊뎰㞤ᗴꥰF䮥蘦䂪樳-Ká·-(^\u20dd_": 2.11318679791770592E17 + } + ] + ] + ]}, + "묗E䀳㧯᳀逞GMc\bï•¹å¢¹ã“„ë–Æ &U??íŽŒé‘ åª‹k))ᄊ": null, + "묥7콽벼諌J_DɯﮪMæ®´ä£,煚ྼ`Y:ì”§<\/â©«%yf䦀!1á²¶kì¶ŽQç±³W∠WC跉鬽*á›±iã´•L꘻ê€ì“ª\"_gé¿„'#tâ½™?,Wg㥖|D鑆eâ¥ìª¸åƒ¬h鯔咼ඡ;4TKèŽî¾‘졠嫞" + } + ] + ] + } + ] + ] + ]}} + } + ]} + }, + "뿋뀾淣截䔲踀&XJ펖꙯^Xb訅ꫥgá¬>棟S\"혧騾밫ê²7-": "擹8C憎W\"ìµ®yR뢩浗絆䠣簿9äˆå¼•Wcy䤶孖ꯥïž;íŒ]輩ä3@{å 뽸0ï€á¡ˆìµ¡î›„Ⲇ\u001dLåŒê§2F~ݕ㪂@W^é½L襒ᦘî¢~沦zZ棸!꒲栬R" + } + ] + ], + "Z:ëƒàµ›5Iz찇䅄駠㭧蓡K1": "e8᧤좱U%?ⵇ䯿é¿\u0013縮R∱骒EO\u000fg?幤îš@֗퉙vU`", + "äƒìªˆï‘’埽້=Ij,쭗쓇చ": false + }]}} + ] + } + ]} + } + ] + ] + ], + "咰긖VM]á¼6䓑쇎çºetDÒŒ?ãžê©„퇫밉gj8è ƒ\"â©5䛹1ࣚ㵪": "ക蹊?⎲⧘⾚̀I#\"䈈⦞ë·`wo窭戕෱휾䃼)앷嵃꾞稧,Ⴆ윧9S?೗EMk3Მ3+e{â¹”Te驨7äµ’?타Ulg悳o43ï“¢" + } + ], + "zQᤚ纂땺6#ٽ﹧vï¿¿#ࠫ휊冟蹧텈ꃊʆ?&a䥯Deæ½|ì¿“pt瓞㭻啹^盚2êŠf醪,ì–T窧\\Di䕎谄nn父ꋊE": -2914269627845628872, + "䉩è·|㨻ᷢã‰B{蓧瞸`î°²I!℄욃힕#ೲᙾ竛ᔺCjk췒늕貭è¯\u0017署?W딚%(pê⤼ë³^=on뺲l䆼bzrﳨ[&j狸䠠=ᜑꦦ\u2061Õµnj=牲攑)Mî»\\é¾": false, + "뎕y絬᫡⥮Ϙᯑ㌔/NF*Ë“.ïž¿,QEzvK!Iwz?|쥾\"ê©»Lê¼—Bê”§è³´ç·œs뉣隤茛>ロ?(?^îµ­`>冺飒=噸泥⺭Ᲊ婓鎔븜z^å·è£®Ãªâ“…à»—jM7ﶕ找\\O": 1.376745434746303E-19 + }, + "ä›ræ»–wã¤,|Nዜ": false + } + ]], + "@ê¿™?è–•å°¬ gd晆(ë„5躕ﻫS蔺4)떒錸ç“?~": 1665108992286702624, + "wë¯ná =`঺ᅥC>'從ë槷ä¤çœ·èž„ãŽ»æ°æ‰°XᅧCè´½uáƒë‚ŸjKD03T!lDV쀉Ӊy뢖,袛!终캨G?鉮Q)â‘—1쾅庅O4ê‰H7?d\u0010蠈줘월Þ粯Q!낇껉6í…|{": null, + "~Ë·jg쿤촖쉯y": -5.5527605669177098E18, + "펅Wᶺzê†ã¨í‘­e?4j仪열[D<鈑皶婆䵽ehS?袪;Hê¨Më—Žã°[(å—M3qíŸg4y╸鰧茀[Bi盤~ï«å”Žé‹†å½ºî½«â¦Šq?î–³B4쉓癚O洙킋툈䶯_?ퟲ": null + } + ] + ]] + ]], + "꟱Ԕã¤7æ›ï¦—ಃéŒVä·°?v㪃૦~K\"$%请|ꇹn\"kä«›ã¨é²¨\u2023ä„¢\u0004[︊Vï‹•J?䶟ាꮈ䗱=깘U빩": -4863152493797013264 + } + ]}]} + ] + }}} + ], + "ì·ì²Û¹í‰ƒ~aEå”™a챑,9㮹gLHd'ä”|í‚—ãžäŽ¥&KZYTë§µ7䥺Nâ±³åŒèŽžé¿§w\\༌疣n/+ꎥU\"å°ëž¾â—‹íŸ™AJá­Œ?9ä›$?é©”9è®ì§˜é­¡TÖ¯cè—³`虉Cì‡ì¦T" + } + ], + "è°¶ê°œgTRï¿>áµÍšdtæ™‘ä‰‡é™æ»º}9㉸P漄": -3350307268584339381 + }] + ] + ] + ]] + ] + ], + "0y꟭馋X뱔瑇:䌚ï¿å»¿jîžg-懲鸭䷭垤㒬茭u賚찶ಽ+\\mT땱\u20821殑ã„J쩩䭛ꬿNSæ½”*d\\X,壠뒦e殟%LxG9:摸": 3737064585881894882, + "í’µO^-â§§â…¶vѪ8廸鉵㈉רâ†Q㿴뺟EႳvNM:磇>wî·/៻唎뷭୥!냹D䯙iëµ±è²C#⼉NH6`柴ʗ#\\!2ä‚—â±§f?諳.Pëˆ-è¿”I꘶6?8î“ê˜": -8934657287877777844, + "溎-è˜å¯ƒi诖ര\"æ±µ\"\ftl,?d⼡쾪⺋h匱[,à·©I8MÒ§F{kç“¿PAî…§'橸ꩯ綷퉲翓": null + } + ] + ], + "ោ係Øî½<å…ƒ": 1.7926963090826924E-18 + }}] + } + ] + ]]}] + }] + ] + ] + ] + ], + "ጩV<\"Ú¸sOᤘ": 2.0527167903723048E-19 + }] + ]} + ] + ]], + "∳㙰3ì ´pá§—ä±™?`yZA8Ez0,^á™›4_0븢\u001ft:~䎼s.bb룦明yNP8弆Cå¯;⪾ì§'蕴뮛": -6976654157771105701, + "íµê¦€\\㇑:nî‹™v+뒤燻䀪ﴣï·9ᚈ኷K㚊誦撪䚛,ꮪxሲ쳊\u0005HSf?asg昱dqꬌVꙇ㼺'k*'㈈": -5.937042203633044E-20 + } + ] + }], + "?}\u20e0],så¶³è‹@#2uì’´sQSä©—=ꥮ;烌,|ꘔ䘆": "á…©ì˜Nç’ kZ먕眻?2ቲ芋眑D륟渂⸑ﴃIRE]å•—`K'" + }}, + "쨀jmV賂ﰊå§ä‚¦çŽžã¬™áªM᪟ïՎ씜~`uOn*ॠ8\u000ef6??\\@/?9見d筜ﳋB|Sä¬è‘«ã½o": true + }, + "즛ꄤ酳艚â‚㺘봿㎨iGà§•à¡¿?1\"䘓您\u001fSáŠâº¿æºzៀ뻤B\u0019?ìœa䳵᭱䉺膷d:<\/": 3935553551038864272 + } + ] + ]} + ]] + ]] + ]} + } + ] + } + ]]}}, + "᥺3h↛!ê‹°y\"攜(ெl䪕oUkc1A㘞ᡲî촾ᣫ<\/ä’ŒEã›æ½¨i{ï  v?Wà±¾H\\RჅpzè¬R脾;v:碽✘↯삞鷱o㸧瑠jcmK7㶧뾥찲n": true, + "ⶸ?x䊺â¬-ä°…â‰!e쩆2ꎿ准G踌XXᩯ1ß}0?.í—€Z馟;稄\baDꟹ{-寪⚈ꉷ鮸_L7ƽᾚ<\u001bጨA䧆송뇵⨔\\ç¤ë—”d设룱㶉cq{Hyã±R㥽å¢ï¬…p": -7985372423148569301, + "ç·«#ì½®IB6<\/=5Eh礹\t8럭@饹韠r㰛斣$ç”LVì·a갵îŸ'请o0g:^": "䔨(.", + "ë³â„¡åœ¤pï¾à¯„Ä倧訜BìŸGä™”\"Sbâ“®;$$â–S1J뢙SF|赡gï„€*\"Vu䲌y": "䪈&í‹),\\kT鬜1í’¥;ë·´'Zေ䩹@Jéž½Nã¼M?å¥eWb6榀ƩZڮ淽⺞삳煳xჿ絯8eâ¶ç¾·V}ჿ쎱䄫R뱃9Z>'\u20f1â“•äœé½®" + } + ] + ]]] + }} + } + ] + ]}, + "펮b.hç²”í¯2npXè©«g錰鷇㇒<ì™S値bBi@?镬矉`剔}c2壧ଭfhY깨R()痩⺃a\\â”?M&ﯟ<劜꺄ï‘멊ᄟA\"_=": null + }, + "~æ½¹Rqn榢㆓aR鬨侅?䜑亡V_ç¿…ã­”(ä“·w劸á³Dp䀅<\/ï°Žé¶Šm䵱팱긽ꆘ긓准D3掱;o:_Ñœ)껚콥8곤d矦8nP倥ꃸI": null, + "뾎/Q㣩㫸벯➡㠦◕挮aé¶§â‹“å¼\u00001뱓fm覞n?㛅\"": 2.8515592202045408E17 + }], + ",": -5426918750465854828, + "2æ««@0柡g䢻/gꆑ6演&D稒肩Y?艘/놘p{f투`飷ᒉ챻ëŽîª–<늛ä˜ï´¡ì¤°ì«„": false, + "8î™–(鸑嵀⵹ퟡ<9㣎Tߗ┘d슒ل蘯&㠦뮮eà kç g ì—»": false, + "d-\u208b?0ﳮ嵙'(J`蔿d^踅⤔榥\\Jâµ²v7": 6.8002426206715341E17, + "ཎ耰í“ê•ï’ã±·\u0013y=詽I\"盈xm{0쾽倻䉚ષso#é°‘/8㸴짯%ꀄ떸b츟*\\鲷礬ZQå…©?np㋄椂榨kc᡹醅3": false, + "싊j20": false + }]] + ]], + "ä¿›\u0017nç·½Tu뫉èœé¼Ÿçƒ¬.ï‘ꭠIâ°“\"Ἀ᜾uC쎆J@å¤%ê›m뻨ᾀ画è›íœƒT:錖㑸ዚ9죡$": true + } + ] + ], + "ãµâ‡˜ê¦–辈s}㱮慀밒s`\"㞟j:`ií”»Zì„«^諎0Ok{켿æ­à·£èƒ°a2﨤[탳뚬쎼嫭뉮m": 409440660915023105, + "w墄#*ᢄ峠밮jLa`ㆪ꺊漓Lã§ëŽ!Agkï¹ï¾'ê›ë¢ƒã¯å²¬D#ã’¦": false, + "ଦPGI䕺L몥罭ꃑ궩﮶#⮈ᢓӢ䚬p7웼臧%ï‘¥~Sè âŒíž€6îž’&t䳙y㪘ëƒ\\*;é‰ï¿Šé¿µ'å—•pa\"oL쇿꬈Cgî“": "ã¶½1ç¸D⟸䴅ᆤ뉎﷛渤csî¸x ä”цꬃ锚æ¬?ຽ+x~꘩uI࡞\u0007æ ²5呚ẓem?è¢\")=㥴䨃pac!/æŽY", + "á·±o\\||뎂몷r篙|#X䦜I#딌媸픕åžRDæ–³X4t⯩夬=[ï‹ë­²r=绥jhë·±ì¸âª˜%]⚋܈㖴スHí…¹m(WOæ›åЉ0~K3c柢Õã‰ïªªé€³~": false, + "ç…½_qb[첑\\륌wEâ½Ztï”´CNï­+餌ᕜOê›­": "{ﳾ쉌&s惧á­âµ†3䢫;䨞팑ï›ê’ªí˜è¤€à¢–Qä ¿V5뭀䎂澻%ë°›u5í…¸oA⮥U㎦;B䳌wzä•™$áž¿\\௅婺ëµâª¾í†\\`Kyौꋟ._\u0006L챯l뇠Hi䧈å’5", + "艊ä½à£ƒë¡‡ä± çˆ¬ï˜‚!*;⨣æŽïžæ…“qé“|儑ᨋL+è¿¥=6㒺딉6弄3è¾…J-㕎뛄듘SG㆛(\noAzQê±ä°©X*ã¢O퀌%펠낌moí‹®a^<\/F&_눊ᾉ㨦ы4\"8H": 2974648459619059400, + "鬙@뎣䫳á®ë¡?){y?5K;î§„TA*k溱䫜J汃ꂯ싔ì\u001dA}룖(<\/^,": false, + "ëª@QꋦFꊩá’뎶î‡lXl垨4î¤^郣|ꮇ;ä´á“}ìµ²zç–": null + } + ]]]], + ":_=ë‹§å¼—D䙋暨é›. 㱻붘ä‚Jå„’&ZK/녩䪜rå›â½¯D喠죥7ï“⹌䪥c\u001a\u2076￞妈朹oLkè®F౟覛ì§ã®7T;}è›™2{9\"å´“bB<\/⡷룀;즮鿹)丒툃୤뷠5W⊢嶜(fb뭳갣": "E{å“1WM" + }}, + "䘨tjJ驳豨?y輊M*᳑梵瞻઻ofQGç‘®e": 2.222802939724948E-19, + "ä®´=â‘âž¶Tà·‹wäžœ\"垦ꃼUt\u001dx;B$뵣䙶E↌艣ᡥ!á§Ÿ;ä±€[䔯k쬃`à©8饙른ç†î‹”'2_'袻tGfè’­J땟as꯳╖&å•’zWࡇᒫYSá¬\u0014ℑ첥鈤|cG~Pá“®\">\"": "ႆl\f7V儊㦬nHꄬꨧC{ì¢~C⮃⛓嶦vꄎ1w鰠嘩뿠魄&\"_qMâµ–é‡”ë…®îœ¡ê‡ ãš{ç³Jå“‹ cî°¸v?-jkﻯྌ鹑L舟r", + "龧葆yB✱H盋夔ﶉ?n*0(": "ꧣኆ㢓氥î³qZZ酒ຜ)鮢樛)X䣆gTSî»»Ò‘Gí…žï’˜k.J圬ç–ë¡«ïœì¯­z L:\\ྤ@w炋塜쿖ᾳy뢀䶃ë±N䥨㚔勇ê²#p", + "ë„畎Q娡\"@S/뼋:äµ!Pè¡…ì´šfVHQs✜á«i㻑殡B䜇%믚k*U#濨낄~": "êŸá‹•ì³¸êˆæ•‹&lå¦\u0005憡멗瘌uPgá…ªm<\/To쯬锩h뒓k" + } + ] + }], + "墥홞r绚<\/⸹ⰃB}<躅\\Y;๑@䔸>韫䜲뱀X뗩鿥쩗SI%ﴞ㳕䛇?<\/\u00018x\\&侂9é‹™a[LRã‹­W胕)â¡¿8ãž™0JF,}?í—ˆd1cDMáƒâ›é„ⱕ%X)!XQ": "â³ê—³=橇a;3t⦾꼑仈î¥á€°aᚯ⯋ꕃAsé´·Nâ•_䎃ꙎAz\u0016䯷\\<à¿«>8q{}ï½·?ᣰ}'0ᴕ펓B┦lF#趤厃T?㕊#撹圂䆲" + }, + "Ü‹ë‹é¾«ï¥c웑": false, + "ㇿ/q\"6-co髨íœCí¦#\u001b4~?3ä¹E삇<<": 7.600917488140322E-20, + "äE6?㣖êƒé—´t祗*é‘ {ḣV(æµ¾h逇íž=W?ૉ?nꇽ8ꅉຉj으쮺@Ꚅ㰤u]Oyr": "vâ‰á«¸_*όAඤԆl)ۓᦇQ}í zà¼q滚", + "ソ᥊/넺I": true + }]] + ] + ] + ] + ]] + }, + "ä­‘Ik攑\u0002QV烄:芩.麑㟴㘨≕": true, + "å„꿕C쇻풉~å´%碼\\8\"䬦꣙": null, + "欌L圬䅘Y8c(♺2?ON}o椳s宥2䉀eJ%é—¹rå†O^K諭%凞⺉⡻,掜?$ꥉ?略焕찳㯊艼誜4?\"﯎<ï±ã‚›XáˆINT:è©“ +": -1.0750456770694562E-19, + "ç’àc뜭싼ﺳ뎤K`ïŸ]p隨LtE": null, + "ç”™8䵊神EIꩤé¯á¢€,ïµ®Uä‘u疒ử驺䚿≚ഋ梶秓F`覤è­#짾蔀묊4<åªì¬¦éª_Yzgcà¡¶î²§4kç´¥`kc[Lï®—î°£ç°*I瀑[â¾°L殽鑥_mGÈ <\/|囹ç gæ¡°iri": true, + "챓ꖙꟻì¢è‡ou,å— 0\\jK핻뜠qwQ?ഩ㼕3Y彦b\u009bJ榶N棨f?ë¦é–綃6é³µM[OEë´¨uí–.Ꮁ癜蟳뽲ꩌ뻾rM豈Rï¨ç¾« uDꎚ%": null + }, + "V傜2<": 7175127699521359521 + }], + "é“«aG切<\/\"ী⊆e<^g࢛)Dé¡ï½Žï¬®é¥¼\u008c猪繩嵿ﱚCꡬ㻊g엺Aì—¦\u000fæš¿_f꿤ë³ã¦•桦`蒦䎔j甬%å²rj ç³": "䚢åŽëˆ´Au<4箞7礦Iï±”å eȧ䪸uï„€äµp|逹$嗫쨘ꖾï·!胠z寓팢^㨔|u8Nሇe텔ꅦ抷]،鹎ã³#༔繁 ", + "낂乕ꃻ볨ϱ-ꇋã–fsâ¿«)zꜦ/K?솞♞ꑌ宭hJ᤭瑥Fu": false, + "쟰ãœé­›G\u0003u?`㾕ℾ㣭5螠烶這趩ꖢ:@å’•ê¶xë’˜ëŠmä°¨bç—ƒë 0鳊喵熬딃$摉_~7*ⱦ녯1錾GKhJ惎秴6'H妈Tᧅ窹㺒疄矤铟wላ": null, + "쯆q4!3錕ã²âµ†ã‡›ê˜·Zç‘©ë­†\\â—ªNH\u001d\\ã½°U~㯶<\"쑣낞3ᵤ'峉eꢬ;鬹o꣒木X*é•·PXᘱu\"ä ¹n惞": null, + "ᅸ祊\"&ꥴCjࢼ﴿?䡉`U效5殼㮞V昽êª#ﺸ\\&t6x꠹盥꣰a[\u001aêªSpe鎿蠹": -1.1564713893659811E-19 + } + ]] + ] + ] + ], + "羵䥳H,6ⱎ겾|@t\"#í–Šî¦1|稃 ì„­)ëœ=뻔ꡜ???櫎~*ῡ꫌/繣ﻠq": null + } + ]} + ]}, + "츤": false + }}, + "s": 3.7339341963399598E18 + } + ], + "N,I?1+㢓|ࣱ嶃쩥V2\u0012(4EE虪朶$|w颇væ­¥": "~ì¢~_,Mzrã«YB溓Eæ·š\"â…¹äˆ”áºæŠ™ b,nt5Vã’J檶ê¨â»”?", + "Q껑ꡡ}$넎qHç…”æƒ/ez^!ẳF댙äŒé¦»å‰8": "梲;yté’°$i冄}Aî‘”L%a jëœå¥·ê±³ëš¾d꿽*ሬuDY3î…—?뮟鼯뮟wãªí‹±îŸ‚V", + "o{Q/K O胟ãzUdê€m&⨺J舕â¾é­¸è¨ŸãŒ¥[T籨櫉å”í‚ aṭ뱫촙莛>碶覆⧬짙쭰ׯdAiH໥벤í¥_æ¸[ 0î­¬e:죃TCå¼¼èŽëµDA:w唵ê£": null, + "á½æ¨Žäµ®è»§|?à±—aWH쩃1 ê…­su": null + } + ] + }, + "å‹‚\\&mé°ˆJ釮=Ⲽ鳋+䂡郑": null, + "殣b綊倶5㥗惢⳷è¢á‘€ä¬„é•§M^ï±´3⣢翣næ«»1㨵}ኯ뗙顖Z.Q➷ꮨ뗇\u0004": "ê”™ä¼>n^[GीA䨟AMç¢á’ŠS쨲w?d㶣젊嘶çºéº“+æ„£a%気ྞScë“ᔘ:8bM7Xd8㶑臌]Ꙥ0ê­ì’™ä«£æŒµCè–½î€Dfⵃ떼᷸", + "?ç´¡.ì…ª_à·¨j\u0013Oxâ” $Xᶨ-á…‡oè–¹-}軫;yæ¯ãªœKã£?.EVì®±4둽⛻䤜'2盡\u001f60(|eì°ã¼Žá¦€ã’§-$l@ﻑå³\u0003ä­±å“å·—WFo5c㧆Tí„Y맸♤(": -2.50917882560589088E17 + }} + ], + "侸\\릩.᳠뎠狣살cs项䭩畳H1s瀉븇19?.w骴崖㤊h痠볭㞳㞳ä®Ql怠㦵": "@䟴-=7f", + "鹟1x௢+d ;viä­´FSDS\u0004hꎹãš?â’â¦Ñž6u,扩@ë·Su)Pag휛Tá’—Vç—©!çžé‡€ê–žè˜¥&ೞè˜ê­°êž‡áŽ": "ah懱Ժ&\u20f7䵅♎඀䞧鿪굛ౕ湚粎蚵ᯋ幌YOE)५襦ãŠY*^\"R+ඈî¶å’·è¶9î—ꥂ榨艦멎헦é–ë¶v좛咊E)K㓷ྭr", + "æ†q쮦4綱켙ì….f4<\/g<籽늷?#蚴픘:fF\u00051㹉뀭.á°–í’ŽfÖ¦Hv蔎㧤.!ä­½=éž½]ìŒH:?\"-4": 8.740133984938656E-20 + }]} + } + ], + "tVKn딩꘥⊾蹓᤹{\u0003lR꼽ᄲQFá…傅ﱋ猢⤊á”,E㓒秤nTà¶­v`â™›I\u0000]꫔ṞD\"麵cè¸î“²æ°X&æ¿¿ë˜ê£¹ê¹³à±¥è‘‚鿎\\aꡨ?": 3900062609292104525 + } + ], + "ਉ샒⊩Lu@Sä§°^g": -1.1487677090371648E18, + "⎢k⑊꬗yá«7^err糎Dt\u000bJç¤¯í™•ã†æ²‘サꋽeèµ”ã¢^J\u0004笲㿋idra剰-᪉C錇/Ĝ䂾ညSì§€?~ì½®gR敉⬹'ä§­": 1901472137232418266, + "ç—kä¶¥:?ì´½è´ì“‰ê“ˆã’¸gç˜[뵎\\胕?\u0014_榙p.j稶,$`糉妋0>Fá¡°ly㘽$?": "]ê™›O赎&#ã ƒë±å‰³î°·\"<â—†>0誉é½_|z|裵씪>áŒã¼\"Z[ç•}O?G뚇諦cs⠜撺5cuç—‘U圲\u001c?鴴計lì¶¥/╓哼䄗èŒîšªê®…뫈댽AëŒë¡–뤫V窗讬sHd&\nOi;_î´–u" + } + ], + "Uﺗ\\Y\\梷䄬~\u0002": null, + "k\"Y磓ᗔ휎@U冈<\/w컑)[": false, + "æ›Jè·âŒ»ë¦\u001f㙳s꥓âŸé‚«P늮쥄c∬ྡྷ舆렮칤Zè¶£5콡넛A쳨\\뀙骫(棻.*&è¼›LiIfi{@EA婳KᬰTXT": -4.3088230431977587E17 + }]} + ] + ], + "곃㲧<\/dఓꂟså…¶à¡§&Nè‘¶=?c㠤Ჴ'횠숄臼#\u001a~": false + } + ] + ]}] + }] + }} + ], + "2f`â½°E쵟>Jî•笂裭!〛觬囀ۺ쟰#桊l鹛ⲋ|RA_Vxá­gEë“h﵀mfá»|?juTUæ¡£[d⢼⺻p濚7E峿": 5613688852456817133 + }, + "濘ë¶gå¿®7ãµæ®¬W팕Qæ› ë«°)惃廊5%-î«è¹šzYZ樭ﴷQ锘쯤崫îŸgg": true, + "絥ᇑâ¦ì’“븣爚H.ã—Šß„o蘵貆ꂚ(쎔O᥉î¼ï®“]姨Wê“!RMA|o퉢THxè½®7Mê»U즨'i뾘舯o": "è·¥f꜃?" + }} + ], + "é·°é¹®K-9k;ï°°?_ݦѷ-ꅣ䩨Zꥱ\"mꠟ屎/콑Y╘2&鸞脇ã¢ê€‡à ºâ°¼æ‹¾å–­í‹®îL꽩bt俸墶 [l/웄\"꾦\u20d3iও-&+\u000fQ+໱뵞": -1.296494662286671E-19 + }, + "HX੹/⨇୕붷Uﮘ旧\\쾜͔3l鄈磣糂̖䟎Eá³wæ©–bá¿€_딕huè‘°î¤çª³é—¹Ð²U颵|染H죶.fPä—®:jä«¢\\b뎖i燕ꜚGâ® W-≚뉗lè¶•": "ଊ칭Oa᡺$IVã·§L\u0019脴셀붿餲햪$迳å‘ì¯ì¼‚PqfT\" ?î¹€I屉鴼쿕@ç¡™z^é•㊵M}ãš›T젣쓌-Wâ©-g%⺵<ë®±~빅╴瑿浂脬\u0005왦燲4áƒb|Då § <\/oEQh", + "䘶#㥘à©îººìº”ï” f巋ἡAJ䢚쭈ࣨ뫒*mᇊK,ࣺAꑱ\u000bR<\/A\"1a6鵌㯀bh곿w(\"$ê˜*rà²è¶£.dà¿©k/抶면䒎9W⊃9": "漩b挋Swè—Ž\u0000", + "ç•€e㨼mK꙼HglKb,\"'䤜": null + }]}] + ] + ] + }] + ]} + ] + ]} + ], + "æ­™>駿ꣂ숰Q`J΋方樛(d鱾뼣(ë«–í„­\u20f9lচ9æ­Œ8o]8윶lì–¶?é•–G摄탗6í‹íµ+g:䱫홊<멀뀿/س|ê­ºsê±è·¶ç¨šW々c㫣⎖": "㣮蔊깚Cꓔ舊|XRfé»ã†šï¸†'쾉ì·\\&言", + "æ®­\"cÞɨê™äž˜:嬮eæ½½Y펪㳅/\"O@à —ê²´]ì·–YÇž(t>R\"N?梳LDæ­=næ°¯Tè±°2R諸#N}*ç§ï¡§4}ã¶ŠGä£bì–š": null, + "襞<\/å•§ B|싞W瓇)6簭鼡艆lNì©`|펭佡\\é–“é‚[z릶&쭟愱ꅅ\\Tá°½1靝忠ˆ4̸s윜R7â’/똽?치X": "âŠèº–Cﱰ2Qẫè„&இ?%ëƒæ‚Š", + ",é°§åµì…£îˆ›ì‹¹xᎹ힨᯳EṬHïŽã¹–9": -4604276727380542356 + } + } + ]]]], + "웺㚑xs}q䭵䪠馯8?LB犯zK'osäš›HZ\"L?ì…Žs^ã¿§ã´˜Cv2": null + }] + ] + ] + ], + "Kdî©´2Kv+|z": 7367845130646124107, + "ᦂⶨ?ᢠ祂些ഷ牢㋇æ“\"腭䙾㖪\\(y4cE뽺ㆷ쫺ᔖ%zfÛ»$Ñž1柦,ã¶¢9r漢": -3.133230960444846E-20, + "ç˜Mç„€q%㢟f鸯Oâ£è“‘맕鯊$Oå™·|)z褫^㢦⠮ꚯ꫞`毕1qꢚ{ĭ䎀বώT\"뱘3G൴?ï¢ï¢^^oï…¯f": null + } + ], + "aî¶¹8V᯺?:ﺃ/8ꉿBq|9啓댚;*i2": null, + "cpT瀇Hç°á»ªpೃi鎪Rrâ£ìˆ¬-鹸ҩ䠚z脚цGoN8å…¥y%è¶ŒI┽2ឪЀiJNcN)æ§£/â–Ÿ6S숆牟\"箑X僛G殱娇葱T%æ»:J諹昰qV쨰": 8331037591040855245 + }], + "G5ᩜ䄗巢껳": true + } + }, + "Ồ巢ゕ@_è­™A`碫é„㡥砄㠓(^K": "?܃B혢▦@犑ὺD~Tâ§|é†;o=J牌9냚⢽㨘{4è§èš”9#$∺\u0016p囅\\3Xk阖⪚\"UzA穕롬✎âžã­’춺C㣌ဉ\"2瓑员ᅽê¶ë«}꽚ꞇ鶂舟彺]ê½JCè§éЉ", + "â†Äšè†\"b-í‰ACR言J謈53~V튥x䜢?ꃽɄY뮩ꚜ": "K/↾eèƒ}]Bs⾿q룅鷦-膋?m+æ­»^魊镲6", + "粡霦cæž‹AHíŸo礼Ke?qWcA趸㡔ê‚?\u000eì¶‚8iতᦜ婪\u0015㢼nﵿê»!á´é–¢\u001d5j㨻gfá¿©UK5Juä¸tã‹TI'?ã“t>⼟o a>i}á°—;뤕Ü": false, + "ꄮ匴껢ꂰ涽+䜨B蛹H䛓-k蕞fu7kLè°–,'涃V~챳逋穞cT\"vQ쓕ObaCRQã“¡â²®?轭⫦輢墳?vA餽=h䮇킵ní²í‰…喙?\"'1ç–¬V嬗Qdç—'Lự": "6v!së¯ã­Ÿî€µî¦˜ã£¯çƒ!磸餠ቂh0C뿯봗Fé·­gê–¶~コkK<ᦈTtïŽ\\è·“w㭣횋钘ᆹ듡䑚W䟾X'ê…”4ï€FL勉Vܴ邨y)2'〚쭉⽵-鞣E,Q.?å—", + "?(˧쩯@å´Ÿå‹æ­„K": null + }, + "Gc럃녧>?2DYIé´¿\\륨)æ¾”0ᔬlx'è§”7젘⤡縷螩%Sv׫묈/]↱&S ï…h\u0006æ­‹á‘›xi̘}ã²Y蔯_醨鯘煑橾8?䵎쨋z儬ê*@츾:": null + } + } + } + ] + ] + ]} + }, + "HO츧G": 3.694949578823609E17, + "QC\u0012(翻曇Tfã·ŸbGBJ옉53\\嚇ᛎDï–/\u001b夾á‰4\"í•€@祎)쫆yD\"i먎Vnî¿ã¿¿V1Wá¨ä¶€": -6150931500380982286, + "Zã“®P翸é±é‰¼K䋞꘺튿â­Y": -7704503411315138850, + "]모开ꬖP븣c霤<[3aΠ\"é»ä––䰑뮋ꤦ秽∼㑷冹T+YUt\"싳F↭ä–&鋌": -2.7231911483181824E18, + "tꎖ": -4.9517948741799555E-19, + "䋘즊îŽ.⬅IꬃۣQ챢ꄑé»|f?C⾺|å…•ì¯sC鬸섾整腨솷V": "旆柩l쪦sá–¸My㦅울ì‰ç˜—㎜檵9ï……ê‚駓ૉᚿ/u3ì”…å¾ï¤¥[Z䞸ࡗ1ꆱ&Q풘?Ç‚8\u0011BCDY2볨;é¸": null, + "幫 nç…¥sì‡íއ 왊-$C\"è¡:\u0014㣯舼.3ë™—Yl⋇\"K迎멎[ê½µs}9鉳UK8ì¥\"掄㹖h㙈!얄સ?Ꜳ봺R伕UTD媚I䜘Wé¨è”®": -4.150842714188901E-17, + "ﺯ^ã„„\b죵@fྉkf颡팋î¤êž¦{/Pm0V둳⻿/è½éŸ’ꊔᚬ@5螺G\\å’¸a谆⊪ቧ慷绖?è´¢(é·‡uéŒF=ráæ©¢áž³n:^iá´µtD볠覅Nèµ´": null + }] + }] + } + ] + ]} + ]}, + "謯?w厓奰Tï§¡í——èážè²–o⪇弒L!캶$ᆅ": -4299324168507841322, + "뺊奉_åžæµ¸å»¶ëªå­„Z舰2i$q붿좾껇d▵é¤\"v暜Ҭì„mï¿´g>": -1.60911932510533427E18 + } + ] + } + ] + ]], + "í‰êº”㠦楶Pê…±": 7517896876489142899, + "ï™°": false + } + ]}, + "是u&I狻餼|è°–j\"7cë®sï­-踳鉷`䣷쉄_A艣鳞凃*m⯾☦椿q㎭Nîœæº”铉tlㆈ^": 1.93547720203604352E18, + "ï…µkⲨ\\%vr#\u000bâ’ºY\\t<\/3﬌R訤='﹠8è¤êž´ë ´æ›”r": false + } + ]}, + "阨{c?C\u001d~K?鎌Ԭ8烫#뙣Pì´ˆé—tã­±E­ë’䆺}ç”—[R*1!\\~hã•…á°º@<9JêષIä³–æ ­6綘걹ᅩM\"▯是∔v鬽顭⋊譬": "ìš´ï¶Kæ•‚(欖C취پ℄爦賾" + } + }} + }], + "鷨赼鸙+\\ä­£t圙ڹx᜾ČN<\/踘\"S_ë§¶a鷺漇T彚⎲i㈥LT-xA캔$\u001cUH=a0츺l릦": "溣㣂0æ¿•=鉵氬駘>Pꌢpb솇쬤h힊줎çªãª¬CrQ矠a&è„꼬爼M茴/á¿®\u0017å¼è½¼y#êž c6ë‘´=?Rå´ë· éº–w?" + }, + "閕ᘜ]CT)䵞l9z'xZF{:ØI/躅匽ì¡:䟇AGF૸\u001cퟗ9)駬慟ꡒꆒRS״툋A<>\u0010\"ꂔ炃7gëšEà§îˆbꅰ輤]oã±_뷕ܘ暂\"u": "芢+U^+㢩^鱆8*1鈶鮀\u0002뺰9⬳ꪮlL䃣괟,G8\u20a8DF㉪錖0ㄤ瓶8Nଷd?眡GLc陓\\_죌Vì°à¤²äºŒ?cë¦æ± \u0019JC\u0011b⤉zẒT볕\"绣蘨뚋cꡉkî« I\u001eé³´", + "ꃣI'{6u^㡃#཰Kq4逹y൒䧠䵮!㱙ï®/n??{Lí’“ZETã™ í¿X2᩟綳跠葿㚙w཮x캽扳B唕S|å°¾}ì´•%N?o䪨": null, + "ⰴFjà·Ÿì…ˆ[\u0018è¾·px?椯\\1<ﲻ栘á£ë´¢æ† ë‰´p": -5263694954586507640 + } + ] + ]] + ]} + ]}] + ] + ], + "?#癘82禩鋆êŠty?&": -1.9419029518535086E-19 + } + ] + ] + ]} + ] + ] + ], + "훊榲.|῕戄&.ãšZꛦ2\"䢥ሆ⤢fV_æ‘•å©”?â‰Fji冀탆꜕iã¬_ẑKᅢ꫄蔻XWc|饡Siẘ^㲦?羡2ã´1ç¸á™…?ì‰Ou": false + }]] + ]}}}, + "æ…‚ë—„å“è“”á“åŒåš–/颹蘯/翻ㆼL?뇊,í…µ<\\ç·ã”Cボ": null + }, + "p溉ᑟi짣z:䒤棇r^Ù«%G9缑r砌롧.물农g?0׼ሩ4ƸO㣥㯄쩞ጩ": null, + "껎繥YxK\"F젷쨹뤤1wq轫o?鱑뜀瘊?뎃hç‘\\ꛣ}Kå³^ኖâ¤ï§´ê‰“hy": null + } + ], + "á±€nè‚“ã„›\"å »2>mæ®®'1橌%êž´êµ°=Ӳ鯨9耛<\/n據0u彘8㬇៩fá¿è¯™]嚊": "䋯쪦S럶åŒã…›#î½)O`ሀX_éªæ¸²â›€ã¨»å®…闩➈ꢙஶDRâª" + }, + "tAì“龇 â‹¥bj왎录r땽✒롰;羋^\\?툳*┎?ì€ma䵳넅U䳆૘〹䆀LQ0\bç–€U~u$M}(鵸gï­â³¾i抦뛹?䤈땚검.鹆?ê©¡tâ¶¥GÄ’;!ቹHïš©Så³»B츪ì¼f5≺": 2366175040075384032, + "ì „pJjleb]áž½": -7.5418493141528422E18, + "n.鎖ጲ\n?,$䪘": true + }, + "欈Ar㉣螵᪚茩?O)": null + }, + "쫸M#x}Dç§±æ¬K=侫们ä¸ï‡ª.KꕾxẠ\u001e㿯䣛FÜ캗ï¬qq8꟞ṢFD훎⵳簕꭛^鳜\u205cÙ«~⑟~冫ऊ2ì«°<\/戲윱o<\"": true + }, + "ã·è¥/T뱂\u0010锕|内䞇xä¾â‰¦ã­–:M?iM᣿IJeç…œdG࣯尃⚩gPt*辂.{磼럾äª@a\\袛?}ᓺBç¼": true + } + } + ]]}]}}, + "tn\"6î´ê«¤ìƒ¾ä„„;銞^%VBPwu묪`Y僑N.↺Ws?3C⤻9唩Sä ®á´m;sᇷ냞඘B/;툥B?lB∤)G+O9m裢0kC햪䪤": -4.5941249382502277E18, + "áš”t'\\æ„«?éµ€@\\ã³ê‚•Pí <<]ç…¹G-b!S?\nꖽ鼫,Ý›&é ºy踦?Eæ†î¬–릱H}햧캡b@手.p탻>췽㣬ꒅ`qeä½­P>á“‚&?u}毚ᜉ蟶頳졪áŽzl2wO": -2.53561440423275936E17 + }]} + } + ] + ]], + "潈촒⿂å¡": 5495738871964062986 + } + ]] + } + ] + ]} + ]] + ]] + ]} + ] + ]}, + "á‚qí‚è“…R`謈èŸá¦î’³å„‚æ§åƒ»ï¹¶9å©Œî¬æ«žé‡ˆ~\"%匹躾ɢ뤥>࢟瀴愅?殕节/냔O✬H鲽엢?ᮈà©î“Žâ‹§dâ½ã«zCe*": 2.15062231586689536E17, + "ã¶µUi曚ç°é‹ªá¾¼è‡§P{ä䷪쨑̟A뼿T渠誈äšD1!ìž¶<\/ã¡7?)2l≣穷᛾ç¨{:;㡹nemיּ訊`Gî¹²": null, + "䀕\"飕辭påœf#뫆䶷뛮;â›´á©3çšëá°ìŽ“â¦·è©µ%᜖Մfs⇫(\u001e~P|ï­—CⲾផv湟W첋(텪બTî¾·<บSê‰à©—⋲X婵i ӵ⇮?L䬇|êˆ?졸": 1.548341247351782E-19 + } + ] + }, + "t;:N\u0015qé¦Rt缆{ê®C?஛㷱敪\\+鲊㉫㓪몗릙ç«(æ°µkYS": "Xá°‚T?൮ô", + "碕飦幑|+ 㚦é¶`é•¥ê© B<\/加륙": -4314053432419755959, + "秌孳(p!G?Vå‚«%8ሽ8w;5鲗㦙LI檸\u2098": "zG N볞䆭éŽí˜\\ONK3íš™<\/樚立圌Q튅k쩎Ffì‹aׂJK銆ઘì¦ç‹©6༥✙䩜篥CzP(è»é§‡HHퟲ讃%,ά{ë p而刲vy䦅ክ^톺M楒é¢ã¹³]Mdg2>䤉洞", + "踛Mì §>忔芿㌜Zk": 2215369545966507819, + "ì”A`$æ§­é °í»^U覒\bG毲aᣴU;8!팲f꜇E⸃_åµ{å«ç¾ƒX쀳C7ë—®m(åš¼u NÜè°ŸD劯9]#": true, + "ﻩ!뵸-ç­šPá­›}á¼°å±¥lPh?౮ⶹꆛ穉뎃gè‘㑓溢CX뾇Gã–¬A錟]RKï’î´²aꄘ]Yo+@ä˜'s섎襠$^í™°}F": null + }, + "粘ꪒ4HXᕘ蹵.$å€\r\u001dë¬77pPc^yî¶ç¬²Q<\/ê–¶ è¨äƒá¨•G?*": 1.73773035935040224E17 + }, + "婅拳?bkU;#D矠â´vVN쩆t㜷A풃갮娪a%é®çµª3dAv룒#tm쑬⌛qYwc4|L8KZ;xU⓭㳔밆拓EZ7襨eD|隰ऌ䧼u9Ô¢+]è´´Pè¿": 2.9628516456987075E18 + }]}}] + ]} + }} + ]}] + ], + "|g翉F*湹̶\u0005â1脉̀eI쩓ᖂ㫱0碞l䴨ꑅ㵽7AtἈ턧yq䳥塑:z:é€ï¾¼X눔擉)`N3昛oQì…–y-ڨ⾶æ¢êˆµq^<\/": null, + "è¹\\ëž“G^璬x৴뭸ゆUSê²§ï®·Bꮤ ┉銜᯻0%N7}~fæ´‹å„Xꔼ<\/4妟Vꄟ9:౟곡t킅冩䧉笭裟炂4ë´‹â±³åºæ€Št+怯涗\"0ã–ˆHq": false, + "졬믟'ﺇফ圪쓬멤m邸QLà¦¬ä—æ„4jvsç¿™ à¾ê§€è‰³H-|": null, + "컮襱⣱뗠 R毪/鹙꾀%í—³8&": -5770986448525107020 + } + ], + "î½­B䔚bê»ë™å§“展槰T-똌鷺tcï§ç¿á«½^㓟ä€o3o$꘭趙è¬Ié¡©)뇭Ἑä“\f@{ᣨ`x3è”›": null + } + ] + ] + }], + "⦖扚vWꃱ꥙㾠壢輓{-⎳鹷è´ç’¿äœ‘bG倛â‹ç£Žc皇皩7a~ﳫUâ•£Q࠭ꎉS摅姽OW.홌ೞ.": null, + "蚪eVlH献r}á®ë¯ ï°©ê”„@ç‘„â²±": null, + "퀭$JWoê©¢gì—­ì䖔㑺h&à­¢tXX愰㱇?㾫I_6 OaB瑈q裿": null, + "꽦ﲼLyr纛ZduçB絟쬴糔?ã•‚ì§¹äµe": "ḱ\u2009cX9ë©€i䶛簆㳀k" + } + ]]]], + "(_ê®g່澮?ᩑyM<艷\u001aꪽ\\庼뙭Zë§·ã°©Vm\\lYç­º]3㋲2㌩㄀Eਟäµâ¨„ì¨á”ŸgङHné–⤇놋瓇Q탚單oY\"♆臾jHᶈå¾îž«á‰„??uㇰA?#1侓": null + }, + "è§“^~ሢ&iIë†g륎ḱ캀.ᓡꀮ胙鈉": 1.0664523593012836E-19, + "yè©­GbᔶऽsëŒU:æœî „⤎ϲì—⮼D醄诿që™°I#즧v蔎xHᵿt᡽[**?崮耖p缫쿃Lè,ë´¬ï–ꤦC쯵#=X1çž»@OZc鱗CQTï‹„x": null + } + ] + }}], + "剘ç´\u0004\\Xn⊠6,á€×±;嵣崇}讃iႽ)d1\\䔓": null + }, + "脨z\"{X,1uì°œ<'k&@?1}Yn$\u0015Rd輲ーa쮂굄+B$l": true, + "諳>*ì­®ê´äµŸÒ+<ç®}빀䅱⡔æªï€è‡’hIH脟ꩪCí•ଗP좕\"0i<\/C褻DÛžæ—+^5?'ꂱ䚫^7}ã¡ cq6\\쨪ꔞꥢ?纖䫀氮蒫侲빦敶q{Aç…²G": -6880961710038544266 + }}] + }, + "5s⨲JvಽῶꭂᄢI.aà§Š": null, + "?1qê½ì¿»ê›‹DR%Uå¨>DgNä¹­G": -1.2105047302732358E-19 + } + ] + ]}, + "qZz`撋뙹둣j碇ì\\ꆥ\u0018@ïœè—´ç–°Wz)O{Fä¶›l᷂绘訥$]ë®å¤»ä¢‹ä©‡è¿ç°æ¨§çŒµâ£­jè¶q)$꬚⵷0馢W:â°!Qoe": -1666634370862219540, + "t": "=î¹›wp|~碎Q鬳Ó\\l-<\/^ﳊhní–}ä”t碵ḛ혷?é»äŠ—", + "邙쇡㯇%#=,î‰E4勃驆V繚q[Y댻XV㡸[逹á°è‘¢B@u=JS5?bLRnì–®ã‰â…ï°³?a6[&íŸ!è—ˆ": 1.2722786745736667E-19 + }, + "X블땨4{ph鵋ꉯ웸 5p簂䦭s_E徔濧dç¨~No穔噕뽲)뉈c5M윅>âš‹[岦䲟懷æ?éŽê“†à¸¬çˆ‹ç äœ”s{\u001bméšå„¸ç…›%bﯿXT>ê—˜@8G": 1157841540507770724, + "媤娪Qæ¸ï‡\u0011SAyᡈ쿯": true, + "çš^ಸ%ê±<\/蛯?\"祴å“\\\\'í": -3.4614808555942579E18, + "釴U:O湛㴑䀣렑縓\ta)(j:숾å´ä—ŒgCiB뽬Oyuqè¼¥åŽ/7)?今hY︺Q": null + } + ] + ]]]}] + ], + "I笔趠Ph!<ཛྷ㸞诘X$畉F\u0005笷èŸ.Esr릙!W☆ï›ä²–뗷莾뒭U\"䀸犜Uo3ï¯Gꯌx4r蔇᡹㧪쨢準<ä‚€%ࡡꟼç‘8ç‚Xs0ä€é”€?fi쥱ê†àª²BB": -8571484181158525797, + "Lâ¦o#J|\"⽩-ã±¢d㌛8d\\㶤傩儻E[Y熯)r噤὘勇 }": "e(濨쓌K䧚僒ã˜è ¤Vᛸ\"络QJL2,嬓ì™î¿‰ä¼¢ã‹’䴿考澰@(ã¾`kX$ë‘ÑE斡,èœ&~y", + "vj.|统圪ᵮPL?2oŶ`ë°§\"勃+0ue%⿥绬췈체$6:qaë Q;~晘3㙘鹑": true, + "à·Ø™4ç„â¶¿c︋iâš…:ã‚“é–Ⳙ苆籦kw{䙞셕pCì·ƒê¬âœêŸ¯êš“é…„bížhwkê­­M鬋8B耳쑘WQ\\å™ac'唀x᪌\u2048*hì§Ž#á‡é® ë¾áž¿ë€Œ": false, + "⎀jꄒ牺3Ⓝ컴~?親ꕽã¼Ü“å–瘘!@<튋ãŒê¿±â©¦{a?Yv%⪧笯Uܱ栅Eæši뚬:ꄃx7䙳ꦋ&䓹vq☶Iä˜á¾˜æ¶œ\\ì‰ëºŒLr%Bcãœ3?î¤ï…¨ê­ç ¿è£ž]": null, + "⭤뙓z(ã¡‚%亳K䌽꫿AԾ岺㦦㼴輞낚Vꦴw냟鬓㹈뽈+o3è­»K1ìžž": 2091209026076965894, + "ㇲ\t⋇轑ꠤ룫X긒\"zoYì‡í¬wjæ¢ì‘l侸`e%s": -9.9240075473576563E17, + "啸ꮑ㉰!áš“}éŠ": -4.0694813896301194E18, + "ï‰>]囋੽EK뇜>_ꀣ緳碖{ì裔[<ನ\"䇅\"5L?#îµ³xTwv#ç½\u0005래t应\\N?빗;": "v쮽瞭pë­ƒ" + } + ]], + "æ–´æ§¾?Zç¿\"~æ…弞ﻆ=꜡o5é‹ï’½dw\"?Kè ¡i샾ogDï²°_C*⬟iㇷ4nયèŸ[㟉U꽌娛苸 à§æ“贻洞펻)쿗૊許X⨪VY츚Zä¾ã¶­~튃ᵦ<\/E臭tve猑x嚢": null, + "锡⛩<\/칥ꈙᬙè€&êšç±¬â– 865?_>Lè©ì¿¨äˆŒæµ¿å¼¥ï©‰Ì«î¾½ï‘lj&zx<\/C쉾?覯n?": null, + "꾳鑤/꼩ï¨d=ᘈn挫ᑩ䰬ZC": "3錢爋6Ƹ䴗v⪿Wr益G韠[\u0010å±—9ì¡é’u?殢c䳀蓃樄욂NAq赟c튒ç˜ë ¶î‚³Aà«¡Éšæ" + } + ] + ] + ]} + ] + ] + }]]]}} + ]}], + "ï‚’Ejä—³U<\/Q=ç’샎䞦,å °é  @褙g_\u0003ꤾfâ¶½?퇋!łB〙ד3CC䌴鈌U:뭔咎(Qો臃䡬è‹BO7î¼§ã¢äŸ¸\"Yb": 2.36010731779814E-20, + "逸'0å²”j\u000e눘먷翌C츊秦=ꭣ棭ှ;鳸=麱$XP⩉駚橄A\\좱⛌jqvä°ž3Ь踌v㳆¹gT┌gvLBè³–ïžçƒ¡m?@E঳i": null + }, + "曺vì°˜×?&绫OáŸ": 9107241066550187880 + } + ] + ], + "(e屄\u0019昜훕ç–b蓘ᬄ0/۲묇Z蘮á€â¨è›˜èƒ¯ë¢ƒ@㘉8ሪWᨮ⦬ᅳ䅴HIá‡ì¨³z囕陻엣1赳o": true, + ",b刈Z,á æ™Tì†Å•B⩆ou'í¼â‰ƒç»—é›—dè­Š": null, + "a唥KB\"ï³è‚•$u\n^â…„P䟼냉䞸⩪u윗瀱ꔨ#yÅŸsî««ê’¬=ï‹•1ïš–|ﲤ爢`tà±íмî£ì³«_Az(Ṋ擬㦷좕耈6": 2099309172767331582, + "?ã´¸U<\/䢔ꯡ阽扆ã¤qé‹?f㔫wM嬙-;UV죫嚔픞G&\"Cá—äªí’ŠQ": "VM7ç–¹+陕枡툩窲}ç¿¡ä–¶8欞ÄsTë®}ç’¤:jﺋ鎴}HfAàµâ§»Zd#Qï¬u茅J髒皣Y-︴[?-~쉜vë”璮㹚䅊﩯<-#\u000eê±€h\u0004u抱﵊㼃U<㱷⊱IC進" + }, + "숌dee節é½é‚ºp넱蹓+e罕U": true + } + ], + "b⧴ë£??á” 3ã±>%郿劃ç¿ê¬ê ›Wï¡°çž³á«ëˆ„躨狀ໄy੽\"ីuS=㨞馸k乆E": "トz݈^9R䬑<ﮛGRꨳ\u000fTT泠纷꽀MRᴱ纊:ã ­ë³®?%N56%鈕1ä—äœaä²—j陇=ë¿»å‚衋࿘ᓸ?ᕵZ+<\/}H耢bä€z^f$&ã’LkꢳI脚뙛u": 5.694374481577558E-20 + }] + } + ]], + "obj": {"key": "wrong value"}, + "퓲꽪m{ã¶©/뇿#â¼¢&᭙硞㪔E嚉c樱㬇1aç¶‘á–DḾä©": null + }, + "key": "6.908319653520691E8", + "z": { + "6U閆崬밺뀫颒myj츥휘:$è–ˆmYí–š#rzé£+玭V㭢뾿愴Yî°‘ê–šX亥ᮉ푊\u0006åž¡ã­ë£\"厓ᔧḅ^Sqpv媫\"⤽걒\"˽Ἆ?ꇆ䬔未tv{DV鯀Tἆl凸g\\㈭ĭ즿UH㽤": null, + "b茤z\\î¨.N": [[ + "ZL:ᅣዎ*Y|çŒ«åŠæ«•è¾Oj为1糕쪥æ³S룂w࡛á²â¸¥èš™)", + { + "\"䬰á»wDæ¾V`邀⠕VDãºsH6[칑.:醥葹*뻵倻aD\"": true, + "e浱uî¿£p蔽Crà· JK軵xCʨ<뜡癙Yç©ï½¹é½ˆX/螗唻?<蘡+뷄㩤쳖3å‘犾&\\첊xzå崦ݻé´\"åµ¥B3㰃詤豺嚼aqJ⑆∥韼@\u000b㢊\u0015L臯.샥": false, + "l?Ǩ喳e6㔡$M꼄I,(3á縢,䊀疅뉲B㴔傳䂴\u0088㮰钘ꜵ!ᅛ韽>": -5514085325291784739, + "o㮚?\"춛㵉<\/﬊ࠃ䃪ä£wp6ἀ䱄[s*S嬈貒pᛥ㰉'ë€": [{ + "(QP윤懊FI<ꃣ『䕷[\"ç’å¶®?%Ḭå£à²»ä‡Ÿ0è¤!è—²ë¹bdæµ¶tl\u2049#쯀@僞": {"î—i妾8홫": { + ",Mï£ë§ƒäž›K5nAㆴVNã’Ší–¬$n꩑&êŽæ¤žî·é˜«?/á¹ì„¸ë‰ª1x쥼㻤㪙`\"$쟒薟B煌܀ì¨à­2掳7㙟鴙Xå©¢\u0002": "Vዉèˆï ’᧷⦌kîŒï®žà°ˆnz*ï·œFM\"è­7ê€-VR<\/';ä™E9$䩉\f @s?íªo3^è¡´cî˜à¶Žä§ªaK鼟q䆨c{ä³ 5mᒲՙ蘹ᮩ": { + "Fã²·JGoâ¯Pëµxë’³p䘧☔\"+ꨲå¿JfR㔹)4nç´¬G练Qáž!C|": true, + "p^㫮솎ocî’£.೚A㤠??r\u000f)⾽⌲們M2.䴘䩳:⫭胃\\á¾@Fá­Œ\\K": false, + "蟌Tk愙潦伩": { + "aï‘<\/@ᾛ慂侇瘎": -7271305752851720826, + "艓藬/>á„ṯ,XW~㲆w": {"Eç—§î–郶)㜓ha朗!N赻瞉駠uC\u20adè¾ x퓮⣫P1à «LMMX'M刼唳ë¤": null, + "P쓫晥%k覛ዩIUᇸ滨:å™í˜²lMR5䋈V梗>%å¹½ué –\\)쟟": null, + "eg+昉~矠䧞难\b?gQì­·ç­\\eê® Nl{ಢ哭|]Mn銌╥zê–˜zⱷ⭤ᮜ^": [ + -1.30142114406914976E17, + -1.7555215491128452E-19, + null, + "渾ã¨ß牄귛r?ëŒ?w[âšžÓ»~廩輫㼧/", + -4.5737191805302129E18, + null, + "xyà¿‘M[ocì…’ç«“â’ºx?뜓y䊦>-Dì¼(&&?XKkc꩖ﺸá‹ëµžK伕6à§€)딀PæœyWæ™îž¢?훻魢傎EG碸9類៌g踲C⟌aEX舲:z꒸许", + 3808159498143417627, + null, + {"m試\u20df1{G8&뚈h홯J<\/": { + "3ஸ厠zs#1K7:rᥞoꅔꯧ&ë‡éµ¼éž«6è·œ#赿5l'8{7㕳(b/j\"厢aqç±€êš\u0015厼稥": [ + -2226135764510113982, + true, + null, + { + "h%'ë§žï–±Sì‹…Hs&dï”l슾W0jé¿M×D놯L~S-㇡Rì­¬%": null, + "⟓咔謡칲\u0000孺ꛭx旑檉㶆?": null, + "æ‡I転;￸B2Y`z\\ç“w,ë†æ¿æ’埵䂄)!ä¶¢D=à´­ã´ŸjyY": { + "$ࡘt厛毣ൢIèŠ<겿骫⫦6tr惺a": [ + 6.385779736989334E-20, + false, + true, + true, + [ + -6.891946211462334E-19, + null, + { + "]-\\êŸ1/è–“â§á½Š\\l牑\u0007A郃)阜ᇒᓌ-塯`W峬G}SDb㬨Q臉⮻빌O鞟톴첂B㺱<ƈmu챑J㴹㷳픷Oㆩs": { + "\"â—‰B\"pᶉt骔J꩸ᄇá›iâ•°æ ›K쉷㉯é©!ãˆnì¹äŸ…難>盥yé“¿eà­”è’M貹ヅ8å˜‹í€¯ä‰¶áŒ¥ã¢æ®Šë»³\"絧╿ꉑ䠥?∃蓊{}㣣Gk긔H1哵峱": false, + "6.瀫cN䇮F㧺?\\椯=ÚˆT䘆4â˜ïšŒ8qv": -3.5687501019676885E-19, + "Q?yऴr혴{஀䳘p惭f1ﹸ䅷䕋贲<ྃᄊ繲hq\\b|#QSTî“¶s1c-7(äµ¢\u2069åŒçµ˜ê¯‰:læ¯´ï›æ±žt戀oà·Ÿáµ¶ë®±á£-醇Jx䙬äí–¢0࣫á¡grã„›": "\u0011_xM/蘇Chv;dhA5.嗀绱V爤ﰦiëµ²M", + "â‘[\"ugoy^儣횎~U\\섯겜ï¥l2jw஌yD腅̂\u0019": true, + "ⵯɇä²á«¿à¢š!㯢l샅笶戮1꣖0Xe": null, + "劅fë„€ï‹ï§¼bå®ç„ŠE찓橵G!ʱç“뭔雩괛": [{"p⹣켙[q>燣äƒãž½î›œá©²x:쓤삘7玑퇼0<\/qç’‚á‘[ï ™Z\\3䅵䧳\u0011㤧|妱緒C['ì·“Yꞟ3Z鳱雼P錻BUì”§U`ᢶg蓱>.1Ó§è­«'L_5VäµÐ¦": [ + false, + false, + {"22ä‚盥N霂얢躰îe9â‘©_뵜斌n@B}$ê´»Yá±@ä§‹î´½V\"☒-諯cVë¯Ê ": true, + "Ű螧ᔼæªéŽë•’딜qꄃH뜣<ç§à¥‚CYå“â¸>XQ㵡趌oë¬k픀빯a(ܵç”ë†à­¯/6Nᪧ}æšá†šì§ŒP牰泱鈷^d꣟#Lì‚€\"㕹襻;k㸊\\f+": true, + "쎣\",|⫝̸阊x庿k잣v庅$éˆê´Žç‚”k쬪O_": [ + "ìž©AzZGz3v愠ꉈⵎ?㊱}Så°³à¯p\r2>ì·IP䘈M)w|\u000eE", + -9222726055990423201, + null, + [ + false, + {"´킮'뮤쯽Wxè®V,6ᩪ1ç´²aႈ\u205czD": [ + -930994432421097536, + 3157232031581030121, + "l貚PY䃛5@ä­„ê·»m㎮ç¸fî§¡": 1.0318894506812084E-19, + "࢜⩢Ш䧔1肽씮+༎ᣰ闺馺窃䕨8Mƶqè…½xc(៯å¤J5굄ä•Qj_훨/~価.䢵慯틠퇱豠㼇Qﵘ$DuSp(8Uà¸<\/ಟ룴𥳐ݩ$": 8350772684161555590, + "ㆎQ䄾\u001bpá©­${[諟^^骴᤮b^ã…¥Iâ”§T㉇⾞\"绦rä°‚f矩'-î½7ä¡­æ¡¥Dz兔V9è°¶å±…ãºá”Šä©¯ë².\u001eL0ὅㅷ釣": [{ + "<쯬Jå·^숞u࠯䌗艞R9닪gã¾ë³Ža䂈歖æ„:%é”|ﵤ|y}î¡»>;2,覂⶚啵tb*ä»›8ä¹’ã“¶B࿠㯉戩oX 貘5V嗆렽ë‚߼4hä§›êºM空\\b꿋貼": 8478577078537189402, + "VD*|ï§­z~hè­ºaᯒ": { + "YIì·¢K<\/濳xNne玗rJo쾘3í•°é´Š\"↱AR:ࢷ\"9?\"è‡ï¦¡)?誚êŠe)_D翾W?&F6J@뺾ê°NZ醊Z쾈വHï±å¶¿?炫㷱鬰M겈᭨b,â»éˆµP䕡䀠८ⱄ홎鄣": { + "@?k2é¶–ã‹®\"Oರ K㨇廪儲\u0017ä¾î¿‚J?);\b*묀㗠섳햭1MC V": null, + "UIICP!BUA`î€á¢ˆã‹¸~袩㗪⾒=fBï®´l1ꡛ죘R辂여ҳ7쮡<䩲`熕8é ": 4481809488267626463, + "Y?+8먙ᚔ鋳蜩ï–럶1㥔y璜౩`": [ + null, + 1.2850335807501874E-19, + "~V2", + 2035406654801997866, + { + "<숻1>\"": -8062468865199390827, + "Mã¿£ï€E]}qwG莎Gná¶(ê”™\\D⬲iꇲs寢t駇S뀡ꢜ": false, + "pê¤ãŽ9W%>M;-Uç’fî£(^j1?&RBéš§ å¿“b똊îƒE": "#G?C8.躬ꥯ'?냪#< 渟&헿란zpo왓Kj}é·§XﻘMツbä•–;㪻", + "vE풤幉xz뱕쫥Ug㦲aH} ᣟp:鬼Yá°ŸH3镔ᴚ斦\\é‘r*2橱Gâ¼”F/.j": true, + "RK좬뎂aí™ f*f㱉á®â¦‹æ½™ã¨‹Gu곌SGI3Ië¿\\F',)t`è蘯囯ﮉ裲뇟쥼_ገ驪▵æ’ᕤV": 1.52738225997956557E18, + "^k굲䪿꠹B逤%F㱢漥O披M㽯镞竇霒i꼂焅륓\u00059=皫之눃\u2047娤é–銤唫á•b<\/w踲䔼u솆맚,ä’á³'/it": "B餹饴is権ꖪ怯ꦂẉဎt\"!凢谵⧿ï™0\\<=(uLä·åˆ¨ì‘ª>俆æ“Cy襸Q힆䆭涷<\/á±0î É§îŠ‹䗾䚹\\ኜ?ꄢᇘ`ä´¢{囇}᠈䴥X4퓪檄]ꥷ/3謒ሴn+gé¨X", + "GgG꽬[(å«“ëª6\u0004ê¶宩㙻/>\u0011^è¾dTè…ªhxÇ‘%ꊇk,8(Wâ§‚çµP鬜O": [{ + "Mã´¾c>\\ᓲ\u0019V{>ꤩ혙넪㭪躂TS-痴໸闓âµ/徯O.Mã¥Ê·D囎⧔ì³íœ¤T??鉬뇙=#ꢫ숣BXä­¼<\/d똬졬g榿)eꨋﯪ좇첻\u001a\u0011\";~쓆BH4勿”Š7힪", + "iT:L闞椕윚*æ»›gI≀Wਟඊ'ꢆ縺뱹鮚Nê©á§¬è•¼21줧\\䋯``â\\ã±é³¨": 1927052677739832894, + "ì®ç¼¦è…ƒg]礿Y㬙 fî¼ãƒºSɪ꾾N㞈": [ + null, + null, + { + "!t,çY 1䗉罵?c饃호䉂Cá­ì’˜z(즽sZG㬣sഖE4ï‚뢜㓕äžä¸®Qpç°6EZឪ겛fx'ꩱQ0ç½£i{k锩*㤴㯞r迎jTⲤ渔m炅肳": [ + -3.3325685522591933E18, + [{"ã“5]A䢕1룥Bï²C?Ꙍ`r룔Ⳛ䙡uä¼²+\u0001àµo": [ + null, + 4975309147809803991, + null, + null, + {"T팘8Dﯲ稟MM☻㧚䥧/8ﻥ⥯aXLaH\"顾S☟耲ît7fSà·‰ë†ë®”/ꕼ䓈ìº4\\霶䠴ᩢ<\/t4?죵>uDï›5➶༆쉌럮⢀秙䘥\u20972ETR3æ¿¡æ†vB? ~鸆\u0005": { + "`é––mç’㥉b뜴?Wf;?DV콜\u2020í‰à±“æ“å®ZMj3mJ먡-å‚·ë±™yח㸷꥿ ໘u=Mì!5å­L4v\\?ÇŽ7C홫": null, + "|": false, + "~Ztᛋ䚘\\æ“­ã—傪Wé™–+ã—¶qᵿ蘥ᙄp%䫎)}=â ”6ᮢS湟-èž¾-mXH?cp": 448751162044282216, + "\u209fad놹j檋䇌ᶾ梕ã‰bוּ": {"?è‹´ê© D䋓帘5騱qï±–PF?☸ç—é¡’yU á¡«cb䫎 S@㥚gꮒ쎘泴멖\\:Ié®±TZ듒ᶨQ3+f7캙\"?\fí’¾\\oæžç´Ÿï»½M.âŽï˜¸é‘OP": [ + -2.6990368911551596E18, + [{"ä’–@<á°¿<\/⽬tTrè…ž&G%᳊秩蜰擻f㎳?Sãµ§\r*k뎾-乢겹隷j軛겷0ë£é®ï µ": {")DO0è…¦:ì¶é€¿:1㥨่!è›æ¨‹2": [{ + ",ꌣf侴笾m๫ꆽ?1?U?\u0011ꌈꂇ": { + "xæ—ç” nVqä…¦w`CD⦂惺嘴0I#vỵ} \\ê·‚Së´Dì–¾?Ô’j溯\"v餄a": { + "@ç¿™c⢃趚痋i\u0015OQâlqë†Y0pࢥ3쉨䜩^<8g懥0w)]䊑næ´ºo5ì­QL댊랖L镈Qnt⪟㒅십q헎鳒⮤眉ᔹ梠@O縠u泌ㄘb榚癸Xî©­Þ”Ftj;iC": false, + "I&뱋゘|ï£è“”䔕측瓯%6á—»HW\\N1貇#?åƒá—œghá­ªo'䗈꽹Rcìš/蔳迄à¼!0邔䨷푪8ç–©)[쭶緄㇈୧á": { + "B+:ꉰ`sì¾­)ë¹¼Cç¾A䫊pMgjdxäHf9᥸W0!C樃'ï¤f䫤סи\u0017Jve? è¦f둀⬣퓉Whk\"஼=չï³î•¤çš†ç¬BIW虨쫓F廰饞": -642906201042308791, + "sb,XcZ<\/m㉹ ;ä‘·@cäµ€s奤⬷7`ꘖ蕘戚?Feb#輜}p4nH⬮eKL트}": [ + "RKé³—z=袤Pf|[,u욺", + "Ẏá»ç½¯ë‰‹âº–锅젯㷻{H䰞쬙-ì©“D]~\u0013Oã³¢gb@æ¶è”‰|kᦂâ—!\u001ebMè¤sca쨜襒y⺉룓", + null, + null, + true, + -1.650777344339075E-19, + false, + "☑lꄆs힨꤇]'uTന⌳ë†].1â‹”ê´æ²°\"IWà´©\u0019æ°œ8쟇䔻;3衲æ‹,窌zíŽå–íš—?4?Cë„é—®?ᥙ橭{稻Ⴗ_ì”", + "n?]讇빽å—}1å­…9#ê­¨é¶v\u0014å–ˆ)vw祔}룼쮿I", + -2.7033457331882025E18, + { + ";⚃^㱋x:饬ኡj'ê§µT☽O㔬RO婎?향ᒭæ©$渣y4i;(Q>꿘e8q": "j~錘}0g;Lèº*;á•­ê„®0l潛烢5H▄쳂ê’ï­‹ê™¶T犘≫x閦웧v", + "~î¢æ¯\u2018c4è·ë E~ᑅቚꈂ?nq뎤.:æ…¹`F햘+%鉎Oç€œìŸæ•›è®âŒæµ¢<\/㮺紿P鳆ࠉ8I-o?#jﮨîŸ7v3Dt赻J9": null, + "à£W䌈0êŽqC逖,íš…î·Žcáƒswj;jJSæ«5æ§—OaB>D踾Y": {"ã’°äµF%î©®?59.î„„ãˆcᕨï†í•틎á¸ã‹©B=9IÛⓌ{:9.ywï½å‘°ã†®è‚’᎒tIã¾´62\"ዃ抡C﹬B<\/ì´‹jo朣", + [ + -7675533242647793366, + {"ᙧ呃ï£:[㒺쳀쌡ì‚H稈㢤\u001dá¶—GG-{GHྻຊꡃ哸䵬;$?&d\\⥬ã“Nåœ´ë¤æŒ¨-'ê•®$î“‹PU%?冕눖ié­q騎Q": [ + false, + [[ + 7929823049157504248, + [[ + true, + "Zè™\u0017'eꕤ᱕l,0\\X\u001c[=雿8è ¬L<\/낲긯W99g톉4ퟋbãº\u0007åŠ'!麕Q궈oW:@XáŽïœ¬z蘻m絙璩귓죉+3柚怫tSæ‡è’£ä -æ“¶D[0=퉿8)q0ÙŸ", + "唉\nFA椭穒巯\\䥴䅺鿤S#bè¿…ç˜ ï¶—ê¬˜\\?q1qN犠pX꜅^䤊⛤㢌[⬛휖岺q唻ⳡí‹\"ã™™Eh@oA賑㗠yå¿…Nꊑᗘ", + -2154220236962890773, + -3.2442003245397908E18, + "Wá„¿ç­ :瘫퀩?o貸q⊻(᎞KWf宛尨h^残3[U(='æ©„", + -7857990034281549164, + 1.44283696979059942E18, + null, + {"ꫯAwè·­å–€ ?_ï““9\"Aty背F=9缉ྦྷ@;?^鞀w:uN㘢Rá»": [ + 7.393662029337442E15, + 3564680942654233068, + [ + false, + -5253931502642112194, + "ç…‰\\îš¶î¶è¾Žî›¢à³†ç½5â’­1äªäƒ‘s䎢:[e5}峳ﴱn騎3?è…³Hyêƒè†¼N潭錖,Yá‹ËœYAá“㬠bG렣䰣:", + true, + null, + { + "â’›'P&%죮|:â«¶ì¶ž": -3818336746965687085, + "钖m<\/0ÝŽMtF2Pk=瓰୮洽겎.": [[ + -8757574841556350607, + -3045234949333270161, + null, + { + "áœî…½rè¼³>⫇9hU#î¦#w@ê·ªA\\Cî’¢ é‹ºã˜“ê–æ¢’뒬묹㹻+郸å¬ìœ¤'+g<\/碴,}ꙫ>ì†;情d齆Jä¬àº©æ’›ì±íƒ¹/R澡7剌tꤼ?ặ!`â²ç¤\u00002똥଴âŸ": null, + "\u20f2ܹe\\tAê¥Æ°\\x当뿖ï»ë ‰ç¦›;G檳ﯪï…Sà«°3~㘠#[J<}{奲 5箉⨔{ë†<\/釿抋,åš /曳m&WaOvT赋皺璑ï“í…": [[ + false, + null, + true, + -5.7131445659795661E18, + "è­m䓪D5|3å©à°ž>î‰è ‡æ™¼6nï´ºPp禽羱î¤DS<ç“닫屚ì‚å§¿", + true, + [ + -8759747687917306831, + { + ">ⓛ\t,odKr{䘠?b퓸C嶈=DyEᙬï¿@ᴔ쨺芛髿UT퓻春<\/yê¸>豚W釺N뜨^?꽴﨟5殺ᗃç¿%>í‚ဿ䄸沂Ea;A_\u0005閹殀W+窊?Ꭼd\u0013Pæ±´G5ì“æ˜": 4.342729067882445E-18, + "Q^즾眆@AN\u0011Kb榰냎Y#ä€ê€’ᳺ'q暇çµs\"!3#I⊆畼寤@HxJ9": false, + "⿾D[)袨㇩i]웪䀤ᛰMvR<èŸã£¨": {"v퇓L㪱ꖣ豛톤î£\\ê³±#ï–©kDTN": [{ + "(ì¾´ä¡£,寴ph(C\"ã³¶w\"憳2s馆E!n!&柄<\/0Pꈗſ?㿳Qdéµ”": {"娇堰孹L錮h嵅⛤èºé¡’?CglNæŸ+쨣ﺜ\\MrH": {"çžäŽ‡ë‘ƒá‰²å¼­íŒ­^ꄞ踦涟XK錆쳞ឌ`;੶S炥騞ଋ褂B៎{Ú’ä­·á¶¼éœpIè—è™¶K$": [{"â—–S~躘蒉꫿輜è­Qã½™é—@ᢗ¥Eæ¦iØ¡5┄^B[絮跉ᰥé™PWi3wㄾⵀDJ9!w㞣ᄎ{ë“’ê““b6\\篴??c⼰鶹⟧\\鮇ꮇ": [[ + 654120831325413520, + -1.9562073916357608E-19, + { + "DC(æ˜è¡µá¼¡ê¸™ê°µå§­|Ö›[t": 7.6979110359897907E18, + "Jâ…))嫼â³9Xfd飉j7猬ᩉ+⤻î®çœ—벎Eé°‰Zï¾¶63zá69}Zá¶L崭ᦥ⡦éšâ‹›êŽ¨î´µ~i㨃咊ꧭo䰠阀3C(": -3.5844809362512589E17, + "p꣑팱쒬ꎑ뛡Ꙩ挴æèƒ”&7ᔈ묒4Hdç¡¶í›ãŽ–zꢼè±ã¿¢aሃ=<\/湉鵲Eî„¡Ó…%$F!í¶æ£Œå­¼{Oé§à¨ºgeu+": ")\u001bìž“kÅ€Xì©«Aë°Â®Ú£ç™¦ç‹¢)扔弒p}k縕ꩋ,䃉tࣼi", + "ã‚¡F肿輸<솄G-䢹䛸êŠl`Tqê•—îŠè’ža氷⸅ᴉ蠰]S/{J왲m5{9.uá½³~㕚㣹u>x8Uè®Bëºè¥ªç›ŽQhVS맅킃i识{벂磄Ià·„ä™…xZy/æŠà«­Zï–Šé²î¦š-霳Væ®æŒ¦â„’": null, + "㯛|Nî½™ê¸b7âµb?æ‹ O\u0014Þ†?-(EꞨ4ꕷᄤYᯕï‘OW瞺~螸\"욿ќe㺰\"'㌢ÆW\u0004çž•>0?V鷵엳": true, + "뤥G\\î¡‹è¿‹ä ¿[庩'꼡\u001aiá©®Vì¯á³ªä¦ªÃ”î²…;倱ନë›èªˆ": null, + "쥹䄆䚟Qæ¦äŽá¢­<\/2ã•£p}HW蟔|äƒî‚꿈ꚉ锳2Pb7㙑Tⅹᵅ": { + "Y?Ö­$>#cVBꩨ:>ï†eLè’å‹™": { + "86柡0po äš&-æ‘Ћ祌<\/휃-G*㶢הּì©s㶟餇c걺yu꽎還5*í„§ç°•Ogå©¥Sê": null, + "a+葞h٥ࠆ裈嗫ﵢ5輙퀟ᛜ,QDﹼ⟶Y騠锪E_|x죗jä¾µ;m蜫轘趥?븅w5+miì½›L": { + ";⯭ﱢ!ä¹°Fâ½æŸ¤é¶‚näµ£V㫚墱2ë ¾ELEl⣆": [ + true, + -3.6479311868339015E-18, + -7270785619461995400, + 3.334081886177621E18, + 2.581457786298155E18, + -6.605252412954115E-20, + -3.9232347037744167E-20, + { + "B6㊕.k1": null, + "ZAê„®Jé®·á³±o갘硥鈠䠒츼": { + "á•…}럡}.@y陪é¶r業'æ´î‰°í€‰x䉴ﵴlí˜):씭脴ᥞhiꃰblﲂ䡲엕8߇Mã¶­0燋標æŒ-?PCwe⾕J碻Ᾱ䬈䈥뷰憵賣뵓痬+": {"aì·©v礗X⋈耓áŠfç½…é®!㔽YYᣓwæ¾33⎔芲F|\"äœT↮輦挑6ᓘL侘?ᅥ]ë†1R௯✎餘6ê½<\/௨\\?qå–·ê«j~@ulq": {"嗫欆뾔Xꆹ4H㌋Fåµ§]à Ž]ã –1ꞤT<$më«O i댳0ä²iï—Œ": {"?à·©?\u20cd슮|ꯆjs{?îž…d7?eNs⢚嫥氂䡮쎱:鑵롟2hJꎒﯭ鱢3춲亄:ë¼£v䊭諱Yj択cVmR䩃㘬T\"Ní™*ै%x^F\\_s9ë³´zz4æ·—?q": [ + null, + "?", + 2941869570821073737, + "{5{殇0ä¾ïž¢g6ë°–í‹è‡©ç¶¹R$ä–­j紋釰7î‹‘sXI繳漪행y", + false, + "aH磂?뛡#惇då©…?Fe,ì˜+늵ä˜\"3r瘆唊å‹ï¢Šj⳧࠴ꇓ<\/唕윈x⬌讣䋵%拗ᛆⰿ妴á”M2ã³—å¿…ê§‚æ·²?ゥ젯檢<8ë’ï¶MidXä’3á³»Qî”â–®ä½UT|⤪봦éâŠ", + [[{ + "颉(&뜸귙{yîš’^\"P퟉ì¶á²Ÿä®­î‹ºDé¡¡9=?}Y誱<$bë±£RvO8cH煉@tk~4ǂ⤧â©å±‹Sî›ïž¢S;J{vV#剤餓ᯅc?#a6D,s": [ + -7.8781018564821536E16, + true, + [ + -2.28770899315832371E18, + false, + -1.0863912140143876E-20, + -6282721572097446995, + 6767121921199223078, + -2545487755405567831, + false, + null, + -9065970397975641765, + [ + -5.928721243413937E-20, + {"6ì´Š\u001a홯kB0w撨燠룉{绎6⳹!í„è´‘y▾鱧ժ[;7ᨷ∀*땒䪮1x霆Hᩭ☔\"rî¹›ä7毟á°r惃3ꉭE+>僒æ¾": [ + "Ta쎩aÆt쵯ⰪVb", + [ + -5222472249213580702, + null, + -2851641861541559595, + null, + 4808804630502809099, + 5657671602244269874, + "5犲﨣4mᥣ?yf젫꾯|䋬ìž$`Iⳉﴷ扳å…,'î±c", + false, + [ + null, + { + "DyUIN쎾M仼惀⮥裎岶泭lh扠\u001e礼.tEC癯튻@_Qd4cï…«5S熯A<\/ï¼¼6U윲蹴Q=%푫汹\\\u20614b[௒Câ’¥Xe⊇囙b,ï®æœ3ss땊ë¢i~逇PA쇸1": -2.63273619193485312E17, + "Mq꺋貘k휕=nKç¡ë«žè¼©>㾆~á¼žà¡¹ê¸æ¦µlâ‹™Hw뮢帋M엳뢯î¹…vâ…ƒ^": 1877913476688465125, + "á¶´ë»—`~ç­—å…⚽টW˃â½b犳䓺Iz篤p;乨A\u20efì©?ç–Šmã€ì»©ë«¡b탔鄃ᾈV(é¢ç³=뎲ିeF仢䆡谨8t0醄7㭧瘵⻰컆r厡궥d)a阄á·Ed&c﯄伮1p": null, + "â¯w4曢\"(欷輡": "\"Má­«]䣒頳B\\燧ࠃN㡇j姈g⊸⺌忉ꡥF矉স%^", + "㣡Oᄦ昵⫮Y祎Sì級㭻撥>{I$": -378474210562741663, + "䛒掷留Q%ì“—1*1J*ë“헩ᦢ﫫哉쩧EↅIcê…¡\\?â´Šl귛顮4": false, + "寔愆샠5]ä—„IHï©¥=d﯊/å¶?ॊn%晥D視Nò—˜ˆ'᫂⚦|X쵩넽z질tsî¦kxDQ莮Aoﱻ뛓": true, + "é’£xp?&\u001e侉/yä´¼~?U篔蘚缣/î”›I畚ï—?Q绊": -3034854258736382234, + "꺲໣眀)â¿·J暘î©pИfAVì‚•ì³­Nꯗ4々'唄ⶑ伻㷯騑倭D*Okï¯ê§3bâ½_ï„¡<\/ì±£Xm톰á•䆄`*fl㭀暮滠毡?": [ + "Dç”·p`V뙸擨å¿ë¸ª9c麺`淂⢦Yw⡢+kzÜ–\fY1䬡Hæ­)ë²¾Z♤溊-혰셢?1ï”<-\u0005;æ¢Tále\\ᛵߓﭩ榩è¨-xJ;å·¡8깊è ï»“U$K": { + "Vê•¡è«…æ“W=斸s︪vﲜ츧$)iꡟ싉eî®å¯³?ጭムVથ嵬iæ¥Fg<\/Z|៪ꩆ-5'@ꃱ80!燱R쇤tç³³]罛逇dṌ֣XHiͦ{": true, + "Ya矲Cë©—Q9膲墅æºíœ»c\\ë”¶Gç””<\/.齵휴": -1.1456247877031811E-19, + "z#.OOï¿J": -8263224695871959017, + "å´_3夼ᮟ1Fë¸ë½¯á¦“é´­V豈Ь": [{ + "Nè’¬74": null, + "yuB?厅vK笗!ᔸcXQ旦컶P-ë…«mᄉ麟_": "1R@ 톘xa_|﩯é˜î¥§sæ§žd!d껀筤⬫è–焵먑D{\\ïƒïŽ¿6k共倌☀G~AS_D\"딟쬚뮥馲렓쓠攥WTMÜ­8nX㩴䕅檹E\u0007ï­¨N 2 ℆æ¶ê¥ê µï“3▙玽|ë¨_\u2048", + "æA Cä§©G": {":Mí£5e들\\ê€æ¼á”„é¸|Iï¨$)n": { + "|U䬫㟯SKV6ꛤ㗮\bn봻䲄fXT:㾯쳤'笓0b/à³¢Cì³–?2浓uO.ä°´": "à½ê¼‹e?``,ᚇæ…^8ꜙNM䂱\u0001Iá–™ê§M'vKdꌊH牮r\\O@䊷ᓵ쀆(fî »yè»i툺\"?<\/峧ࣞ⓺ᤤ쵒߯ꎺ騬?)刦\u2072læ…ªy꺜ﲖTjî’•+u", + "뽫hh䈵î”w>1â²ì­V[â…Ž\\헑벑F_ã–⠗㫇hæ½;á¿æ±°á±¼ç€–J옆9RRì…vsZ柺鶶툤r뢱橾/ꉇ囦FGm\"謗ꉦ⨶쒿⥡%]鵩#ᖣ_蹎 u5|祥?O", + null, + 2.0150326776036215E-19, + null, + true, + false, + true, + {"\faá­¶Pæ¤WWcá Ÿf뚉á¬í“—â³€Wç¹5:HXH=q7xì°™X$)모r뚥ᆟ!Jﳸf": [ + -2995806398034583407, + [ + 6441377066589744683, + "Mﶒ醹i)Gἦ廃s6몞 KJ౹礎VZ螺费힀\u0000冺업{è°¥'꡾뱻:.ꘘ굄奉攼Diá·‘Ké¶²y繈욊阓v㻘}枭캗e矮1c?íœ\"4\u0005厑莔뀾墓ë‚⽴洗ṹ䇃糞@b1\u0016즽Yè½¹", + { + "1⽕⌰鉟í”M㤭n⧴ỼD#%é˜âŠ¯ì¿¼ç¨ë¸£ëªç´§á…‡ã“•ᛖcw嬀~ഌ㖓(0r⧦Qä‘•é«à´°é“‚㓻Rå„®\"@ꇱmâˆà¯¿á¦¯é Œ8}㿹犴?xn잆꥽R": 2.07321075750427366E18, + "˳b18㗈䃟柵Z曆VTAu7+㛂cb0﯑Wp執<\/臋뭡뚋刼틮è‹ë²²î·´TLP预庰܈G\\O@VD'鱃#ä¹–ëº*鑪ꬳ?MÞždï­¹{â‡åœ¯ì‡œã¼ž顄︖Y홡g": [{ + "0a,FZ": true, + "2z̬è£î’®ê§¦é©¸\u0006L↛Ḣ4๚뿀'?lcwá„§ã®!蓚䃦-|7.飑挴.樵*+1ﮊ\u0010ꛌ%貨啺/JdM:ë˜ïˆ!FBe?鰴㨗0Oè´¢I藻ʔWAá«“Gì³›u`<\/I": [{ + "$Ï„5Vé´a뾆両環iZp頻යn븃v": -4869131188151215571, + "*즢[⦃b礞Râ—šnΰꕢH=귰燙[yc誘g䆌?ଜ臛": { + "洤湌鲒)⟻\\䥳va}PeAMnï¼®[": "ã³Éª/(軆lZR,Cpæ®È®Nå•·\"3Bå©´?i=r$펽á¤ì€¸", + "阄R4㒿㯔ڀ69ZᲦ2ç™í•Œå™—På´œîž#\\-ì­è¢›îˆµ&é‘/$4ç«¥Vê©‘_ZHAæ¾¢fZ3": {"x;P{긳:Gé–‰:9?æ´»H": [ + "繺漮6?z犞焃슳\">á»[Ⳛ䌜ë…䂹>èµâ¼¶ç…œï’˜Yæ¡¥[泥뚩MvK$4ï‰jtï¾›", + "E#갶霠좭㦻ୗ먵F+䪀oè’ba쮎4X㣵 h", + -335836610224228782, + null, + null, + [ + "r1á«©0>danjYì§¿bs{", + [ + -9.594464059325631E-23, + 1.0456894622831624E-20, + null, + 5.803973284253454E-20, + -8141787905188892123, + true, + -4735305442504973382, + 9.513150514479281E-20, + "7넳$螔忷㶪}䪪lì§´\u0007é¹Pé°šHFéŠZJﳴ/âŽ1ᷓ忉ç‡áœ‹ì“ˆxëµ mä·çª¥á”^\u0019á¶Œå­#ヂt☆áƒpáŽè‡¶äŸ±5ï‰$ä°µ&๵分ìˆ]äˆë‰â™‚åŽ\u0011<>", + "C蒑貑è—lï°°}X喇몛;të°¿O7/᯹f\u0015îµ¼kI嘦<ዴ㟮ᗎZ`GWퟩ瑹࡮ᅴB꿊칈??Ræ ¡s脚", + { + "9çµæˆ¬+AU^洘拻ቒy柭床'ç²™XG鞕᠜繀伪%]hï ¾C,$è¼™?Utä¹–Qmë–šWï¶8઼}~qâ ªrU䤶CQ痗ig@#≲t샌f㈥酧l;yé—¥ZHæ–¦e⸬]j⸗?ঢ拻퀆滌": null, + "畯}ã§¢J罚å¸VX㨑>1ꢶkT⿄蘥ã‘o|<嗸層沈挄GEOM@-äžšä§°$만峬è¼ä ±V✩5宸-æ‚î¡§D'ã—ªyP掶7bâ ŸJã•»SfP?d}v㼂á…'猘": { + "陓y잀v>╪": null, + "鬿L+7:ë‘Y=ç„ U;킻䯌잫!韎ஔ\f": { + "é§«WmGጶ": { + "\\~m6ç‹©K": -2586304199791962143, + "ႜࠀ%Í‘lâ¿…D.ç‘¢Dk%0ç´ªdḨTI픸%뗜☓s榗኉\"?V籄7w髄♲쟗翛歂E䤓皹t ?)ᄟ鬲éœ6Cî³´": { + "_ì·¤a圷1\u000eB-XOy缿請∎$`쳌eZ~æï€§íŠ»/蜞`塣৙\"⪰\"æ²’l}蕌\\ë¡ƒè«æ°Œ.望wZ|o!)Hnçqg}": null, + "kOSܧ䖨钨:಼é‰ê­O醧Sî…¨`ì‹­`ꓭì­ï¯¢N&Et㺪馻ã¢â…³ã¢ºå´¡àºŠèœšé”«\\%ahx켨|ż劻ꎄ㢄ìŸA躊᰹p譞綨Ir쿯\u0016ﵚOd럂*僨郀N*bã•·63z": { + ":Lï œ5r+T㡲": [{ + "VK泓ë²á®™Ry㓤➙Ⱗ38oi}LJቨ7Ó㹡৘*q)1豢⛃e᫛뙪壥镇æž7Gè—¯g㨛oI䄽 孂L缊ꋕ'EN`": -2148138481412096818, + "`â›á˜‘$(खꊲ⤖á„ꤒ䦦3=)]Y㢌跨NĴ驳줟秠++då­³>8ᎊ떩Eê¡£Sv룃 쯫أ?#Eî·°|á­™ãŽ?zv:5ï©^â‹‘V": [ + -1.4691944435285607E-19, + 3.4128661569395795E17, + "ãƒì´—^G9ä½­é¾¶n募8R厞eEw⺡_ㆱ%⼨D뉄퉠2ê©µá›…â³æ¿L팹Là·€n=\"æ…‰ë…á›®y>!`g!í’²î¦ï¨’[/;?[vï®ê²è»‡}⤳â¤í•∌Tã½²R홓é‰ã“¥", + "æ„°_⮹T䓒妒閤둥?0î°šaB@㈧gç„»-#~è·¬x<\/èˆPÝ„ê¡=\\׳P\u0015jᳪá¢qï‹¶;ã¯l%á­—;砢觨â–,è¬ê°Gy?躤O黩í‹Yã’a擯\n7覌똟_䔡]fJ晋IAS", + 4367930106786121250, + -4.9421193149720582E17, + null, + { + ";ᄌ똾柉곟ⰺKpá‡ä±»à¸ºä–{o~h!ï½…ê¿àª»ìš„Úš\u0002y?xUd\u207c悜ꌭ": [ + 1.6010824122815255E-19, + [ + "宨︩9앉檥pr쇷?WxLb", + "æ°‡9】J玚\u000f옛呲~ è¼ 1D嬛,î•*mW3?n휂糊γ虻*á´«ê¾ ?qîžå‡è¶—Ko↦GTé“®", + "ã¶¢ážmOã”k'诔栀Z蛟}GZé’¹D", + false, + -6.366995517736813E-20, + -4894479530745302899, + null, + "V%᫡IIç’…ï»ä…›ä“Ží’¹ï±¢/pU9seë˜ë›žx梔~C)䨧䩻蜺(g㘚R?/á»°[å¿“C뾠ࢤc왈邠买?嫥挤풜隊枕", + ",vç¢å–”㌲쟚蔚톬៓ꭶ", + 3.9625444752577524E-19, + null, + [ + "kO8란뿒䱕馔b臻âŸéš¨\"㜮鲣Yq5mí”K#ꢘug㼈á¦=P^6탲@ä§”%$CqSw铜랊0&m⟭<\/a逎ym\u0013îš¡vᯗ": true, + "æ´«`|XN뤮\u0018詞=ç´©é´˜_sX)㯅鿻á»ì‹¹": 7.168252736947373E-20, + "ꛊ饤ï´è¢(逊+~⽫얢鈮ï«è‰¬O힉7Dç­—S곯wæ“I斞᠈븘蓷x": [[[[ + -7.3136069426336952E18, + -2.13572396712722688E18, + { + "ç¡¢3㇩R:o칢行E<=\u0018á¬YuH!\u00044U%å炼2>\u001eSi$â“·ê’ˆ'ï‘¿ë ¢gᙫ番ꯒ㛹럥嶀澈v;è‘·é„•x蓎\\惩+稘Uî“´Eᖸﳊ㊈壋Nå«¿â¾æŒŽ,袯苷ኢ\\x|3c": 7540762493381776411, + "?!*^á¢çª¯?\u0001ڔꙃw虜ë³îšFgJ?&⨫*uo籤:?}ꃹ=ٴ惨瓜Z媊@ત戹ã”똩Ԛ耦Wtè½\\æž’^\\ꩵ}}}ꀣD\\]6M_⌫)Hè±£:36섘㑜": { + ";í™—á°°U஋㙛`D왔ཿЃS회çˆ\u001b-㢈`ë´†?盂㛣듿ᦾ蒽_AD~EEຆ㊋(eNwk=RÉ å³­qï’«\"5Ἠ婾^>'ls\n8QAK)- Q䲌mo펹L_îŽ¦ì¹æ¨–庫9ê©ìª¹á˜¹ä‘–ç€aK îž?*趤fë­“å»p=磕", + "î“å“‘z懅á¤-ê¹ux쀭", + [ + true, + 3998739591332339511, + "ጻ㙙?᳸aK<\/囩U`B3袗ﱱ?\"/ké”ä§2ï…¤l@쿎VZ쨎/6ꃭ脥|B?31+on颼-ê®§,O嫚m à¡­`KH葦:粘i]aSUì“™$ì‚f+詛頖b", + [{"^<9<ç®&絡;%iï«¡2攑紴\\켉hì“™-柂äšven\u20f7浯-Ꮏ\r^í›ä“ší—¬\u000e?\\ã…¡ÖºJë–·VOt": [{ + "-௄å¶k㘆í˜à®½y⎱㢬sS઄+^瞥h;á¾·jî­;抭\u0003ë°«f<\/5â°§ï§§ï¡™_朻ï—%*[-撵䷮彈-芈": { + "㩩p3篊G|å®®hz䑊oê³¥j^Co0": [ + 653239109285256503, + {"ê¶²?|\":N1Û¿æ°ƒNZ#깩:쇡o8킗ࡊ[\"ë¸Po핇1(6é°$膓}â½*)渽J'DN<ì™ê¸˜æ¯¦ë²Ysì¹–": { + "2Pr?Xjㆠ?æ®/?㓦柖馃5뚣Nᦼ|é“¢rè¡´ã©–\"ç”æ¹—Üæ†": "\"뾯ië‡ç­ç‰»$ç²/4ka $åŒíœ´ï‹è¯‘zbAá©ê‡¸ç‘…&뵲衯ꎀᆿ7@ꈋ'ᶨH@á ´l+", + "7뢽ëšv?4^ꊥ_⪛.>pởr渲<\/⢕疻c\"g䇘vU剺dஔ鮥꒚(dïŸv祴Xâ¼¹\\îºa8y5å†": true, + "o뼄Bìšžç¾hrï·”í˜ë’šâ¿›U5pꪴfg!6\\\"爑ì䢱W<ï¶•î\\í…£ç‡oI/BK뺡'谑♟[Ut븷亮g(\"t⡎有?ꬊ躺ç¿è‰©nl F⤿蠜": 1695826030502619742, + "ÛŠê¹–>ࡹ햹^ⵕ쌾BnN〳2C䌕tʬ]ì° ?ݾ2饺蹳ã¶êŒ­è¨\"â—¹á¬D鯎4e滨T輀ﵣ੃3\u20f3í‚™D瘮g\\擦+泙᧠鬹ﯨַ肋7놷郟lPå†{ß’hà§œr5,ê“‹": null, + "á¿‹N$y{}2\\N﹯ⱙK'8ɜͣwt,.钟廣䎘ꆚk媄_î­®": null, + "䎥eᾆá¦î‘§ì‰,JÞªn岪ã¥sî­•æ–謽䚔5tã¯ï–µï£šã°³ã±ŠZhD䃭f絕s鋡篟îža`Q鬃┦鸳n_é‚(E4è¿ _è§…ë·_宪D(NLî²ç–¶hL追V熑%]vè‚«=惂!㇫5⬒\u001fï²å–º4랪옑": { + "2aè¼85먙R㮧㚪Sm}E2yîŠê†£ê«¨rRymã±è†¶á”¨\\tç¶¾A☰.ç„„ë™—9<쫷챻䒵셴᭛䮜.<\/慌꽒9å»Okä°ŠZ㥪幸k": [ + null, + true, + {"쌞ì": { + "â–ŸGL K2ië›±iï¼±\"Ì .옛1X$}涺]éŽæ‡ Ú¦ëŠ·?tfçŸÝžã‚Ÿ{": 1.227740268699265E-19, + "ê’¶]퓚%ฬKâ…": [{ + "(à·›@Ç®ã£ä§¼äµ¤[aテൖvEnAdUë –ë—ˆ@볓yꈪ,mÔ´|꟢ìº(而첸죕CX4Y믅": "2⯩㳿ꢚ훀~迯?᪑\\啚;4X\u20c2è¥B箹)ä¿£eá»»w䇄", + "75༂f詳䅫ê§é¿ }3\u20b5'∓ä±è™€fè¼î‘”Iq鈆﨤gí©)BFa왢d0뮪痮Mé‹¡nw∵謊;ê§f美箈ḋ*\u001cî±ïœŸ`퇚í‹ä³«$!V#N㹲抗ⱉçŽ(V嵟ï«_bã³…\u0019": null, + "e_m@(i㜀3ꦗ䕯䭰Oc+-ë ¨0뭦⢹苿蟰ê‚SVä°­å‹¢ë¥.ྈ爑Vd,á•¥=í€)vz뱊ꈊB_6듯\"?{ã’²&㵞뵫ç–ë¡ë¯ˆ%Qwé™,?\ræž®\"? N~癃ruà¡—dn&": null, + "㉹&'Pfs䑜공j<\/?|8oc᧨L7\\pXá­ 9᪘": -2.423073789014103E18, + "ä„瑄䢸穊f盈᥸,Bî§§ë¾§í‘—íšµB1쟢f\u001f凄": "é­–âš2儉j꼂긾껢嗎0ࢇ纬xI4]ï„(à©“`蕞;픬\fC\"æ–’\")2æ«·I﹥迧", + "ퟯ詔xæ‚ë ¹+T?Bg⥄섅kOeQí¼ã»´*{Eé¼6æ°¿L缋\u001c둌๶-㥂2==-츫I즃ã ï–˜Lg踞ꙂEG貨鞠\"\u0014d'.ç¼—ï¡gI-lIb䋱ᎂDy缦?": null, + "î’¢ç´Mã¦çŠ¿w浴詟棓쵫G:äœ?V2íž½7N*n&ã–ŠNd-'ຊ?-樹DIv⊜)g䑜9뉂ㄹí‘阉~ê…쵃#R^\u000bïž®B䌎䦾]p.䀳": [{"ϒ爛\"ꄱ︗竒G䃓-î†ã¾å¸³ã‚.j)qguæ‰å¾£à¨Zé¼—A9A鸦甈!kè”å–™:3Tî†%&ã ˜+,ä·ž|ì±½v䚞문H<\/醯rì…“ã¶¾\\a볜åºzEä·_죤ဵ뿰᎟CB": [ + 6233512720017661219, + null, + -1638543730522713294, + false, + -8901187771615024724, + [ + 3891351109509829590, + true, + false, + -1.03836679125188032E18, + { + "j랎:g曞ѕᘼ}链N", + -1.1103819473845426E-19, + true, + [ + true, + null, + -7.9091791735309888E17, + true, + {"}蔰鋈+ê¨å•µ0?g*사%`J?*": [{ + "\"2wG?yn,ç™·BK\\龞䑞x?è ¢": -3.7220345009853505E-19, + ";饹়â€)çš‹`噿焒j(3â¿w>å5Xè–™å©è¿3aFÆÃ": "2,ê“´g?_섦_>Y쪥션钺;=趘F~?D㨫\bX?㹤+>/믟kᠪ멅쬂Uzỵ]$ç§`mé›ç‘Šî’ඖ鯬cꙉ梢f묛bB", + "♽n$YjKiXX*GOè´©éƒè±®ç¥´éžK醞眡}ê—¨v嵎꼷0à­¸+Mè‹eH徸Jîžê£†:â¼æ‚¥B켽迚㯃bè«‚\u000bjꠜ碱逮m8": [ + "푷᣺ﻯd8ﱖ嬇ភHîªé¹Žâ¡±á±…0g:æžœ6$GQ췎{vá·§Yy-è„•xå¹ç ¡ï¨¬â®¸Cï§‚êš=軄H犠Gè°–ES詤Zè ‚3î§™lë´Ÿhï¿’7䦹1GPQG癸숟~[#é§¥8zQ뛣J소obg,", + null, + 1513751096373485652, + null, + -6.851466660824754E-19, + {"ä©‚-â´®2Ù°K솖풄꾚ႻP앳1Hî³é·›wmR䗂皎칄?醜<\/&à §ã¬X濬䵈K`vJ륒Q/IC묛!;$vÏ‘": { + "@-êš—xྐྵ@m瘬\u0010U絨ﮌé©\\켑寛넆T=tQã­¤Lì—°@脸삯e-ï–…î–‘:⩼u㎳VQ㋱襗ຓ<Ⅶ䌸cML3+\u001e_C)r\\9+Jn\\Pﺔ8蠱檾è…Pqé³è¯î¦§Tä„I": -1.80683891195530061E18, + "á·­á‹»U~ཷsgSJ`᪅'%ã–”n5픆桪砳峣3ç®æž¾äŒ·âа呀ïŒ": { + "Ş੉䓰邟自~X耤pl7间懑徛s첦5ਕXexh⬖鎥á€nNr(J컗|ૃF\"Q겮葲놔엞^겄+㈆è¯ã€¾í¬ç´G'E?飕1fâ¼í…¬æ‚šï•¦æ³¬ë¨Uç¬í›¶Qs": false, + "î³…(\u20dag8í½íŠ£>^Y{뤋.袊䂓î†;_ïg]S\u202a꽬L;^'#î—™ë•bႌ?Cç·¡<ä²ä²æ–­ê6\u001asD7IK5Wxo8\u0006på¼Šâ¼‚ê¯æ‰µ\u0003`뵂픋%ꄰ⫙ë¶lå›å°›ïˆ®+ä—…E쟇\\": [ + true, + { + "\n鱿aKã¡â’ã¼™2ì´¹f;`ì¾qIà¡”G}ã·äç“°w늮*ç²…9뒪ㄊCj倡翑閳R渚MiUO~仨䜶RꙀA僈㉋⦋n{ã–¥0딿벑î§é€¦â¥»0î¾®h薓쯴ê»": [ + 5188716534221998369, + 2579413015347802508, + 9.010794400256652E-21, + -6.5327297761238093E17, + 1.11635352494065523E18, + -6656281618760253655, + { + "": ")?", + "TWKLꑙ裑꺔UE俸塑炌Ũ᜕-ï’‚o\"徚#": {"M/癟6!oI51niíš=댡>xê¨\u0004 ?": { + "çš­": {"⢫䋖>u%wî²´ìž¼<ä•ê˜P䋵$é­‹æ‹U䮎緧皇Y훂&|羋ꋕ잿cJ䨈跓齳5\u001a삱籷I꿾뤔S8㌷繖_Yឯ䲱B턼Oæ­µF\\l醴o_欬6ç±=D": [ + false, + true, + {"Mt|êžD|Fê¶£MQ뵕T,ëºk+?ãµi": [ + 7828094884540988137, + false, + { + "!༦鯠,&aﳑ>[euJê½ç¶·æB.h": -7648546591767075632, + "-n켧嘰{7æŒæ¯„Y,>â螵煫乌pv醑Qå¶š!|âŒè²¬0왾ë¢ê…蛨S\\)ç«°'舓Q}A釡5#v": 3344849660672723988, + "8é–ªéºV=鈢1녈幬6棉⪮둌\u207d᚛驉ꛃ'r䆉æƒà¥ˆ|bἧﺢᒙ<=穊强s혧eꮿ慩⌡ \\æ§³W븧J檀C,ᘉì˜0俯퀉M;筷ࣴ瓿{늊埂鄧_4æ¸Nn阼Jੵ˥(社": true, + "oë¼€vwï…®)4A뢵(î¼±a䵢)p姃뛸\u000fK#KiQp\u0005ê…芅ì…îª": null, + "ç ¥$ꥸ┇耽uæ–®Gc{z빔깎밇\\숰\u001eê´·å„㶇쵿_á´„+hç©¢p촀Ნ䃬zäé…³Ó‚31xꔄ1_ç šWë ˜G#2葊P ": [ + -3709692921720865059, + null, + [ + 6669892810652602379, + -135535375466621127, + "뎴iO}Z? 馢녱稹ᄾä©rSt帤넆&7ié¨ë©—ç•–ï”9誧鄜'w{Ͻ^2窭외b㑎粖i矪ꦨ탪跣)KEㆹ\u0015V8[W?⽉>'kc$䨘ᮛ뉻٬M5", + 1.10439588726055846E18, + false, + -4349729830749729097, + null, + [ + false, + "_è ¢ã ^䟪/D녒㡋ỎCä’ˆíŒïŒ¢\u0006àªq@O펢%;é¹ìŒo戥~A[ꡉ濽ỳ&虃᩾è£å”™ï¤£èŒ¨Ig楡꒻M窓冉?", + true, + 2.17220752996421728E17, + -5079714907315156164, + -9.960375974658589E-20, + "ᾎ戞༒", + true, + false, + [[ + "ⶉᖌX⧕홇)g엃⹪xëšç™Ÿ\u0002", + -5185853871623955469, + { + "L㜤9ợㇶKé°â‹“V뽋˖!æ–«as|9"á¬ä†ª?î¾¶7胜&n薑~": -2.11545634977136992E17, + "O8뀩D}캖qè‚6༣ã—䈓煮å½à¨†á޼Dᣘí›;": false, + "YTá¡…^ï—Lã—ŽcbY$pᣞ縿#fh!ꘂb삵玊颟샞ဢ$ä—é¼’ëª~rkH^:닮먖츸륈⪺쒉砉?㙓扫㆕꣒`R䢱Bé…‚?C뇞<5Iޚ讳騕S瞦z": null, + "\\RB?`mG댵鉡å¹ç‰©äµŽæœ‰5*e骄T㌓ᛪç¾é§’Ku\u001a[柆jUq8⋈5鿋츿myï»—?é›ux঴?": 5828963951918205428, + "n0æ™…:黯 î¶·xu씪^퓞cB㎊á¬âº˜Ù¤Öƒ~B岚3㥕擄vᲂ~F?Cä¶–@$mï›~å¿”S왖㲚?챴⊟W#벌{'ã°Iä ç¸s樘\\X뢻9í•¡I6èㄛî‚î«8쯶]wॽ0L\"q": null, + "x增줖j⦦tä¢áŽ™ïŠ­ã›¿Yf鼘~ê«“æ„4惊\u209c": "oOhbᤃ᛽z&Bi犑\\3B㩬劇䄑oÅ쨅孥ë©àº–acA㖫借ãžvg싰샂ãœ#譞⢤@k]鋰嘘䜾L熶塥_<\/â¾å±ˆï®Š_mYè¹t뙺}Ox=wé®®4S1ê©ï¬¾'å·‘", + "㗓蟵ꂾe蠅匳(JPä—à·¸\u0089耀왲": [{ + "ᤃ㵥韎뤽\r?挥O쯡⇔㞚3ä¼–\u0005Pî•⋪\"Dê¶£QLn(⚘罩䩢Ŏv䤘尗뼤ë›O淽鋋î¡é—šrå´©a{4ç®™{煷m6〈": { + "l곺1L": { + "T'ਤ?ç …|੬Km]ä„©\"(à¿¶<\/6U爢䫈倔郴l2ã´±^줣k'Læµ–Lé°„Rp今鎗⒗Cì–¨Mí›ã¡§Î˜X粜뫈N꤇輊㌻켑#㮮샶-ä—룲è ç™œã±V>=\\I尬癤t=": 7648082845323511446, + "鋞EP:<\/_`á§e混ㇹBd⯢㮂驋\\q碽饩跓྿ᴜ+j箿ë ã—‘yK毢宸p謹h䦹乕U媣\\炤": [[ + "3", + [ + true, + 3.4058271399411134E-20, + true, + "æ€+憱f逮@먻BpW曉\u001aã£âŽŠ$n劈D枤㡞좾\u001aá›ïŒƒè‹”౩é—1B䷒Ṋ݋âžê€žêƒç£$t੤_:蘺⮼(#N", + 697483894874368636, + [ + "vᘯ锴)0訶}䳅⩚0O壱韈ߜ\u0018*Ué¾ä–=䧉뽑å•휻ID쿇嘗?ꌸῬ07", + -5.4858784319382006E18, + 7.5467775182251151E18, + -8911128589670029195, + -7531052386005780140, + null, + [ + null, + true, + [[{ + "1欯twG<\/ï†Q:0怯押殃탷è«ì‚¬<ỗꕧ蚨ä¡ï¨î³‰nDꌕ\u001cë…¬~蓩鲃g儊>ê¡l㻿/â‘·*ì±³6㻜W毤緛ﹺᨪ4\u0013뺚J髬e3쳸䘦伧?æª&{L掾p+꬜MäŠd娘6": { + "2p첼양棜h䜢﮶aQ*c扦v︥뮓kC寵횂S銩&Ç{O*य़iH`Uí…à¡“rä©•5ꄸ?`\\á§«?ᮼ?t〟崾훈kè–ì/iy꤃뵰z1<\/AQ#ë¿©8jJ1z@u䕥": 1.82135747285215155E18, + "ZdN &=dë…„á…†'ì‘â…‰:烋5&áŸï”‹á„‚汎æ¥L㯄固{é’§u\\ãŠíŠšeæ‘‘&tå—„ê–„UbâŒ?m䴘熚9EW": [{ + "ଛ{i*a(": -8.0314147546006822E17, + "⫾ꃆY\u000e+W`௸ \"Më’¶+\\ë·lKE}(NTí‚¶Yjé¸ç¯’î©¥ì¶'jNQ硾(똡\\\"逌â´y? IRꜘ὞鄬﨧:M\\fâ ‹Cꚜ쫊ᚴNV^Dä•—ã…–á¼”Iao꿬Câ8": [ + 287156137829026547, + { + "H丞N逕⯲": {"": { + "7-;枮阕梒9á‘„Z": [[[[ + null, + { + "": [[[[ + -7.365909561486078E-19, + 2948694324944243408, + null, + [ + true, + "荒\"并孷䂡쵼9o䀘F\u0002龬7⮹Wz%厖/*? a*R枈㌦ë¾g뒠䤈q딄㺿$쮸tᶎ릑弣^éŽ<\/Y鷇驜L鿽<\/ì¶‹9Mᲆឨ^<\/庲3'lë‚¢", + "c鮦\u001bë‘\\~?眾ಢu݆綑෪蘛轋◜gȃ<\/â´ƒcpkDt誩܅\"Y", + [[ + null, + null, + [ + 3113744396744005402, + true, + "v(y", + { + "AQ幆h쾜O+꺷铀ꛉ練A蚗⼺螔jãŒ3꽂楎䥯뎸먩?": null, + "蠗渗izé±–w]擪E": 1.2927828494783804E-17, + "튷|䀭n*曎b✿~æ¤U]î­¡Gz鄭kW|ã´š#㟗ഠ8u擨": [[ + true, + null, + null, + {"⾪壯톽g7?㥜ώQê‘㦀æƒã§½î“¡ä¼“\\î¦*᧰閖樧뢇赸N휶䎈pIæ°‡ï®é•Šmaᬠ탷#X?î³A+kÐM ༑᩟Ø?5꧎鰜ṚY즫궔 =ঈî³;ﳈ?*s|켦蜌wM笙莔": [ + null, + -3808207793125626469, + [ + -469910450345251234, + 7852761921290328872, + -2.7979740127017492E18, + 1.4458504352519893E-20, + true, + "㽙깹?ë¨ä†¢:ä´ŽÛ»gæ® JBTU⇞}ꄹꗣi#Iî’¡ëµ£é‰r혯~脀ìƒ#釯:场:ä”>ä°®o'ã¼½HZ擓௧nd", + [ + 974441101787238751, + null, + -2.1647718292441327E-19, + 1.03602824249831488E18, + [ + null, + 1.0311977941822604E-17, + false, + true, + { + "": -3.7019778830816707E18, + "Eå³¾æ†èŒ6xLIm縂0n2视֯J-ᤜz+ᨣè·mYDè±ç¹¹â¹ºäŠ“ëª“ï´€E(@è©®(!ï’Y膽#᎙2䟓섣A䈀㟎,囪QbKæ’wcG湎ꤧtGì—xâ¥ä¿Žj'A一ᯥ뛙6ㅑ鬀": 8999803005418087004, + "よ殳\\zDâ§…%Y泥簳Uꈩ*wîRL{3#3FYHା[d岀䉯T稉駅䞘礄P:é—ˆWæ€ElBã¤å–¬èµ”bGä ¼U଄Nw鰯闀楈ePsDꥷ꭬⊊": [ + 6.77723657904486E-20, + null, + [ + "ཚ_뷎꾑è¹q'㾱ꂓ钚蘞慵렜떆`ⴹ⎼櫯]J?[t9Ⓢ !컶躔I᮸uz>3aã •i,錃L$æ°°í…°@7ë…«W㸮?ç¾§W뇧ꃞ,î—‘N鋮숪2ɼì½â”ä²6", + "&y?뢶=킕올Za惻HZk>c\u20b58i?ꦶcfBv잉ETî…9jä¡¡", + "imçŠÕƒbì¹§æ ¡\\뼾쯀", + 9.555715121193197E-20, + true, + { + "<㫚v6腓㨭e1ã•”&&V∌ᗈT奄5Lጥ>탤?튣瑦㳆ꉰ!(ᙪ㿬擇_n쌯IMá¿‹î£ã•¨â°æ«ˆá±·5풔蟹&L.ì²½e鰷쯃劼﫭b#ï­¶í“€7ë·„Wr㢈๧Tʴશ㶑澕é%": -1810142373373748101, + "fg晌o?߲ꗄ;>C>?=鑰監侯Ktêµ…": true, + "䫡蓺ꑷ]C蒹㦘\"1à°ƒ@å‘«\u0014NLä¾egå‘®á³,r$裢k>/\\?ㄤᇰﻛ쉕1஥'ÄŠ\" \\_?쨔\"ʾr: 9Sä˜ç¦ºáª§ê„‚㲄", + [[{ + "*ç¡™^+E쌺I1䀖ju?:⦈Ꞓl๴竣迃xKC/饉:\fl\"XTFᄄ蟭,芢<\/骡軺ëœhê˜\u001f銿<棔햳▨(궆*=ä¹¥b8\\媦ä·€ë«}닶ꇭ(Kej䤑M": [{ + "1á¬?>옿Iâ•…C<ÞŽ?ꊌ冉SV5A㢊㶆z-๎玶绢2F뵨@㉌뀌oå¶”f9-庒茪ç“ë·³4": null, + ";lá°³": "CbB+è‚»aä„·è‹*/볳+/4fq=ã°h6瘉샴4é“¢Yéª.⌖@哼猎㦞+'gꋸ㒕ߤï—ãž‘(ä¶’è·²tiâ‘´aî¥ç¡‚#Noë³”", + "t?/jE幸YHT셵⩎Kî¹!Eq糦ꗣv刴w\"l$ο:=6:ç§»": { + "z]鑪醊嫗J-Xm銌ç¿çµ¨c里ëç‚™Ep㣋é£ë˜¼åšŒä€“GPï¹–cmf4é¹­T䅿꣭姧â¸wy6ꦶ;S&(}ᎧKxᾂQ|tï¹ë»³k\"d6\"|Mlì·†hwLtê¼¼4$&8Պ褵婶鯀9": {"嵃닢ᒯ'î–›dá§«ä³³#Nî‡Xe3-붋鸿î¢à¬¢ë–“î§ž%dK\u0013䲎ê–YV.裸Râ‰rR3蟛\\:ì ¯:å—ĺLʆ넕>|텩鴷矔ꋅⒹ{tå­¶ã“‘4_": [ + true, + null, + [ + false, + "l怨콈lá’", + { + "0wä²å¬§-:`䉅쉇漧\\Ü‚yㄨb%㽄j7ᦶ涶<": 3.7899452730383747E-19, + "ꯛTẀq纤qå¶Vâ¿£?\"g}ი艹(쥯B î­T騠I=仵ë°X": {"KX6颠+&á…ƒ^fç•’y[": { + "H?뱜^?꤂-⦲1a㋞&î‘®êƒç²¾Ii᤾챪咽쬘唂쫷<땡劈훫놡o㥂\\ Kâ´™Dç§¼Fæ°®[{'좴:례晰Iq+Iì­¥_T綺砸GOç…䟪ᚪ`î‘↹l羉qì¼Dê½áœ…훦: vUV": true, + "u^yï³0㱓#[y뜌앸ꊬLã·©?蕶蘾â»KӼ": -7931695755102841701, + "䤬轉車>\u001c鴵惋\"$쯃྆⇻në½€Gæ° Såª]à²²ê¨æ‡Qxኻ椕駔\\9ࣼ﫻ìœç£¡ï©ˆëºªá¶šë³l㕆t+sζ": [[[ + true, + false, + [ + null, + 3363739578828074923, + true, + { + "\"鸣詩 î›ë³°ã‘µgLã¯¦á¿…ì¶æ—«}ED辗ﮈI쀤-ꧤ|ã ¦Z\"娑ᕸ4çˆé¨ã£\"]ì³Af]茛⬻싦oèšk䢯ä©è½3廇喑ޅ": 4.5017999150704666E17, + "TYႇ7ʠ值4챳唤~Zo&Ý›": false, + "`å¡„J袛㭆ëºã³€N㺣`ê½å¶¥Kï¯SVᶔ∲퀠ç¾N딂X\"á¤hNﬨvI": {"\u20bbã­˜I䖵䰼?sw䂷쇪]î(泒f\"~;꼪FÔsá¦": {"p,'ꉂ軿=Aèš¶?bƉãµä…°è«¬'LYKL6B깯⋩겦뎙(ᜭ\u0006噣d꾆㗼Z;ä„äš”cd<情@äž‚3苼㸲U{)<6&ꩻ钛\u001au〷N숨囖愙j=BXWìš•^x芜å á¿™çˆ‚ë›·ê’»t✘Q\b": [[ + "ç±›&ଃ䩹.ꃩ㦔\\C颫#暪&!勹ꇶ놽攺J堬镙~軌C'꾖䣹㮅ï¶å²ƒá™´éµ£", + 4.317829988264744E15, + 6.013585322002147E-20, + false, + true, + null, + null, + -3.084633632357326E-20, + false, + null, + { + "\"짫愔昻 Xï«\"è—£j\"\"ë¨à½…ѻ㘤㬯0晲DU꟒㸃dë²€î¢ìœ’l䦾cà©»*3": null, + "è°ˆWm陧阦咟ฯ歖擓Nå–´ã‹éŠ­rCCnVࢥ^♼Ⅾ젲씗刊Sà¼+_tèµ”\\bäšë‰¨ê¬«6펛cL䊘᜼<\/澤pF懽&H": [ + null, + { + "W\"HDUuΌ퀟M'P4à¿°H똆ⰱﮯ<\/å‡è˜²\"C鴫ﭒж}ꭩ쥾t5yd诪ﮡí‰â´°@?æ°é†³rj4I6Qt": 6.9090159359219891E17, + "絛ﳛ⺂": {"è«°Pã—®î˜è¦`ZQ?ꫦh*à´±cbâ§±}埌茥h{棩렛툽o3é’›5é®l7Q榛6_g)ὄ\u0013kj뤬^爖eO4Ⱈ槞鉨ͺ订%qX0Tì—å«·$?\\\"봅늆'%": [ + -2.348150870600346E-19, + [[ + true, + -6619392047819511778, + false, + [[ + -1.2929189982356161E-20, + 1.7417192219309838E-19, + {"?åµ²2à¿2\u0001啑㷳c縯": [ + null, + [ + false, + true, + 2578060295690793218, + { + "?\"殃呎ïˆ#ã‘‘F": true, + "}F炊_æ®›oU헢兔êˆ,èµ­9703.Bæ•°gTz3â¬": { + "5&t3,í–“Mݸᵣ㴵;꣫ä©â†³#ï¢@ë«·ä …ï¦+W-ࣇzᓃ鿕ಔ梭?T䮑ꥬ旴]u뫵막bBè®:왳둛lEh=숾鱠på’î›î­ˆ$ì§#?gâ¹·á—Švã·µ.æ–ˆu頻\u0018-G.": "ë½™m-ouࣤ஫牷\"`Ksꕞ筼3HlȨvCï¢î›¦å ˆ\"I]㖡玎r먞#'W賜鴇k'c룼髋䆿飉㗆xgå·¤9;芔cáŒ/ax䊨♢í“rå“㸫೼䢗da᩾\"]å±£`", + ":M딪<䢥喠\u0013ã–…x9è•ã‘‚XO]f*Q呰瞊å­VP@9,㨣 D\\穎vˤƩs㜂-曱唅L걬/롬j㈹EB8g<\/ì„©o渀\"u0y&룣": ">æ°ç·©L/ä•‘ë¯êŸ˜îŸ”蕞^aBë’£+0jK⪄瑨痜LXK^힦1qK{æ·št츔X:Vm{2rçB뾄H첚7æ°¥?쉟䨗ꠂv팳圎è¸é½€\\", + "D彤5㢷Gꪻ[lㄆ@὜⓰絳[ଃç½ì®¹â˜’[*0ꑚ㜳": 9022717159376231865, + "Ò–aV銣tW+$é­¿\u20c3ïœäºœ~ë«¡ᙰ禿쨽ã¡fá¹¼zE/h": "5è‡ï’Œã‹‡á²¯ì®º? 昨탰Wム밎#'\"崲钅U?幫뺀â¾@4kh>騧\\0Ò¾EV=çˆî©®ÍŒUæ€%ꉼ 㮋<{j]{R>:gÔ©L\u001c瀈锌ﯲﳡꚒ'â«¿E4æšãŒ—뵉X\"Háœ", + "ᱚגּ;s醒}çŠSἿ㦣&{T$jkB\\\tḮ앾䤹o<é¿(tW": "vb⯽䴪䮢@|)", + "⥒í껉%惀뗌+녣迺顀qæ¢g⚯i⤭ë£Mç¹j̈́⽜A": -8385214638503106917, + "逨ꊶZ<\/W⫟솪㎮ᘇb?ê ”i\"H㧺x෷韒Xꫨฟ|]窽\u001a熑}Agn?Má¶–a9韲4$3á»´^=ì煤áë·2䣃%ï…Žé· /eQ9頸쥎", + 2398360204813891033, + false, + 3.2658897259932633E-19, + null, + "?ꚃ8Nnãž·å¹µd䲳䱲뀙ꪛQ瑓鎴]î’¶ä©‹-é°¾æ¡ï¾ä³¡??掊", + false, + -1309779089385483661, + "ᦲxu_/yecR.6èŠ.áœ‡éŽ ~", + -5658779764160586501, + "ì’Œ:æ› =lìœä¢œwk#s蕚\"互㮉m䉤~0ë“䋙#Gîš¿;h숄옥顇෤勹(C7㢅雚ã¯Lâ …VVç°…<", + null, + -4.664877097240962E18, + -4.1931322262828017E18, + { + ",": { + "v㮟麑䄠뤵g{Më®.\u001bzt뢜뵡0Ǥ龍떟Ᾰ怷ϓRT@Lꀌ樂Uã â¾•e扉|bJg(뵒㠶唺~ꂿ(땉x⻫싉ìŠ;%0鎻V(o\f,NéŠ%nk郼螺": -1.73631993428376141E18, + "쟧摑繮Q@Rᕾ㭚㾣4隅待㓎3è’Ÿ": [ + 4971487283312058201, + 8973067552274458613, + { + "`aæ™á£—î\u0015iBo¸": 4.3236479112537999E18, + "HW&퉡ãåœïŸ†Y?ç‘¡Qyí›q!帰ï©s舠㫸zêš—aSæ­²v`G株巷Jp6킼 (ê·¶é”â¾î‹¥â¡ˆ>Mæ±ãžá‰´ê™²dv@i㳓ᇆ?é»": [ + null, + 4997607199327183467, + "E㻎蠫á¾é«˜ä™Ÿè˜¬æ´¼æ—¾ï« í…›ã‡›?'M$㣒蔸=A_亀绉앭rN帮", + null, + [{ + "Eᑞ)8餧A5u&ã—¾q?": [ + -1.969987519306507E-19, + null, + [ + 3.42437673373841E-20, + true, + "eê±·Må¢\"割Pâ›í§åŽ€R䱜3ï»´Oí“«r﹉⹊", + [ + -8164221302779285367, + [ + true, + null, + "爘y^-î¬?蘞Ⲽꪓaâ…ê¨}I", + 1.4645984996724427E-19, + [{ + "tY좗⧑mrzïºã¿¥â´–᥷jè«…\u0000q賋è­êž„â®±S\nà¡£B/íƒêµª3ZÉ‘å¤o<\/;ë¡‹": null, + "彟hæµ _|V4䦭Dᙣ♞uì¿»=ì‚®ã¦\u001e哀鬌": [{"6횣楠,qʎꗇ鎆빙]ã±­R굋鈌%æ ²j分僅ペ䇰wí¦î¼‹p蛃N溈ê¡ê€?@(GI뉬$ﮄ9èªê“š2e甸ڋ[äº,\u0011\u001cࢃ=\\+衪䷨ᯕ鬸K": [[ + "ㅩ拏鈩勥\u000etgWVî–¨Xs陂è¦p狵w퓼{뮵_i\u0002ퟑႢâ¬d6é‹«F~챿æŸ\u0096äš¼1ۼ칥0꣯å„=鋷牋ⅈêžé¾", + -7283717290969427831, + true, + [ + 4911644391234541055, + { + "Iî¹éˆ’ì²½P릜朸W徨觘-HᎄíŸâ“º>8kr1{ê²µäƒã€›á¬¡Ì¨Oê·‘oä•'쿡鉕p5": "fvç²–RNçž–è›a?q꤄\u001d⸥}'ꣴ犿ꦼ?뤋?鵆쥴ë‹ä¡«s矷̄?à¶£/;괱絢oWfV<\/\u202cC,ã–¦0䑾%nè³¹g&T;|lj_欂N4w", + "짨䠗;䌕u i+rà¹0": [{"9ä¥\\à°©8\"馇z䇔<\/á‚¡Y3e狚ì¡\"ุ6ï°†Zé–c\"Ll:ïŠê®¾ç–£<\/᭙O◌납୕湞9⡳Und㫜\u0018^4pj1;ä§å„‚ä—·à­—>@e톬": { + "aâ‘‚Fé‹»Qèž°'<퇽Qè´ç€§{ᘪ,cP&~䮃Z?gI彃": [ + -1.69158726118025933E18, + [ + "ê¶‚z簽㔛㮨瘥⤜䛖Gℤ逆Y⪾j08î±²Sn昞ꘔ캻禀鴚P謦b{ê“®mNéMᥙ5\"ç2냑I\u0011.L&=?6á„ ë»·X鸌t刑\"#z)o꫚n쳟줋", + null, + 7517598198523963704, + "ኑQp襟`uá©„ræ–¹]*F48ꔵn俺ሙ9뇒", + null, + null, + 6645782462773449868, + 1219168146640438184, + null, + { + ")ယ넌竀Sdä°¾zqâ«£âŒÊ¥\u0010á¿“' |磪&p牢蔑mï³V蘸૰짬꺵;K": [ + -7.539062290108008E-20, + [ + true, + false, + null, + true, + 6574577753576444630, + [[ + 1.2760162530699766E-19, + [ + null, + [ + "顊\\憎zXB,", + [{ + "㇆{CVC9ï¼MN㜋ઘR눽#{h@ퟨ!鼚׼XOvXS\u0017á£=cS+梽៲綆16së½íœy屬?ᇳG2á´­\u00054쫖y룇nKcW̭炦s/鰘ᬽ?J|퓀髣n勌\u0010í™ P>j": false, + "ç®´": [ + false, + "éžj\"ꮾ*엇칬瘫xṬ⭽ì©äƒ³\"-⋵?ᦽ댎Ĝ": true, + "Pg帯佃籛n㔠⭹࠳ë·â‰»à¿Ÿ3ãž±ï“!î—-ì’¾!}쭪䃕!籿næ¶»J5ਲ਼yî˜vy;Rኂ%ᔡጀ裃;M⣼)쵂쑈": 1.80447711803435366E18, + "ꈑC⡂ᑆ㤉壂뎃Xub<\/쀆༈憓قì¨×§\\": [ + 7706977185172797197, + {"": {"K╥踮砆NWࡆFy韣7ä밥{|紒︧䃀榫rᩛꦡTSy잺iH8}ퟴ,M?Ʂ勺ᴹ@T@~꾂=I㙕뾰_涀쑜嫴曣8IY?Ò¿o줫fऒ}\\S\"ᦨ뵼#nDX": { + "♘k6?଱癫d68?㽚乳䬳-Vé¡·\u0005è•?\u0018䞊V{邾zã˜l]é›k臤~ൖHë’iꢥ]g?.G碄懺䔛pR$ä…’X觨lë´œA刊8R梒',}u邩퉕?;91Eî¦a䈈ë¯G⊶芔h袪&廣㺄j;ã¡ç¶½\u001bN頸쳘橆": -2272208444812560733, + "æ‹‘Wﵚî²j鵼駳Oࣿ)#ã¾…é¡‚N傓çºy僱栜'Bê-!KF*ꭇK¦?䈴^:啤wG逭w᧯": "xᣱmYe1Û@霄F$ě꧘푫O䤕í€Pq52憬ꀜ兴㑗ᡚ?ï—ƒLé·íŸî—¼ë­zJê‘™}╆ᅨJB]\"袌㺲u8䯆f", + "꿽á…㔂긱Ǧ?SI": -1669030251960539193, + "ì‡É¨`!葎>瞺瘡驷錶â¤ï»®é…œ=": -6961311505642101651, + "?f7♄꫄Jᡔ훮eì‡îª¼í¾á£ä­´KhखT;Qty}O\\|ë«Iá¿’Ne(5æƒê¥¶ã†·Y9ﮡ\\ oyâ­–-䆩å©m#xë´‰>Y鈕Eç–£s驇↙ᙰm<": {"퉻:dê‚&efᅫ쫢[ï„™\"ëˆëŠ–êº™|Ôå‰1Í–-K:Êšá­•/;ì–㷛]Iç—èŒ4gZ4âœkเꛘZ⥺\\Bʫᇩ鄨魢弞&幟ᓮ2̊盜", + -9006004849098116748, + -3118404930403695681, + { + "_彃Y艘-\"Xx㤩㳷瑃?%2ä¡éµ›o귵옔夘v*탋èŒ&㳈챗|Oé’§": [ + false, + "daꧺdᗹ羞쯧Hã¤é„³é ³<型孒ン냆㹀f4ã¹°\u000f|C*ሟ鰠(O<ꨭ峹ipຠ*yà³§4VQè””hVæ·¬{?ᵌEfrI_", + "j;ꗣ밷é‚副]á—“", + -4299029053086432759, + -5610837526958786727, + [ + null, + [ + -1.3958390678662759E-19, + { + "lh좈T_ë¯Y\"伨\u001cꔌG爔겕ꫳ晚è¸â¿»ìT䯎]~e#฽燇\"5hٔ嶰`泯r;ᗜ쮪Q):/tç­‘,榄&5ï¤ëŽ«ç‹(": [{ + "2áâ“›]r3C攟וּ9è³µsâ›”6'ஂ|\"ⵈ鶆ä¹ç¦3\"痰ࢤéœäµ©ì˜†äŒ€?æ •r7Oç°‚Isd?K᫜`^è®¶}zî°’8?zì–°î§T:X倫⨎ꑹ": -6731128077618251511, + "|︦僰~m漿햭\\Y1'Vvخ굇á‰ì±¢cè¶–": [null] + }], + "虌魿閆5⛔煊뎰㞤ᗴꥰF䮥蘦䂪樳-Ká·-(^\u20dd_": 2.11318679791770592E17 + } + ] + ] + ]}, + "묗E䀳㧯᳀逞GMc\bï•¹å¢¹ã“„ë–Æ &U??íŽŒé‘ åª‹k))ᄊ": null, + "묥7콽벼諌J_DɯﮪMæ®´ä£,煚ྼ`Y:ì”§<\/â©«%yf䦀!1á²¶kì¶ŽQç±³W∠WC跉鬽*á›±iã´•L꘻ê€ì“ª\"_gé¿„'#tâ½™?,Wg㥖|D鑆eâ¥ìª¸åƒ¬h鯔咼ඡ;4TKèŽî¾‘졠嫞" + } + ] + ] + } + ] + ] + ]}} + } + ]} + }, + "뿋뀾淣截䔲踀&XJ펖꙯^Xb訅ꫥgá¬>棟S\"혧騾밫ê²7-": "擹8C憎W\"ìµ®yR뢩浗絆䠣簿9äˆå¼•Wcy䤶孖ꯥïž;íŒ]輩ä3@{å 뽸0ï€á¡ˆìµ¡î›„Ⲇ\u001dLåŒê§2F~ݕ㪂@W^é½L襒ᦘî¢~沦zZ棸!꒲栬R" + } + ] + ], + "Z:ëƒàµ›5Iz찇䅄駠㭧蓡K1": "e8᧤좱U%?ⵇ䯿é¿\u0013縮R∱骒EO\u000fg?幤îš@֗퉙vU`", + "äƒìªˆï‘’埽້=Ij,쭗쓇చ": false + }]}} + ] + } + ]} + } + ] + ] + ], + "咰긖VM]á¼6䓑쇎çºetDÒŒ?ãžê©„퇫밉gj8è ƒ\"â©5䛹1ࣚ㵪": "ക蹊?⎲⧘⾚̀I#\"䈈⦞ë·`wo窭戕෱휾䃼)앷嵃꾞稧,Ⴆ윧9S?೗EMk3Მ3+e{â¹”Te驨7äµ’?타Ulg悳o43ï“¢" + } + ], + "zQᤚ纂땺6#ٽ﹧vï¿¿#ࠫ휊冟蹧텈ꃊʆ?&a䥯Deæ½|ì¿“pt瓞㭻啹^盚2êŠf醪,ì–T窧\\Di䕎谄nn父ꋊE": -2914269627845628872, + "䉩è·|㨻ᷢã‰B{蓧瞸`î°²I!℄욃힕#ೲᙾ竛ᔺCjk췒늕貭è¯\u0017署?W딚%(pê⤼ë³^=on뺲l䆼bzrﳨ[&j狸䠠=ᜑꦦ\u2061Õµnj=牲攑)Mî»\\é¾": false, + "뎕y絬᫡⥮Ϙᯑ㌔/NF*Ë“.ïž¿,QEzvK!Iwz?|쥾\"ê©»Lê¼—Bê”§è³´ç·œs뉣隤茛>ロ?(?^îµ­`>冺飒=噸泥⺭Ᲊ婓鎔븜z^å·è£®Ãªâ“…à»—jM7ﶕ找\\O": 1.376745434746303E-19 + }, + "ä›ræ»–wã¤,|Nዜ": false + } + ]], + "@ê¿™?è–•å°¬ gd晆(ë„5躕ﻫS蔺4)떒錸ç“?~": 1665108992286702624, + "wë¯ná =`঺ᅥC>'從ë槷ä¤çœ·èž„ãŽ»æ°æ‰°XᅧCè´½uáƒë‚ŸjKD03T!lDV쀉Ӊy뢖,袛!终캨G?鉮Q)â‘—1쾅庅O4ê‰H7?d\u0010蠈줘월Þ粯Q!낇껉6í…|{": null, + "~Ë·jg쿤촖쉯y": -5.5527605669177098E18, + "펅Wᶺzê†ã¨í‘­e?4j仪열[D<鈑皶婆䵽ehS?袪;Hê¨Më—Žã°[(å—M3qíŸg4y╸鰧茀[Bi盤~ï«å”Žé‹†å½ºî½«â¦Šq?î–³B4쉓癚O洙킋툈䶯_?ퟲ": null + } + ] + ]] + ]], + "꟱Ԕã¤7æ›ï¦—ಃéŒVä·°?v㪃૦~K\"$%请|ꇹn\"kä«›ã¨é²¨\u2023ä„¢\u0004[︊Vï‹•J?䶟ាꮈ䗱=깘U빩": -4863152493797013264 + } + ]}]} + ] + }}} + ], + "ì·ì²Û¹í‰ƒ~aEå”™a챑,9㮹gLHd'ä”|í‚—ãžäŽ¥&KZYTë§µ7䥺Nâ±³åŒèŽžé¿§w\\༌疣n/+ꎥU\"å°ëž¾â—‹íŸ™AJá­Œ?9ä›$?é©”9è®ì§˜é­¡TÖ¯cè—³`虉Cì‡ì¦T" + } + ], + "è°¶ê°œgTRï¿>áµÍšdtæ™‘ä‰‡é™æ»º}9㉸P漄": -3350307268584339381 + }] + ] + ] + ]] + ] + ], + "0y꟭馋X뱔瑇:䌚ï¿å»¿jîžg-懲鸭䷭垤㒬茭u賚찶ಽ+\\mT땱\u20821殑ã„J쩩䭛ꬿNSæ½”*d\\X,壠뒦e殟%LxG9:摸": 3737064585881894882, + "í’µO^-â§§â…¶vѪ8廸鉵㈉רâ†Q㿴뺟EႳvNM:磇>wî·/៻唎뷭୥!냹D䯙iëµ±è²C#⼉NH6`柴ʗ#\\!2ä‚—â±§f?諳.Pëˆ-è¿”I꘶6?8î“ê˜": -8934657287877777844, + "溎-è˜å¯ƒi诖ര\"æ±µ\"\ftl,?d⼡쾪⺋h匱[,à·©I8MÒ§F{kç“¿PAî…§'橸ꩯ綷퉲翓": null + } + ] + ], + "ោ係Øî½<å…ƒ": 1.7926963090826924E-18 + }}] + } + ] + ]]}] + }] + ] + ] + ] + ], + "ጩV<\"Ú¸sOᤘ": 2.0527167903723048E-19 + }] + ]} + ] + ]], + "∳㙰3ì ´pá§—ä±™?`yZA8Ez0,^á™›4_0븢\u001ft:~䎼s.bb룦明yNP8弆Cå¯;⪾ì§'蕴뮛": -6976654157771105701, + "íµê¦€\\㇑:nî‹™v+뒤燻䀪ﴣï·9ᚈ኷K㚊誦撪䚛,ꮪxሲ쳊\u0005HSf?asg昱dqꬌVꙇ㼺'k*'㈈": -5.937042203633044E-20 + } + ] + }], + "?}\u20e0],så¶³è‹@#2uì’´sQSä©—=ꥮ;烌,|ꘔ䘆": "á…©ì˜Nç’ kZ먕眻?2ቲ芋眑D륟渂⸑ﴃIRE]å•—`K'" + }}, + "쨀jmV賂ﰊå§ä‚¦çŽžã¬™áªM᪟ïՎ씜~`uOn*ॠ8\u000ef6??\\@/?9見d筜ﳋB|Sä¬è‘«ã½o": true + }, + "즛ꄤ酳艚â‚㺘봿㎨iGà§•à¡¿?1\"䘓您\u001fSáŠâº¿æºzៀ뻤B\u0019?ìœa䳵᭱䉺膷d:<\/": 3935553551038864272 + } + ] + ]} + ]] + ]] + ]} + } + ] + } + ]]}}, + "᥺3h↛!ê‹°y\"攜(ெl䪕oUkc1A㘞ᡲî촾ᣫ<\/ä’ŒEã›æ½¨i{ï  v?Wà±¾H\\RჅpzè¬R脾;v:碽✘↯삞鷱o㸧瑠jcmK7㶧뾥찲n": true, + "ⶸ?x䊺â¬-ä°…â‰!e쩆2ꎿ准G踌XXᩯ1ß}0?.í—€Z馟;稄\baDꟹ{-寪⚈ꉷ鮸_L7ƽᾚ<\u001bጨA䧆송뇵⨔\\ç¤ë—”d设룱㶉cq{Hyã±R㥽å¢ï¬…p": -7985372423148569301, + "ç·«#ì½®IB6<\/=5Eh礹\t8럭@饹韠r㰛斣$ç”LVì·a갵îŸ'请o0g:^": "䔨(.", + "ë³â„¡åœ¤pï¾à¯„Ä倧訜BìŸGä™”\"Sbâ“®;$$â–S1J뢙SF|赡gï„€*\"Vu䲌y": "䪈&í‹),\\kT鬜1í’¥;ë·´'Zေ䩹@Jéž½Nã¼M?å¥eWb6榀ƩZڮ淽⺞삳煳xჿ絯8eâ¶ç¾·V}ჿ쎱䄫R뱃9Z>'\u20f1â“•äœé½®" + } + ] + ]]] + }} + } + ] + ]}, + "펮b.hç²”í¯2npXè©«g錰鷇㇒<ì™S値bBi@?镬矉`剔}c2壧ଭfhY깨R()痩⺃a\\â”?M&ﯟ<劜꺄ï‘멊ᄟA\"_=": null + }, + "~æ½¹Rqn榢㆓aR鬨侅?䜑亡V_ç¿…ã­”(ä“·w劸á³Dp䀅<\/ï°Žé¶Šm䵱팱긽ꆘ긓准D3掱;o:_Ñœ)껚콥8곤d矦8nP倥ꃸI": null, + "뾎/Q㣩㫸벯➡㠦◕挮aé¶§â‹“å¼\u00001뱓fm覞n?㛅\"": 2.8515592202045408E17 + }], + ",": -5426918750465854828, + "2æ««@0柡g䢻/gꆑ6演&D稒肩Y?艘/놘p{f투`飷ᒉ챻ëŽîª–<늛ä˜ï´¡ì¤°ì«„": false, + "8î™–(鸑嵀⵹ퟡ<9㣎Tߗ┘d슒ل蘯&㠦뮮eà kç g ì—»": false, + "d-\u208b?0ﳮ嵙'(J`蔿d^踅⤔榥\\Jâµ²v7": 6.8002426206715341E17, + "ཎ耰í“ê•ï’ã±·\u0013y=詽I\"盈xm{0쾽倻䉚ષso#é°‘/8㸴짯%ꀄ떸b츟*\\鲷礬ZQå…©?np㋄椂榨kc᡹醅3": false, + "싊j20": false + }]] + ]], + "ä¿›\u0017nç·½Tu뫉èœé¼Ÿçƒ¬.ï‘ꭠIâ°“\"Ἀ᜾uC쎆J@å¤%ê›m뻨ᾀ画è›íœƒT:錖㑸ዚ9죡$": true + } + ] + ], + "ãµâ‡˜ê¦–辈s}㱮慀밒s`\"㞟j:`ií”»Zì„«^諎0Ok{켿æ­à·£èƒ°a2﨤[탳뚬쎼嫭뉮m": 409440660915023105, + "w墄#*ᢄ峠밮jLa`ㆪ꺊漓Lã§ëŽ!Agkï¹ï¾'ê›ë¢ƒã¯å²¬D#ã’¦": false, + "ଦPGI䕺L몥罭ꃑ궩﮶#⮈ᢓӢ䚬p7웼臧%ï‘¥~Sè âŒíž€6îž’&t䳙y㪘ëƒ\\*;é‰ï¿Šé¿µ'å—•pa\"oL쇿꬈Cgî“": "ã¶½1ç¸D⟸䴅ᆤ뉎﷛渤csî¸x ä”цꬃ锚æ¬?ຽ+x~꘩uI࡞\u0007æ ²5呚ẓem?è¢\")=㥴䨃pac!/æŽY", + "á·±o\\||뎂몷r篙|#X䦜I#딌媸픕åžRDæ–³X4t⯩夬=[ï‹ë­²r=绥jhë·±ì¸âª˜%]⚋܈㖴スHí…¹m(WOæ›åЉ0~K3c柢Õã‰ïªªé€³~": false, + "ç…½_qb[첑\\륌wEâ½Ztï”´CNï­+餌ᕜOê›­": "{ﳾ쉌&s惧á­âµ†3䢫;䨞팑ï›ê’ªí˜è¤€à¢–Qä ¿V5뭀䎂澻%ë°›u5í…¸oA⮥U㎦;B䳌wzä•™$áž¿\\௅婺ëµâª¾í†\\`Kyौꋟ._\u0006L챯l뇠Hi䧈å’5", + "艊ä½à£ƒë¡‡ä± çˆ¬ï˜‚!*;⨣æŽïžæ…“qé“|儑ᨋL+è¿¥=6㒺딉6弄3è¾…J-㕎뛄듘SG㆛(\noAzQê±ä°©X*ã¢O퀌%펠낌moí‹®a^<\/F&_눊ᾉ㨦ы4\"8H": 2974648459619059400, + "鬙@뎣䫳á®ë¡?){y?5K;î§„TA*k溱䫜J汃ꂯ싔ì\u001dA}룖(<\/^,": false, + "ëª@QꋦFꊩá’뎶î‡lXl垨4î¤^郣|ꮇ;ä´á“}ìµ²zç–": null + } + ]]]], + ":_=ë‹§å¼—D䙋暨é›. 㱻붘ä‚Jå„’&ZK/녩䪜rå›â½¯D喠죥7ï“⹌䪥c\u001a\u2076￞妈朹oLkè®F౟覛ì§ã®7T;}è›™2{9\"å´“bB<\/⡷룀;즮鿹)丒툃୤뷠5W⊢嶜(fb뭳갣": "E{å“1WM" + }}, + "䘨tjJ驳豨?y輊M*᳑梵瞻઻ofQGç‘®e": 2.222802939724948E-19, + "ä®´=â‘âž¶Tà·‹wäžœ\"垦ꃼUt\u001dx;B$뵣䙶E↌艣ᡥ!á§Ÿ;ä±€[䔯k쬃`à©8饙른ç†î‹”'2_'袻tGfè’­J땟as꯳╖&å•’zWࡇᒫYSá¬\u0014ℑ첥鈤|cG~Pá“®\">\"": "ႆl\f7V儊㦬nHꄬꨧC{ì¢~C⮃⛓嶦vꄎ1w鰠嘩뿠魄&\"_qMâµ–é‡”ë…®îœ¡ê‡ ãš{ç³Jå“‹ cî°¸v?-jkﻯྌ鹑L舟r", + "龧葆yB✱H盋夔ﶉ?n*0(": "ꧣኆ㢓氥î³qZZ酒ຜ)鮢樛)X䣆gTSî»»Ò‘Gí…žï’˜k.J圬ç–ë¡«ïœì¯­z L:\\ྤ@w炋塜쿖ᾳy뢀䶃ë±N䥨㚔勇ê²#p", + "ë„畎Q娡\"@S/뼋:äµ!Pè¡…ì´šfVHQs✜á«i㻑殡B䜇%믚k*U#濨낄~": "êŸá‹•ì³¸êˆæ•‹&lå¦\u0005憡멗瘌uPgá…ªm<\/To쯬锩h뒓k" + } + ] + }], + "墥홞r绚<\/⸹ⰃB}<躅\\Y;๑@䔸>韫䜲뱀X뗩鿥쩗SI%ﴞ㳕䛇?<\/\u00018x\\&侂9é‹™a[LRã‹­W胕)â¡¿8ãž™0JF,}?í—ˆd1cDMáƒâ›é„ⱕ%X)!XQ": "â³ê—³=橇a;3t⦾꼑仈î¥á€°aᚯ⯋ꕃAsé´·Nâ•_䎃ꙎAz\u0016䯷\\<à¿«>8q{}ï½·?ᣰ}'0ᴕ펓B┦lF#趤厃T?㕊#撹圂䆲" + }, + "Ü‹ë‹é¾«ï¥c웑": false, + "ㇿ/q\"6-co髨íœCí¦#\u001b4~?3ä¹E삇<<": 7.600917488140322E-20, + "äE6?㣖êƒé—´t祗*é‘ {ḣV(æµ¾h逇íž=W?ૉ?nꇽ8ꅉຉj으쮺@Ꚅ㰤u]Oyr": "vâ‰á«¸_*όAඤԆl)ۓᦇQ}í zà¼q滚", + "ソ᥊/넺I": true + }]] + ] + ] + ] + ]] + }, + "ä­‘Ik攑\u0002QV烄:芩.麑㟴㘨≕": true, + "å„꿕C쇻풉~å´%碼\\8\"䬦꣙": null, + "欌L圬䅘Y8c(♺2?ON}o椳s宥2䉀eJ%é—¹rå†O^K諭%凞⺉⡻,掜?$ꥉ?略焕찳㯊艼誜4?\"﯎<ï±ã‚›XáˆINT:è©“ +": -1.0750456770694562E-19, + "ç’àc뜭싼ﺳ뎤K`ïŸ]p隨LtE": null, + "ç”™8䵊神EIꩤé¯á¢€,ïµ®Uä‘u疒ử驺䚿≚ഋ梶秓F`覤è­#짾蔀묊4<åªì¬¦éª_Yzgcà¡¶î²§4kç´¥`kc[Lï®—î°£ç°*I瀑[â¾°L殽鑥_mGÈ <\/|囹ç gæ¡°iri": true, + "챓ꖙꟻì¢è‡ou,å— 0\\jK핻뜠qwQ?ഩ㼕3Y彦b\u009bJ榶N棨f?ë¦é–綃6é³µM[OEë´¨uí–.Ꮁ癜蟳뽲ꩌ뻾rM豈Rï¨ç¾« uDꎚ%": null + }, + "V傜2<": 7175127699521359521 + }], + "é“«aG切<\/\"ী⊆e<^g࢛)Dé¡ï½Žï¬®é¥¼\u008c猪繩嵿ﱚCꡬ㻊g엺Aì—¦\u000fæš¿_f꿤ë³ã¦•桦`蒦䎔j甬%å²rj ç³": "䚢åŽëˆ´Au<4箞7礦Iï±”å eȧ䪸uï„€äµp|逹$嗫쨘ꖾï·!胠z寓팢^㨔|u8Nሇe텔ꅦ抷]،鹎ã³#༔繁 ", + "낂乕ꃻ볨ϱ-ꇋã–fsâ¿«)zꜦ/K?솞♞ꑌ宭hJ᤭瑥Fu": false, + "쟰ãœé­›G\u0003u?`㾕ℾ㣭5螠烶這趩ꖢ:@å’•ê¶xë’˜ëŠmä°¨bç—ƒë 0鳊喵熬딃$摉_~7*ⱦ녯1錾GKhJ惎秴6'H妈Tᧅ窹㺒疄矤铟wላ": null, + "쯆q4!3錕ã²âµ†ã‡›ê˜·Zç‘©ë­†\\â—ªNH\u001d\\ã½°U~㯶<\"쑣낞3ᵤ'峉eꢬ;鬹o꣒木X*é•·PXᘱu\"ä ¹n惞": null, + "ᅸ祊\"&ꥴCjࢼ﴿?䡉`U效5殼㮞V昽êª#ﺸ\\&t6x꠹盥꣰a[\u001aêªSpe鎿蠹": -1.1564713893659811E-19 + } + ]] + ] + ] + ], + "羵䥳H,6ⱎ겾|@t\"#í–Šî¦1|稃 ì„­)ëœ=뻔ꡜ???櫎~*ῡ꫌/繣ﻠq": null + } + ]} + ]}, + "츤": false + }}, + "s": 3.7339341963399598E18 + } + ], + "N,I?1+㢓|ࣱ嶃쩥V2\u0012(4EE虪朶$|w颇væ­¥": "~ì¢~_,Mzrã«YB溓Eæ·š\"â…¹äˆ”áºæŠ™ b,nt5Vã’J檶ê¨â»”?", + "Q껑ꡡ}$넎qHç…”æƒ/ez^!ẳF댙äŒé¦»å‰8": "梲;yté’°$i冄}Aî‘”L%a jëœå¥·ê±³ëš¾d꿽*ሬuDY3î…—?뮟鼯뮟wãªí‹±îŸ‚V", + "o{Q/K O胟ãzUdê€m&⨺J舕â¾é­¸è¨ŸãŒ¥[T籨櫉å”í‚ aṭ뱫촙莛>碶覆⧬짙쭰ׯdAiH໥벤í¥_æ¸[ 0î­¬e:죃TCå¼¼èŽëµDA:w唵ê£": null, + "á½æ¨Žäµ®è»§|?à±—aWH쩃1 ê…­su": null + } + ] + }, + "å‹‚\\&mé°ˆJ釮=Ⲽ鳋+䂡郑": null, + "殣b綊倶5㥗惢⳷è¢á‘€ä¬„é•§M^ï±´3⣢翣næ«»1㨵}ኯ뗙顖Z.Q➷ꮨ뗇\u0004": "ê”™ä¼>n^[GीA䨟AMç¢á’ŠS쨲w?d㶣젊嘶çºéº“+æ„£a%気ྞScë“ᔘ:8bM7Xd8㶑臌]Ꙥ0ê­ì’™ä«£æŒµCè–½î€Dfⵃ떼᷸", + "?ç´¡.ì…ª_à·¨j\u0013Oxâ” $Xᶨ-á…‡oè–¹-}軫;yæ¯ãªœKã£?.EVì®±4둽⛻䤜'2盡\u001f60(|eì°ã¼Žá¦€ã’§-$l@ﻑå³\u0003ä­±å“å·—WFo5c㧆Tí„Y맸♤(": -2.50917882560589088E17 + }} + ], + "侸\\릩.᳠뎠狣살cs项䭩畳H1s瀉븇19?.w骴崖㤊h痠볭㞳㞳ä®Ql怠㦵": "@䟴-=7f", + "鹟1x௢+d ;viä­´FSDS\u0004hꎹãš?â’â¦Ñž6u,扩@ë·Su)Pag휛Tá’—Vç—©!çžé‡€ê–žè˜¥&ೞè˜ê­°êž‡áŽ": "ah懱Ժ&\u20f7䵅♎඀䞧鿪굛ౕ湚粎蚵ᯋ幌YOE)५襦ãŠY*^\"R+ඈî¶å’·è¶9î—ꥂ榨艦멎헦é–ë¶v좛咊E)K㓷ྭr", + "æ†q쮦4綱켙ì….f4<\/g<籽늷?#蚴픘:fF\u00051㹉뀭.á°–í’ŽfÖ¦Hv蔎㧤.!ä­½=éž½]ìŒH:?\"-4": 8.740133984938656E-20 + }]} + } + ], + "tVKn딩꘥⊾蹓᤹{\u0003lR꼽ᄲQFá…傅ﱋ猢⤊á”,E㓒秤nTà¶­v`â™›I\u0000]꫔ṞD\"麵cè¸î“²æ°X&æ¿¿ë˜ê£¹ê¹³à±¥è‘‚鿎\\aꡨ?": 3900062609292104525 + } + ], + "ਉ샒⊩Lu@Sä§°^g": -1.1487677090371648E18, + "⎢k⑊꬗yá«7^err糎Dt\u000bJç¤¯í™•ã†æ²‘サꋽeèµ”ã¢^J\u0004笲㿋idra剰-᪉C錇/Ĝ䂾ညSì§€?~ì½®gR敉⬹'ä§­": 1901472137232418266, + "ç—kä¶¥:?ì´½è´ì“‰ê“ˆã’¸gç˜[뵎\\胕?\u0014_榙p.j稶,$`糉妋0>Fá¡°ly㘽$?": "]ê™›O赎&#ã ƒë±å‰³î°·\"<â—†>0誉é½_|z|裵씪>áŒã¼\"Z[ç•}O?G뚇諦cs⠜撺5cuç—‘U圲\u001c?鴴計lì¶¥/╓哼䄗èŒîšªê®…뫈댽AëŒë¡–뤫V窗讬sHd&\nOi;_î´–u" + } + ], + "Uﺗ\\Y\\梷䄬~\u0002": null, + "k\"Y磓ᗔ휎@U冈<\/w컑)[": false, + "æ›Jè·âŒ»ë¦\u001f㙳s꥓âŸé‚«P늮쥄c∬ྡྷ舆렮칤Zè¶£5콡넛A쳨\\뀙骫(棻.*&è¼›LiIfi{@EA婳KᬰTXT": -4.3088230431977587E17 + }]} + ] + ], + "곃㲧<\/dఓꂟså…¶à¡§&Nè‘¶=?c㠤Ჴ'횠숄臼#\u001a~": false + } + ] + ]}] + }] + }} + ], + "2f`â½°E쵟>Jî•笂裭!〛觬囀ۺ쟰#桊l鹛ⲋ|RA_Vxá­gEë“h﵀mfá»|?juTUæ¡£[d⢼⺻p濚7E峿": 5613688852456817133 + }, + "濘ë¶gå¿®7ãµæ®¬W팕Qæ› ë«°)惃廊5%-î«è¹šzYZ樭ﴷQ锘쯤崫îŸgg": true, + "絥ᇑâ¦ì’“븣爚H.ã—Šß„o蘵貆ꂚ(쎔O᥉î¼ï®“]姨Wê“!RMA|o퉢THxè½®7Mê»U즨'i뾘舯o": "è·¥f꜃?" + }} + ], + "é·°é¹®K-9k;ï°°?_ݦѷ-ꅣ䩨Zꥱ\"mꠟ屎/콑Y╘2&鸞脇ã¢ê€‡à ºâ°¼æ‹¾å–­í‹®îL꽩bt俸墶 [l/웄\"꾦\u20d3iও-&+\u000fQ+໱뵞": -1.296494662286671E-19 + }, + "HX੹/⨇୕붷Uﮘ旧\\쾜͔3l鄈磣糂̖䟎Eá³wæ©–bá¿€_딕huè‘°î¤çª³é—¹Ð²U颵|染H죶.fPä—®:jä«¢\\b뎖i燕ꜚGâ® W-≚뉗lè¶•": "ଊ칭Oa᡺$IVã·§L\u0019脴셀붿餲햪$迳å‘ì¯ì¼‚PqfT\" ?î¹€I屉鴼쿕@ç¡™z^é•㊵M}ãš›T젣쓌-Wâ©-g%⺵<ë®±~빅╴瑿浂脬\u0005왦燲4áƒb|Då § <\/oEQh", + "䘶#㥘à©îººìº”ï” f巋ἡAJ䢚쭈ࣨ뫒*mᇊK,ࣺAꑱ\u000bR<\/A\"1a6鵌㯀bh곿w(\"$ê˜*rà²è¶£.dà¿©k/抶면䒎9W⊃9": "漩b挋Swè—Ž\u0000", + "ç•€e㨼mK꙼HglKb,\"'䤜": null + }]}] + ] + ] + }] + ]} + ] + ]} + ], + "æ­™>駿ꣂ숰Q`J΋方樛(d鱾뼣(ë«–í„­\u20f9lচ9æ­Œ8o]8윶lì–¶?é•–G摄탗6í‹íµ+g:䱫홊<멀뀿/س|ê­ºsê±è·¶ç¨šW々c㫣⎖": "㣮蔊깚Cꓔ舊|XRfé»ã†šï¸†'쾉ì·\\&言", + "æ®­\"cÞɨê™äž˜:嬮eæ½½Y펪㳅/\"O@à —ê²´]ì·–YÇž(t>R\"N?梳LDæ­=næ°¯Tè±°2R諸#N}*ç§ï¡§4}ã¶ŠGä£bì–š": null, + "襞<\/å•§ B|싞W瓇)6簭鼡艆lNì©`|펭佡\\é–“é‚[z릶&쭟愱ꅅ\\Tá°½1靝忠ˆ4̸s윜R7â’/똽?치X": "âŠèº–Cﱰ2Qẫè„&இ?%ëƒæ‚Š", + ",é°§åµì…£îˆ›ì‹¹xᎹ힨᯳EṬHïŽã¹–9": -4604276727380542356 + } + } + ]]]], + "웺㚑xs}q䭵䪠馯8?LB犯zK'osäš›HZ\"L?ì…Žs^ã¿§ã´˜Cv2": null + }] + ] + ] + ], + "Kdî©´2Kv+|z": 7367845130646124107, + "ᦂⶨ?ᢠ祂些ഷ牢㋇æ“\"腭䙾㖪\\(y4cE뽺ㆷ쫺ᔖ%zfÛ»$Ñž1柦,ã¶¢9r漢": -3.133230960444846E-20, + "ç˜Mç„€q%㢟f鸯Oâ£è“‘맕鯊$Oå™·|)z褫^㢦⠮ꚯ꫞`毕1qꢚ{ĭ䎀বώT\"뱘3G൴?ï¢ï¢^^oï…¯f": null + } + ], + "aî¶¹8V᯺?:ﺃ/8ꉿBq|9啓댚;*i2": null, + "cpT瀇Hç°á»ªpೃi鎪Rrâ£ìˆ¬-鹸ҩ䠚z脚цGoN8å…¥y%è¶ŒI┽2ឪЀiJNcN)æ§£/â–Ÿ6S숆牟\"箑X僛G殱娇葱T%æ»:J諹昰qV쨰": 8331037591040855245 + }], + "G5ᩜ䄗巢껳": true + } + }, + "Ồ巢ゕ@_è­™A`碫é„㡥砄㠓(^K": "?܃B혢▦@犑ὺD~Tâ§|é†;o=J牌9냚⢽㨘{4è§èš”9#$∺\u0016p囅\\3Xk阖⪚\"UzA穕롬✎âžã­’춺C㣌ဉ\"2瓑员ᅽê¶ë«}꽚ꞇ鶂舟彺]ê½JCè§éЉ", + "â†Äšè†\"b-í‰ACR言J謈53~V튥x䜢?ꃽɄY뮩ꚜ": "K/↾eèƒ}]Bs⾿q룅鷦-膋?m+æ­»^魊镲6", + "粡霦cæž‹AHíŸo礼Ke?qWcA趸㡔ê‚?\u000eì¶‚8iতᦜ婪\u0015㢼nﵿê»!á´é–¢\u001d5j㨻gfá¿©UK5Juä¸tã‹TI'?ã“t>⼟o a>i}á°—;뤕Ü": false, + "ꄮ匴껢ꂰ涽+䜨B蛹H䛓-k蕞fu7kLè°–,'涃V~챳逋穞cT\"vQ쓕ObaCRQã“¡â²®?轭⫦輢墳?vA餽=h䮇킵ní²í‰…喙?\"'1ç–¬V嬗Qdç—'Lự": "6v!së¯ã­Ÿî€µî¦˜ã£¯çƒ!磸餠ቂh0C뿯봗Fé·­gê–¶~コkK<ᦈTtïŽ\\è·“w㭣횋钘ᆹ듡䑚W䟾X'ê…”4ï€FL勉Vܴ邨y)2'〚쭉⽵-鞣E,Q.?å—", + "?(˧쩯@å´Ÿå‹æ­„K": null + }, + "Gc럃녧>?2DYIé´¿\\륨)æ¾”0ᔬlx'è§”7젘⤡縷螩%Sv׫묈/]↱&S ï…h\u0006æ­‹á‘›xi̘}ã²Y蔯_醨鯘煑橾8?䵎쨋z儬ê*@츾:": null + } + } + } + ] + ] + ]} + }, + "HO츧G": 3.694949578823609E17, + "QC\u0012(翻曇Tfã·ŸbGBJ옉53\\嚇ᛎDï–/\u001b夾á‰4\"í•€@祎)쫆yD\"i먎Vnî¿ã¿¿V1Wá¨ä¶€": -6150931500380982286, + "Zã“®P翸é±é‰¼K䋞꘺튿â­Y": -7704503411315138850, + "]모开ꬖP븣c霤<[3aΠ\"é»ä––䰑뮋ꤦ秽∼㑷冹T+YUt\"싳F↭ä–&鋌": -2.7231911483181824E18, + "tꎖ": -4.9517948741799555E-19, + "䋘즊îŽ.⬅IꬃۣQ챢ꄑé»|f?C⾺|å…•ì¯sC鬸섾整腨솷V": "旆柩l쪦sá–¸My㦅울ì‰ç˜—㎜檵9ï……ê‚駓ૉᚿ/u3ì”…å¾ï¤¥[Z䞸ࡗ1ꆱ&Q풘?Ç‚8\u0011BCDY2볨;é¸": null, + "幫 nç…¥sì‡íއ 왊-$C\"è¡:\u0014㣯舼.3ë™—Yl⋇\"K迎멎[ê½µs}9鉳UK8ì¥\"掄㹖h㙈!얄સ?Ꜳ봺R伕UTD媚I䜘Wé¨è”®": -4.150842714188901E-17, + "ﺯ^ã„„\b죵@fྉkf颡팋î¤êž¦{/Pm0V둳⻿/è½éŸ’ꊔᚬ@5螺G\\å’¸a谆⊪ቧ慷绖?è´¢(é·‡uéŒF=ráæ©¢áž³n:^iá´µtD볠覅Nèµ´": null + }] + }] + } + ] + ]} + ]}, + "謯?w厓奰Tï§¡í——èážè²–o⪇弒L!캶$ᆅ": -4299324168507841322, + "뺊奉_åžæµ¸å»¶ëªå­„Z舰2i$q붿좾껇d▵é¤\"v暜Ҭì„mï¿´g>": -1.60911932510533427E18 + } + ] + } + ] + ]], + "í‰êº”㠦楶Pê…±": 7517896876489142899, + "ï™°": false + } + ]}, + "是u&I狻餼|è°–j\"7cë®sï­-踳鉷`䣷쉄_A艣鳞凃*m⯾☦椿q㎭Nîœæº”铉tlㆈ^": 1.93547720203604352E18, + "ï…µkⲨ\\%vr#\u000bâ’ºY\\t<\/3﬌R訤='﹠8è¤êž´ë ´æ›”r": false + } + ]}, + "阨{c?C\u001d~K?鎌Ԭ8烫#뙣Pì´ˆé—tã­±E­ë’䆺}ç”—[R*1!\\~hã•…á°º@<9JêષIä³–æ ­6綘걹ᅩM\"▯是∔v鬽顭⋊譬": "ìš´ï¶Kæ•‚(欖C취پ℄爦賾" + } + }} + }], + "鷨赼鸙+\\ä­£t圙ڹx᜾ČN<\/踘\"S_ë§¶a鷺漇T彚⎲i㈥LT-xA캔$\u001cUH=a0츺l릦": "溣㣂0æ¿•=鉵氬駘>Pꌢpb솇쬤h힊줎çªãª¬CrQ矠a&è„꼬爼M茴/á¿®\u0017å¼è½¼y#êž c6ë‘´=?Rå´ë· éº–w?" + }, + "閕ᘜ]CT)䵞l9z'xZF{:ØI/躅匽ì¡:䟇AGF૸\u001cퟗ9)駬慟ꡒꆒRS״툋A<>\u0010\"ꂔ炃7gëšEà§îˆbꅰ輤]oã±_뷕ܘ暂\"u": "芢+U^+㢩^鱆8*1鈶鮀\u0002뺰9⬳ꪮlL䃣괟,G8\u20a8DF㉪錖0ㄤ瓶8Nଷd?眡GLc陓\\_죌Vì°à¤²äºŒ?cë¦æ± \u0019JC\u0011b⤉zẒT볕\"绣蘨뚋cꡉkî« I\u001eé³´", + "ꃣI'{6u^㡃#཰Kq4逹y൒䧠䵮!㱙ï®/n??{Lí’“ZETã™ í¿X2᩟綳跠葿㚙w཮x캽扳B唕S|å°¾}ì´•%N?o䪨": null, + "ⰴFjà·Ÿì…ˆ[\u0018è¾·px?椯\\1<ﲻ栘á£ë´¢æ† ë‰´p": -5263694954586507640 + } + ] + ]] + ]} + ]}] + ] + ], + "?#癘82禩鋆êŠty?&": -1.9419029518535086E-19 + } + ] + ] + ]} + ] + ] + ], + "훊榲.|῕戄&.ãšZꛦ2\"䢥ሆ⤢fV_æ‘•å©”?â‰Fji冀탆꜕iã¬_ẑKᅢ꫄蔻XWc|饡Siẘ^㲦?羡2ã´1ç¸á™…?ì‰Ou": false + }]] + ]}}}, + "æ…‚ë—„å“è“”á“åŒåš–/颹蘯/翻ㆼL?뇊,í…µ<\\ç·ã”Cボ": null + }, + "p溉ᑟi짣z:䒤棇r^Ù«%G9缑r砌롧.물农g?0׼ሩ4ƸO㣥㯄쩞ጩ": null, + "껎繥YxK\"F젷쨹뤤1wq轫o?鱑뜀瘊?뎃hç‘\\ꛣ}Kå³^ኖâ¤ï§´ê‰“hy": null + } + ], + "á±€nè‚“ã„›\"å »2>mæ®®'1橌%êž´êµ°=Ӳ鯨9耛<\/n據0u彘8㬇៩fá¿è¯™]嚊": "䋯쪦S럶åŒã…›#î½)O`ሀX_éªæ¸²â›€ã¨»å®…闩➈ꢙஶDRâª" + }, + "tAì“龇 â‹¥bj왎录r땽✒롰;羋^\\?툳*┎?ì€ma䵳넅U䳆૘〹䆀LQ0\bç–€U~u$M}(鵸gï­â³¾i抦뛹?䤈땚검.鹆?ê©¡tâ¶¥GÄ’;!ቹHïš©Så³»B츪ì¼f5≺": 2366175040075384032, + "ì „pJjleb]áž½": -7.5418493141528422E18, + "n.鎖ጲ\n?,$䪘": true + }, + "欈Ar㉣螵᪚茩?O)": null + }, + "쫸M#x}Dç§±æ¬K=侫们ä¸ï‡ª.KꕾxẠ\u001e㿯䣛FÜ캗ï¬qq8꟞ṢFD훎⵳簕꭛^鳜\u205cÙ«~⑟~冫ऊ2ì«°<\/戲윱o<\"": true + }, + "ã·è¥/T뱂\u0010锕|内䞇xä¾â‰¦ã­–:M?iM᣿IJeç…œdG࣯尃⚩gPt*辂.{磼럾äª@a\\袛?}ᓺBç¼": true + } + } + ]]}]}}, + "tn\"6î´ê«¤ìƒ¾ä„„;銞^%VBPwu묪`Y僑N.↺Ws?3C⤻9唩Sä ®á´m;sᇷ냞඘B/;툥B?lB∤)G+O9m裢0kC햪䪤": -4.5941249382502277E18, + "áš”t'\\æ„«?éµ€@\\ã³ê‚•Pí <<]ç…¹G-b!S?\nꖽ鼫,Ý›&é ºy踦?Eæ†î¬–릱H}햧캡b@手.p탻>췽㣬ꒅ`qeä½­P>á“‚&?u}毚ᜉ蟶頳졪áŽzl2wO": -2.53561440423275936E17 + }]} + } + ] + ]], + "潈촒⿂å¡": 5495738871964062986 + } + ]] + } + ] + ]} + ]] + ]] + ]} + ] + ]}, + "á‚qí‚è“…R`謈èŸá¦î’³å„‚æ§åƒ»ï¹¶9å©Œî¬æ«žé‡ˆ~\"%匹躾ɢ뤥>࢟瀴愅?殕节/냔O✬H鲽엢?ᮈà©î“Žâ‹§dâ½ã«zCe*": 2.15062231586689536E17, + "ã¶µUi曚ç°é‹ªá¾¼è‡§P{ä䷪쨑̟A뼿T渠誈äšD1!ìž¶<\/ã¡7?)2l≣穷᛾ç¨{:;㡹nemיּ訊`Gî¹²": null, + "䀕\"飕辭påœf#뫆䶷뛮;â›´á©3çšëá°ìŽ“â¦·è©µ%᜖Մfs⇫(\u001e~P|ï­—CⲾផv湟W첋(텪બTî¾·<บSê‰à©—⋲X婵i ӵ⇮?L䬇|êˆ?졸": 1.548341247351782E-19 + } + ] + }, + "t;:N\u0015qé¦Rt缆{ê®C?஛㷱敪\\+鲊㉫㓪몗릙ç«(æ°µkYS": "Xá°‚T?൮ô", + "碕飦幑|+ 㚦é¶`é•¥ê© B<\/加륙": -4314053432419755959, + "秌孳(p!G?Vå‚«%8ሽ8w;5鲗㦙LI檸\u2098": "zG N볞䆭éŽí˜\\ONK3íš™<\/樚立圌Q튅k쩎Ffì‹aׂJK銆ઘì¦ç‹©6༥✙䩜篥CzP(è»é§‡HHퟲ讃%,ά{ë p而刲vy䦅ክ^톺M楒é¢ã¹³]Mdg2>䤉洞", + "踛Mì §>忔芿㌜Zk": 2215369545966507819, + "ì”A`$æ§­é °í»^U覒\bG毲aᣴU;8!팲f꜇E⸃_åµ{å«ç¾ƒX쀳C7ë—®m(åš¼u NÜè°ŸD劯9]#": true, + "ﻩ!뵸-ç­šPá­›}á¼°å±¥lPh?౮ⶹꆛ穉뎃gè‘㑓溢CX뾇Gã–¬A錟]RKï’î´²aꄘ]Yo+@ä˜'s섎襠$^í™°}F": null + }, + "粘ꪒ4HXᕘ蹵.$å€\r\u001dë¬77pPc^yî¶ç¬²Q<\/ê–¶ è¨äƒá¨•G?*": 1.73773035935040224E17 + }, + "婅拳?bkU;#D矠â´vVN쩆t㜷A풃갮娪a%é®çµª3dAv룒#tm쑬⌛qYwc4|L8KZ;xU⓭㳔밆拓EZ7襨eD|隰ऌ䧼u9Ô¢+]è´´Pè¿": 2.9628516456987075E18 + }]}}] + ]} + }} + ]}] + ], + "|g翉F*湹̶\u0005â1脉̀eI쩓ᖂ㫱0碞l䴨ꑅ㵽7AtἈ턧yq䳥塑:z:é€ï¾¼X눔擉)`N3昛oQì…–y-ڨ⾶æ¢êˆµq^<\/": null, + "è¹\\ëž“G^璬x৴뭸ゆUSê²§ï®·Bꮤ ┉銜᯻0%N7}~fæ´‹å„Xꔼ<\/4妟Vꄟ9:౟곡t킅冩䧉笭裟炂4ë´‹â±³åºæ€Št+怯涗\"0ã–ˆHq": false, + "졬믟'ﺇফ圪쓬멤m邸QLà¦¬ä—æ„4jvsç¿™ à¾ê§€è‰³H-|": null, + "컮襱⣱뗠 R毪/鹙꾀%í—³8&": -5770986448525107020 + } + ], + "î½­B䔚bê»ë™å§“展槰T-똌鷺tcï§ç¿á«½^㓟ä€o3o$꘭趙è¬Ié¡©)뇭Ἑä“\f@{ᣨ`x3è”›": null + } + ] + ] + }], + "⦖扚vWꃱ꥙㾠壢輓{-⎳鹷è´ç’¿äœ‘bG倛â‹ç£Žc皇皩7a~ﳫUâ•£Q࠭ꎉS摅姽OW.홌ೞ.": null, + "蚪eVlH献r}á®ë¯ ï°©ê”„@ç‘„â²±": null, + "퀭$JWoê©¢gì—­ì䖔㑺h&à­¢tXX愰㱇?㾫I_6 OaB瑈q裿": null, + "꽦ﲼLyr纛ZduçB絟쬴糔?ã•‚ì§¹äµe": "ḱ\u2009cX9ë©€i䶛簆㳀k" + } + ]]]], + "(_ê®g່澮?ᩑyM<艷\u001aꪽ\\庼뙭Zë§·ã°©Vm\\lYç­º]3㋲2㌩㄀Eਟäµâ¨„ì¨á”ŸgङHné–⤇놋瓇Q탚單oY\"♆臾jHᶈå¾îž«á‰„??uㇰA?#1侓": null + }, + "è§“^~ሢ&iIë†g륎ḱ캀.ᓡꀮ胙鈉": 1.0664523593012836E-19, + "yè©­GbᔶऽsëŒU:æœî „⤎ϲì—⮼D醄诿që™°I#즧v蔎xHᵿt᡽[**?崮耖p缫쿃Lè,ë´¬ï–ꤦC쯵#=X1çž»@OZc鱗CQTï‹„x": null + } + ] + }}], + "剘ç´\u0004\\Xn⊠6,á€×±;嵣崇}讃iႽ)d1\\䔓": null + }, + "脨z\"{X,1uì°œ<'k&@?1}Yn$\u0015Rd輲ーa쮂굄+B$l": true, + "諳>*ì­®ê´äµŸÒ+<ç®}빀䅱⡔æªï€è‡’hIH脟ꩪCí•ଗP좕\"0i<\/C褻DÛžæ—+^5?'ꂱ䚫^7}ã¡ cq6\\쨪ꔞꥢ?纖䫀氮蒫侲빦敶q{Aç…²G": -6880961710038544266 + }}] + }, + "5s⨲JvಽῶꭂᄢI.aà§Š": null, + "?1qê½ì¿»ê›‹DR%Uå¨>DgNä¹­G": -1.2105047302732358E-19 + } + ] + ]}, + "qZz`撋뙹둣j碇ì\\ꆥ\u0018@ïœè—´ç–°Wz)O{Fä¶›l᷂绘訥$]ë®å¤»ä¢‹ä©‡è¿ç°æ¨§çŒµâ£­jè¶q)$꬚⵷0馢W:â°!Qoe": -1666634370862219540, + "t": "=î¹›wp|~碎Q鬳Ó\\l-<\/^ﳊhní–}ä”t碵ḛ혷?é»äŠ—", + "邙쇡㯇%#=,î‰E4勃驆V繚q[Y댻XV㡸[逹á°è‘¢B@u=JS5?bLRnì–®ã‰â…ï°³?a6[&íŸ!è—ˆ": 1.2722786745736667E-19 + }, + "X블땨4{ph鵋ꉯ웸 5p簂䦭s_E徔濧dç¨~No穔噕뽲)뉈c5M윅>âš‹[岦䲟懷æ?éŽê“†à¸¬çˆ‹ç äœ”s{\u001bméšå„¸ç…›%bﯿXT>ê—˜@8G": 1157841540507770724, + "媤娪Qæ¸ï‡\u0011SAyᡈ쿯": true, + "çš^ಸ%ê±<\/蛯?\"祴å“\\\\'í": -3.4614808555942579E18, + "釴U:O湛㴑䀣렑縓\ta)(j:숾å´ä—ŒgCiB뽬Oyuqè¼¥åŽ/7)?今hY︺Q": null + } + ] + ]]]}] + ], + "I笔趠Ph!<ཛྷ㸞诘X$畉F\u0005笷èŸ.Esr릙!W☆ï›ä²–뗷莾뒭U\"䀸犜Uo3ï¯Gꯌx4r蔇᡹㧪쨢準<ä‚€%ࡡꟼç‘8ç‚Xs0ä€é”€?fi쥱ê†àª²BB": -8571484181158525797, + "Lâ¦o#J|\"⽩-ã±¢d㌛8d\\㶤傩儻E[Y熯)r噤὘勇 }": "e(濨쓌K䧚僒ã˜è ¤Vᛸ\"络QJL2,嬓ì™î¿‰ä¼¢ã‹’䴿考澰@(ã¾`kX$ë‘ÑE斡,èœ&~y", + "vj.|统圪ᵮPL?2oŶ`ë°§\"勃+0ue%⿥绬췈체$6:qaë Q;~晘3㙘鹑": true, + "à·Ø™4ç„â¶¿c︋iâš…:ã‚“é–Ⳙ苆籦kw{䙞셕pCì·ƒê¬âœêŸ¯êš“é…„bížhwkê­­M鬋8B耳쑘WQ\\å™ac'唀x᪌\u2048*hì§Ž#á‡é® ë¾áž¿ë€Œ": false, + "⎀jꄒ牺3Ⓝ컴~?親ꕽã¼Ü“å–瘘!@<튋ãŒê¿±â©¦{a?Yv%⪧笯Uܱ栅Eæši뚬:ꄃx7䙳ꦋ&䓹vq☶Iä˜á¾˜æ¶œ\\ì‰ëºŒLr%Bcãœ3?î¤ï…¨ê­ç ¿è£ž]": null, + "⭤뙓z(ã¡‚%亳K䌽꫿AԾ岺㦦㼴輞낚Vꦴw냟鬓㹈뽈+o3è­»K1ìžž": 2091209026076965894, + "ㇲ\t⋇轑ꠤ룫X긒\"zoYì‡í¬wjæ¢ì‘l侸`e%s": -9.9240075473576563E17, + "啸ꮑ㉰!áš“}éŠ": -4.0694813896301194E18, + "ï‰>]囋੽EK뇜>_ꀣ緳碖{ì裔[<ನ\"䇅\"5L?#îµ³xTwv#ç½\u0005래t应\\N?빗;": "v쮽瞭pë­ƒ" + } + ]], + "æ–´æ§¾?Zç¿\"~æ…弞ﻆ=꜡o5é‹ï’½dw\"?Kè ¡i샾ogDï²°_C*⬟iㇷ4nયèŸ[㟉U꽌娛苸 à§æ“贻洞펻)쿗૊許X⨪VY츚Zä¾ã¶­~튃ᵦ<\/E臭tve猑x嚢": null, + "锡⛩<\/칥ꈙᬙè€&êšç±¬â– 865?_>Lè©ì¿¨äˆŒæµ¿å¼¥ï©‰Ì«î¾½ï‘lj&zx<\/C쉾?覯n?": null, + "꾳鑤/꼩ï¨d=ᘈn挫ᑩ䰬ZC": "3錢爋6Ƹ䴗v⪿Wr益G韠[\u0010å±—9ì¡é’u?殢c䳀蓃樄욂NAq赟c튒ç˜ë ¶î‚³Aà«¡Éšæ" + } + ] + ] + ]} + ] + ] + }]]]}} + ]}], + "ï‚’Ejä—³U<\/Q=ç’샎䞦,å °é  @褙g_\u0003ꤾfâ¶½?퇋!łB〙ד3CC䌴鈌U:뭔咎(Qો臃䡬è‹BO7î¼§ã¢äŸ¸\"Yb": 2.36010731779814E-20, + "逸'0å²”j\u000e눘먷翌C츊秦=ꭣ棭ှ;鳸=麱$XP⩉駚橄A\\좱⛌jqvä°ž3Ь踌v㳆¹gT┌gvLBè³–ïžçƒ¡m?@E঳i": null + }, + "曺vì°˜×?&绫OáŸ": 9107241066550187880 + } + ] + ], + "(e屄\u0019昜훕ç–b蓘ᬄ0/۲묇Z蘮á€â¨è›˜èƒ¯ë¢ƒ@㘉8ሪWᨮ⦬ᅳ䅴HIá‡ì¨³z囕陻엣1赳o": true, + ",b刈Z,á æ™Tì†Å•B⩆ou'í¼â‰ƒç»—é›—dè­Š": null, + "a唥KB\"ï³è‚•$u\n^â…„P䟼냉䞸⩪u윗瀱ꔨ#yÅŸsî««ê’¬=ï‹•1ïš–|ﲤ爢`tà±íмî£ì³«_Az(Ṋ擬㦷좕耈6": 2099309172767331582, + "?ã´¸U<\/䢔ꯡ阽扆ã¤qé‹?f㔫wM嬙-;UV죫嚔픞G&\"Cá—äªí’ŠQ": "VM7ç–¹+陕枡툩窲}ç¿¡ä–¶8欞ÄsTë®}ç’¤:jﺋ鎴}HfAàµâ§»Zd#Qï¬u茅J髒皣Y-︴[?-~쉜vë”璮㹚䅊﩯<-#\u000eê±€h\u0004u抱﵊㼃U<㱷⊱IC進" + }, + "숌dee節é½é‚ºp넱蹓+e罕U": true + } + ], + "b⧴ë£??á” 3ã±>%郿劃ç¿ê¬ê ›Wï¡°çž³á«ëˆ„躨狀ໄy੽\"ីuS=㨞馸k乆E": "トz݈^9R䬑<ﮛGRꨳ\u000fTT泠纷꽀MRᴱ纊:ã ­ë³®?%N56%鈕1ä—äœaä²—j陇=ë¿»å‚衋࿘ᓸ?ᕵZ+<\/}H耢bä€z^f$&ã’LkꢳI脚뙛u": 5.694374481577558E-20 + }] + } + ]], + "obj": {"key": "wrong value"}, + "퓲꽪m{ã¶©/뇿#â¼¢&᭙硞㪔E嚉c樱㬇1aç¶‘á–DḾä©": null + } +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/webapp.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/webapp.json new file mode 100644 index 0000000000..ee7b0f8bab --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/webapp.json @@ -0,0 +1,88 @@ +{"web-app": { + "servlet": [ + { + "servlet-name": "cofaxCDS", + "servlet-class": "org.cofax.cds.CDSServlet", + "init-param": { + "configGlossary:installationAt": "Philadelphia, PA", + "configGlossary:adminEmail": "ksm@pobox.com", + "configGlossary:poweredBy": "Cofax", + "configGlossary:poweredByIcon": "/images/cofax.gif", + "configGlossary:staticPath": "/content/static", + "templateProcessorClass": "org.cofax.WysiwygTemplate", + "templateLoaderClass": "org.cofax.FilesTemplateLoader", + "templatePath": "templates", + "templateOverridePath": "", + "defaultListTemplate": "listTemplate.htm", + "defaultFileTemplate": "articleTemplate.htm", + "useJSP": false, + "jspListTemplate": "listTemplate.jsp", + "jspFileTemplate": "articleTemplate.jsp", + "cachePackageTagsTrack": 200, + "cachePackageTagsStore": 200, + "cachePackageTagsRefresh": 60, + "cacheTemplatesTrack": 100, + "cacheTemplatesStore": 50, + "cacheTemplatesRefresh": 15, + "cachePagesTrack": 200, + "cachePagesStore": 100, + "cachePagesRefresh": 10, + "cachePagesDirtyRead": 10, + "searchEngineListTemplate": "forSearchEnginesList.htm", + "searchEngineFileTemplate": "forSearchEngines.htm", + "searchEngineRobotsDb": "WEB-INF/robots.db", + "useDataStore": true, + "dataStoreClass": "org.cofax.SqlDataStore", + "redirectionClass": "org.cofax.SqlRedirection", + "dataStoreName": "cofax", + "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver", + "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon", + "dataStoreUser": "sa", + "dataStorePassword": "dataStoreTestQuery", + "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';", + "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log", + "dataStoreInitConns": 10, + "dataStoreMaxConns": 100, + "dataStoreConnUsageLimit": 100, + "dataStoreLogLevel": "debug", + "maxUrlLength": 500}}, + { + "servlet-name": "cofaxEmail", + "servlet-class": "org.cofax.cds.EmailServlet", + "init-param": { + "mailHost": "mail1", + "mailHostOverride": "mail2"}}, + { + "servlet-name": "cofaxAdmin", + "servlet-class": "org.cofax.cds.AdminServlet"}, + + { + "servlet-name": "fileServlet", + "servlet-class": "org.cofax.cds.FileServlet"}, + { + "servlet-name": "cofaxTools", + "servlet-class": "org.cofax.cms.CofaxToolsServlet", + "init-param": { + "templatePath": "toolstemplates/", + "log": 1, + "logLocation": "/usr/local/tomcat/logs/CofaxTools.log", + "logMaxSize": "", + "dataLog": 1, + "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log", + "dataLogMaxSize": "", + "removePageCache": "/content/admin/remove?cache=pages&id=", + "removeTemplateCache": "/content/admin/remove?cache=templates&id=", + "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder", + "lookInContext": 1, + "adminGroupID": 4, + "betaServer": true}}], + "servlet-mapping": { + "cofaxCDS": "/", + "cofaxEmail": "/cofaxutil/aemail/*", + "cofaxAdmin": "/admin/*", + "fileServlet": "/static/*", + "cofaxTools": "/tools/*"}, + + "taglib": { + "taglib-uri": "cofax.tld", + "taglib-location": "/WEB-INF/tlds/cofax.tld"}}} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/widget.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/widget.json new file mode 100644 index 0000000000..32690e8b76 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/data/widget.json @@ -0,0 +1,26 @@ +{"widget": { + "debug": "on", + "window": { + "title": "Sample Konfabulator Widget", + "name": "main_window", + "width": 500, + "height": 500 + }, + "image": { + "src": "Images/Sun.png", + "name": "sun1", + "hOffset": 250, + "vOffset": 250, + "alignment": "center" + }, + "text": { + "data": "Click Here", + "size": 36, + "style": "bold", + "name": "text1", + "hOffset": 250, + "vOffset": 100, + "alignment": "center", + "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;" + } +}} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/draft-04/schema b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/draft-04/schema new file mode 100644 index 0000000000..85eb502a68 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/draft-04/schema @@ -0,0 +1,150 @@ +{ + "id": "http://json-schema.org/draft-04/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", + "description": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "positiveInteger": { + "type": "integer", + "minimum": 0 + }, + "positiveIntegerDefault0": { + "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ] + }, + "simpleTypes": { + "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "minItems": 1, + "uniqueItems": true + } + }, + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uri" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "multipleOf": { + "type": "number", + "minimum": 0, + "exclusiveMinimum": true + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "boolean", + "default": false + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "boolean", + "default": false + }, + "maxLength": { "$ref": "#/definitions/positiveInteger" }, + "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": {} + }, + "maxItems": { "$ref": "#/definitions/positiveInteger" }, + "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "maxProperties": { "$ref": "#/definitions/positiveInteger" }, + "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ], + "default": {} + }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "dependencies": { + "exclusiveMaximum": [ "maximum" ], + "exclusiveMinimum": [ "minimum" ] + }, + "default": {} +} diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16be.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16be.json new file mode 100644 index 0000000000..e46dbfb9dd Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16be.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16bebom.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16bebom.json new file mode 100644 index 0000000000..0a23ae205c Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16bebom.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16le.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16le.json new file mode 100644 index 0000000000..92d504530c Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16le.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16lebom.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16lebom.json new file mode 100644 index 0000000000..eaba00132c Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf16lebom.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32be.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32be.json new file mode 100644 index 0000000000..9cbb522279 Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32be.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32bebom.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32bebom.json new file mode 100644 index 0000000000..bde6a99ab4 Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32bebom.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32le.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32le.json new file mode 100644 index 0000000000..b00f290a64 Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32le.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32lebom.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32lebom.json new file mode 100644 index 0000000000..d3db39bf73 Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf32lebom.json differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf8.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf8.json new file mode 100644 index 0000000000..c500c943f6 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf8.json @@ -0,0 +1,7 @@ +{ + "en":"I can eat glass and it doesn't hurt me.", + "zh-Hant":"我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。", + "zh-Hans":"我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。", + "ja":"ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãれã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。", + "ko":"나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ 않아요" +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf8bom.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf8bom.json new file mode 100644 index 0000000000..b9839fe2fa --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/encodings/utf8bom.json @@ -0,0 +1,7 @@ +{ + "en":"I can eat glass and it doesn't hurt me.", + "zh-Hant":"我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。", + "zh-Hans":"我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。", + "ja":"ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãれã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。", + "ko":"나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ 않아요" +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail1.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail1.json new file mode 100644 index 0000000000..6216b865f1 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail1.json @@ -0,0 +1 @@ +"A JSON payload should be an object or array, not a string." \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail10.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail10.json new file mode 100644 index 0000000000..5d8c0047bd --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail10.json @@ -0,0 +1 @@ +{"Extra value after close": true} "misplaced quoted value" \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail11.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail11.json new file mode 100644 index 0000000000..76eb95b458 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail11.json @@ -0,0 +1 @@ +{"Illegal expression": 1 + 2} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail12.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail12.json new file mode 100644 index 0000000000..77580a4522 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail12.json @@ -0,0 +1 @@ +{"Illegal invocation": alert()} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail13.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail13.json new file mode 100644 index 0000000000..379406b59b --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail13.json @@ -0,0 +1 @@ +{"Numbers cannot have leading zeroes": 013} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail14.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail14.json new file mode 100644 index 0000000000..0ed366b38a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail14.json @@ -0,0 +1 @@ +{"Numbers cannot be hex": 0x14} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail15.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail15.json new file mode 100644 index 0000000000..fc8376b605 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail15.json @@ -0,0 +1 @@ +["Illegal backslash escape: \x15"] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail16.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail16.json new file mode 100644 index 0000000000..3fe21d4b53 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail16.json @@ -0,0 +1 @@ +[\naked] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail17.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail17.json new file mode 100644 index 0000000000..62b9214aed --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail17.json @@ -0,0 +1 @@ +["Illegal backslash escape: \017"] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail18.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail18.json new file mode 100644 index 0000000000..edac92716f --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail18.json @@ -0,0 +1 @@ +[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail19.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail19.json new file mode 100644 index 0000000000..3b9c46fa9a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail19.json @@ -0,0 +1 @@ +{"Missing colon" null} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail2.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail2.json new file mode 100644 index 0000000000..6b7c11e5a5 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail2.json @@ -0,0 +1 @@ +["Unclosed array" \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail20.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail20.json new file mode 100644 index 0000000000..27c1af3e72 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail20.json @@ -0,0 +1 @@ +{"Double colon":: null} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail21.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail21.json new file mode 100644 index 0000000000..62474573b2 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail21.json @@ -0,0 +1 @@ +{"Comma instead of colon", null} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail22.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail22.json new file mode 100644 index 0000000000..a7752581bc --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail22.json @@ -0,0 +1 @@ +["Colon instead of comma": false] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail23.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail23.json new file mode 100644 index 0000000000..494add1ca1 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail23.json @@ -0,0 +1 @@ +["Bad value", truth] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail24.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail24.json new file mode 100644 index 0000000000..caff239bfc --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail24.json @@ -0,0 +1 @@ +['single quote'] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail25.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail25.json new file mode 100644 index 0000000000..8b7ad23e01 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail25.json @@ -0,0 +1 @@ +[" tab character in string "] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail26.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail26.json new file mode 100644 index 0000000000..845d26a6a5 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail26.json @@ -0,0 +1 @@ +["tab\ character\ in\ string\ "] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail27.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail27.json new file mode 100644 index 0000000000..6b01a2ca4a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail27.json @@ -0,0 +1,2 @@ +["line +break"] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail28.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail28.json new file mode 100644 index 0000000000..621a0101c6 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail28.json @@ -0,0 +1,2 @@ +["line\ +break"] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail29.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail29.json new file mode 100644 index 0000000000..47ec421bb6 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail29.json @@ -0,0 +1 @@ +[0e] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail3.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail3.json new file mode 100644 index 0000000000..168c81eb78 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail3.json @@ -0,0 +1 @@ +{unquoted_key: "keys must be quoted"} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail30.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail30.json new file mode 100644 index 0000000000..8ab0bc4b8b --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail30.json @@ -0,0 +1 @@ +[0e+] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail31.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail31.json new file mode 100644 index 0000000000..1cce602b51 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail31.json @@ -0,0 +1 @@ +[0e+-1] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail32.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail32.json new file mode 100644 index 0000000000..45cba7396f --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail32.json @@ -0,0 +1 @@ +{"Comma instead if closing brace": true, \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail33.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail33.json new file mode 100644 index 0000000000..ca5eb19dc9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail33.json @@ -0,0 +1 @@ +["mismatch"} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail4.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail4.json new file mode 100644 index 0000000000..9de168bf34 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail4.json @@ -0,0 +1 @@ +["extra comma",] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail5.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail5.json new file mode 100644 index 0000000000..ddf3ce3d24 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail5.json @@ -0,0 +1 @@ +["double extra comma",,] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail6.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail6.json new file mode 100644 index 0000000000..ed91580e1b --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail6.json @@ -0,0 +1 @@ +[ , "<-- missing value"] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail7.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail7.json new file mode 100644 index 0000000000..8a96af3e4e --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail7.json @@ -0,0 +1 @@ +["Comma after the close"], \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail8.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail8.json new file mode 100644 index 0000000000..b28479c6ec --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail8.json @@ -0,0 +1 @@ +["Extra close"]] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail9.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail9.json new file mode 100644 index 0000000000..5815574f36 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/fail9.json @@ -0,0 +1 @@ +{"Extra comma": true,} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass1.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass1.json new file mode 100644 index 0000000000..70e2685436 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass1.json @@ -0,0 +1,58 @@ +[ + "JSON Test Pattern pass1", + {"object with 1 member":["array with 1 element"]}, + {}, + [], + -42, + true, + false, + null, + { + "integer": 1234567890, + "real": -9876.543210, + "e": 0.123456789e-12, + "E": 1.234567890E+34, + "": 23456789012E66, + "zero": 0, + "one": 1, + "space": " ", + "quote": "\"", + "backslash": "\\", + "controls": "\b\f\n\r\t", + "slash": "/ & \/", + "alpha": "abcdefghijklmnopqrstuvwyz", + "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", + "digit": "0123456789", + "0123456789": "digit", + "special": "`1~!@#$%^&*()_+-={':[,]}|;.?", + "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", + "true": true, + "false": false, + "null": null, + "array":[ ], + "object":{ }, + "address": "50 St. James Street", + "url": "http://www.JSON.org/", + "comment": "// /* */": " ", + " s p a c e d " :[1,2 , 3 + +, + +4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], + "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", + "quotes": "" \u0022 %22 0x22 034 "", + "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" +: "A key can be any string" + }, + 0.5 ,98.6 +, +99.44 +, + +1066, +1e1, +0.1e1, +1e-1, +1e00,2e+00,2e-00 +,"rosebud"] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass2.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass2.json new file mode 100644 index 0000000000..d3c63c7ad8 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass2.json @@ -0,0 +1 @@ +[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass3.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass3.json new file mode 100644 index 0000000000..4528d51f1a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/pass3.json @@ -0,0 +1,6 @@ +{ + "JSON Test Pattern pass3": { + "The outermost value": "must be an object or array.", + "In this test": "It is an object." + } +} diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/readme.txt b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/readme.txt new file mode 100644 index 0000000000..321d89d998 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonchecker/readme.txt @@ -0,0 +1,3 @@ +Test suite from http://json.org/JSON_checker/. + +If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files. diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/.gitignore b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/.gitignore new file mode 100644 index 0000000000..1333ed77b7 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/.gitignore @@ -0,0 +1 @@ +TODO diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/.travis.yml b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/.travis.yml new file mode 100644 index 0000000000..deecd61100 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/.travis.yml @@ -0,0 +1,4 @@ +language: python +python: "2.7" +install: pip install jsonschema +script: bin/jsonschema_suite check diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/LICENSE b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/LICENSE new file mode 100644 index 0000000000..c28adbadd9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2012 Julian Berman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/README.md b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/README.md new file mode 100644 index 0000000000..6d9da94932 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/README.md @@ -0,0 +1,148 @@ +JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite.png?branch=develop)](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite) +====================== + +This repository contains a set of JSON objects that implementors of JSON Schema +validation libraries can use to test their validators. + +It is meant to be language agnostic and should require only a JSON parser. + +The conversion of the JSON objects into tests within your test framework of +choice is still the job of the validator implementor. + +Structure of a Test +------------------- + +If you're going to use this suite, you need to know how tests are laid out. The +tests are contained in the `tests` directory at the root of this repository. + +Inside that directory is a subdirectory for each draft or version of the +schema. We'll use `draft3` as an example. + +If you look inside the draft directory, there are a number of `.json` files, +which logically group a set of test cases together. Often the grouping is by +property under test, but not always, especially within optional test files +(discussed below). + +Inside each `.json` file is a single array containing objects. It's easiest to +illustrate the structure of these with an example: + +```json + { + "description": "the description of the test case", + "schema": {"the schema that should" : "be validated against"}, + "tests": [ + { + "description": "a specific test of a valid instance", + "data": "the instance", + "valid": true + }, + { + "description": "another specific test this time, invalid", + "data": 15, + "valid": false + } + ] + } +``` + +So a description, a schema, and some tests, where tests is an array containing +one or more objects with descriptions, data, and a boolean indicating whether +they should be valid or invalid. + +Coverage +-------- + +Draft 3 and 4 should have full coverage. If you see anything missing or think +there is a useful test missing, please send a pull request or open an issue. + +Who Uses the Test Suite +----------------------- + +This suite is being used by: + +### Coffeescript ### + +* [jsck](https://github.com/pandastrike/jsck) + +### Dart ### + +* [json_schema](https://github.com/patefacio/json_schema) + +### Erlang ### + +* [jesse](https://github.com/klarna/jesse) + +### Go ### + +* [gojsonschema](https://github.com/sigu-399/gojsonschema) +* [validate-json](https://github.com/cesanta/validate-json) + +### Haskell ### + +* [aeson-schema](https://github.com/timjb/aeson-schema) +* [hjsonschema](https://github.com/seagreen/hjsonschema) + +### Java ### + +* [json-schema-validator](https://github.com/fge/json-schema-validator) + +### JavaScript ### + +* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark) +* [direct-schema](https://github.com/IreneKnapp/direct-schema) +* [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) +* [jassi](https://github.com/iclanzan/jassi) +* [JaySchema](https://github.com/natesilva/jayschema) +* [json-schema-valid](https://github.com/ericgj/json-schema-valid) +* [Jsonary](https://github.com/jsonary-js/jsonary) +* [jsonschema](https://github.com/tdegrunt/jsonschema) +* [request-validator](https://github.com/bugventure/request-validator) +* [skeemas](https://github.com/Prestaul/skeemas) +* [tv4](https://github.com/geraintluff/tv4) +* [z-schema](https://github.com/zaggino/z-schema) +* [jsen](https://github.com/bugventure/jsen) +* [ajv](https://github.com/epoberezkin/ajv) + +### Node.js ### + +The JSON Schema Test Suite is also available as an +[npm](https://www.npmjs.com/package/json-schema-test-suite) package. +Node-specific support is maintained on the [node branch](https://github.com/json-schema/JSON-Schema-Test-Suite/tree/node). +See [NODE-README.md](https://github.com/json-schema/JSON-Schema-Test-Suite/blob/node/NODE-README.md) +for more information. + +### .NET ### + +* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema) + +### PHP ### + +* [json-schema](https://github.com/justinrainbow/json-schema) + +### Python ### + +* [jsonschema](https://github.com/Julian/jsonschema) + +### Ruby ### + +* [json-schema](https://github.com/hoxworth/json-schema) + +### Rust ### + +* [valico](https://github.com/rustless/valico) + +### Swift ### + +* [JSONSchema](https://github.com/kylef/JSONSchema.swift) + +If you use it as well, please fork and send a pull request adding yourself to +the list :). + +Contributing +------------ + +If you see something missing or incorrect, a pull request is most welcome! + +There are some sanity checks in place for testing the test suite. You can run +them with `bin/jsonschema_suite check` or `tox`. They will be run automatically by +[Travis CI](https://travis-ci.org/) as well. diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/bin/jsonschema_suite b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/bin/jsonschema_suite new file mode 100755 index 0000000000..96108c86ba --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/bin/jsonschema_suite @@ -0,0 +1,283 @@ +#! /usr/bin/env python +from __future__ import print_function +import sys +import textwrap + +try: + import argparse +except ImportError: + print(textwrap.dedent(""" + The argparse library could not be imported. jsonschema_suite requires + either Python 2.7 or for you to install argparse. You can do so by + running `pip install argparse`, `easy_install argparse` or by + downloading argparse and running `python2.6 setup.py install`. + + See https://pypi.python.org/pypi/argparse for details. + """.strip("\n"))) + sys.exit(1) + +import errno +import fnmatch +import json +import os +import random +import shutil +import unittest +import warnings + +if getattr(unittest, "skipIf", None) is None: + unittest.skipIf = lambda cond, msg : lambda fn : fn + +try: + import jsonschema +except ImportError: + jsonschema = None +else: + validators = getattr( + jsonschema.validators, "validators", jsonschema.validators + ) + + +ROOT_DIR = os.path.join( + os.path.dirname(__file__), os.pardir).rstrip("__pycache__") +SUITE_ROOT_DIR = os.path.join(ROOT_DIR, "tests") + +REMOTES = { + "integer.json": {"type": "integer"}, + "subSchemas.json": { + "integer": {"type": "integer"}, + "refToInteger": {"$ref": "#/integer"}, + }, + "folder/folderInteger.json": {"type": "integer"} +} +REMOTES_DIR = os.path.join(ROOT_DIR, "remotes") + +TESTSUITE_SCHEMA = { + "$schema": "http://json-schema.org/draft-03/schema#", + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string", "required": True}, + "schema": {"required": True}, + "tests": { + "type": "array", + "items": { + "type": "object", + "properties": { + "description": {"type": "string", "required": True}, + "data": {"required": True}, + "valid": {"type": "boolean", "required": True} + }, + "additionalProperties": False + }, + "minItems": 1 + } + }, + "additionalProperties": False, + "minItems": 1 + } +} + + +def files(paths): + for path in paths: + with open(path) as test_file: + yield json.load(test_file) + + +def groups(paths): + for test_file in files(paths): + for group in test_file: + yield group + + +def cases(paths): + for test_group in groups(paths): + for test in test_group["tests"]: + test["schema"] = test_group["schema"] + yield test + + +def collect(root_dir): + for root, dirs, files in os.walk(root_dir): + for filename in fnmatch.filter(files, "*.json"): + yield os.path.join(root, filename) + + +class SanityTests(unittest.TestCase): + @classmethod + def setUpClass(cls): + print("Looking for tests in %s" % SUITE_ROOT_DIR) + cls.test_files = list(collect(SUITE_ROOT_DIR)) + print("Found %s test files" % len(cls.test_files)) + assert cls.test_files, "Didn't find the test files!" + + def test_all_files_are_valid_json(self): + for path in self.test_files: + with open(path) as test_file: + try: + json.load(test_file) + except ValueError as error: + self.fail("%s contains invalid JSON (%s)" % (path, error)) + + def test_all_descriptions_have_reasonable_length(self): + for case in cases(self.test_files): + descript = case["description"] + self.assertLess( + len(descript), + 60, + "%r is too long! (keep it to less than 60 chars)" % (descript,) + ) + + def test_all_descriptions_are_unique(self): + for group in groups(self.test_files): + descriptions = set(test["description"] for test in group["tests"]) + self.assertEqual( + len(descriptions), + len(group["tests"]), + "%r contains a duplicate description" % (group,) + ) + + @unittest.skipIf(jsonschema is None, "Validation library not present!") + def test_all_schemas_are_valid(self): + for schema in os.listdir(SUITE_ROOT_DIR): + schema_validator = validators.get(schema) + if schema_validator is not None: + test_files = collect(os.path.join(SUITE_ROOT_DIR, schema)) + for case in cases(test_files): + try: + schema_validator.check_schema(case["schema"]) + except jsonschema.SchemaError as error: + self.fail("%s contains an invalid schema (%s)" % + (case, error)) + else: + warnings.warn("No schema validator for %s" % schema) + + @unittest.skipIf(jsonschema is None, "Validation library not present!") + def test_suites_are_valid(self): + validator = jsonschema.Draft3Validator(TESTSUITE_SCHEMA) + for tests in files(self.test_files): + try: + validator.validate(tests) + except jsonschema.ValidationError as error: + self.fail(str(error)) + + def test_remote_schemas_are_updated(self): + for url, schema in REMOTES.items(): + filepath = os.path.join(REMOTES_DIR, url) + with open(filepath) as schema_file: + self.assertEqual(json.load(schema_file), schema) + + +def main(arguments): + if arguments.command == "check": + suite = unittest.TestLoader().loadTestsFromTestCase(SanityTests) + result = unittest.TextTestRunner(verbosity=2).run(suite) + sys.exit(not result.wasSuccessful()) + elif arguments.command == "flatten": + selected_cases = [case for case in cases(collect(arguments.version))] + + if arguments.randomize: + random.shuffle(selected_cases) + + json.dump(selected_cases, sys.stdout, indent=4, sort_keys=True) + elif arguments.command == "remotes": + json.dump(REMOTES, sys.stdout, indent=4, sort_keys=True) + elif arguments.command == "dump_remotes": + if arguments.update: + shutil.rmtree(arguments.out_dir, ignore_errors=True) + + try: + os.makedirs(arguments.out_dir) + except OSError as e: + if e.errno == errno.EEXIST: + print("%s already exists. Aborting." % arguments.out_dir) + sys.exit(1) + raise + + for url, schema in REMOTES.items(): + filepath = os.path.join(arguments.out_dir, url) + + try: + os.makedirs(os.path.dirname(filepath)) + except OSError as e: + if e.errno != errno.EEXIST: + raise + + with open(filepath, "wb") as out_file: + json.dump(schema, out_file, indent=4, sort_keys=True) + elif arguments.command == "serve": + try: + from flask import Flask, jsonify + except ImportError: + print(textwrap.dedent(""" + The Flask library is required to serve the remote schemas. + + You can install it by running `pip install Flask`. + + Alternatively, see the `jsonschema_suite remotes` or + `jsonschema_suite dump_remotes` commands to create static files + that can be served with your own web server. + """.strip("\n"))) + sys.exit(1) + + app = Flask(__name__) + + @app.route("/") + def serve_path(path): + if path in REMOTES: + return jsonify(REMOTES[path]) + return "Document does not exist.", 404 + + app.run(port=1234) + + +parser = argparse.ArgumentParser( + description="JSON Schema Test Suite utilities", +) +subparsers = parser.add_subparsers(help="utility commands", dest="command") + +check = subparsers.add_parser("check", help="Sanity check the test suite.") + +flatten = subparsers.add_parser( + "flatten", + help="Output a flattened file containing a selected version's test cases." +) +flatten.add_argument( + "--randomize", + action="store_true", + help="Randomize the order of the outputted cases.", +) +flatten.add_argument( + "version", help="The directory containing the version to output", +) + +remotes = subparsers.add_parser( + "remotes", + help="Output the expected URLs and their associated schemas for remote " + "ref tests as a JSON object." +) + +dump_remotes = subparsers.add_parser( + "dump_remotes", help="Dump the remote ref schemas into a file tree", +) +dump_remotes.add_argument( + "--update", + action="store_true", + help="Update the remotes in an existing directory.", +) +dump_remotes.add_argument( + "--out-dir", + default=REMOTES_DIR, + type=os.path.abspath, + help="The output directory to create as the root of the file tree", +) + +serve = subparsers.add_parser( + "serve", + help="Start a webserver to serve schemas used by remote ref tests." +) + +if __name__ == "__main__": + main(parser.parse_args()) diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/.DS_Store b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/.DS_Store new file mode 100644 index 0000000000..1d098a4103 Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/.DS_Store differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/folder/folderInteger.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/folder/folderInteger.json new file mode 100644 index 0000000000..dbe5c758ee --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/folder/folderInteger.json @@ -0,0 +1,3 @@ +{ + "type": "integer" +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/integer.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/integer.json new file mode 100644 index 0000000000..dbe5c758ee --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/integer.json @@ -0,0 +1,3 @@ +{ + "type": "integer" +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/subSchemas.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/subSchemas.json new file mode 100644 index 0000000000..8b6d8f842f --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/remotes/subSchemas.json @@ -0,0 +1,8 @@ +{ + "integer": { + "type": "integer" + }, + "refToInteger": { + "$ref": "#/integer" + } +} \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/.DS_Store b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/.DS_Store new file mode 100644 index 0000000000..dae9b18efa Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/.DS_Store differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/additionalItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/additionalItems.json new file mode 100644 index 0000000000..6d4bff51cf --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/additionalItems.json @@ -0,0 +1,82 @@ +[ + { + "description": "additionalItems as schema", + "schema": { + "items": [], + "additionalItems": {"type": "integer"} + }, + "tests": [ + { + "description": "additional items match schema", + "data": [ 1, 2, 3, 4 ], + "valid": true + }, + { + "description": "additional items do not match schema", + "data": [ 1, 2, 3, "foo" ], + "valid": false + } + ] + }, + { + "description": "items is schema, no additionalItems", + "schema": { + "items": {}, + "additionalItems": false + }, + "tests": [ + { + "description": "all items match schema", + "data": [ 1, 2, 3, 4, 5 ], + "valid": true + } + ] + }, + { + "description": "array of items with no additionalItems", + "schema": { + "items": [{}, {}, {}], + "additionalItems": false + }, + "tests": [ + { + "description": "no additional items present", + "data": [ 1, 2, 3 ], + "valid": true + }, + { + "description": "additional items are not permitted", + "data": [ 1, 2, 3, 4 ], + "valid": false + } + ] + }, + { + "description": "additionalItems as false without items", + "schema": {"additionalItems": false}, + "tests": [ + { + "description": + "items defaults to empty schema so everything is valid", + "data": [ 1, 2, 3, 4, 5 ], + "valid": true + }, + { + "description": "ignores non-arrays", + "data": {"foo" : "bar"}, + "valid": true + } + ] + }, + { + "description": "additionalItems are allowed by default", + "schema": {"items": []}, + "tests": [ + { + "description": "only the first items are validated", + "data": [1, "foo", false], + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/additionalProperties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/additionalProperties.json new file mode 100644 index 0000000000..40831f9e9a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/additionalProperties.json @@ -0,0 +1,88 @@ +[ + { + "description": + "additionalProperties being false does not allow other properties", + "schema": { + "properties": {"foo": {}, "bar": {}}, + "patternProperties": { "^v": {} }, + "additionalProperties": false + }, + "tests": [ + { + "description": "no additional properties is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "an additional property is invalid", + "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": [1, 2, 3], + "valid": true + }, + { + "description": "patternProperties are not additional properties", + "data": {"foo":1, "vroom": 2}, + "valid": true + } + ] + }, + { + "description": + "additionalProperties allows a schema which should validate", + "schema": { + "properties": {"foo": {}, "bar": {}}, + "additionalProperties": {"type": "boolean"} + }, + "tests": [ + { + "description": "no additional properties is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "an additional valid property is valid", + "data": {"foo" : 1, "bar" : 2, "quux" : true}, + "valid": true + }, + { + "description": "an additional invalid property is invalid", + "data": {"foo" : 1, "bar" : 2, "quux" : 12}, + "valid": false + } + ] + }, + { + "description": + "additionalProperties can exist by itself", + "schema": { + "additionalProperties": {"type": "boolean"} + }, + "tests": [ + { + "description": "an additional valid property is valid", + "data": {"foo" : true}, + "valid": true + }, + { + "description": "an additional invalid property is invalid", + "data": {"foo" : 1}, + "valid": false + } + ] + }, + { + "description": "additionalProperties are allowed by default", + "schema": {"properties": {"foo": {}, "bar": {}}}, + "tests": [ + { + "description": "additional properties are allowed", + "data": {"foo": 1, "bar": 2, "quux": true}, + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/default.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/default.json new file mode 100644 index 0000000000..17629779fb --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/default.json @@ -0,0 +1,49 @@ +[ + { + "description": "invalid type for default", + "schema": { + "properties": { + "foo": { + "type": "integer", + "default": [] + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"foo": 13}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + }, + { + "description": "invalid string value for default", + "schema": { + "properties": { + "bar": { + "type": "string", + "minLength": 4, + "default": "bad" + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"bar": "good"}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/dependencies.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/dependencies.json new file mode 100644 index 0000000000..2f6ae489ae --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/dependencies.json @@ -0,0 +1,108 @@ +[ + { + "description": "dependencies", + "schema": { + "dependencies": {"bar": "foo"} + }, + "tests": [ + { + "description": "neither", + "data": {}, + "valid": true + }, + { + "description": "nondependant", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "with dependency", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "missing dependency", + "data": {"bar": 2}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": "foo", + "valid": true + } + ] + }, + { + "description": "multiple dependencies", + "schema": { + "dependencies": {"quux": ["foo", "bar"]} + }, + "tests": [ + { + "description": "neither", + "data": {}, + "valid": true + }, + { + "description": "nondependants", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "with dependencies", + "data": {"foo": 1, "bar": 2, "quux": 3}, + "valid": true + }, + { + "description": "missing dependency", + "data": {"foo": 1, "quux": 2}, + "valid": false + }, + { + "description": "missing other dependency", + "data": {"bar": 1, "quux": 2}, + "valid": false + }, + { + "description": "missing both dependencies", + "data": {"quux": 1}, + "valid": false + } + ] + }, + { + "description": "multiple dependencies subschema", + "schema": { + "dependencies": { + "bar": { + "properties": { + "foo": {"type": "integer"}, + "bar": {"type": "integer"} + } + } + } + }, + "tests": [ + { + "description": "valid", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "wrong type", + "data": {"foo": "quux", "bar": 2}, + "valid": false + }, + { + "description": "wrong type other", + "data": {"foo": 2, "bar": "quux"}, + "valid": false + }, + { + "description": "wrong type both", + "data": {"foo": "quux", "bar": "quux"}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/disallow.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/disallow.json new file mode 100644 index 0000000000..a5c9d90cce --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/disallow.json @@ -0,0 +1,80 @@ +[ + { + "description": "disallow", + "schema": { + "disallow": "integer" + }, + "tests": [ + { + "description": "allowed", + "data": "foo", + "valid": true + }, + { + "description": "disallowed", + "data": 1, + "valid": false + } + ] + }, + { + "description": "multiple disallow", + "schema": { + "disallow": ["integer", "boolean"] + }, + "tests": [ + { + "description": "valid", + "data": "foo", + "valid": true + }, + { + "description": "mismatch", + "data": 1, + "valid": false + }, + { + "description": "other mismatch", + "data": true, + "valid": false + } + ] + }, + { + "description": "multiple disallow subschema", + "schema": { + "disallow": + ["string", + { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + }] + }, + "tests": [ + { + "description": "match", + "data": 1, + "valid": true + }, + { + "description": "other match", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "mismatch", + "data": "foo", + "valid": false + }, + { + "description": "other mismatch", + "data": {"foo": "bar"}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/divisibleBy.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/divisibleBy.json new file mode 100644 index 0000000000..ef7cc14890 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/divisibleBy.json @@ -0,0 +1,60 @@ +[ + { + "description": "by int", + "schema": {"divisibleBy": 2}, + "tests": [ + { + "description": "int by int", + "data": 10, + "valid": true + }, + { + "description": "int by int fail", + "data": 7, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "foo", + "valid": true + } + ] + }, + { + "description": "by number", + "schema": {"divisibleBy": 1.5}, + "tests": [ + { + "description": "zero is divisible by anything (except 0)", + "data": 0, + "valid": true + }, + { + "description": "4.5 is divisible by 1.5", + "data": 4.5, + "valid": true + }, + { + "description": "35 is not divisible by 1.5", + "data": 35, + "valid": false + } + ] + }, + { + "description": "by small number", + "schema": {"divisibleBy": 0.0001}, + "tests": [ + { + "description": "0.0075 is divisible by 0.0001", + "data": 0.0075, + "valid": true + }, + { + "description": "0.00751 is not divisible by 0.0001", + "data": 0.00751, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/enum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/enum.json new file mode 100644 index 0000000000..0c83f0804d --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/enum.json @@ -0,0 +1,71 @@ +[ + { + "description": "simple enum validation", + "schema": {"enum": [1, 2, 3]}, + "tests": [ + { + "description": "one of the enum is valid", + "data": 1, + "valid": true + }, + { + "description": "something else is invalid", + "data": 4, + "valid": false + } + ] + }, + { + "description": "heterogeneous enum validation", + "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, + "tests": [ + { + "description": "one of the enum is valid", + "data": [], + "valid": true + }, + { + "description": "something else is invalid", + "data": null, + "valid": false + }, + { + "description": "objects are deep compared", + "data": {"foo": false}, + "valid": false + } + ] + }, + { + "description": "enums in properties", + "schema": { + "type":"object", + "properties": { + "foo": {"enum":["foo"]}, + "bar": {"enum":["bar"], "required":true} + } + }, + "tests": [ + { + "description": "both properties are valid", + "data": {"foo":"foo", "bar":"bar"}, + "valid": true + }, + { + "description": "missing optional property is valid", + "data": {"bar":"bar"}, + "valid": true + }, + { + "description": "missing required property is invalid", + "data": {"foo":"foo"}, + "valid": false + }, + { + "description": "missing all properties is invalid", + "data": {}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/extends.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/extends.json new file mode 100644 index 0000000000..909bce575a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/extends.json @@ -0,0 +1,94 @@ +[ + { + "description": "extends", + "schema": { + "properties": {"bar": {"type": "integer", "required": true}}, + "extends": { + "properties": { + "foo": {"type": "string", "required": true} + } + } + }, + "tests": [ + { + "description": "extends", + "data": {"foo": "baz", "bar": 2}, + "valid": true + }, + { + "description": "mismatch extends", + "data": {"foo": "baz"}, + "valid": false + }, + { + "description": "mismatch extended", + "data": {"bar": 2}, + "valid": false + }, + { + "description": "wrong type", + "data": {"foo": "baz", "bar": "quux"}, + "valid": false + } + ] + }, + { + "description": "multiple extends", + "schema": { + "properties": {"bar": {"type": "integer", "required": true}}, + "extends" : [ + { + "properties": { + "foo": {"type": "string", "required": true} + } + }, + { + "properties": { + "baz": {"type": "null", "required": true} + } + } + ] + }, + "tests": [ + { + "description": "valid", + "data": {"foo": "quux", "bar": 2, "baz": null}, + "valid": true + }, + { + "description": "mismatch first extends", + "data": {"bar": 2, "baz": null}, + "valid": false + }, + { + "description": "mismatch second extends", + "data": {"foo": "quux", "bar": 2}, + "valid": false + }, + { + "description": "mismatch both", + "data": {"bar": 2}, + "valid": false + } + ] + }, + { + "description": "extends simple types", + "schema": { + "minimum": 20, + "extends": {"maximum": 30} + }, + "tests": [ + { + "description": "valid", + "data": 25, + "valid": true + }, + { + "description": "mismatch extends", + "data": 35, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/items.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/items.json new file mode 100644 index 0000000000..f5e18a1384 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/items.json @@ -0,0 +1,46 @@ +[ + { + "description": "a schema given for items", + "schema": { + "items": {"type": "integer"} + }, + "tests": [ + { + "description": "valid items", + "data": [ 1, 2, 3 ], + "valid": true + }, + { + "description": "wrong type of items", + "data": [1, "x"], + "valid": false + }, + { + "description": "ignores non-arrays", + "data": {"foo" : "bar"}, + "valid": true + } + ] + }, + { + "description": "an array of schemas for items", + "schema": { + "items": [ + {"type": "integer"}, + {"type": "string"} + ] + }, + "tests": [ + { + "description": "correct types", + "data": [ 1, "foo" ], + "valid": true + }, + { + "description": "wrong types", + "data": [ "foo", 1 ], + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maxItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maxItems.json new file mode 100644 index 0000000000..3b53a6b371 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maxItems.json @@ -0,0 +1,28 @@ +[ + { + "description": "maxItems validation", + "schema": {"maxItems": 2}, + "tests": [ + { + "description": "shorter is valid", + "data": [1], + "valid": true + }, + { + "description": "exact length is valid", + "data": [1, 2], + "valid": true + }, + { + "description": "too long is invalid", + "data": [1, 2, 3], + "valid": false + }, + { + "description": "ignores non-arrays", + "data": "foobar", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maxLength.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maxLength.json new file mode 100644 index 0000000000..4de42bcaba --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maxLength.json @@ -0,0 +1,33 @@ +[ + { + "description": "maxLength validation", + "schema": {"maxLength": 2}, + "tests": [ + { + "description": "shorter is valid", + "data": "f", + "valid": true + }, + { + "description": "exact length is valid", + "data": "fo", + "valid": true + }, + { + "description": "too long is invalid", + "data": "foo", + "valid": false + }, + { + "description": "ignores non-strings", + "data": 10, + "valid": true + }, + { + "description": "two supplementary Unicode code points is long enough", + "data": "\uD83D\uDCA9\uD83D\uDCA9", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maximum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maximum.json new file mode 100644 index 0000000000..86c7b89c9a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/maximum.json @@ -0,0 +1,42 @@ +[ + { + "description": "maximum validation", + "schema": {"maximum": 3.0}, + "tests": [ + { + "description": "below the maximum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "exclusiveMaximum validation", + "schema": { + "maximum": 3.0, + "exclusiveMaximum": true + }, + "tests": [ + { + "description": "below the maximum is still valid", + "data": 2.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 3.0, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minItems.json new file mode 100644 index 0000000000..ed5118815e --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minItems.json @@ -0,0 +1,28 @@ +[ + { + "description": "minItems validation", + "schema": {"minItems": 1}, + "tests": [ + { + "description": "longer is valid", + "data": [1, 2], + "valid": true + }, + { + "description": "exact length is valid", + "data": [1], + "valid": true + }, + { + "description": "too short is invalid", + "data": [], + "valid": false + }, + { + "description": "ignores non-arrays", + "data": "", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minLength.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minLength.json new file mode 100644 index 0000000000..3f09158dee --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minLength.json @@ -0,0 +1,33 @@ +[ + { + "description": "minLength validation", + "schema": {"minLength": 2}, + "tests": [ + { + "description": "longer is valid", + "data": "foo", + "valid": true + }, + { + "description": "exact length is valid", + "data": "fo", + "valid": true + }, + { + "description": "too short is invalid", + "data": "f", + "valid": false + }, + { + "description": "ignores non-strings", + "data": 1, + "valid": true + }, + { + "description": "one supplementary Unicode code point is not long enough", + "data": "\uD83D\uDCA9", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minimum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minimum.json new file mode 100644 index 0000000000..d5bf000bcc --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/minimum.json @@ -0,0 +1,42 @@ +[ + { + "description": "minimum validation", + "schema": {"minimum": 1.1}, + "tests": [ + { + "description": "above the minimum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "below the minimum is invalid", + "data": 0.6, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "exclusiveMinimum validation", + "schema": { + "minimum": 1.1, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "above the minimum is still valid", + "data": 1.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 1.1, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/bignum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/bignum.json new file mode 100644 index 0000000000..ccc7c17fe8 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/bignum.json @@ -0,0 +1,107 @@ +[ + { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a bignum is an integer", + "data": 12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a bignum is a number", + "data": 98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, + { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a negative bignum is an integer", + "data": -12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a negative bignum is a number", + "data": -98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, + { + "description": "string", + "schema": {"type": "string"}, + "tests": [ + { + "description": "a bignum is not a string", + "data": 98249283749234923498293171823948729348710298301928331, + "valid": false + } + ] + }, + { + "description": "integer comparison", + "schema": {"maximum": 18446744073709551615}, + "tests": [ + { + "description": "comparison works for high numbers", + "data": 18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision", + "schema": { + "maximum": 972783798187987123879878123.18878137, + "exclusiveMaximum": true + }, + "tests": [ + { + "description": "comparison works for high numbers", + "data": 972783798187987123879878123.188781371, + "valid": false + } + ] + }, + { + "description": "integer comparison", + "schema": {"minimum": -18446744073709551615}, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision on negative numbers", + "schema": { + "minimum": -972783798187987123879878123.18878137, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -972783798187987123879878123.188781371, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/format.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/format.json new file mode 100644 index 0000000000..3ca7319dda --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/format.json @@ -0,0 +1,222 @@ +[ + { + "description": "validation of regular expressions", + "schema": {"format": "regex"}, + "tests": [ + { + "description": "a valid regular expression", + "data": "([abc])+\\s+$", + "valid": true + }, + { + "description": "a regular expression with unclosed parens is invalid", + "data": "^(abc]", + "valid": false + } + ] + }, + { + "description": "validation of date-time strings", + "schema": {"format": "date-time"}, + "tests": [ + { + "description": "a valid date-time string", + "data": "1963-06-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "an invalid date-time string", + "data": "06/19/1963 08:30:06 PST", + "valid": false + }, + { + "description": "only RFC3339 not all of ISO 8601 are valid", + "data": "2013-350T01:01:01", + "valid": false + } + ] + }, + { + "description": "validation of date strings", + "schema": {"format": "date"}, + "tests": [ + { + "description": "a valid date string", + "data": "1963-06-19", + "valid": true + }, + { + "description": "an invalid date string", + "data": "06/19/1963", + "valid": false + } + ] + }, + { + "description": "validation of time strings", + "schema": {"format": "time"}, + "tests": [ + { + "description": "a valid time string", + "data": "08:30:06", + "valid": true + }, + { + "description": "an invalid time string", + "data": "8:30 AM", + "valid": false + } + ] + }, + { + "description": "validation of URIs", + "schema": {"format": "uri"}, + "tests": [ + { + "description": "a valid URI", + "data": "http://foo.bar/?baz=qux#quux", + "valid": true + }, + { + "description": "a valid protocol-relative URI", + "data": "//foo.bar/?baz=qux#quux", + "valid": true + }, + { + "description": "an invalid URI", + "data": "\\\\WINDOWS\\fileshare", + "valid": false + }, + { + "description": "an invalid URI though valid URI reference", + "data": "abc", + "valid": false + } + ] + }, + { + "description": "validation of e-mail addresses", + "schema": {"format": "email"}, + "tests": [ + { + "description": "a valid e-mail address", + "data": "joe.bloggs@example.com", + "valid": true + }, + { + "description": "an invalid e-mail address", + "data": "2962", + "valid": false + } + ] + }, + { + "description": "validation of IP addresses", + "schema": {"format": "ip-address"}, + "tests": [ + { + "description": "a valid IP address", + "data": "192.168.0.1", + "valid": true + }, + { + "description": "an IP address with too many components", + "data": "127.0.0.0.1", + "valid": false + }, + { + "description": "an IP address with out-of-range values", + "data": "256.256.256.256", + "valid": false + } + ] + }, + { + "description": "validation of IPv6 addresses", + "schema": {"format": "ipv6"}, + "tests": [ + { + "description": "a valid IPv6 address", + "data": "::1", + "valid": true + }, + { + "description": "an IPv6 address with out-of-range values", + "data": "12345::", + "valid": false + }, + { + "description": "an IPv6 address with too many components", + "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", + "valid": false + }, + { + "description": "an IPv6 address containing illegal characters", + "data": "::laptop", + "valid": false + } + ] + }, + { + "description": "validation of host names", + "schema": {"format": "host-name"}, + "tests": [ + { + "description": "a valid host name", + "data": "www.example.com", + "valid": true + }, + { + "description": "a host name starting with an illegal character", + "data": "-a-host-name-that-starts-with--", + "valid": false + }, + { + "description": "a host name containing illegal characters", + "data": "not_a_valid_host_name", + "valid": false + }, + { + "description": "a host name with a component too long", + "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", + "valid": false + } + ] + }, + { + "description": "validation of CSS colors", + "schema": {"format": "color"}, + "tests": [ + { + "description": "a valid CSS color name", + "data": "fuchsia", + "valid": true + }, + { + "description": "a valid six-digit CSS color code", + "data": "#CC8899", + "valid": true + }, + { + "description": "a valid three-digit CSS color code", + "data": "#C89", + "valid": true + }, + { + "description": "an invalid CSS color code", + "data": "#00332520", + "valid": false + }, + { + "description": "an invalid CSS color name", + "data": "puce", + "valid": false + }, + { + "description": "a CSS color name containing invalid characters", + "data": "light_grayish_red-violet", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/jsregex.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/jsregex.json new file mode 100644 index 0000000000..03fe97724c --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/jsregex.json @@ -0,0 +1,18 @@ +[ + { + "description": "ECMA 262 regex dialect recognition", + "schema": { "format": "regex" }, + "tests": [ + { + "description": "[^] is a valid regex", + "data": "[^]", + "valid": true + }, + { + "description": "ECMA 262 has no support for lookbehind", + "data": "(?<=foo)bar", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json new file mode 100644 index 0000000000..9b50ea2776 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json @@ -0,0 +1,15 @@ +[ + { + "description": "some languages do not distinguish between different types of numeric value", + "schema": { + "type": "integer" + }, + "tests": [ + { + "description": "a float is not an integer even without fractional part", + "data": 1.0, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/pattern.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/pattern.json new file mode 100644 index 0000000000..25e7299731 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/pattern.json @@ -0,0 +1,34 @@ +[ + { + "description": "pattern validation", + "schema": {"pattern": "^a*$"}, + "tests": [ + { + "description": "a matching pattern is valid", + "data": "aaa", + "valid": true + }, + { + "description": "a non-matching pattern is invalid", + "data": "abc", + "valid": false + }, + { + "description": "ignores non-strings", + "data": true, + "valid": true + } + ] + }, + { + "description": "pattern is not anchored", + "schema": {"pattern": "a+"}, + "tests": [ + { + "description": "matches a substring", + "data": "xxaayy", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/patternProperties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/patternProperties.json new file mode 100644 index 0000000000..18586e5dab --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/patternProperties.json @@ -0,0 +1,110 @@ +[ + { + "description": + "patternProperties validates properties matching a regex", + "schema": { + "patternProperties": { + "f.*o": {"type": "integer"} + } + }, + "tests": [ + { + "description": "a single valid match is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "multiple valid matches is valid", + "data": {"foo": 1, "foooooo" : 2}, + "valid": true + }, + { + "description": "a single invalid match is invalid", + "data": {"foo": "bar", "fooooo": 2}, + "valid": false + }, + { + "description": "multiple invalid matches is invalid", + "data": {"foo": "bar", "foooooo" : "baz"}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": 12, + "valid": true + } + ] + }, + { + "description": "multiple simultaneous patternProperties are validated", + "schema": { + "patternProperties": { + "a*": {"type": "integer"}, + "aaa*": {"maximum": 20} + } + }, + "tests": [ + { + "description": "a single valid match is valid", + "data": {"a": 21}, + "valid": true + }, + { + "description": "a simultaneous match is valid", + "data": {"aaaa": 18}, + "valid": true + }, + { + "description": "multiple matches is valid", + "data": {"a": 21, "aaaa": 18}, + "valid": true + }, + { + "description": "an invalid due to one is invalid", + "data": {"a": "bar"}, + "valid": false + }, + { + "description": "an invalid due to the other is invalid", + "data": {"aaaa": 31}, + "valid": false + }, + { + "description": "an invalid due to both is invalid", + "data": {"aaa": "foo", "aaaa": 31}, + "valid": false + } + ] + }, + { + "description": "regexes are not anchored by default and are case sensitive", + "schema": { + "patternProperties": { + "[0-9]{2,}": { "type": "boolean" }, + "X_": { "type": "string" } + } + }, + "tests": [ + { + "description": "non recognized members are ignored", + "data": { "answer 1": "42" }, + "valid": true + }, + { + "description": "recognized members are accounted for", + "data": { "a31b": null }, + "valid": false + }, + { + "description": "regexes are case sensitive", + "data": { "a_x_3": 3 }, + "valid": true + }, + { + "description": "regexes are case sensitive, 2", + "data": { "a_X_3": 3 }, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/properties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/properties.json new file mode 100644 index 0000000000..cd1644dcd9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/properties.json @@ -0,0 +1,92 @@ +[ + { + "description": "object properties validation", + "schema": { + "properties": { + "foo": {"type": "integer"}, + "bar": {"type": "string"} + } + }, + "tests": [ + { + "description": "both properties present and valid is valid", + "data": {"foo": 1, "bar": "baz"}, + "valid": true + }, + { + "description": "one property invalid is invalid", + "data": {"foo": 1, "bar": {}}, + "valid": false + }, + { + "description": "both properties invalid is invalid", + "data": {"foo": [], "bar": {}}, + "valid": false + }, + { + "description": "doesn't invalidate other properties", + "data": {"quux": []}, + "valid": true + }, + { + "description": "ignores non-objects", + "data": [], + "valid": true + } + ] + }, + { + "description": + "properties, patternProperties, additionalProperties interaction", + "schema": { + "properties": { + "foo": {"type": "array", "maxItems": 3}, + "bar": {"type": "array"} + }, + "patternProperties": {"f.o": {"minItems": 2}}, + "additionalProperties": {"type": "integer"} + }, + "tests": [ + { + "description": "property validates property", + "data": {"foo": [1, 2]}, + "valid": true + }, + { + "description": "property invalidates property", + "data": {"foo": [1, 2, 3, 4]}, + "valid": false + }, + { + "description": "patternProperty invalidates property", + "data": {"foo": []}, + "valid": false + }, + { + "description": "patternProperty validates nonproperty", + "data": {"fxo": [1, 2]}, + "valid": true + }, + { + "description": "patternProperty invalidates nonproperty", + "data": {"fxo": []}, + "valid": false + }, + { + "description": "additionalProperty ignores property", + "data": {"bar": []}, + "valid": true + }, + { + "description": "additionalProperty validates others", + "data": {"quux": 3}, + "valid": true + }, + { + "description": "additionalProperty invalidates others", + "data": {"quux": "foo"}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/ref.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/ref.json new file mode 100644 index 0000000000..903ecb6bce --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/ref.json @@ -0,0 +1,159 @@ +[ + { + "description": "root pointer ref", + "schema": { + "properties": { + "foo": {"$ref": "#"} + }, + "additionalProperties": false + }, + "tests": [ + { + "description": "match", + "data": {"foo": false}, + "valid": true + }, + { + "description": "recursive match", + "data": {"foo": {"foo": false}}, + "valid": true + }, + { + "description": "mismatch", + "data": {"bar": false}, + "valid": false + }, + { + "description": "recursive mismatch", + "data": {"foo": {"bar": false}}, + "valid": false + } + ] + }, + { + "description": "relative pointer ref to object", + "schema": { + "properties": { + "foo": {"type": "integer"}, + "bar": {"$ref": "#/properties/foo"} + } + }, + "tests": [ + { + "description": "match", + "data": {"bar": 3}, + "valid": true + }, + { + "description": "mismatch", + "data": {"bar": true}, + "valid": false + } + ] + }, + { + "description": "relative pointer ref to array", + "schema": { + "items": [ + {"type": "integer"}, + {"$ref": "#/items/0"} + ] + }, + "tests": [ + { + "description": "match array", + "data": [1, 2], + "valid": true + }, + { + "description": "mismatch array", + "data": [1, "foo"], + "valid": false + } + ] + }, + { + "description": "escaped pointer ref", + "schema": { + "tilda~field": {"type": "integer"}, + "slash/field": {"type": "integer"}, + "percent%field": {"type": "integer"}, + "properties": { + "tilda": {"$ref": "#/tilda~0field"}, + "slash": {"$ref": "#/slash~1field"}, + "percent": {"$ref": "#/percent%25field"} + } + }, + "tests": [ + { + "description": "slash invalid", + "data": {"slash": "aoeu"}, + "valid": false + }, + { + "description": "tilda invalid", + "data": {"tilda": "aoeu"}, + "valid": false + }, + { + "description": "percent invalid", + "data": {"percent": "aoeu"}, + "valid": false + }, + { + "description": "slash valid", + "data": {"slash": 123}, + "valid": true + }, + { + "description": "tilda valid", + "data": {"tilda": 123}, + "valid": true + }, + { + "description": "percent valid", + "data": {"percent": 123}, + "valid": true + } + ] + }, + { + "description": "nested refs", + "schema": { + "definitions": { + "a": {"type": "integer"}, + "b": {"$ref": "#/definitions/a"}, + "c": {"$ref": "#/definitions/b"} + }, + "$ref": "#/definitions/c" + }, + "tests": [ + { + "description": "nested ref valid", + "data": 5, + "valid": true + }, + { + "description": "nested ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "remote ref, containing refs itself", + "schema": {"$ref": "http://json-schema.org/draft-03/schema#"}, + "tests": [ + { + "description": "remote ref valid", + "data": {"items": {"type": "integer"}}, + "valid": true + }, + { + "description": "remote ref invalid", + "data": {"items": {"type": 1}}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/refRemote.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/refRemote.json new file mode 100644 index 0000000000..4ca804732c --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/refRemote.json @@ -0,0 +1,74 @@ +[ + { + "description": "remote ref", + "schema": {"$ref": "http://localhost:1234/integer.json"}, + "tests": [ + { + "description": "remote ref valid", + "data": 1, + "valid": true + }, + { + "description": "remote ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "fragment within remote ref", + "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, + "tests": [ + { + "description": "remote fragment valid", + "data": 1, + "valid": true + }, + { + "description": "remote fragment invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "ref within remote ref", + "schema": { + "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" + }, + "tests": [ + { + "description": "ref within ref valid", + "data": 1, + "valid": true + }, + { + "description": "ref within ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "change resolution scope", + "schema": { + "id": "http://localhost:1234/", + "items": { + "id": "folder/", + "items": {"$ref": "folderInteger.json"} + } + }, + "tests": [ + { + "description": "changed scope ref valid", + "data": [[1]], + "valid": true + }, + { + "description": "changed scope ref invalid", + "data": [["a"]], + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/required.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/required.json new file mode 100644 index 0000000000..aaaf024273 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/required.json @@ -0,0 +1,53 @@ +[ + { + "description": "required validation", + "schema": { + "properties": { + "foo": {"required" : true}, + "bar": {} + } + }, + "tests": [ + { + "description": "present required property is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "non-present required property is invalid", + "data": {"bar": 1}, + "valid": false + } + ] + }, + { + "description": "required default validation", + "schema": { + "properties": { + "foo": {} + } + }, + "tests": [ + { + "description": "not required by default", + "data": {}, + "valid": true + } + ] + }, + { + "description": "required explicitly false validation", + "schema": { + "properties": { + "foo": {"required": false} + } + }, + "tests": [ + { + "description": "not required if required is false", + "data": {}, + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/type.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/type.json new file mode 100644 index 0000000000..337da1206d --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/type.json @@ -0,0 +1,474 @@ +[ + { + "description": "integer type matches integers", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "an integer is an integer", + "data": 1, + "valid": true + }, + { + "description": "a float is not an integer", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not an integer", + "data": "foo", + "valid": false + }, + { + "description": "an object is not an integer", + "data": {}, + "valid": false + }, + { + "description": "an array is not an integer", + "data": [], + "valid": false + }, + { + "description": "a boolean is not an integer", + "data": true, + "valid": false + }, + { + "description": "null is not an integer", + "data": null, + "valid": false + } + ] + }, + { + "description": "number type matches numbers", + "schema": {"type": "number"}, + "tests": [ + { + "description": "an integer is a number", + "data": 1, + "valid": true + }, + { + "description": "a float is a number", + "data": 1.1, + "valid": true + }, + { + "description": "a string is not a number", + "data": "foo", + "valid": false + }, + { + "description": "an object is not a number", + "data": {}, + "valid": false + }, + { + "description": "an array is not a number", + "data": [], + "valid": false + }, + { + "description": "a boolean is not a number", + "data": true, + "valid": false + }, + { + "description": "null is not a number", + "data": null, + "valid": false + } + ] + }, + { + "description": "string type matches strings", + "schema": {"type": "string"}, + "tests": [ + { + "description": "1 is not a string", + "data": 1, + "valid": false + }, + { + "description": "a float is not a string", + "data": 1.1, + "valid": false + }, + { + "description": "a string is a string", + "data": "foo", + "valid": true + }, + { + "description": "an object is not a string", + "data": {}, + "valid": false + }, + { + "description": "an array is not a string", + "data": [], + "valid": false + }, + { + "description": "a boolean is not a string", + "data": true, + "valid": false + }, + { + "description": "null is not a string", + "data": null, + "valid": false + } + ] + }, + { + "description": "object type matches objects", + "schema": {"type": "object"}, + "tests": [ + { + "description": "an integer is not an object", + "data": 1, + "valid": false + }, + { + "description": "a float is not an object", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not an object", + "data": "foo", + "valid": false + }, + { + "description": "an object is an object", + "data": {}, + "valid": true + }, + { + "description": "an array is not an object", + "data": [], + "valid": false + }, + { + "description": "a boolean is not an object", + "data": true, + "valid": false + }, + { + "description": "null is not an object", + "data": null, + "valid": false + } + ] + }, + { + "description": "array type matches arrays", + "schema": {"type": "array"}, + "tests": [ + { + "description": "an integer is not an array", + "data": 1, + "valid": false + }, + { + "description": "a float is not an array", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not an array", + "data": "foo", + "valid": false + }, + { + "description": "an object is not an array", + "data": {}, + "valid": false + }, + { + "description": "an array is an array", + "data": [], + "valid": true + }, + { + "description": "a boolean is not an array", + "data": true, + "valid": false + }, + { + "description": "null is not an array", + "data": null, + "valid": false + } + ] + }, + { + "description": "boolean type matches booleans", + "schema": {"type": "boolean"}, + "tests": [ + { + "description": "an integer is not a boolean", + "data": 1, + "valid": false + }, + { + "description": "a float is not a boolean", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not a boolean", + "data": "foo", + "valid": false + }, + { + "description": "an object is not a boolean", + "data": {}, + "valid": false + }, + { + "description": "an array is not a boolean", + "data": [], + "valid": false + }, + { + "description": "a boolean is a boolean", + "data": true, + "valid": true + }, + { + "description": "null is not a boolean", + "data": null, + "valid": false + } + ] + }, + { + "description": "null type matches only the null object", + "schema": {"type": "null"}, + "tests": [ + { + "description": "an integer is not null", + "data": 1, + "valid": false + }, + { + "description": "a float is not null", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not null", + "data": "foo", + "valid": false + }, + { + "description": "an object is not null", + "data": {}, + "valid": false + }, + { + "description": "an array is not null", + "data": [], + "valid": false + }, + { + "description": "a boolean is not null", + "data": true, + "valid": false + }, + { + "description": "null is null", + "data": null, + "valid": true + } + ] + }, + { + "description": "any type matches any type", + "schema": {"type": "any"}, + "tests": [ + { + "description": "any type includes integers", + "data": 1, + "valid": true + }, + { + "description": "any type includes float", + "data": 1.1, + "valid": true + }, + { + "description": "any type includes string", + "data": "foo", + "valid": true + }, + { + "description": "any type includes object", + "data": {}, + "valid": true + }, + { + "description": "any type includes array", + "data": [], + "valid": true + }, + { + "description": "any type includes boolean", + "data": true, + "valid": true + }, + { + "description": "any type includes null", + "data": null, + "valid": true + } + ] + }, + { + "description": "multiple types can be specified in an array", + "schema": {"type": ["integer", "string"]}, + "tests": [ + { + "description": "an integer is valid", + "data": 1, + "valid": true + }, + { + "description": "a string is valid", + "data": "foo", + "valid": true + }, + { + "description": "a float is invalid", + "data": 1.1, + "valid": false + }, + { + "description": "an object is invalid", + "data": {}, + "valid": false + }, + { + "description": "an array is invalid", + "data": [], + "valid": false + }, + { + "description": "a boolean is invalid", + "data": true, + "valid": false + }, + { + "description": "null is invalid", + "data": null, + "valid": false + } + ] + }, + { + "description": "types can include schemas", + "schema": { + "type": [ + "array", + {"type": "object"} + ] + }, + "tests": [ + { + "description": "an integer is invalid", + "data": 1, + "valid": false + }, + { + "description": "a string is invalid", + "data": "foo", + "valid": false + }, + { + "description": "a float is invalid", + "data": 1.1, + "valid": false + }, + { + "description": "an object is valid", + "data": {}, + "valid": true + }, + { + "description": "an array is valid", + "data": [], + "valid": true + }, + { + "description": "a boolean is invalid", + "data": true, + "valid": false + }, + { + "description": "null is invalid", + "data": null, + "valid": false + } + ] + }, + { + "description": + "when types includes a schema it should fully validate the schema", + "schema": { + "type": [ + "integer", + { + "properties": { + "foo": {"type": "null"} + } + } + ] + }, + "tests": [ + { + "description": "an integer is valid", + "data": 1, + "valid": true + }, + { + "description": "an object is valid only if it is fully valid", + "data": {"foo": null}, + "valid": true + }, + { + "description": "an object is invalid otherwise", + "data": {"foo": "bar"}, + "valid": false + } + ] + }, + { + "description": "types from separate schemas are merged", + "schema": { + "type": [ + {"type": ["string"]}, + {"type": ["array", "null"]} + ] + }, + "tests": [ + { + "description": "an integer is invalid", + "data": 1, + "valid": false + }, + { + "description": "a string is valid", + "data": "foo", + "valid": true + }, + { + "description": "an array is valid", + "data": [1, 2, 3], + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/uniqueItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/uniqueItems.json new file mode 100644 index 0000000000..c1f4ab99c9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft3/uniqueItems.json @@ -0,0 +1,79 @@ +[ + { + "description": "uniqueItems validation", + "schema": {"uniqueItems": true}, + "tests": [ + { + "description": "unique array of integers is valid", + "data": [1, 2], + "valid": true + }, + { + "description": "non-unique array of integers is invalid", + "data": [1, 1], + "valid": false + }, + { + "description": "numbers are unique if mathematically unequal", + "data": [1.0, 1.00, 1], + "valid": false + }, + { + "description": "unique array of objects is valid", + "data": [{"foo": "bar"}, {"foo": "baz"}], + "valid": true + }, + { + "description": "non-unique array of objects is invalid", + "data": [{"foo": "bar"}, {"foo": "bar"}], + "valid": false + }, + { + "description": "unique array of nested objects is valid", + "data": [ + {"foo": {"bar" : {"baz" : true}}}, + {"foo": {"bar" : {"baz" : false}}} + ], + "valid": true + }, + { + "description": "non-unique array of nested objects is invalid", + "data": [ + {"foo": {"bar" : {"baz" : true}}}, + {"foo": {"bar" : {"baz" : true}}} + ], + "valid": false + }, + { + "description": "unique array of arrays is valid", + "data": [["foo"], ["bar"]], + "valid": true + }, + { + "description": "non-unique array of arrays is invalid", + "data": [["foo"], ["foo"]], + "valid": false + }, + { + "description": "1 and true are unique", + "data": [1, true], + "valid": true + }, + { + "description": "0 and false are unique", + "data": [0, false], + "valid": true + }, + { + "description": "unique heterogeneous types are valid", + "data": [{}, [1], true, null, 1], + "valid": true + }, + { + "description": "non-unique heterogeneous types are invalid", + "data": [{}, [1], true, null, {}, 1], + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/.DS_Store b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/.DS_Store new file mode 100644 index 0000000000..ef142295ea Binary files /dev/null and b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/.DS_Store differ diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/additionalItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/additionalItems.json new file mode 100644 index 0000000000..521745c8d6 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/additionalItems.json @@ -0,0 +1,82 @@ +[ + { + "description": "additionalItems as schema", + "schema": { + "items": [{}], + "additionalItems": {"type": "integer"} + }, + "tests": [ + { + "description": "additional items match schema", + "data": [ null, 2, 3, 4 ], + "valid": true + }, + { + "description": "additional items do not match schema", + "data": [ null, 2, 3, "foo" ], + "valid": false + } + ] + }, + { + "description": "items is schema, no additionalItems", + "schema": { + "items": {}, + "additionalItems": false + }, + "tests": [ + { + "description": "all items match schema", + "data": [ 1, 2, 3, 4, 5 ], + "valid": true + } + ] + }, + { + "description": "array of items with no additionalItems", + "schema": { + "items": [{}, {}, {}], + "additionalItems": false + }, + "tests": [ + { + "description": "no additional items present", + "data": [ 1, 2, 3 ], + "valid": true + }, + { + "description": "additional items are not permitted", + "data": [ 1, 2, 3, 4 ], + "valid": false + } + ] + }, + { + "description": "additionalItems as false without items", + "schema": {"additionalItems": false}, + "tests": [ + { + "description": + "items defaults to empty schema so everything is valid", + "data": [ 1, 2, 3, 4, 5 ], + "valid": true + }, + { + "description": "ignores non-arrays", + "data": {"foo" : "bar"}, + "valid": true + } + ] + }, + { + "description": "additionalItems are allowed by default", + "schema": {"items": [{"type": "integer"}]}, + "tests": [ + { + "description": "only the first item is validated", + "data": [1, "foo", false], + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/additionalProperties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/additionalProperties.json new file mode 100644 index 0000000000..40831f9e9a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/additionalProperties.json @@ -0,0 +1,88 @@ +[ + { + "description": + "additionalProperties being false does not allow other properties", + "schema": { + "properties": {"foo": {}, "bar": {}}, + "patternProperties": { "^v": {} }, + "additionalProperties": false + }, + "tests": [ + { + "description": "no additional properties is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "an additional property is invalid", + "data": {"foo" : 1, "bar" : 2, "quux" : "boom"}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": [1, 2, 3], + "valid": true + }, + { + "description": "patternProperties are not additional properties", + "data": {"foo":1, "vroom": 2}, + "valid": true + } + ] + }, + { + "description": + "additionalProperties allows a schema which should validate", + "schema": { + "properties": {"foo": {}, "bar": {}}, + "additionalProperties": {"type": "boolean"} + }, + "tests": [ + { + "description": "no additional properties is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "an additional valid property is valid", + "data": {"foo" : 1, "bar" : 2, "quux" : true}, + "valid": true + }, + { + "description": "an additional invalid property is invalid", + "data": {"foo" : 1, "bar" : 2, "quux" : 12}, + "valid": false + } + ] + }, + { + "description": + "additionalProperties can exist by itself", + "schema": { + "additionalProperties": {"type": "boolean"} + }, + "tests": [ + { + "description": "an additional valid property is valid", + "data": {"foo" : true}, + "valid": true + }, + { + "description": "an additional invalid property is invalid", + "data": {"foo" : 1}, + "valid": false + } + ] + }, + { + "description": "additionalProperties are allowed by default", + "schema": {"properties": {"foo": {}, "bar": {}}}, + "tests": [ + { + "description": "additional properties are allowed", + "data": {"foo": 1, "bar": 2, "quux": true}, + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/allOf.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/allOf.json new file mode 100644 index 0000000000..bbb5f89e4b --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/allOf.json @@ -0,0 +1,112 @@ +[ + { + "description": "allOf", + "schema": { + "allOf": [ + { + "properties": { + "bar": {"type": "integer"} + }, + "required": ["bar"] + }, + { + "properties": { + "foo": {"type": "string"} + }, + "required": ["foo"] + } + ] + }, + "tests": [ + { + "description": "allOf", + "data": {"foo": "baz", "bar": 2}, + "valid": true + }, + { + "description": "mismatch second", + "data": {"foo": "baz"}, + "valid": false + }, + { + "description": "mismatch first", + "data": {"bar": 2}, + "valid": false + }, + { + "description": "wrong type", + "data": {"foo": "baz", "bar": "quux"}, + "valid": false + } + ] + }, + { + "description": "allOf with base schema", + "schema": { + "properties": {"bar": {"type": "integer"}}, + "required": ["bar"], + "allOf" : [ + { + "properties": { + "foo": {"type": "string"} + }, + "required": ["foo"] + }, + { + "properties": { + "baz": {"type": "null"} + }, + "required": ["baz"] + } + ] + }, + "tests": [ + { + "description": "valid", + "data": {"foo": "quux", "bar": 2, "baz": null}, + "valid": true + }, + { + "description": "mismatch base schema", + "data": {"foo": "quux", "baz": null}, + "valid": false + }, + { + "description": "mismatch first allOf", + "data": {"bar": 2, "baz": null}, + "valid": false + }, + { + "description": "mismatch second allOf", + "data": {"foo": "quux", "bar": 2}, + "valid": false + }, + { + "description": "mismatch both", + "data": {"bar": 2}, + "valid": false + } + ] + }, + { + "description": "allOf simple types", + "schema": { + "allOf": [ + {"maximum": 30}, + {"minimum": 20} + ] + }, + "tests": [ + { + "description": "valid", + "data": 25, + "valid": true + }, + { + "description": "mismatch one", + "data": 35, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/anyOf.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/anyOf.json new file mode 100644 index 0000000000..a58714afd8 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/anyOf.json @@ -0,0 +1,68 @@ +[ + { + "description": "anyOf", + "schema": { + "anyOf": [ + { + "type": "integer" + }, + { + "minimum": 2 + } + ] + }, + "tests": [ + { + "description": "first anyOf valid", + "data": 1, + "valid": true + }, + { + "description": "second anyOf valid", + "data": 2.5, + "valid": true + }, + { + "description": "both anyOf valid", + "data": 3, + "valid": true + }, + { + "description": "neither anyOf valid", + "data": 1.5, + "valid": false + } + ] + }, + { + "description": "anyOf with base schema", + "schema": { + "type": "string", + "anyOf" : [ + { + "maxLength": 2 + }, + { + "minLength": 4 + } + ] + }, + "tests": [ + { + "description": "mismatch base schema", + "data": 3, + "valid": false + }, + { + "description": "one anyOf valid", + "data": "foobar", + "valid": true + }, + { + "description": "both anyOf invalid", + "data": "foo", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/default.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/default.json new file mode 100644 index 0000000000..17629779fb --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/default.json @@ -0,0 +1,49 @@ +[ + { + "description": "invalid type for default", + "schema": { + "properties": { + "foo": { + "type": "integer", + "default": [] + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"foo": 13}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + }, + { + "description": "invalid string value for default", + "schema": { + "properties": { + "bar": { + "type": "string", + "minLength": 4, + "default": "bad" + } + } + }, + "tests": [ + { + "description": "valid when property is specified", + "data": {"bar": "good"}, + "valid": true + }, + { + "description": "still valid when the invalid default is used", + "data": {}, + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/definitions.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/definitions.json new file mode 100644 index 0000000000..cf935a3215 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/definitions.json @@ -0,0 +1,32 @@ +[ + { + "description": "valid definition", + "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, + "tests": [ + { + "description": "valid definition schema", + "data": { + "definitions": { + "foo": {"type": "integer"} + } + }, + "valid": true + } + ] + }, + { + "description": "invalid definition", + "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, + "tests": [ + { + "description": "invalid definition schema", + "data": { + "definitions": { + "foo": {"type": 1} + } + }, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/dependencies.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/dependencies.json new file mode 100644 index 0000000000..7b9b16a7e1 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/dependencies.json @@ -0,0 +1,113 @@ +[ + { + "description": "dependencies", + "schema": { + "dependencies": {"bar": ["foo"]} + }, + "tests": [ + { + "description": "neither", + "data": {}, + "valid": true + }, + { + "description": "nondependant", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "with dependency", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "missing dependency", + "data": {"bar": 2}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": "foo", + "valid": true + } + ] + }, + { + "description": "multiple dependencies", + "schema": { + "dependencies": {"quux": ["foo", "bar"]} + }, + "tests": [ + { + "description": "neither", + "data": {}, + "valid": true + }, + { + "description": "nondependants", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "with dependencies", + "data": {"foo": 1, "bar": 2, "quux": 3}, + "valid": true + }, + { + "description": "missing dependency", + "data": {"foo": 1, "quux": 2}, + "valid": false + }, + { + "description": "missing other dependency", + "data": {"bar": 1, "quux": 2}, + "valid": false + }, + { + "description": "missing both dependencies", + "data": {"quux": 1}, + "valid": false + } + ] + }, + { + "description": "multiple dependencies subschema", + "schema": { + "dependencies": { + "bar": { + "properties": { + "foo": {"type": "integer"}, + "bar": {"type": "integer"} + } + } + } + }, + "tests": [ + { + "description": "valid", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "no dependency", + "data": {"foo": "quux"}, + "valid": true + }, + { + "description": "wrong type", + "data": {"foo": "quux", "bar": 2}, + "valid": false + }, + { + "description": "wrong type other", + "data": {"foo": 2, "bar": "quux"}, + "valid": false + }, + { + "description": "wrong type both", + "data": {"foo": "quux", "bar": "quux"}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/enum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/enum.json new file mode 100644 index 0000000000..f124436a7d --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/enum.json @@ -0,0 +1,72 @@ +[ + { + "description": "simple enum validation", + "schema": {"enum": [1, 2, 3]}, + "tests": [ + { + "description": "one of the enum is valid", + "data": 1, + "valid": true + }, + { + "description": "something else is invalid", + "data": 4, + "valid": false + } + ] + }, + { + "description": "heterogeneous enum validation", + "schema": {"enum": [6, "foo", [], true, {"foo": 12}]}, + "tests": [ + { + "description": "one of the enum is valid", + "data": [], + "valid": true + }, + { + "description": "something else is invalid", + "data": null, + "valid": false + }, + { + "description": "objects are deep compared", + "data": {"foo": false}, + "valid": false + } + ] + }, + { + "description": "enums in properties", + "schema": { + "type":"object", + "properties": { + "foo": {"enum":["foo"]}, + "bar": {"enum":["bar"]} + }, + "required": ["bar"] + }, + "tests": [ + { + "description": "both properties are valid", + "data": {"foo":"foo", "bar":"bar"}, + "valid": true + }, + { + "description": "missing optional property is valid", + "data": {"bar":"bar"}, + "valid": true + }, + { + "description": "missing required property is invalid", + "data": {"foo":"foo"}, + "valid": false + }, + { + "description": "missing all properties is invalid", + "data": {}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/items.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/items.json new file mode 100644 index 0000000000..f5e18a1384 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/items.json @@ -0,0 +1,46 @@ +[ + { + "description": "a schema given for items", + "schema": { + "items": {"type": "integer"} + }, + "tests": [ + { + "description": "valid items", + "data": [ 1, 2, 3 ], + "valid": true + }, + { + "description": "wrong type of items", + "data": [1, "x"], + "valid": false + }, + { + "description": "ignores non-arrays", + "data": {"foo" : "bar"}, + "valid": true + } + ] + }, + { + "description": "an array of schemas for items", + "schema": { + "items": [ + {"type": "integer"}, + {"type": "string"} + ] + }, + "tests": [ + { + "description": "correct types", + "data": [ 1, "foo" ], + "valid": true + }, + { + "description": "wrong types", + "data": [ "foo", 1 ], + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxItems.json new file mode 100644 index 0000000000..3b53a6b371 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxItems.json @@ -0,0 +1,28 @@ +[ + { + "description": "maxItems validation", + "schema": {"maxItems": 2}, + "tests": [ + { + "description": "shorter is valid", + "data": [1], + "valid": true + }, + { + "description": "exact length is valid", + "data": [1, 2], + "valid": true + }, + { + "description": "too long is invalid", + "data": [1, 2, 3], + "valid": false + }, + { + "description": "ignores non-arrays", + "data": "foobar", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxLength.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxLength.json new file mode 100644 index 0000000000..811d35b253 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxLength.json @@ -0,0 +1,33 @@ +[ + { + "description": "maxLength validation", + "schema": {"maxLength": 2}, + "tests": [ + { + "description": "shorter is valid", + "data": "f", + "valid": true + }, + { + "description": "exact length is valid", + "data": "fo", + "valid": true + }, + { + "description": "too long is invalid", + "data": "foo", + "valid": false + }, + { + "description": "ignores non-strings", + "data": 100, + "valid": true + }, + { + "description": "two supplementary Unicode code points is long enough", + "data": "\uD83D\uDCA9\uD83D\uDCA9", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxProperties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxProperties.json new file mode 100644 index 0000000000..d282446ad6 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maxProperties.json @@ -0,0 +1,28 @@ +[ + { + "description": "maxProperties validation", + "schema": {"maxProperties": 2}, + "tests": [ + { + "description": "shorter is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "exact length is valid", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "too long is invalid", + "data": {"foo": 1, "bar": 2, "baz": 3}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": "foobar", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maximum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maximum.json new file mode 100644 index 0000000000..86c7b89c9a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/maximum.json @@ -0,0 +1,42 @@ +[ + { + "description": "maximum validation", + "schema": {"maximum": 3.0}, + "tests": [ + { + "description": "below the maximum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "above the maximum is invalid", + "data": 3.5, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "exclusiveMaximum validation", + "schema": { + "maximum": 3.0, + "exclusiveMaximum": true + }, + "tests": [ + { + "description": "below the maximum is still valid", + "data": 2.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 3.0, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minItems.json new file mode 100644 index 0000000000..ed5118815e --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minItems.json @@ -0,0 +1,28 @@ +[ + { + "description": "minItems validation", + "schema": {"minItems": 1}, + "tests": [ + { + "description": "longer is valid", + "data": [1, 2], + "valid": true + }, + { + "description": "exact length is valid", + "data": [1], + "valid": true + }, + { + "description": "too short is invalid", + "data": [], + "valid": false + }, + { + "description": "ignores non-arrays", + "data": "", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minLength.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minLength.json new file mode 100644 index 0000000000..3f09158dee --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minLength.json @@ -0,0 +1,33 @@ +[ + { + "description": "minLength validation", + "schema": {"minLength": 2}, + "tests": [ + { + "description": "longer is valid", + "data": "foo", + "valid": true + }, + { + "description": "exact length is valid", + "data": "fo", + "valid": true + }, + { + "description": "too short is invalid", + "data": "f", + "valid": false + }, + { + "description": "ignores non-strings", + "data": 1, + "valid": true + }, + { + "description": "one supplementary Unicode code point is not long enough", + "data": "\uD83D\uDCA9", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minProperties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minProperties.json new file mode 100644 index 0000000000..a72c7d293e --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minProperties.json @@ -0,0 +1,28 @@ +[ + { + "description": "minProperties validation", + "schema": {"minProperties": 1}, + "tests": [ + { + "description": "longer is valid", + "data": {"foo": 1, "bar": 2}, + "valid": true + }, + { + "description": "exact length is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "too short is invalid", + "data": {}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": "", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minimum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minimum.json new file mode 100644 index 0000000000..d5bf000bcc --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/minimum.json @@ -0,0 +1,42 @@ +[ + { + "description": "minimum validation", + "schema": {"minimum": 1.1}, + "tests": [ + { + "description": "above the minimum is valid", + "data": 2.6, + "valid": true + }, + { + "description": "below the minimum is invalid", + "data": 0.6, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "x", + "valid": true + } + ] + }, + { + "description": "exclusiveMinimum validation", + "schema": { + "minimum": 1.1, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "above the minimum is still valid", + "data": 1.2, + "valid": true + }, + { + "description": "boundary point is invalid", + "data": 1.1, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/multipleOf.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/multipleOf.json new file mode 100644 index 0000000000..ca3b761805 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/multipleOf.json @@ -0,0 +1,60 @@ +[ + { + "description": "by int", + "schema": {"multipleOf": 2}, + "tests": [ + { + "description": "int by int", + "data": 10, + "valid": true + }, + { + "description": "int by int fail", + "data": 7, + "valid": false + }, + { + "description": "ignores non-numbers", + "data": "foo", + "valid": true + } + ] + }, + { + "description": "by number", + "schema": {"multipleOf": 1.5}, + "tests": [ + { + "description": "zero is multiple of anything", + "data": 0, + "valid": true + }, + { + "description": "4.5 is multiple of 1.5", + "data": 4.5, + "valid": true + }, + { + "description": "35 is not multiple of 1.5", + "data": 35, + "valid": false + } + ] + }, + { + "description": "by small number", + "schema": {"multipleOf": 0.0001}, + "tests": [ + { + "description": "0.0075 is multiple of 0.0001", + "data": 0.0075, + "valid": true + }, + { + "description": "0.00751 is not multiple of 0.0001", + "data": 0.00751, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/not.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/not.json new file mode 100644 index 0000000000..cbb7f46bf8 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/not.json @@ -0,0 +1,96 @@ +[ + { + "description": "not", + "schema": { + "not": {"type": "integer"} + }, + "tests": [ + { + "description": "allowed", + "data": "foo", + "valid": true + }, + { + "description": "disallowed", + "data": 1, + "valid": false + } + ] + }, + { + "description": "not multiple types", + "schema": { + "not": {"type": ["integer", "boolean"]} + }, + "tests": [ + { + "description": "valid", + "data": "foo", + "valid": true + }, + { + "description": "mismatch", + "data": 1, + "valid": false + }, + { + "description": "other mismatch", + "data": true, + "valid": false + } + ] + }, + { + "description": "not more complex schema", + "schema": { + "not": { + "type": "object", + "properties": { + "foo": { + "type": "string" + } + } + } + }, + "tests": [ + { + "description": "match", + "data": 1, + "valid": true + }, + { + "description": "other match", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "mismatch", + "data": {"foo": "bar"}, + "valid": false + } + ] + }, + { + "description": "forbidden property", + "schema": { + "properties": { + "foo": { + "not": {} + } + } + }, + "tests": [ + { + "description": "property present", + "data": {"foo": 1, "bar": 2}, + "valid": false + }, + { + "description": "property absent", + "data": {"bar": 1, "baz": 2}, + "valid": true + } + ] + } + +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/oneOf.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/oneOf.json new file mode 100644 index 0000000000..1eaa4e4794 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/oneOf.json @@ -0,0 +1,68 @@ +[ + { + "description": "oneOf", + "schema": { + "oneOf": [ + { + "type": "integer" + }, + { + "minimum": 2 + } + ] + }, + "tests": [ + { + "description": "first oneOf valid", + "data": 1, + "valid": true + }, + { + "description": "second oneOf valid", + "data": 2.5, + "valid": true + }, + { + "description": "both oneOf valid", + "data": 3, + "valid": false + }, + { + "description": "neither oneOf valid", + "data": 1.5, + "valid": false + } + ] + }, + { + "description": "oneOf with base schema", + "schema": { + "type": "string", + "oneOf" : [ + { + "minLength": 2 + }, + { + "maxLength": 4 + } + ] + }, + "tests": [ + { + "description": "mismatch base schema", + "data": 3, + "valid": false + }, + { + "description": "one oneOf valid", + "data": "foobar", + "valid": true + }, + { + "description": "both oneOf valid", + "data": "foo", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/bignum.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/bignum.json new file mode 100644 index 0000000000..ccc7c17fe8 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/bignum.json @@ -0,0 +1,107 @@ +[ + { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a bignum is an integer", + "data": 12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a bignum is a number", + "data": 98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, + { + "description": "integer", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "a negative bignum is an integer", + "data": -12345678910111213141516171819202122232425262728293031, + "valid": true + } + ] + }, + { + "description": "number", + "schema": {"type": "number"}, + "tests": [ + { + "description": "a negative bignum is a number", + "data": -98249283749234923498293171823948729348710298301928331, + "valid": true + } + ] + }, + { + "description": "string", + "schema": {"type": "string"}, + "tests": [ + { + "description": "a bignum is not a string", + "data": 98249283749234923498293171823948729348710298301928331, + "valid": false + } + ] + }, + { + "description": "integer comparison", + "schema": {"maximum": 18446744073709551615}, + "tests": [ + { + "description": "comparison works for high numbers", + "data": 18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision", + "schema": { + "maximum": 972783798187987123879878123.18878137, + "exclusiveMaximum": true + }, + "tests": [ + { + "description": "comparison works for high numbers", + "data": 972783798187987123879878123.188781371, + "valid": false + } + ] + }, + { + "description": "integer comparison", + "schema": {"minimum": -18446744073709551615}, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -18446744073709551600, + "valid": true + } + ] + }, + { + "description": "float comparison with high precision on negative numbers", + "schema": { + "minimum": -972783798187987123879878123.18878137, + "exclusiveMinimum": true + }, + "tests": [ + { + "description": "comparison works for very negative numbers", + "data": -972783798187987123879878123.188781371, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/format.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/format.json new file mode 100644 index 0000000000..aacfd11984 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/format.json @@ -0,0 +1,148 @@ +[ + { + "description": "validation of date-time strings", + "schema": {"format": "date-time"}, + "tests": [ + { + "description": "a valid date-time string", + "data": "1963-06-19T08:30:06.283185Z", + "valid": true + }, + { + "description": "an invalid date-time string", + "data": "06/19/1963 08:30:06 PST", + "valid": false + }, + { + "description": "only RFC3339 not all of ISO 8601 are valid", + "data": "2013-350T01:01:01", + "valid": false + } + ] + }, + { + "description": "validation of URIs", + "schema": {"format": "uri"}, + "tests": [ + { + "description": "a valid URI", + "data": "http://foo.bar/?baz=qux#quux", + "valid": true + }, + { + "description": "a valid protocol-relative URI", + "data": "//foo.bar/?baz=qux#quux", + "valid": true + }, + { + "description": "an invalid URI", + "data": "\\\\WINDOWS\\fileshare", + "valid": false + }, + { + "description": "an invalid URI though valid URI reference", + "data": "abc", + "valid": false + } + ] + }, + { + "description": "validation of e-mail addresses", + "schema": {"format": "email"}, + "tests": [ + { + "description": "a valid e-mail address", + "data": "joe.bloggs@example.com", + "valid": true + }, + { + "description": "an invalid e-mail address", + "data": "2962", + "valid": false + } + ] + }, + { + "description": "validation of IP addresses", + "schema": {"format": "ipv4"}, + "tests": [ + { + "description": "a valid IP address", + "data": "192.168.0.1", + "valid": true + }, + { + "description": "an IP address with too many components", + "data": "127.0.0.0.1", + "valid": false + }, + { + "description": "an IP address with out-of-range values", + "data": "256.256.256.256", + "valid": false + }, + { + "description": "an IP address without 4 components", + "data": "127.0", + "valid": false + }, + { + "description": "an IP address as an integer", + "data": "0x7f000001", + "valid": false + } + ] + }, + { + "description": "validation of IPv6 addresses", + "schema": {"format": "ipv6"}, + "tests": [ + { + "description": "a valid IPv6 address", + "data": "::1", + "valid": true + }, + { + "description": "an IPv6 address with out-of-range values", + "data": "12345::", + "valid": false + }, + { + "description": "an IPv6 address with too many components", + "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1", + "valid": false + }, + { + "description": "an IPv6 address containing illegal characters", + "data": "::laptop", + "valid": false + } + ] + }, + { + "description": "validation of host names", + "schema": {"format": "hostname"}, + "tests": [ + { + "description": "a valid host name", + "data": "www.example.com", + "valid": true + }, + { + "description": "a host name starting with an illegal character", + "data": "-a-host-name-that-starts-with--", + "valid": false + }, + { + "description": "a host name containing illegal characters", + "data": "not_a_valid_host_name", + "valid": false + }, + { + "description": "a host name with a component too long", + "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component", + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json new file mode 100644 index 0000000000..9b50ea2776 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json @@ -0,0 +1,15 @@ +[ + { + "description": "some languages do not distinguish between different types of numeric value", + "schema": { + "type": "integer" + }, + "tests": [ + { + "description": "a float is not an integer even without fractional part", + "data": 1.0, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/pattern.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/pattern.json new file mode 100644 index 0000000000..25e7299731 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/pattern.json @@ -0,0 +1,34 @@ +[ + { + "description": "pattern validation", + "schema": {"pattern": "^a*$"}, + "tests": [ + { + "description": "a matching pattern is valid", + "data": "aaa", + "valid": true + }, + { + "description": "a non-matching pattern is invalid", + "data": "abc", + "valid": false + }, + { + "description": "ignores non-strings", + "data": true, + "valid": true + } + ] + }, + { + "description": "pattern is not anchored", + "schema": {"pattern": "a+"}, + "tests": [ + { + "description": "matches a substring", + "data": "xxaayy", + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/patternProperties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/patternProperties.json new file mode 100644 index 0000000000..18586e5dab --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/patternProperties.json @@ -0,0 +1,110 @@ +[ + { + "description": + "patternProperties validates properties matching a regex", + "schema": { + "patternProperties": { + "f.*o": {"type": "integer"} + } + }, + "tests": [ + { + "description": "a single valid match is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "multiple valid matches is valid", + "data": {"foo": 1, "foooooo" : 2}, + "valid": true + }, + { + "description": "a single invalid match is invalid", + "data": {"foo": "bar", "fooooo": 2}, + "valid": false + }, + { + "description": "multiple invalid matches is invalid", + "data": {"foo": "bar", "foooooo" : "baz"}, + "valid": false + }, + { + "description": "ignores non-objects", + "data": 12, + "valid": true + } + ] + }, + { + "description": "multiple simultaneous patternProperties are validated", + "schema": { + "patternProperties": { + "a*": {"type": "integer"}, + "aaa*": {"maximum": 20} + } + }, + "tests": [ + { + "description": "a single valid match is valid", + "data": {"a": 21}, + "valid": true + }, + { + "description": "a simultaneous match is valid", + "data": {"aaaa": 18}, + "valid": true + }, + { + "description": "multiple matches is valid", + "data": {"a": 21, "aaaa": 18}, + "valid": true + }, + { + "description": "an invalid due to one is invalid", + "data": {"a": "bar"}, + "valid": false + }, + { + "description": "an invalid due to the other is invalid", + "data": {"aaaa": 31}, + "valid": false + }, + { + "description": "an invalid due to both is invalid", + "data": {"aaa": "foo", "aaaa": 31}, + "valid": false + } + ] + }, + { + "description": "regexes are not anchored by default and are case sensitive", + "schema": { + "patternProperties": { + "[0-9]{2,}": { "type": "boolean" }, + "X_": { "type": "string" } + } + }, + "tests": [ + { + "description": "non recognized members are ignored", + "data": { "answer 1": "42" }, + "valid": true + }, + { + "description": "recognized members are accounted for", + "data": { "a31b": null }, + "valid": false + }, + { + "description": "regexes are case sensitive", + "data": { "a_x_3": 3 }, + "valid": true + }, + { + "description": "regexes are case sensitive, 2", + "data": { "a_X_3": 3 }, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/properties.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/properties.json new file mode 100644 index 0000000000..cd1644dcd9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/properties.json @@ -0,0 +1,92 @@ +[ + { + "description": "object properties validation", + "schema": { + "properties": { + "foo": {"type": "integer"}, + "bar": {"type": "string"} + } + }, + "tests": [ + { + "description": "both properties present and valid is valid", + "data": {"foo": 1, "bar": "baz"}, + "valid": true + }, + { + "description": "one property invalid is invalid", + "data": {"foo": 1, "bar": {}}, + "valid": false + }, + { + "description": "both properties invalid is invalid", + "data": {"foo": [], "bar": {}}, + "valid": false + }, + { + "description": "doesn't invalidate other properties", + "data": {"quux": []}, + "valid": true + }, + { + "description": "ignores non-objects", + "data": [], + "valid": true + } + ] + }, + { + "description": + "properties, patternProperties, additionalProperties interaction", + "schema": { + "properties": { + "foo": {"type": "array", "maxItems": 3}, + "bar": {"type": "array"} + }, + "patternProperties": {"f.o": {"minItems": 2}}, + "additionalProperties": {"type": "integer"} + }, + "tests": [ + { + "description": "property validates property", + "data": {"foo": [1, 2]}, + "valid": true + }, + { + "description": "property invalidates property", + "data": {"foo": [1, 2, 3, 4]}, + "valid": false + }, + { + "description": "patternProperty invalidates property", + "data": {"foo": []}, + "valid": false + }, + { + "description": "patternProperty validates nonproperty", + "data": {"fxo": [1, 2]}, + "valid": true + }, + { + "description": "patternProperty invalidates nonproperty", + "data": {"fxo": []}, + "valid": false + }, + { + "description": "additionalProperty ignores property", + "data": {"bar": []}, + "valid": true + }, + { + "description": "additionalProperty validates others", + "data": {"quux": 3}, + "valid": true + }, + { + "description": "additionalProperty invalidates others", + "data": {"quux": "foo"}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/ref.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/ref.json new file mode 100644 index 0000000000..7e80552249 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/ref.json @@ -0,0 +1,159 @@ +[ + { + "description": "root pointer ref", + "schema": { + "properties": { + "foo": {"$ref": "#"} + }, + "additionalProperties": false + }, + "tests": [ + { + "description": "match", + "data": {"foo": false}, + "valid": true + }, + { + "description": "recursive match", + "data": {"foo": {"foo": false}}, + "valid": true + }, + { + "description": "mismatch", + "data": {"bar": false}, + "valid": false + }, + { + "description": "recursive mismatch", + "data": {"foo": {"bar": false}}, + "valid": false + } + ] + }, + { + "description": "relative pointer ref to object", + "schema": { + "properties": { + "foo": {"type": "integer"}, + "bar": {"$ref": "#/properties/foo"} + } + }, + "tests": [ + { + "description": "match", + "data": {"bar": 3}, + "valid": true + }, + { + "description": "mismatch", + "data": {"bar": true}, + "valid": false + } + ] + }, + { + "description": "relative pointer ref to array", + "schema": { + "items": [ + {"type": "integer"}, + {"$ref": "#/items/0"} + ] + }, + "tests": [ + { + "description": "match array", + "data": [1, 2], + "valid": true + }, + { + "description": "mismatch array", + "data": [1, "foo"], + "valid": false + } + ] + }, + { + "description": "escaped pointer ref", + "schema": { + "tilda~field": {"type": "integer"}, + "slash/field": {"type": "integer"}, + "percent%field": {"type": "integer"}, + "properties": { + "tilda": {"$ref": "#/tilda~0field"}, + "slash": {"$ref": "#/slash~1field"}, + "percent": {"$ref": "#/percent%25field"} + } + }, + "tests": [ + { + "description": "slash invalid", + "data": {"slash": "aoeu"}, + "valid": false + }, + { + "description": "tilda invalid", + "data": {"tilda": "aoeu"}, + "valid": false + }, + { + "description": "percent invalid", + "data": {"percent": "aoeu"}, + "valid": false + }, + { + "description": "slash valid", + "data": {"slash": 123}, + "valid": true + }, + { + "description": "tilda valid", + "data": {"tilda": 123}, + "valid": true + }, + { + "description": "percent valid", + "data": {"percent": 123}, + "valid": true + } + ] + }, + { + "description": "nested refs", + "schema": { + "definitions": { + "a": {"type": "integer"}, + "b": {"$ref": "#/definitions/a"}, + "c": {"$ref": "#/definitions/b"} + }, + "$ref": "#/definitions/c" + }, + "tests": [ + { + "description": "nested ref valid", + "data": 5, + "valid": true + }, + { + "description": "nested ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "remote ref, containing refs itself", + "schema": {"$ref": "http://json-schema.org/draft-04/schema#"}, + "tests": [ + { + "description": "remote ref valid", + "data": {"minLength": 1}, + "valid": true + }, + { + "description": "remote ref invalid", + "data": {"minLength": -1}, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/refRemote.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/refRemote.json new file mode 100644 index 0000000000..4ca804732c --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/refRemote.json @@ -0,0 +1,74 @@ +[ + { + "description": "remote ref", + "schema": {"$ref": "http://localhost:1234/integer.json"}, + "tests": [ + { + "description": "remote ref valid", + "data": 1, + "valid": true + }, + { + "description": "remote ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "fragment within remote ref", + "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"}, + "tests": [ + { + "description": "remote fragment valid", + "data": 1, + "valid": true + }, + { + "description": "remote fragment invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "ref within remote ref", + "schema": { + "$ref": "http://localhost:1234/subSchemas.json#/refToInteger" + }, + "tests": [ + { + "description": "ref within ref valid", + "data": 1, + "valid": true + }, + { + "description": "ref within ref invalid", + "data": "a", + "valid": false + } + ] + }, + { + "description": "change resolution scope", + "schema": { + "id": "http://localhost:1234/", + "items": { + "id": "folder/", + "items": {"$ref": "folderInteger.json"} + } + }, + "tests": [ + { + "description": "changed scope ref valid", + "data": [[1]], + "valid": true + }, + { + "description": "changed scope ref invalid", + "data": [["a"]], + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/required.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/required.json new file mode 100644 index 0000000000..612f73f347 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/required.json @@ -0,0 +1,39 @@ +[ + { + "description": "required validation", + "schema": { + "properties": { + "foo": {}, + "bar": {} + }, + "required": ["foo"] + }, + "tests": [ + { + "description": "present required property is valid", + "data": {"foo": 1}, + "valid": true + }, + { + "description": "non-present required property is invalid", + "data": {"bar": 1}, + "valid": false + } + ] + }, + { + "description": "required default validation", + "schema": { + "properties": { + "foo": {} + } + }, + "tests": [ + { + "description": "not required by default", + "data": {}, + "valid": true + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/type.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/type.json new file mode 100644 index 0000000000..db42a44d3f --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/type.json @@ -0,0 +1,330 @@ +[ + { + "description": "integer type matches integers", + "schema": {"type": "integer"}, + "tests": [ + { + "description": "an integer is an integer", + "data": 1, + "valid": true + }, + { + "description": "a float is not an integer", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not an integer", + "data": "foo", + "valid": false + }, + { + "description": "an object is not an integer", + "data": {}, + "valid": false + }, + { + "description": "an array is not an integer", + "data": [], + "valid": false + }, + { + "description": "a boolean is not an integer", + "data": true, + "valid": false + }, + { + "description": "null is not an integer", + "data": null, + "valid": false + } + ] + }, + { + "description": "number type matches numbers", + "schema": {"type": "number"}, + "tests": [ + { + "description": "an integer is a number", + "data": 1, + "valid": true + }, + { + "description": "a float is a number", + "data": 1.1, + "valid": true + }, + { + "description": "a string is not a number", + "data": "foo", + "valid": false + }, + { + "description": "an object is not a number", + "data": {}, + "valid": false + }, + { + "description": "an array is not a number", + "data": [], + "valid": false + }, + { + "description": "a boolean is not a number", + "data": true, + "valid": false + }, + { + "description": "null is not a number", + "data": null, + "valid": false + } + ] + }, + { + "description": "string type matches strings", + "schema": {"type": "string"}, + "tests": [ + { + "description": "1 is not a string", + "data": 1, + "valid": false + }, + { + "description": "a float is not a string", + "data": 1.1, + "valid": false + }, + { + "description": "a string is a string", + "data": "foo", + "valid": true + }, + { + "description": "an object is not a string", + "data": {}, + "valid": false + }, + { + "description": "an array is not a string", + "data": [], + "valid": false + }, + { + "description": "a boolean is not a string", + "data": true, + "valid": false + }, + { + "description": "null is not a string", + "data": null, + "valid": false + } + ] + }, + { + "description": "object type matches objects", + "schema": {"type": "object"}, + "tests": [ + { + "description": "an integer is not an object", + "data": 1, + "valid": false + }, + { + "description": "a float is not an object", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not an object", + "data": "foo", + "valid": false + }, + { + "description": "an object is an object", + "data": {}, + "valid": true + }, + { + "description": "an array is not an object", + "data": [], + "valid": false + }, + { + "description": "a boolean is not an object", + "data": true, + "valid": false + }, + { + "description": "null is not an object", + "data": null, + "valid": false + } + ] + }, + { + "description": "array type matches arrays", + "schema": {"type": "array"}, + "tests": [ + { + "description": "an integer is not an array", + "data": 1, + "valid": false + }, + { + "description": "a float is not an array", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not an array", + "data": "foo", + "valid": false + }, + { + "description": "an object is not an array", + "data": {}, + "valid": false + }, + { + "description": "an array is an array", + "data": [], + "valid": true + }, + { + "description": "a boolean is not an array", + "data": true, + "valid": false + }, + { + "description": "null is not an array", + "data": null, + "valid": false + } + ] + }, + { + "description": "boolean type matches booleans", + "schema": {"type": "boolean"}, + "tests": [ + { + "description": "an integer is not a boolean", + "data": 1, + "valid": false + }, + { + "description": "a float is not a boolean", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not a boolean", + "data": "foo", + "valid": false + }, + { + "description": "an object is not a boolean", + "data": {}, + "valid": false + }, + { + "description": "an array is not a boolean", + "data": [], + "valid": false + }, + { + "description": "a boolean is a boolean", + "data": true, + "valid": true + }, + { + "description": "null is not a boolean", + "data": null, + "valid": false + } + ] + }, + { + "description": "null type matches only the null object", + "schema": {"type": "null"}, + "tests": [ + { + "description": "an integer is not null", + "data": 1, + "valid": false + }, + { + "description": "a float is not null", + "data": 1.1, + "valid": false + }, + { + "description": "a string is not null", + "data": "foo", + "valid": false + }, + { + "description": "an object is not null", + "data": {}, + "valid": false + }, + { + "description": "an array is not null", + "data": [], + "valid": false + }, + { + "description": "a boolean is not null", + "data": true, + "valid": false + }, + { + "description": "null is null", + "data": null, + "valid": true + } + ] + }, + { + "description": "multiple types can be specified in an array", + "schema": {"type": ["integer", "string"]}, + "tests": [ + { + "description": "an integer is valid", + "data": 1, + "valid": true + }, + { + "description": "a string is valid", + "data": "foo", + "valid": true + }, + { + "description": "a float is invalid", + "data": 1.1, + "valid": false + }, + { + "description": "an object is invalid", + "data": {}, + "valid": false + }, + { + "description": "an array is invalid", + "data": [], + "valid": false + }, + { + "description": "a boolean is invalid", + "data": true, + "valid": false + }, + { + "description": "null is invalid", + "data": null, + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/uniqueItems.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/uniqueItems.json new file mode 100644 index 0000000000..c1f4ab99c9 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tests/draft4/uniqueItems.json @@ -0,0 +1,79 @@ +[ + { + "description": "uniqueItems validation", + "schema": {"uniqueItems": true}, + "tests": [ + { + "description": "unique array of integers is valid", + "data": [1, 2], + "valid": true + }, + { + "description": "non-unique array of integers is invalid", + "data": [1, 1], + "valid": false + }, + { + "description": "numbers are unique if mathematically unequal", + "data": [1.0, 1.00, 1], + "valid": false + }, + { + "description": "unique array of objects is valid", + "data": [{"foo": "bar"}, {"foo": "baz"}], + "valid": true + }, + { + "description": "non-unique array of objects is invalid", + "data": [{"foo": "bar"}, {"foo": "bar"}], + "valid": false + }, + { + "description": "unique array of nested objects is valid", + "data": [ + {"foo": {"bar" : {"baz" : true}}}, + {"foo": {"bar" : {"baz" : false}}} + ], + "valid": true + }, + { + "description": "non-unique array of nested objects is invalid", + "data": [ + {"foo": {"bar" : {"baz" : true}}}, + {"foo": {"bar" : {"baz" : true}}} + ], + "valid": false + }, + { + "description": "unique array of arrays is valid", + "data": [["foo"], ["bar"]], + "valid": true + }, + { + "description": "non-unique array of arrays is invalid", + "data": [["foo"], ["foo"]], + "valid": false + }, + { + "description": "1 and true are unique", + "data": [1, true], + "valid": true + }, + { + "description": "0 and false are unique", + "data": [0, false], + "valid": true + }, + { + "description": "unique heterogeneous types are valid", + "data": [{}, [1], true, null, 1], + "valid": true + }, + { + "description": "non-unique heterogeneous types are invalid", + "data": [{}, [1], true, null, {}, 1], + "valid": false + } + ] + } +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tox.ini b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tox.ini new file mode 100644 index 0000000000..5301222a84 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/jsonschema/tox.ini @@ -0,0 +1,8 @@ +[tox] +minversion = 1.6 +envlist = py27 +skipsdist = True + +[testenv] +deps = jsonschema +commands = {envpython} bin/jsonschema_suite check diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/booleans.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/booleans.json new file mode 100755 index 0000000000..2dcbb5fe87 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/booleans.json @@ -0,0 +1,102 @@ +[ + true, + true, + false, + false, + true, + true, + true, + false, + false, + true, + false, + false, + true, + false, + false, + false, + true, + false, + false, + true, + true, + false, + true, + true, + true, + false, + false, + false, + true, + false, + true, + false, + false, + true, + true, + true, + true, + true, + true, + false, + false, + true, + false, + false, + false, + true, + true, + false, + true, + true, + false, + true, + false, + true, + true, + true, + false, + false, + false, + true, + false, + false, + false, + true, + true, + false, + true, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + false, + false, + true, + true, + true, + true, + true, + true, + true, + false, + false, + false, + true, + false, + false, + false, + true, + true, + true, + false, + false, + true, + false +] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/floats.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/floats.json new file mode 100755 index 0000000000..12b94a11dc --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/floats.json @@ -0,0 +1,102 @@ +[ + 135.747111636, + 123.377054008, + 140.527504552, + -72.299143906, + -23.851678949, + 73.586193519, + -158.299382442, + 177.477876032, + 32.268518982, + -139.560009969, + 115.203105183, + -106.025823607, + 167.224138231, + 103.378383732, + -97.498486285, + 18.184723416, + 69.137075711, + 33.849002681, + -120.185228215, + -20.841408615, + -172.659492727, + -2.691464061, + 22.426164066, + -98.416909437, + -31.603082708, + -85.072296561, + 108.620987395, + -43.127078238, + -126.473562057, + -158.595489097, + -57.890678254, + -13.254016573, + -85.024504709, + 171.663552644, + -146.495558248, + -10.606748276, + -118.786969354, + 153.352057804, + -45.215545083, + 37.038725288, + 106.344071897, + -64.607402031, + 85.148030911, + 28.897784566, + 39.51082061, + 20.450382102, + -113.174943618, + 71.60785784, + -168.202648062, + -157.338200017, + 10.879588527, + -114.261694831, + -5.622927072, + -173.330830616, + -29.47002003, + -39.829034201, + 50.031545162, + 82.815735508, + -119.188760828, + -48.455928081, + 163.964263034, + 46.30378861, + -26.248889762, + -47.354615322, + 155.388677633, + -166.710356904, + 42.987233558, + 144.275297374, + 37.394383186, + -122.550388725, + 177.469945914, + 101.104677413, + 109.429869885, + -104.919625624, + 147.522756541, + -81.294703727, + 122.744731363, + 81.803603684, + 26.321556167, + 147.045441354, + 147.256895816, + -174.211095908, + 52.518769316, + -78.58250334, + -173.356685435, + -107.728209264, + -69.982325771, + -113.776095893, + -35.785267074, + -105.748545976, + -30.206523864, + -76.185311723, + -126.400112781, + -26.864958639, + 56.840053629, + 93.781553535, + -116.002949803, + -46.617140948, + 176.846840093, + -144.24821335 +] diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/guids.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/guids.json new file mode 100755 index 0000000000..9d7f5dbc8f --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/guids.json @@ -0,0 +1,102 @@ +[ + "d35bf0d4-8d8f-4e17-a5c3-ad9bfd675266", + "db402774-eeb6-463b-9986-c458c44d8b5a", + "2a2e4101-b5f2-40b8-8750-e03f01661e60", + "76787cfa-f4eb-4d62-aaad-e1d588d00ad5", + "fd73894b-b500-4a7c-888c-06b5bd9cec65", + "cce1862a-cf31-4ef2-9e23-f1d23b4e6163", + "00a98bb0-2b6e-4368-8512-71c21aa87db7", + "ab9a8d69-cec7-4550-bd35-3ed678e22782", + "f18b48e1-5114-4fbe-9652-579e8d66950e", + "4efe3baa-7ac5-4d6a-a839-6b9cfe825764", + "b4aec119-5b0a-434c-b388-109816c482a5", + "e0ef0cbb-127a-4a28-9831-5741b4295275", + "d50286a5-cb7b-4c9e-be99-f214439bae8c", + "a981094c-f1ac-42ed-a9fa-86404c7210ff", + "2a34ee57-5815-4829-b77b-eeebaa8fe340", + "a0530d44-48f8-4eff-b9ea-8810c4308351", + "c6f91509-83e1-4ea1-9680-e667fbfd56ee", + "cab11402-dcdd-4454-b190-6da124947395", + "283d159c-2b18-4856-b4c7-5059252eaa15", + "146157c6-72a8-4051-9991-cb6ea6743d81", + "aef6f269-7306-4bd2-83f7-6d5605b5dc9a", + "37fe6027-d638-4017-80a9-e7b0567b278e", + "5003d731-33fb-4159-af61-d76348a44079", + "e0e06979-5f80-4713-9fe0-8a4d60dc89f8", + "7e85bdc3-0345-4cb6-9398-ccab06e79976", + "f2ebf5af-6568-4ffe-a46d-403863fd4b66", + "e0b5bb1c-b4dd-4535-9a9e-3c73f1167d46", + "c852d20b-6bcb-4b12-bd57-308296c64c5a", + "7ac3ae82-1818-49cd-a8a4-5ac77dfafd46", + "138004a9-76e2-4ad7-bd42-e74dabdbb803", + "ab25b5be-96be-45b0-b765-947b40ec36a6", + "08404734-fd57-499e-a4cf-71e9ec782ede", + "8dfdeb16-248b-4a21-bf89-2e22b11a4101", + "a0e44ef0-3b09-41e8-ad5d-ed8e6a1a2a67", + "a7981e49-188d-414a-9779-b1ad91e599d1", + "329186c0-bf27-4208-baf7-c0a0a5a2d5b7", + "cb5f3381-d33e-4b30-b1a9-f482623cad33", + "15031262-ca73-4e3c-bd0a-fcf89bdf0caf", + "6d7333d1-2e8c-4d78-bfde-5be47e70eb13", + "acaa160c-670a-4e8f-ac45-49416e77d5f9", + "228f87eb-cde4-4106-808b-2dbf3c7b6d2e", + "2ff830a3-5445-4d8e-b161-bddd30666697", + "f488bedd-ff6e-4108-b9a7-07f6da62f476", + "2e12b846-0a34-478e-adf7-a438493803e6", + "6686b8ef-7446-4d86-bd8c-df24119e3bfe", + "e474a5c5-5793-4d41-b4ab-5423acc56ef1", + "ac046573-e718-44dc-a0dc-9037eeaba6a9", + "6b0e9099-cf53-4d5a-8a71-977528628fcf", + "d51a3f22-0ff9-4087-ba9b-fcee2a2d8ade", + "bdc01286-3511-4d22-bfb8-76d01203d366", + "ca44eb84-17ff-4f27-8f1e-1bd25f4e8725", + "4e9a8c2f-be0b-4913-92d2-c801b9a50d04", + "7685d231-dadd-4041-9165-898397438ab7", + "86f0bf26-d66a-44d8-99f5-d6768addae3b", + "2ca1167c-72ba-45a0-aa42-faf033db0d0b", + "199a1182-ea55-49ff-ba51-71c29cdd0aac", + "be6a4dd2-c821-4aa0-8b83-d64d6644b5b2", + "4c5f4781-7f80-4daa-9c20-76b183000514", + "513b31bd-54fb-4d12-a427-42a7c13ff8e1", + "8e211bcb-d76c-4012-83ad-74dd7d23b687", + "44d5807e-0501-4f66-8779-e244d4fdca0a", + "db8cd555-0563-4b7b-b00c-eada300a7065", + "cb14d0c9-46cc-4797-bd3a-752b05629f07", + "4f68b3ef-ac9b-47a0-b6d7-57f398a5c6a5", + "77221aae-1bcf-471c-be45-7f31f733f9d6", + "42a7cac8-9e80-4c45-8c71-511d863c98ea", + "f9018d22-b82c-468c-bdb5-8864d5964801", + "75f4e9b8-62a2-4f21-ad8a-e19eff0419bc", + "9b7385c8-8653-4184-951c-b0ac1b36b42e", + "571018aa-ffbf-4b42-a16d-07b57a7f5f0e", + "35de4a2f-6bf1-45aa-b820-2a27ea833e44", + "0b8edb20-3bb4-4cb4-b089-31957466dbab", + "97da4778-9a7b-4140-a545-968148c81fb7", + "969f326c-8f2a-47c5-b41c-d9c2f06c9b9d", + "ae211037-8b53-4b17-bfc8-c06fc7774409", + "12c5c3c4-0bd5-45d3-bc1d-d04a3c65d3e6", + "ec02024f-ce43-4dd3-8169-a59f7baee043", + "5b6afe77-ce48-47ca-90a0-25cd10ca5ffd", + "2e3a61d4-6b8f-4d2f-ba86-878b4012efd8", + "19a88a67-a5d3-4647-898f-1cde07bce040", + "6db6f420-b5c8-48b9-bbb2-8864fe6fed65", + "5a45dbde-7b53-4f6b-b864-e3b63be3708a", + "c878321b-8a02-4239-9981-15760c2e7d15", + "4e36687f-8bf6-4b12-b496-3a8e382d067e", + "a59a63cd-43c0-4c6e-b208-6dbca86f8176", + "303308c4-2e4a-45b5-8bf3-3e66e9ad05a1", + "8b58fdf1-43a6-4c98-9547-6361b50791af", + "a3563591-72ed-42b5-8e41-bac1d76d70cf", + "38db8c78-3739-4f6e-8313-de4138082114", + "86615bea-7e73-4daf-95da-ae6b9eee1bbb", + "35d38e3e-076e-40dd-9aa8-05be2603bd59", + "9f84c62d-b454-4ba3-8c19-a01878985cdc", + "6721bbae-d765-4a06-8289-6fe46a1bf943", + "0837796f-d0dd-4e50-9b7c-1983e6cc7c48", + "021eb7d7-e869-49b9-80c3-9dd16ce2d981", + "819c56f8-e040-475d-aad5-c6d5e98b20aa", + "3a61ef02-735e-4229-937d-b3777a3f4e1f", + "79dfab84-12e6-4ec8-bfc8-460ae71e4eca", + "a106fabf-e149-476c-8053-b62388b6eb57", + "9a3900a5-bfb4-4de0-baa5-253a8bd0b634" +] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/integers.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/integers.json new file mode 100755 index 0000000000..5dd05e097a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/integers.json @@ -0,0 +1,102 @@ +[ + 8125686, + 8958709, + 5976222, + 1889524, + 7968493, + 1357486, + 118415, + 7081097, + 4635968, + 7555332, + 2270233, + 3428352, + 8699968, + 2087333, + 7861337, + 7554440, + 2017031, + 7981692, + 6060687, + 1877715, + 3297474, + 8373177, + 6158629, + 7853641, + 3004441, + 9650406, + 2695251, + 1180761, + 4988426, + 6043805, + 8063373, + 6103218, + 2848339, + 8188690, + 9235573, + 5949816, + 6116081, + 6471138, + 3354531, + 4787414, + 9660600, + 942529, + 7278535, + 7967399, + 554292, + 1436493, + 267319, + 2606657, + 7900601, + 4276634, + 7996757, + 8544466, + 7266469, + 3301373, + 4005350, + 6437652, + 7717672, + 7126292, + 8588394, + 2127902, + 7410190, + 1517806, + 4583602, + 3123440, + 7747613, + 5029464, + 9834390, + 3087227, + 4913822, + 7550487, + 4518144, + 5862588, + 1778599, + 9493290, + 5588455, + 3638706, + 7394293, + 4294719, + 3837830, + 6381878, + 7175866, + 8575492, + 1415229, + 1453733, + 6972404, + 9782571, + 4234063, + 7117418, + 7293130, + 8057071, + 9345285, + 7626648, + 3358911, + 4574537, + 9371826, + 7627107, + 6154093, + 5392367, + 5398105, + 6956377 +] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/mixed.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/mixed.json new file mode 100755 index 0000000000..43e9a1d7be --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/mixed.json @@ -0,0 +1,592 @@ +[ + { + "favoriteFruit": "banana", + "greeting": "Hello, Kim! You have 10 unread messages.", + "friends": [ + { + "name": "Higgins Rodriquez", + "id": 0 + }, + { + "name": "James Floyd", + "id": 1 + }, + { + "name": "Gay Stewart", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "pariatur", + "ad", + "eiusmod", + "sit", + "et", + "velit", + "culpa" + ], + "longitude": -57.919246, + "latitude": -36.022812, + "registered": "Friday, March 21, 2014 9:13 PM", + "about": "Laborum nulla aliquip ullamco proident excepteur est officia ipsum. Eiusmod exercitation minim ex do labore reprehenderit aliqua minim qui excepteur reprehenderit cupidatat. Sint enim exercitation duis id consequat nisi enim magna. Commodo aliqua id ipsum sit magna enim. Veniam officia in labore fugiat veniam ea laboris ex veniam duis.\r\n", + "address": "323 Pulaski Street, Ronco, North Carolina, 7701", + "phone": "+1 (919) 438-2678", + "email": "kim.griffith@cipromox.biz", + "company": "CIPROMOX", + "name": { + "last": "Griffith", + "first": "Kim" + }, + "eyeColor": "green", + "age": 26, + "picture": "http://placehold.it/32x32", + "balance": "$1,283.55", + "isActive": false, + "guid": "10ab0392-c5e2-48a3-9473-aa725bad892d", + "index": 0, + "_id": "551b91198238a0bcf9a41133" + }, + { + "favoriteFruit": "banana", + "greeting": "Hello, Skinner! You have 9 unread messages.", + "friends": [ + { + "name": "Rhonda Justice", + "id": 0 + }, + { + "name": "Audra Castaneda", + "id": 1 + }, + { + "name": "Vicky Chavez", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "dolore", + "enim", + "sit", + "non", + "exercitation", + "fugiat", + "adipisicing" + ], + "longitude": -60.291407, + "latitude": -84.619318, + "registered": "Friday, February 7, 2014 3:17 AM", + "about": "Consectetur eiusmod laboris dolore est ullamco nulla in velit quis esse Lorem. Amet aliqua sunt aute occaecat veniam officia in duis proident aliqua cupidatat mollit. Sint eu qui anim duis ut anim duis eu cillum. Cillum nostrud adipisicing tempor Lorem commodo sit in ad qui non et irure qui. Labore eu aliquip id duis eiusmod veniam.\r\n", + "address": "347 Autumn Avenue, Fidelis, Puerto Rico, 543", + "phone": "+1 (889) 457-2319", + "email": "skinner.maddox@moltonic.co.uk", + "company": "MOLTONIC", + "name": { + "last": "Maddox", + "first": "Skinner" + }, + "eyeColor": "green", + "age": 22, + "picture": "http://placehold.it/32x32", + "balance": "$3,553.10", + "isActive": false, + "guid": "cfbc2fb6-2641-4388-b06d-ec0212cfac1e", + "index": 1, + "_id": "551b91197e0abe92d6642700" + }, + { + "favoriteFruit": "strawberry", + "greeting": "Hello, Reynolds! You have 5 unread messages.", + "friends": [ + { + "name": "Brady Valdez", + "id": 0 + }, + { + "name": "Boyer Golden", + "id": 1 + }, + { + "name": "Gladys Knapp", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "commodo", + "eiusmod", + "cupidatat", + "et", + "occaecat", + "proident", + "Lorem" + ], + "longitude": 140.866287, + "latitude": 1.401032, + "registered": "Monday, October 20, 2014 8:01 AM", + "about": "Deserunt elit consequat ea dolor pariatur aute consectetur et nulla ipsum ad. Laboris occaecat ipsum ad duis et esse ea ut voluptate. Ex magna consequat pariatur amet. Quis excepteur non mollit dolore cillum dolor ex esse veniam esse deserunt non occaecat veniam. Sit amet proident proident amet. Nisi est id ut ut adipisicing esse fugiat non dolor aute.\r\n", + "address": "872 Montague Terrace, Haena, Montana, 3106", + "phone": "+1 (974) 410-2655", + "email": "reynolds.sanford@combot.biz", + "company": "COMBOT", + "name": { + "last": "Sanford", + "first": "Reynolds" + }, + "eyeColor": "green", + "age": 21, + "picture": "http://placehold.it/32x32", + "balance": "$3,664.47", + "isActive": true, + "guid": "f9933a9c-c41a-412f-a18d-e727c569870b", + "index": 2, + "_id": "551b91197f170b65413a06e3" + }, + { + "favoriteFruit": "banana", + "greeting": "Hello, Neva! You have 7 unread messages.", + "friends": [ + { + "name": "Clara Cotton", + "id": 0 + }, + { + "name": "Ray Gates", + "id": 1 + }, + { + "name": "Jacobs Reese", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "magna", + "labore", + "incididunt", + "velit", + "ea", + "et", + "eiusmod" + ], + "longitude": -133.058479, + "latitude": 87.803677, + "registered": "Friday, May 9, 2014 5:41 PM", + "about": "Do duis occaecat ut officia occaecat officia nostrud reprehenderit ex excepteur aute anim in reprehenderit. Cupidatat nulla eiusmod nulla non minim veniam aute nulla deserunt adipisicing consectetur veniam. Sit consequat ex laboris aliqua labore consectetur tempor proident consequat est. Fugiat quis esse culpa aliquip. Excepteur laborum aliquip sunt eu cupidatat magna eiusmod amet nisi labore aliquip. Ut consectetur esse aliquip exercitation nulla ex occaecat elit do ex eiusmod deserunt. Ex eu voluptate minim deserunt fugiat minim est occaecat ad Lorem nisi.\r\n", + "address": "480 Eagle Street, Fostoria, Oklahoma, 2614", + "phone": "+1 (983) 439-3000", + "email": "neva.barker@pushcart.us", + "company": "PUSHCART", + "name": { + "last": "Barker", + "first": "Neva" + }, + "eyeColor": "brown", + "age": 36, + "picture": "http://placehold.it/32x32", + "balance": "$3,182.24", + "isActive": true, + "guid": "52489849-78e1-4b27-8b86-e3e5ab2b7dc8", + "index": 3, + "_id": "551b9119a13061c083c878d5" + }, + { + "favoriteFruit": "banana", + "greeting": "Hello, Rodgers! You have 6 unread messages.", + "friends": [ + { + "name": "Marguerite Conway", + "id": 0 + }, + { + "name": "Margarita Cunningham", + "id": 1 + }, + { + "name": "Carmela Gallagher", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "ipsum", + "magna", + "amet", + "elit", + "sit", + "occaecat", + "elit" + ], + "longitude": -125.436981, + "latitude": 19.868524, + "registered": "Tuesday, July 8, 2014 8:09 PM", + "about": "In cillum esse tempor do magna id ad excepteur ex nostrud mollit deserunt aliqua. Minim aliqua commodo commodo consectetur exercitation nulla nisi dolore aliqua in. Incididunt deserunt mollit nostrud excepteur. Ipsum fugiat anim deserunt Lorem aliquip nisi consequat eu minim in ex duis.\r\n", + "address": "989 Varanda Place, Duryea, Palau, 3972", + "phone": "+1 (968) 578-2974", + "email": "rodgers.conner@frenex.net", + "company": "FRENEX", + "name": { + "last": "Conner", + "first": "Rodgers" + }, + "eyeColor": "blue", + "age": 23, + "picture": "http://placehold.it/32x32", + "balance": "$1,665.17", + "isActive": true, + "guid": "ed3b2374-5afe-4fca-9325-8a7bbc9f81a0", + "index": 4, + "_id": "551b91197bcedb1b56a241ce" + }, + { + "favoriteFruit": "strawberry", + "greeting": "Hello, Mari! You have 10 unread messages.", + "friends": [ + { + "name": "Irwin Boyd", + "id": 0 + }, + { + "name": "Dejesus Flores", + "id": 1 + }, + { + "name": "Lane Mcmahon", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "esse", + "aliquip", + "excepteur", + "dolor", + "ex", + "commodo", + "anim" + ], + "longitude": -17.038176, + "latitude": 17.154663, + "registered": "Sunday, April 6, 2014 4:46 AM", + "about": "Excepteur veniam occaecat sint nulla magna in in officia elit. Eiusmod qui dolor fugiat tempor in minim esse officia minim consequat. Lorem ullamco labore proident ipsum id pariatur fugiat consectetur anim cupidatat qui proident non ipsum.\r\n", + "address": "563 Hendrickson Street, Westwood, South Dakota, 4959", + "phone": "+1 (980) 434-3976", + "email": "mari.fleming@beadzza.org", + "company": "BEADZZA", + "name": { + "last": "Fleming", + "first": "Mari" + }, + "eyeColor": "blue", + "age": 21, + "picture": "http://placehold.it/32x32", + "balance": "$1,948.04", + "isActive": true, + "guid": "6bd02166-3b1f-4ed8-84c9-ed96cbf12abc", + "index": 5, + "_id": "551b9119b359ff6d24846f77" + }, + { + "favoriteFruit": "strawberry", + "greeting": "Hello, Maxine! You have 7 unread messages.", + "friends": [ + { + "name": "Sullivan Stark", + "id": 0 + }, + { + "name": "Underwood Mclaughlin", + "id": 1 + }, + { + "name": "Kristy Carlson", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "commodo", + "ipsum", + "quis", + "non", + "est", + "mollit", + "exercitation" + ], + "longitude": -105.40635, + "latitude": 37.197993, + "registered": "Tuesday, January 20, 2015 12:30 AM", + "about": "Proident ullamco Lorem est consequat consectetur non eiusmod esse nostrud pariatur eiusmod enim exercitation eiusmod. Consequat duis elit elit minim ullamco et dolor eu minim do tempor esse consequat excepteur. Mollit dolor do voluptate nostrud quis anim cillum velit tempor eiusmod adipisicing tempor do culpa. Eu magna dolor sit amet nisi do laborum dolore nisi. Deserunt ipsum et deserunt non nisi.\r\n", + "address": "252 Boulevard Court, Brenton, Tennessee, 9444", + "phone": "+1 (950) 466-3377", + "email": "maxine.moreno@zentia.tv", + "company": "ZENTIA", + "name": { + "last": "Moreno", + "first": "Maxine" + }, + "eyeColor": "brown", + "age": 24, + "picture": "http://placehold.it/32x32", + "balance": "$1,200.24", + "isActive": false, + "guid": "ce307a37-ca1f-43f5-b637-dca2605712be", + "index": 6, + "_id": "551b91195a6164b2e35f6dc8" + }, + { + "favoriteFruit": "strawberry", + "greeting": "Hello, Helga! You have 5 unread messages.", + "friends": [ + { + "name": "Alicia Vance", + "id": 0 + }, + { + "name": "Vinson Phelps", + "id": 1 + }, + { + "name": "Francisca Kelley", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "nostrud", + "eiusmod", + "dolore", + "officia", + "sint", + "non", + "qui" + ], + "longitude": -7.275151, + "latitude": 75.54202, + "registered": "Wednesday, October 1, 2014 6:35 PM", + "about": "Quis duis ullamco velit qui. Consectetur non adipisicing id magna anim. Deserunt est officia qui esse. Et do pariatur incididunt anim ad mollit non. Et eiusmod sunt fugiat elit mollit ad excepteur anim nisi laboris eiusmod aliquip aliquip.\r\n", + "address": "981 Bush Street, Beaulieu, Vermont, 3775", + "phone": "+1 (956) 506-3807", + "email": "helga.burch@synkgen.name", + "company": "SYNKGEN", + "name": { + "last": "Burch", + "first": "Helga" + }, + "eyeColor": "blue", + "age": 22, + "picture": "http://placehold.it/32x32", + "balance": "$3,827.89", + "isActive": false, + "guid": "ff5dfea0-1052-4ef2-8b66-4dc1aad0a4fb", + "index": 7, + "_id": "551b911946be8358ae40e90e" + }, + { + "favoriteFruit": "banana", + "greeting": "Hello, Shaw! You have 5 unread messages.", + "friends": [ + { + "name": "Christian Cardenas", + "id": 0 + }, + { + "name": "Cohen Pennington", + "id": 1 + }, + { + "name": "Mary Lindsay", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "occaecat", + "ut", + "occaecat", + "magna", + "exercitation", + "incididunt", + "irure" + ], + "longitude": -89.102972, + "latitude": 89.489596, + "registered": "Thursday, August 21, 2014 5:00 PM", + "about": "Amet cupidatat quis velit aute Lorem consequat pariatur mollit deserunt et sint culpa excepteur duis. Enim proident duis qui ex tempor sunt nostrud occaecat. Officia sit veniam mollit eiusmod minim do aute eiusmod fugiat qui anim adipisicing in laboris. Do tempor reprehenderit sunt laborum esse irure dolor ad consectetur aute sit id ipsum. Commodo et voluptate anim consequat do. Minim laborum ad veniam ad minim incididunt excepteur excepteur aliqua.\r\n", + "address": "237 Pierrepont Street, Herbster, New York, 3490", + "phone": "+1 (976) 455-2880", + "email": "shaw.zamora@shadease.me", + "company": "SHADEASE", + "name": { + "last": "Zamora", + "first": "Shaw" + }, + "eyeColor": "blue", + "age": 38, + "picture": "http://placehold.it/32x32", + "balance": "$3,440.82", + "isActive": false, + "guid": "ac5fdb0e-e1fb-427e-881d-da461be0d1ca", + "index": 8, + "_id": "551b9119af0077bc28a2de25" + }, + { + "favoriteFruit": "apple", + "greeting": "Hello, Melissa! You have 5 unread messages.", + "friends": [ + { + "name": "Marion Villarreal", + "id": 0 + }, + { + "name": "Kate Rose", + "id": 1 + }, + { + "name": "Hines Simon", + "id": 2 + } + ], + "range": [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9 + ], + "tags": [ + "amet", + "veniam", + "mollit", + "ad", + "cupidatat", + "deserunt", + "Lorem" + ], + "longitude": -52.735052, + "latitude": 16.258838, + "registered": "Wednesday, April 16, 2014 7:56 PM", + "about": "Aute ut culpa eiusmod tempor duis dolor tempor incididunt. Nisi non proident excepteur eiusmod incididunt nisi minim irure sit. In veniam commodo deserunt proident reprehenderit et consectetur ullamco quis nulla cupidatat.\r\n", + "address": "642 Halsey Street, Blandburg, Kansas, 6761", + "phone": "+1 (941) 539-3851", + "email": "melissa.vaughn@memora.io", + "company": "MEMORA", + "name": { + "last": "Vaughn", + "first": "Melissa" + }, + "eyeColor": "brown", + "age": 24, + "picture": "http://placehold.it/32x32", + "balance": "$2,399.44", + "isActive": true, + "guid": "1769f022-a7f1-4a69-bf4c-f5a5ebeab2d1", + "index": 9, + "_id": "551b9119b607c09c7ffc3b8a" + } +] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/nulls.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/nulls.json new file mode 100755 index 0000000000..7a636ec87c --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/nulls.json @@ -0,0 +1,102 @@ +[ + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null +] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/paragraphs.json b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/paragraphs.json new file mode 100755 index 0000000000..8ab3e1c561 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/paragraphs.json @@ -0,0 +1,102 @@ +[ + "Commodo ullamco cupidatat nisi sit proident ex. Cillum pariatur occaecat in officia do commodo nisi cillum tempor minim. Ad dolor ut et aliquip fugiat eu officia cupidatat occaecat consectetur eiusmod veniam enim officia.\r\n", + "Adipisicing cillum laborum nisi irure. Cillum dolor proident duis nulla qui mollit dolore reprehenderit mollit. Irure nulla dolor ipsum irure nulla quis laboris do.\r\n", + "Est adipisicing consectetur incididunt in. Occaecat ea magna ex consequat irure sit laborum cillum officia magna sunt do exercitation aliquip. Laboris id aute in dolore reprehenderit voluptate non deserunt laborum.\r\n", + "Consectetur eu aute est est occaecat adipisicing sint enim dolor eu. Tempor amet id non mollit eu consectetur cillum duis. Eu labore velit nulla ipsum commodo consequat aliquip. Cupidatat commodo dolore mollit enim sit excepteur nisi duis laboris deserunt esse.\r\n", + "Incididunt ullamco est fugiat enim fugiat. Do sit mollit anim ad excepteur eu laboris exercitation officia labore nulla ut. Voluptate non voluptate cillum sit et voluptate anim duis velit consequat aliquip dolor. Elit et et esse laboris consectetur officia eiusmod aliquip nisi est. Qui labore dolore ad dolor.\r\n", + "Anim adipisicing est irure proident sit officia ullamco voluptate sunt consectetur duis mollit excepteur veniam. Nostrud ut duis aute exercitation officia et quis elit commodo elit tempor aute aliquip enim. Est officia non cillum consequat voluptate ipsum sit voluptate nulla id.\r\n", + "Ipsum enim consectetur aliquip nulla commodo ut ex aliqua elit duis do. Officia et sunt aliqua dolor minim voluptate veniam esse elit enim. Adipisicing reprehenderit duis ex magna non in fugiat sunt ipsum nostrud fugiat aliquip. Labore voluptate id officia voluptate eu. Magna do nostrud excepteur sunt aliqua adipisicing qui.\r\n", + "Est occaecat non non cupidatat laborum qui. Veniam sit est voluptate labore sit irure consectetur fugiat. Anim enim enim fugiat exercitation anim ad proident esse in aliqua. Laboris ut aute culpa ullamco.\r\n", + "Sit et aliquip cupidatat deserunt eiusmod sint aliquip occaecat nostrud aliqua elit commodo ut magna. Amet sit est deserunt id duis in officia pariatur cupidatat ex. Mollit duis est consequat nulla aute velit ipsum sit consectetur pariatur ut non ex ipsum. Tempor esse velit pariatur reprehenderit et nostrud commodo laborum mollit labore.\r\n", + "Aliquip irure quis esse aliquip. Ex non deserunt culpa aliqua ad anim occaecat ad. Lorem consectetur mollit eu consectetur est non nisi non ipsum. Qui veniam ullamco officia est ut excepteur. Nulla elit dolore cupidatat aliqua enim Lorem elit consequat eiusmod non aliqua eu in. Pariatur in culpa labore sint ipsum consectetur occaecat ad ex ipsum laboris aliquip officia. Non officia eiusmod nisi officia id id laboris deserunt sunt enim magna mollit sit.\r\n", + "Mollit velit laboris laborum nulla aliquip consequat Lorem non incididunt irure. Eu voluptate sint do consectetur tempor sit Lorem in. Laborum eiusmod nisi Lorem ipsum dolore do aute laborum occaecat aute sunt. Sit laborum in ea do ipsum officia irure cillum irure nisi laboris. Ad anim deserunt excepteur ea veniam eiusmod culpa velit veniam. Commodo incididunt ea Lorem eu enim esse nisi incididunt mollit.\r\n", + "Velit proident sunt aute dolore reprehenderit culpa. Pariatur reprehenderit commodo ad ea voluptate anim nulla ipsum eu irure fugiat aliqua et. Adipisicing incididunt anim excepteur voluptate minim qui culpa. Sunt veniam enim reprehenderit magna magna. Sit ad amet deserunt ut aute dolore ad minim.\r\n", + "Esse ullamco sunt mollit mollit. Eu enim dolore laboris cupidatat. Cupidatat adipisicing non aute exercitation fugiat. Non ut cillum labore fugiat aliquip ex duis quis consectetur ut nisi Lorem amet qui. Proident veniam amet qui reprehenderit duis qui. Nisi culpa sit occaecat ullamco occaecat laborum fugiat ut. Non duis deserunt culpa duis.\r\n", + "Id ipsum eiusmod laboris non est ipsum deserunt labore duis reprehenderit deserunt. Sint tempor fugiat eiusmod nostrud in ut laborum esse in nostrud sit deserunt nostrud reprehenderit. Cupidatat aliqua qui anim consequat eu quis consequat consequat elit ipsum pariatur. Cupidatat in dolore velit quis. Exercitation cillum ullamco ex consectetur commodo tempor incididunt exercitation labore ad dolore. Minim incididunt consequat adipisicing esse eu eu voluptate.\r\n", + "Anim sint eiusmod nisi anim do deserunt voluptate ut cillum eiusmod esse ex reprehenderit laborum. Dolore nulla excepteur duis excepteur. Magna nisi nostrud duis non commodo velit esse ipsum Lorem incididunt. Nulla enim consequat ad aliqua. Incididunt irure culpa nostrud ea aute ex sit non ad esse.\r\n", + "Ullamco nostrud cupidatat adipisicing anim fugiat mollit eu. Et ut eu in nulla consequat. Sunt do pariatur culpa non est.\r\n", + "Pariatur incididunt reprehenderit non qui excepteur cillum exercitation nisi occaecat ad. Lorem aliquip laborum commodo reprehenderit sint. Laboris qui ut veniam magna quis et et ullamco voluptate. Tempor reprehenderit deserunt consequat nisi. Esse duis sint in tempor. Amet aute cupidatat in sint et.\r\n", + "Est officia nisi dolore consequat irure et excepteur. Sit qui elit tempor magna qui cillum anim amet proident exercitation proident. Eu cupidatat laborum consectetur duis ullamco irure nulla. Adipisicing culpa non reprehenderit anim aute.\r\n", + "Eu est laborum culpa velit dolore non sunt. Tempor magna veniam ea sit non qui Lorem qui exercitation aliqua aliqua et excepteur eiusmod. Culpa aute anim proident culpa adipisicing duis tempor elit aliquip elit nulla laboris esse dolore. Sit adipisicing non dolor eiusmod occaecat cupidatat.\r\n", + "Culpa velit eu esse sunt. Laborum irure aliqua reprehenderit velit ipsum fugiat officia dolor ut aute officia deserunt. Ipsum sit quis fugiat nostrud aliqua cupidatat ex pariatur et. Cillum proident est irure nisi dolor aliqua deserunt esse occaecat velit dolor.\r\n", + "Exercitation nulla officia sit eiusmod cillum eu incididunt officia exercitation qui Lorem deserunt. Voluptate Lorem minim commodo laborum esse in duis excepteur do duis aliquip nisi voluptate consectetur. Amet tempor officia enim ex esse minim reprehenderit.\r\n", + "Laboris sint deserunt ad aute incididunt. Anim officia sunt elit qui laborum labore commodo irure non. Mollit adipisicing ullamco do aute nulla eu laborum et quis sint aute adipisicing amet. Aliqua officia irure nostrud duis ex.\r\n", + "Eiusmod ipsum aliqua reprehenderit esse est non aute id veniam eiusmod. Elit consequat ad sit tempor elit eu incididunt quis irure ad. Eu incididunt veniam consequat Lorem nostrud cillum officia ea consequat ad cillum. Non nisi irure cupidatat incididunt pariatur incididunt. Duis velit officia ad cillum qui. Aliquip consequat sint aute nisi cillum. Officia commodo nisi incididunt laborum nisi voluptate aliquip Lorem cupidatat anim consequat sit laboris.\r\n", + "Veniam cupidatat et incididunt mollit do ex voluptate veniam nostrud labore esse. Eiusmod irure sint fugiat esse. Aute irure consectetur ut mollit nulla sint esse. Lorem ut quis ex proident nostrud mollit nostrud ea duis duis in magna anim consectetur.\r\n", + "Irure culpa esse qui do dolor fugiat veniam ad. Elit commodo aute elit magna incididunt tempor pariatur velit irure pariatur cillum et ea ad. Ad consequat ea et ad minim ut sunt qui commodo voluptate. Laboris est aliquip anim reprehenderit eu officia et exercitation. Occaecat laboris cupidatat Lorem ullamco in nostrud commodo ipsum in quis esse ex.\r\n", + "Incididunt officia quis voluptate eiusmod esse nisi ipsum quis commodo. Eiusmod dolore tempor occaecat sit exercitation aliqua minim consequat minim mollit qui ad nisi. Aute quis irure adipisicing veniam nisi nisi velit deserunt incididunt anim nostrud.\r\n", + "Voluptate exercitation exercitation id minim excepteur excepteur mollit. Fugiat aute proident nulla ullamco ea. Nisi ea culpa duis dolore veniam anim tempor officia in dolore exercitation exercitation. Dolore quis cillum adipisicing sunt do nulla esse proident ad sint.\r\n", + "Laborum ut mollit sint commodo nulla laborum deserunt Lorem magna commodo mollit tempor deserunt ut. Qui aliquip commodo ea id. Consectetur dolor fugiat dolor excepteur eiusmod. Eu excepteur ex aute ex ex elit ex esse officia cillum exercitation. Duis ut labore ea nostrud excepteur. Reprehenderit labore aute sunt nisi quis Lorem officia. Ad aliquip cupidatat voluptate exercitation voluptate ad irure magna quis.\r\n", + "Tempor velit veniam sit labore elit minim do elit cillum eiusmod sunt excepteur nisi. Aliquip est deserunt excepteur duis fugiat incididunt veniam fugiat. Pariatur sit irure labore et minim non. Cillum quis aute anim sint laboris laboris ullamco exercitation nostrud. Nulla pariatur id laborum minim nisi est adipisicing irure.\r\n", + "Irure exercitation laboris nostrud in do consectetur ad. Magna aliqua Lorem culpa exercitation sint do culpa incididunt mollit eu exercitation. Elit tempor Lorem dolore enim deserunt. Anim et ullamco sint ullamco mollit cillum officia et. Proident incididunt laboris aliquip laborum sint veniam deserunt eu consequat deserunt voluptate laboris. Anim Lorem non laborum exercitation voluptate. Cupidatat reprehenderit culpa Lorem fugiat enim minim consectetur tempor quis ad reprehenderit laboris irure.\r\n", + "Deserunt elit mollit nostrud occaecat labore reprehenderit laboris ex. Esse reprehenderit adipisicing cillum minim in esse aliquip excepteur ex et nisi cillum quis. Cillum labore ut ex sunt. Occaecat proident et mollit magna consequat irure esse. Dolor do enim esse nisi ad.\r\n", + "Pariatur est anim cillum minim elit magna adipisicing quis tempor proident nisi laboris incididunt cupidatat. Nulla est adipisicing sit adipisicing id nostrud amet qui consequat eiusmod tempor voluptate ad. Adipisicing non magna sit occaecat magna mollit ad ex nulla velit ea pariatur. Irure labore ad ea exercitation ex cillum.\r\n", + "Lorem fugiat eu eu cillum nulla tempor sint. Lorem id officia nulla velit labore ut duis ad tempor non. Excepteur quis aute adipisicing nisi nisi consectetur aliquip enim Lorem id ullamco cillum sint voluptate. Qui aliquip incididunt tempor aliqua voluptate labore reprehenderit. Veniam eiusmod elit occaecat voluptate tempor culpa consectetur ea ut exercitation eiusmod exercitation qui.\r\n", + "Aliqua esse pariatur nulla veniam velit ea. Aliquip consectetur tempor ex magna sit aliquip exercitation veniam. Dolor ullamco minim commodo pariatur. Et amet reprehenderit dolore proident elit tempor eiusmod eu incididunt enim ullamco. Adipisicing id officia incididunt esse dolor sunt cupidatat do deserunt mollit do non. Magna ut officia fugiat adipisicing quis ea cillum laborum dolore ad nostrud magna minim est. Dolor voluptate officia proident enim ea deserunt eu voluptate dolore proident laborum officia ea.\r\n", + "Culpa aute consequat esse fugiat cupidatat minim voluptate voluptate eiusmod irure anim elit. Do eiusmod culpa laboris consequat incididunt minim nostrud eiusmod commodo velit ea ullamco proident. Culpa pariatur magna ut mollit nisi. Ea officia do magna deserunt minim nisi tempor ea deserunt veniam cillum exercitation esse.\r\n", + "Anim ullamco nostrud commodo Lorem. Do sunt laborum exercitation proident proident magna. Lorem officia laborum laborum dolor sunt duis commodo Lorem. Officia aute adipisicing ea cupidatat ea dolore. Aliquip adipisicing pariatur consectetur aliqua sit amet officia reprehenderit laborum culpa. Occaecat Lorem eu nisi do Lorem occaecat enim eiusmod laboris id quis. Ad mollit adipisicing sunt adipisicing esse.\r\n", + "Laborum quis sit adipisicing cupidatat. Veniam Lorem eiusmod esse esse sint nisi labore elit et. Deserunt aliqua mollit ut commodo aliqua non incididunt ipsum reprehenderit consectetur. Eiusmod nulla minim laboris Lorem ea Lorem aute tempor pariatur in sit. Incididunt culpa ut do irure amet irure cupidatat est anim anim culpa occaecat. Est velit consectetur eiusmod veniam reprehenderit officia sunt occaecat eiusmod ut sunt occaecat amet.\r\n", + "Elit minim aute fugiat nulla ex quis. Labore fugiat sint nostrud amet quis culpa excepteur in. Consectetur exercitation cupidatat laborum sit. Aute nisi eu aliqua est deserunt eiusmod commodo dolor id. Mollit laborum esse sint ipsum voluptate reprehenderit velit et. Veniam aliquip enim in veniam Lorem voluptate quis deserunt consequat qui commodo ut excepteur aute.\r\n", + "Dolore deserunt veniam aute nisi labore sunt et voluptate irure nisi anim ea. Magna nisi quis anim mollit nisi est dolor do ex aliquip elit aliquip ipsum minim. Dolore est officia nostrud eiusmod ex laborum ea amet est. Officia culpa non est et tempor consectetur exercitation tempor eiusmod enim. Ea tempor laboris qui amet ex nisi culpa dolore consectetur incididunt sunt sunt. Lorem aliquip incididunt magna do et ullamco ex elit aliqua eiusmod qui. Commodo amet dolor sint incididunt ex veniam non Lorem fugiat.\r\n", + "Officia culpa enim voluptate dolore commodo. Minim commodo aliqua minim ex sint excepteur cupidatat adipisicing eu irure. Anim magna deserunt anim Lorem non.\r\n", + "Cupidatat aliquip nulla excepteur sunt cupidatat cupidatat laborum cupidatat exercitation. Laboris minim ex cupidatat culpa elit. Amet enim reprehenderit aliqua laborum est tempor exercitation cupidatat ex dolore do. Do incididunt labore fugiat commodo consectetur nisi incididunt irure sit culpa sit. Elit aute occaecat qui excepteur velit proident cillum qui aliqua ex do ex. Dolore irure ex excepteur veniam id proident mollit Lorem.\r\n", + "Ad commodo cillum duis deserunt elit officia consectetur veniam eiusmod. Reprehenderit et veniam ad commodo reprehenderit magna elit laboris sunt non quis. Adipisicing dolor aute proident ea magna sunt et proident in consectetur.\r\n", + "Veniam exercitation esse esse veniam est nisi. Minim velit incididunt sint aute dolor anim. Fugiat cupidatat id ad nisi in voluptate dolor culpa eiusmod magna eiusmod amet id. Duis aliquip labore et ex amet amet aliquip laborum eiusmod ipsum. Quis qui ut duis duis. Minim in voluptate reprehenderit aliqua.\r\n", + "Elit ut pariatur dolor veniam ipsum consequat. Voluptate Lorem mollit et esse dolore mollit Lorem ad. Elit nostrud eu Lorem labore mollit minim cupidatat officia quis minim dolore incididunt. In cillum aute cillum ut.\r\n", + "Commodo laborum deserunt ut cupidatat pariatur ullamco in esse anim exercitation cillum duis. Consectetur incididunt sit esse Lorem in aute. Eiusmod mollit Lorem consequat minim reprehenderit laborum enim excepteur irure nisi elit. Laborum esse proident aute aute proident adipisicing laborum. Pariatur tempor duis incididunt qui velit pariatur ut officia ea mollit labore dolore. Cillum pariatur minim ullamco sunt incididunt culpa id ullamco exercitation consectetur. Ea exercitation consequat reprehenderit ut ullamco velit eu ad velit magna excepteur eiusmod.\r\n", + "Eu deserunt magna laboris laborum laborum in consequat dolore. Officia proident consectetur proident do occaecat minim pariatur officia ipsum sit non velit officia cillum. Laborum excepteur labore eu minim eiusmod. Sit anim dolore cillum ad do minim culpa sit est ad.\r\n", + "Cupidatat dolor nostrud Lorem sint consequat quis. Quis labore sint incididunt officia tempor. Fugiat nostrud in elit reprehenderit dolor. Nisi sit enim officia minim est adipisicing nulla aute labore nulla nostrud cupidatat est. Deserunt dolore qui irure Lorem esse voluptate velit qui nostrud.\r\n", + "Fugiat Lorem amet nulla nisi qui amet laboris enim cillum. Dolore occaecat exercitation id labore velit do commodo ut cupidatat laborum velit fugiat mollit. Ut et aliqua pariatur occaecat. Lorem occaecat dolore quis esse enim cupidatat exercitation ut tempor sit laboris fugiat adipisicing. Est tempor ex irure consectetur ipsum magna labore. Lorem non quis qui minim nisi magna amet aliquip ex cillum fugiat tempor.\r\n", + "Aliquip eiusmod laborum ipsum deserunt velit esse do magna excepteur consectetur exercitation sit. Minim ullamco reprehenderit commodo nostrud exercitation id irure ex qui ullamco sit esse laboris. Nulla cillum non minim qui cillum nisi aute proident. Dolor anim culpa elit quis excepteur aliqua eiusmod. Elit ea est excepteur consectetur sunt eiusmod enim id commodo irure amet et pariatur laboris. Voluptate magna ad magna dolore cillum cillum irure laboris ipsum officia id Lorem veniam.\r\n", + "Esse sunt elit est aliquip cupidatat commodo deserunt. Deserunt pariatur ipsum qui ad esse esse magna qui cillum laborum. Exercitation veniam pariatur elit amet enim.\r\n", + "Esse quis in id elit nulla occaecat incididunt. Et amet Lorem mollit in veniam do. Velit mollit Lorem consequat commodo Lorem aliquip cupidatat. Minim consequat nostrud nulla in nostrud.\r\n", + "Cillum nulla et eu est nostrud quis elit cupidatat dolor enim excepteur exercitation nisi voluptate. Nulla dolore non ex velit et qui tempor proident id deserunt nisi eu. Tempor ad Lorem ipsum reprehenderit in anim. Anim dolore ullamco enim deserunt quis ex id exercitation velit. Magna exercitation fugiat mollit pariatur ipsum ex consectetur nostrud. Id dolore officia nostrud excepteur laborum. Magna incididunt elit ipsum pariatur adipisicing enim duis est qui commodo velit aute.\r\n", + "Quis esse ex qui nisi dolor. Ullamco laborum dolor esse laboris eiusmod ea magna laboris ea esse ut. Dolore ipsum pariatur veniam sint mollit. Lorem ea proident fugiat ullamco ut nisi culpa eu exercitation exercitation aliquip veniam laborum consectetur.\r\n", + "Pariatur veniam laboris sit aliquip pariatur tempor aute sunt id et ut. Laboris excepteur eiusmod nisi qui quis elit enim ut cupidatat. Et et laborum in fugiat veniam consectetur ipsum laboris duis excepteur ullamco aliqua dolor Lorem. Aliqua ex amet sint anim cupidatat nisi ipsum anim et sunt deserunt. Occaecat culpa ut tempor cillum pariatur ex tempor.\r\n", + "Dolor deserunt eiusmod magna do officia voluptate excepteur est cupidatat. Veniam qui cupidatat amet anim est qui consectetur sit commodo commodo ea ad. Enim ad adipisicing qui nostrud. Non nulla esse ullamco nulla et ex.\r\n", + "Id ullamco ea consectetur est incididunt deserunt et esse. Elit nostrud voluptate eiusmod ut. Excepteur adipisicing qui cupidatat consequat labore id. Qui dolor aliqua do dolore do cupidatat labore ex consectetur ea sit cillum. Sint veniam eiusmod in consectetur consequat fugiat et mollit ut fugiat esse dolor adipisicing.\r\n", + "Ea magna proident labore duis pariatur. Esse cillum aliquip dolor duis fugiat ea ex officia ea irure. Sint elit nisi pariatur sunt nostrud exercitation ullamco culpa magna do.\r\n", + "Minim aliqua voluptate dolor consequat sint tempor deserunt amet magna excepteur. Irure do voluptate magna velit. Nostrud in reprehenderit magna officia nostrud. Cupidatat nulla irure laboris non fugiat ex ex est cupidatat excepteur officia aute velit duis. Sit voluptate id ea exercitation deserunt culpa voluptate nostrud est adipisicing incididunt. Amet proident laborum commodo magna ipsum quis.\r\n", + "Ipsum consectetur consectetur excepteur tempor eiusmod ea fugiat aute velit magna in officia sunt. Sit ut sunt dolore cupidatat dolor adipisicing. Veniam nisi adipisicing esse reprehenderit amet aliqua voluptate ex commodo occaecat est voluptate mollit sunt. Pariatur aliqua qui qui in dolor. Fugiat reprehenderit sit nostrud do sint esse. Tempor sit irure adipisicing ea pariatur duis est sit est incididunt laboris quis do. Et voluptate anim minim aliquip excepteur consequat nisi anim pariatur aliquip ut ipsum dolor magna.\r\n", + "Cillum sit labore excepteur magna id aliqua exercitation consequat laborum Lorem id pariatur nostrud. Lorem qui est labore sint cupidatat sint excepteur nulla in eu aliqua et. Adipisicing velit do enim occaecat laboris quis excepteur ipsum dolor occaecat Lorem dolore id exercitation.\r\n", + "Incididunt in laborum reprehenderit eiusmod irure ex. Elit duis consequat minim magna. Esse consectetur aliquip cillum excepteur excepteur fugiat. Sint tempor consequat minim reprehenderit consectetur adipisicing dolor id Lorem elit non. Occaecat esse quis mollit ea et sint aute fugiat qui tempor. Adipisicing tempor duis non dolore irure elit deserunt qui do.\r\n", + "Labore fugiat eiusmod sint laborum sit duis occaecat. Magna in laborum non cillum excepteur nostrud sit proident pariatur voluptate voluptate adipisicing exercitation occaecat. Ad non dolor aute ex sint do do minim exercitation veniam laborum irure magna ea. Magna do non quis sit consequat Lorem aliquip.\r\n", + "Velit anim do laborum laboris laborum Lorem. Sunt do Lorem amet ipsum est sint velit sit do voluptate mollit veniam enim. Commodo do deserunt in pariatur ut elit sint elit deserunt ea. Ad dolor anim consequat aliquip ut mollit nostrud tempor sunt mollit elit. Reprehenderit laboris labore excepteur occaecat veniam adipisicing cupidatat esse. Ad enim aliquip ea minim excepteur magna. Sint velit veniam pariatur qui dolor est adipisicing ex laboris.\r\n", + "Ea cupidatat ex nulla in sunt est sit dolor enim ad. Eu tempor consequat cupidatat consequat ex incididunt sint culpa. Est Lorem Lorem non cupidatat sunt ut aliqua non nostrud do ullamco. Reprehenderit ad ad nulla nostrud do nulla in. Ipsum adipisicing commodo mollit ipsum exercitation. Aliqua ea anim anim est elit. Ea incididunt consequat minim ad sunt eu cillum.\r\n", + "Tempor quis excepteur eiusmod cupidatat ipsum occaecat id et occaecat. Eiusmod magna aliquip excepteur id amet elit. Ullamco dolore amet anim dolor enim ea magna magna elit. Occaecat magna pariatur in deserunt consectetur officia aliquip ullamco ex aute anim. Minim laborum eu sit elit officia esse do irure pariatur tempor et reprehenderit ullamco labore.\r\n", + "Sit tempor eu minim dolore velit pariatur magna duis reprehenderit ea nulla in. Amet est do consectetur commodo do adipisicing adipisicing in amet. Cillum id ut commodo do pariatur duis aliqua nisi sint ad irure officia reprehenderit. Mollit labore id enim fugiat ullamco irure mollit cupidatat. Quis nisi amet labore eu dolor occaecat commodo aliqua laboris deserunt excepteur deserunt officia. Aliqua non ut sit ad. Laborum veniam ad velit minim dolore ea id magna dolor qui in.\r\n", + "Dolore nostrud ipsum aliqua pariatur id reprehenderit enim ad eiusmod qui. Deserunt anim commodo pariatur excepteur velit eu irure nulla ex labore ipsum aliqua minim aute. Id consequat amet tempor aliquip ex elit adipisicing est do. Eu enim Lorem consectetur minim id irure nulla culpa. Consectetur do consequat aute tempor anim. Qui ad non elit dolor est adipisicing nisi amet cillum sunt quis anim laboris incididunt. Incididunt proident adipisicing labore Lorem.\r\n", + "Et reprehenderit ea officia veniam. Aliquip ullamco consequat elit nisi magna mollit id elit. Amet amet sint velit labore ad nisi. Consectetur tempor id dolor aliqua esse deserunt amet. Qui laborum enim proident voluptate aute eu aute aute sit sit incididunt eu. Sunt ullamco nisi nostrud labore commodo non consectetur quis do duis minim irure. Tempor sint dolor sint aliquip dolore nostrud fugiat.\r\n", + "Aute ullamco quis nisi ut excepteur nostrud duis elit. Veniam ex ad incididunt veniam voluptate. Commodo dolore ullamco sit sint adipisicing proident amet aute duis deserunt.\r\n", + "Labore velit eu cillum nisi. Laboris do cupidatat et non duis cillum. Ullamco dolor tempor cupidatat voluptate laborum ullamco ea duis.\r\n", + "Deserunt consequat aliqua duis aliquip nostrud nostrud dolore nisi. Culpa do sint laborum consectetur ipsum quis laborum laborum pariatur eiusmod. Consectetur laboris ad ad ut quis. Ullamco laboris qui velit id laborum voluptate qui aute nostrud aliquip ea.\r\n", + "Ad cillum anim ex est consectetur mollit id in. Non enim aliquip consequat qui deserunt commodo cillum ad laborum fugiat. Dolor deserunt amet laborum tempor adipisicing voluptate dolor pariatur dolor cillum. Eu mollit ex sunt officia veniam qui est sunt proident. Non aliqua qui elit eu cupidatat ex enim ex proident. Lorem sit minim ullamco officia cupidatat duis minim. Exercitation laborum deserunt voluptate culpa tempor quis nulla id pariatur.\r\n", + "Nostrud quis consectetur ut aliqua excepteur elit consectetur occaecat. Occaecat voluptate Lorem pariatur consequat ullamco fugiat minim. Anim voluptate eu eu cillum tempor dolore aliquip aliqua. Fugiat incididunt ut tempor amet minim. Voluptate nostrud minim pariatur non excepteur ullamco.\r\n", + "Dolore nulla velit officia exercitation irure laboris incididunt anim in laborum in fugiat ut proident. Fugiat aute id consequat fugiat officia ut. Labore sint amet proident amet sint nisi laboris amet id ullamco culpa quis consequat proident. Magna do fugiat veniam dolore elit irure minim. Esse ullamco excepteur labore tempor labore fugiat dolore nisi cupidatat irure dolor pariatur. Magna excepteur laboris nisi eiusmod sit pariatur mollit.\r\n", + "In enim aliquip officia ea ad exercitation cillum culpa occaecat dolore Lorem. Irure cillum commodo adipisicing sunt pariatur ea duis fugiat exercitation laboris culpa ullamco aute. Ut voluptate exercitation qui dolor. Irure et duis elit consequat deserunt proident.\r\n", + "Officia ea Lorem sunt culpa id et tempor excepteur enim deserunt proident. Dolore aliquip dolor laboris cillum proident velit. Et culpa occaecat exercitation cupidatat irure sint adipisicing excepteur pariatur incididunt ad occaecat. Qui proident ipsum cillum minim. Quis ut culpa irure aliqua minim fugiat. In voluptate cupidatat fugiat est laborum dolor esse in pariatur voluptate.\r\n", + "Voluptate enim ipsum officia aute ea adipisicing nisi ut ex do aliquip amet. Reprehenderit enim voluptate tempor ex adipisicing culpa. Culpa occaecat voluptate dolor mollit ipsum exercitation labore et tempor sit ea consectetur aliqua. Elit elit sit minim ea ea commodo do tempor cupidatat irure dolore. Occaecat esse adipisicing anim eiusmod commodo fugiat mollit amet. Incididunt tempor tempor qui occaecat cupidatat in.\r\n", + "Ut qui anim velit enim aliquip do ut nulla labore. Mollit ut commodo ut eiusmod consectetur laboris aliqua qui voluptate culpa fugiat incididunt elit. Lorem ullamco esse elit elit. Labore amet incididunt ea nulla aliquip eiusmod. Sit nulla est voluptate officia ipsum aute aute cillum tempor deserunt. Laboris commodo eiusmod labore sunt aute excepteur ea consectetur reprehenderit veniam nisi. Culpa nisi sint sunt sint tempor laboris dolore cupidatat.\r\n", + "Duis cillum qui nisi duis amet velit ad cillum ut elit aute sint ad. Amet laboris pariatur excepteur ipsum Lorem aliqua veniam Lorem quis mollit cupidatat aliqua exercitation. Pariatur ex ullamco sit commodo cillum eiusmod ut proident elit cillum. Commodo ut ipsum excepteur occaecat sint elit consequat ex dolor adipisicing consectetur id ut ad. Velit sit eiusmod est esse tempor incididunt consectetur eiusmod duis commodo veniam.\r\n", + "Ut sunt qui officia anim laboris exercitation Lorem quis laborum do eiusmod officia. Enim consectetur occaecat fugiat cillum cillum. Dolore dolore nostrud in commodo fugiat mollit consequat occaecat non et et elit ullamco. Sit voluptate minim ut est culpa velit nulla fugiat reprehenderit eu aliquip adipisicing labore. Sit minim minim do dolor dolor. Lorem Lorem labore exercitation magna veniam eiusmod do.\r\n", + "Fugiat dolor adipisicing quis aliquip aute dolore. Qui proident anim elit veniam ex aliquip eiusmod ipsum sunt pariatur est. Non fugiat duis do est officia adipisicing.\r\n", + "Nulla deserunt do laboris cupidatat veniam do consectetur ipsum elit veniam in mollit eu. Ea in consequat cupidatat laboris sint fugiat irure. In commodo esse reprehenderit deserunt minim velit ullamco enim eu cupidatat tempor ex. Ullamco in non id culpa amet occaecat culpa nostrud id. Non occaecat culpa magna incididunt.\r\n", + "Enim laboris ex mollit reprehenderit eiusmod exercitation magna. Exercitation Lorem ex mollit non non culpa labore enim. Adipisicing labore dolore incididunt do amet aliquip excepteur ad et nostrud officia aute veniam voluptate. Fugiat enim eiusmod Lorem esse. Minim ullamco commodo consequat ex commodo aliqua eu nulla eu. Veniam non enim nulla ut Lorem nostrud minim sint duis.\r\n", + "Enim duis consectetur in ullamco cillum veniam nulla amet. Exercitation nisi sunt sunt duis in culpa nisi magna ex id ipsum laboris reprehenderit qui. Officia pariatur qui ex fugiat veniam et sunt sit nostrud. Veniam ullamco tempor fugiat minim Lorem proident velit in eiusmod elit. Enim minim excepteur aute aliquip ex magna commodo dolore qui et labore. Proident eu aliquip cillum dolor. Nostrud ipsum ut irure consequat fugiat nulla proident occaecat laborum.\r\n", + "Amet duis eiusmod sunt adipisicing esse ex nostrud consectetur voluptate cillum. Ipsum occaecat sit et anim velit irure ea incididunt cupidatat ullamco in nisi quis. Esse officia ipsum commodo qui quis qui do. Commodo aliquip amet aute sit sit ut cupidatat elit nostrud.\r\n", + "Laboris laboris sit mollit cillum nulla deserunt commodo culpa est commodo anim id anim sit. Officia id consectetur velit incididunt est dolor sunt ipsum magna aliqua consectetur. Eiusmod pariatur minim deserunt cupidatat veniam Lorem aliquip sunt proident eu Lorem sit dolor fugiat. Proident qui ut ex in incididunt nulla nulla dolor ex laboris ea ad.\r\n", + "Ex incididunt enim labore nulla cupidatat elit. Quis ut incididunt incididunt non irure commodo do mollit cillum anim excepteur. Qui consequat laborum dolore elit tempor aute ut nulla pariatur eu ullamco veniam. Nisi non velit labore in commodo excepteur culpa nulla tempor cillum. Ipsum qui sit sint reprehenderit ut labore incididunt dolor aliquip sunt. Reprehenderit occaecat tempor nisi laborum.\r\n", + "Lorem officia ullamco eu occaecat in magna eiusmod consectetur nisi aliqua mollit esse. Ullamco ex aute nostrud pariatur do enim cillum sint do fugiat nostrud culpa tempor. Do aliquip excepteur nostrud culpa eu pariatur eiusmod cillum excepteur do. Est sunt non quis cillum voluptate ex.\r\n", + "Deserunt consectetur tempor irure mollit qui tempor et. Labore enim eu irure laboris in. Nisi in tempor ex occaecat amet cupidatat laboris occaecat amet minim ut magna incididunt id. Consequat cillum laborum commodo mollit. Et magna culpa sunt dolore consequat laboris et sit. Deserunt qui voluptate excepteur dolor. Eu qui amet est proident.\r\n", + "Eu elit minim eiusmod occaecat eu nostrud dolor qui ut elit. Sunt dolore proident ea eu do eiusmod fugiat incididunt pariatur duis amet Lorem nisi ut. Adipisicing quis veniam cupidatat Lorem sint culpa sunt veniam sint. Excepteur eu exercitation est magna pariatur veniam dolore qui fugiat labore proident eiusmod cillum. Commodo reprehenderit elit proident duis sint magna.\r\n", + "Ut aliquip pariatur deserunt nostrud commodo ad proident est exercitation. Sit minim do ea enim sint officia nisi incididunt laborum. Ex amet duis commodo fugiat. Ut aute tempor deserunt irure occaecat aliquip voluptate cillum aute elit qui nostrud.\r\n", + "Irure et quis consectetur sit est do sunt aliquip eu. Cupidatat pariatur consequat dolore consectetur. Adipisicing magna velit mollit occaecat do id. Nisi pariatur cupidatat cillum incididunt excepteur consectetur excepteur do laborum deserunt irure pariatur cillum.\r\n", + "Adipisicing esse incididunt cillum est irure consequat irure ad aute voluptate. Incididunt do occaecat nostrud do ipsum pariatur Lorem qui laboris et pariatur. Est exercitation dolor culpa ad velit ut et.\r\n", + "Sit eiusmod id enim ad ex dolor pariatur do. Ullamco occaecat quis dolor minim non elit labore amet est. Commodo velit eu nulla eiusmod ullamco. Incididunt anim pariatur aute eiusmod veniam tempor enim officia elit id. Elit Lorem est commodo dolore nostrud. Labore et consectetur do exercitation veniam laboris incididunt aliqua proident dolore ea officia cupidatat. Velit laboris aliquip deserunt labore commodo.\r\n", + "Proident nostrud labore eu nostrud. Excepteur ut in velit labore ea proident labore ea sint cillum. Incididunt ipsum consectetur officia irure sit pariatur veniam id velit officia mollit. Adipisicing magna voluptate velit excepteur enim consectetur incididunt voluptate tempor occaecat fugiat velit excepteur labore. Do do incididunt qui nisi voluptate enim. Laboris aute sit voluptate cillum pariatur minim excepteur ullamco mollit deserunt.\r\n", + "Excepteur laborum adipisicing nisi elit fugiat tempor. Elit laboris qui enim labore duis. Proident tempor in consectetur proident excepteur do ex laboris sit.\r\n", + "Dolore do ea incididunt do duis dolore eu labore nisi cupidatat voluptate amet incididunt minim. Nulla pariatur mollit cupidatat adipisicing nulla et. Dolor aliquip in ex magna excepteur. Nulla consequat minim consequat ullamco dolor laboris ullamco eu reprehenderit duis nostrud pariatur.\r\n", + "Id nisi labore duis qui. Incididunt laboris tempor aute do sit. Occaecat excepteur est mollit ea in mollit ullamco est amet reprehenderit.\r\n", + "Aute labore ipsum velit non voluptate eiusmod et reprehenderit cupidatat occaecat. Lorem tempor tempor consectetur exercitation qui nostrud sunt cillum quis ut non dolore. Reprehenderit consequat reprehenderit laborum qui pariatur anim et officia est cupidatat enim velit velit.\r\n", + "Commodo ex et fugiat cupidatat non adipisicing commodo. Minim ad dolore fugiat mollit cupidatat aliqua sunt dolor sit. Labore esse labore velit aute enim. Nulla duis incididunt est aliquip consectetur elit qui incididunt minim minim labore amet sit cillum.\r\n" +] \ No newline at end of file diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/readme.txt b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/readme.txt new file mode 100644 index 0000000000..da1dae675e --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/bin/types/readme.txt @@ -0,0 +1 @@ +Test data obtained from https://github.com/xpol/lua-rapidjson/tree/master/performance diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/doc/CMakeLists.txt b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/doc/CMakeLists.txt new file mode 100644 index 0000000000..c1f165a37a --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/doc/CMakeLists.txt @@ -0,0 +1,25 @@ +find_package(Doxygen) + +IF(NOT DOXYGEN_FOUND) + MESSAGE(STATUS "No Doxygen found. Documentation won't be built") +ELSE() + file(GLOB SOURCES ${CMAKE_CURRENT_LIST_DIR}/../include/*) + file(GLOB MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../doc/*.md) + list(APPEND MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../readme.md) + + CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY) + CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY) + + add_custom_command(OUTPUT html + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn + COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html + DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile* + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../ + ) + + add_custom_target(doc ALL DEPENDS html) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html + DESTINATION ${DOC_INSTALL_DIR} + COMPONENT doc) +ENDIF() diff --git a/deps/discord-rpc/thirdparty/rapidjson-1.1.0/doc/Doxyfile.in b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/doc/Doxyfile.in new file mode 100644 index 0000000000..ca14233960 --- /dev/null +++ b/deps/discord-rpc/thirdparty/rapidjson-1.1.0/doc/Doxyfile.in @@ -0,0 +1,2369 @@ +# Doxyfile 1.8.7 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = RapidJSON + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "A fast JSON parser/generator for C++ with both SAX/DOM style API" + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@ + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = YES + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = $(RAPIDJSON_SECTIONS) + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = NO + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. Do not use file names with spaces, bibtex cannot handle them. See +# also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = readme.md \ + CHANGELOG.md \ + include/rapidjson/rapidjson.h \ + include/ \ + doc/features.md \ + doc/tutorial.md \ + doc/pointer.md \ + doc/stream.md \ + doc/encoding.md \ + doc/dom.md \ + doc/sax.md \ + doc/schema.md \ + doc/performance.md \ + doc/internals.md \ + doc/faq.md + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.inc \ + *.md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = ./include/rapidjson/msinttypes/ + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = internal + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = ./doc + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = readme.md + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = NO + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = NO + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = ./doc/misc/header.html + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = ./doc/misc/footer.html + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user- +# defined cascading style sheet that is included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet file to the output directory. For an example +# see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = YES + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = YES + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /