Merge branch 'master' into changes-periodmarks

This commit is contained in:
Rob Loach 2019-07-24 11:44:22 -04:00 committed by GitHub
commit 831543c42a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2111 changed files with 86958 additions and 48904 deletions

12
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: libretro
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL

4
.gitignore vendored
View File

@ -115,6 +115,10 @@ wiiu/wut/elf2rpl/elf2rpl
/pkg/android/phoenix/bin/
/pkg/android/phoenix/gen/
/pkg/android/phoenix/local.properties
/pkg/android/phoenix/gradle.properties
/pkg/android/phoenix/.gradle
/pkg/android/phoenix/.externalNativeBuild
/pkg/android/phoenix/build
# Cloned by libretro-fetch.sh
/media/assets/

View File

@ -32,6 +32,10 @@ matrix:
env: CXX_BUILD=1 CC=gcc-8 CXX=g++-8
- compiler: gcc
env: DISABLE_MENU=1 CC=gcc-8 CXX=g++-8
- compiler: gcc
env: DISABLE_OVERLAY=1 CC=gcc-8 CXX=g++-8
- compiler: gcc
env: DISABLE_CDROM=1 CC=gcc-8 CXX=g++-8
- compiler: gcc
env: ENABLE_GLES=1 CC=gcc-8 CXX=g++-8
- compiler: gcc
@ -83,6 +87,14 @@ script:
if [ -n "$DISABLE_MENU" ]; then
ARGS="$ARGS --disable-menu"
fi
- |
if [ -n "$DISABLE_OVERLAY" ]; then
ARGS="$ARGS --disable-overlay"
fi
- |
if [ -n "$DISABLE_CDROM" ]; then
ARGS="$ARGS --disable-cdrom"
fi
- |
if [ -n "$ENABLE_GLES" ]; then
ARGS="$ARGS --enable-opengles"

View File

@ -1,16 +1,21 @@
# 1.7.8 (future)
- ANDROID: Implemented multi-touch touchscreen support
- BLISS-BOX: Add 4 new pad types from firmware 3.0
- COMMON: Add optional 'on demand' thumbnail downloads
- COMMON: Add new playlist-based thumbnail downloader, and hide the legacy thumbnail pack version by default
- COMMON: Add new playlist-based thumbnail downloader. Hide the legacy thumbnail pack version by default
- COMMON: Show license per core (if available) inside 'Load Core'
- COMMON: Add option to load content from (and dump) CD-ROM discs
- COMMON: New core options interface, allows for localization, sublabels and more
- GAMECUBE: Add default video/audio filter directories
- GL1: Ignore alpha in core video, fixes XRGB8888 rendering in some cores
- GLCORE: Don't hardcode shader cross compilation target version but poll it. glcore would always only use the minimum target shader version, i.e. GLSL ES 3.00 for OpenGL ES 3.0+ or GLSL 1.50 for OpenGL 3.2+
- D3D10/11/12/SLANG: Added "FrameDirection" slang semantic, which works fine with braid-rewind shader, but not entirely perfect with D3D12
- GLCORE: Don't hardcode shader cross compilation target version but poll it. glcore would always only use the minimum target shader version, i.e. GLSL ES 3.00 for OpenGL ES 3.0+ or GLSL 1.50 for OpenGL 3.2+.
- D3D10/11/12/SLANG: Added "FrameDirection" slang semantic. Works fine with braid-rewind shader, not entirely perfect with D3D12 though.
- D3D10/11/12: Add option to select which GPU to render with
- D3D10/11: Fix maintaining aspect ratio when resizing window
- GLCORE/SLANG: Added "FrameDirection" slang semantic
- INPUT: Menu toggle hotkey can now be bound to another keyboard key and it will toggle properly
- IOS: Correctly centers screen on iPhone X landscape
- IOS: Implemented multi-touch touchscreen support
- LOCALIZATION: Update Korean translation
- LOCALIZATION: Update Japanese translation
- LOCALIZATION: Update Portuguese Brazilian Translation
@ -37,8 +42,10 @@
- VULKAN: Add option to select which GPU to render with
- WII: Add default video/audio filter directories
- WII: Fix RGUI display corruption
- WII: Fix HID joypad drivers
- WIIU/SLANG: Added "FrameDirection" slang semantic
- X11: Add non-evdev keycodes to fix keyboard input on non-Linux systems with X11
- X11/UDEV: Mouse pointer should work now in X11 environment with no Display
# 1.7.7
- 3DS: Add unique IDs to prevent cores overwriting each other

View File

@ -1,5 +1,4 @@
HAVE_FILE_LOGGER=1
HAVE_CC_RESAMPLER=1
NEED_CXX_LINKER=0
MISSING_DECLS =0
@ -193,6 +192,8 @@ config.mk: configure qb/*
endif
endif
SYMBOL_MAP := -Wl,-Map=output.map
retroarch: $(RARCH_OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LINK) -o $@ $(RARCH_OBJ) $(LIBS) $(LDFLAGS) $(LIBRARY_DIRS)

View File

@ -39,10 +39,6 @@ ifeq ($(HAVE_SOCKET_LEGACY), 1)
DEFINES += -DHAVE_SOCKET_LEGACY
endif
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_HID
endif
ifeq ($(HAVE_LIBRETRODB), 1)
DEFINES += -DHAVE_LIBRETRODB
endif
@ -64,11 +60,11 @@ ifeq ($(HAVE_PRESERVE_DYLIB),1)
endif
ifeq ($(GL_DEBUG), 1)
DEF_FLAGS += -DGL_DEBUG
DEFINES += -DGL_DEBUG
endif
ifeq ($(VULKAN_DEBUG), 1)
DEF_FLAGS += -DVULKAN_DEBUG
DEFINES += -DVULKAN_DEBUG
endif
ifeq ($(HAVE_FLOATHARD), 1)
@ -86,23 +82,22 @@ ifeq ($(TDM_GCC),)
endif
ifeq ($(HAVE_FILE_LOGGER), 1)
DEF_FLAGS += -DHAVE_FILE_LOGGER
DEFINES += -DHAVE_FILE_LOGGER
endif
ifeq ($(HAVE_SHADERPIPELINE), 1)
DEF_FLAGS += -DHAVE_SHADERPIPELINE
DEFINES += -DHAVE_SHADERPIPELINE
endif
DEF_FLAGS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR)
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include -I$(DEPS_DIR)
# Switches
#
ifeq ($(HAVE_NETPLAYDISCOVERY), 1)
DEF_FLAGS += -DHAVE_NETPLAYDISCOVERY
DEFINES += -DHAVE_NETPLAYDISCOVERY
endif
ifeq ($(HAVE_NETLOGGER), 1)
DEF_FLAGS += -DHAVE_LOGGER
DEFINES += -DHAVE_LOGGER
OBJ += network/net_logger.o
endif
@ -153,21 +148,14 @@ ifneq ($(GIT_VERSION),)
endif
# General object files
DEFINES += -DHAVE_DR_MP3
DEF_FLAGS += -DHAVE_DR_MP3
ifeq ($(HAVE_DR_MP3), 1)
DEFINES += -DHAVE_DR_MP3
endif
OBJ += frontend/frontend.o \
frontend/frontend_driver.o \
OBJ += frontend/frontend_driver.o \
frontend/drivers/platform_null.o \
ui/drivers/ui_null.o \
ui/drivers/null/ui_null_window.o \
ui/drivers/null/ui_null_browser_window.o \
ui/drivers/null/ui_null_msg_window.o \
ui/drivers/null/ui_null_application.o \
retroarch.o \
dirs.o \
paths.o \
command.o \
msg_hash.o \
intl/msg_hash_us.o \
$(LIBRETRO_COMM_DIR)/queues/task_queue.o \
@ -175,7 +163,7 @@ OBJ += frontend/frontend.o \
tasks/task_save.o \
tasks/task_file_transfer.o \
tasks/task_image.o \
tasks/task_audio_mixer.o \
tasks/task_playlist_manager.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_utf.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_crc32.o \
$(LIBRETRO_COMM_DIR)/encodings/encoding_base64.o \
@ -189,21 +177,35 @@ OBJ += frontend/frontend.o \
$(LIBRETRO_COMM_DIR)/streams/interface_stream.o \
$(LIBRETRO_COMM_DIR)/streams/memory_stream.o \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation.o \
$(LIBRETRO_COMM_DIR)/media/media_detect_cd.o \
$(LIBRETRO_COMM_DIR)/lists/string_list.o \
$(LIBRETRO_COMM_DIR)/string/stdstring.o \
$(LIBRETRO_COMM_DIR)/memmap/memalign.o \
list_special.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_windowsmmap.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_orbis.o \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_stdio.o
ifneq ($(findstring Linux,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_linux.o
endif
ifneq ($(findstring Win32,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_windowsmmap.o
endif
ifneq ($(findstring BSD,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o
else ifneq ($(findstring Darwin,$(OS)),)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_unixmmap.o
endif
ifeq ($(TARGET), retroarch_orbis)
OBJ += $(LIBRETRO_COMM_DIR)/file/nbio/nbio_orbis.o
endif
OBJ += \
$(LIBRETRO_COMM_DIR)/file/nbio/nbio_intf.o \
$(LIBRETRO_COMM_DIR)/file/file_path.o \
file_path_special.o \
file_path_str.o \
$(LIBRETRO_COMM_DIR)/hash/rhash.o \
$(LIBRETRO_COMM_DIR)/audio/audio_mixer.o \
input/common/input_hid_common.o \
input/input_mapper.o \
led/led_driver.o \
@ -213,7 +215,6 @@ OBJ += frontend/frontend.o \
gfx/video_crt_switch.o \
configuration.o \
$(LIBRETRO_COMM_DIR)/dynamic/dylib.o \
dynamic.o \
cores/dynamic_dummy.o \
$(LIBRETRO_COMM_DIR)/queues/message_queue.o \
managers/state_manager.o \
@ -223,7 +224,6 @@ OBJ += frontend/frontend.o \
input/input_keymaps.o \
input/input_remapping.o \
$(LIBRETRO_COMM_DIR)/queues/fifo_queue.o \
managers/core_option_manager.o \
$(LIBRETRO_COMM_DIR)/compat/compat_fnmatch.o \
$(LIBRETRO_COMM_DIR)/compat/compat_posix_string.o \
managers/cheat_manager.o \
@ -234,7 +234,6 @@ OBJ += frontend/frontend.o \
tasks/task_screenshot.o \
tasks/task_powerstate.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler.o \
gfx/video_shader_parse.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/pixconv.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_int.o \
$(LIBRETRO_COMM_DIR)/gfx/scaler/scaler_filter.o \
@ -262,22 +261,32 @@ OBJ += frontend/frontend.o \
verbosity.o \
midi/drivers/null_midi.o
ifeq ($(HAVE_AUDIOMIXER), 1)
DEFINES += -DHAVE_AUDIOMIXER
OBJ += tasks/task_audio_mixer.o \
$(LIBRETRO_COMM_DIR)/audio/audio_mix.o \
$(LIBRETRO_COMM_DIR)/audio/audio_mixer.o
endif
ifeq ($(HAVE_RUNAHEAD), 1)
DEFINES += -DHAVE_RUNAHEAD
OBJ += runahead/copy_load_info.o \
runahead/mem_util.o \
runahead/mylist.o \
runahead/secondary_core.o
OBJ += runahead/mem_util.o \
runahead/mylist.o
endif
ifeq ($(HAVE_CC_RESAMPLER), 1)
DEFINES += -DHAVE_CC_RESAMPLER
OBJ += audio/drivers_resampler/cc_resampler.o
ifeq ($(HAVE_NEON),1)
OBJ += audio/drivers_resampler/cc_resampler_neon.o
endif
endif
ifeq ($(HAVE_LANGEXTRA), 1)
DEFINES += -DHAVE_LANGEXTRA
DEFINES += -finput-charset=UTF-8
DEF_FLAGS += -finput-charset=UTF-8
OBJ += intl/msg_hash_de.o \
intl/msg_hash_eo.o \
@ -318,10 +327,27 @@ ifeq ($(HAVE_IMAGEVIEWER), 1)
OBJ += cores/libretro-imageviewer/image_core.o
endif
ifeq ($(HAVE_D3D9), 1)
HAVE_HLSL = 1
endif
ifeq ($(HAVE_CG), 1)
HAVE_SHADERS_COMMON = 1
endif
ifeq ($(HAVE_GLSL), 1)
HAVE_SHADERS_COMMON = 1
endif
ifeq ($(HAVE_HLSL), 1)
HAVE_SHADERS_COMMON = 1
endif
ifeq ($(HAVE_SLANG), 1)
HAVE_SHADERS_COMMON = 1
endif
# Qt WIMP GUI
ifeq ($(HAVE_OPENSSL), 1)
DEFINES += $(OPENSSL_CFLAGS)
DEF_FLAGS += $(OPENSSL_CFLAGS)
LIBS += $(OPENSSL_LIBS)
endif
@ -333,7 +359,6 @@ ifeq ($(HAVE_QT), 1)
ui/drivers/qt/ui_qt_load_core_window.o \
ui/drivers/qt/ui_qt_msg_window.o \
ui/drivers/qt/gridview.o \
ui/drivers/qt/shaderparamsdialog.o \
ui/drivers/qt/coreoptionsdialog.o \
ui/drivers/qt/filedropwidget.o \
ui/drivers/qt/coreinfodialog.o \
@ -344,17 +369,16 @@ ifeq ($(HAVE_QT), 1)
ui/drivers/qt/thumbnaildownload.o \
ui/drivers/qt/thumbnailpackdownload.o \
ui/drivers/qt/playlistthumbnaildownload.o
ifeq ($(HAVE_SHADERS_COMMON), 1)
OBJ += ui/drivers/qt/shaderparamsdialog.o
endif
ifeq ($(HAVE_MENU), 1)
OBJ += ui/drivers/qt/settingswidgets.o \
ui/drivers/qt/options/achievements.o \
ui/drivers/qt/options/audio.o \
ui/drivers/qt/options/configuration.o \
ui/drivers/qt/options/core.o \
ui/drivers/qt/options/directory.o \
ui/drivers/qt/options/drivers.o \
ui/drivers/qt/options/generic.o \
ui/drivers/qt/options/input.o \
ui/drivers/qt/options/latency.o \
ui/drivers/qt/options/logging.o \
ui/drivers/qt/options/network.o \
ui/drivers/qt/options/osd.o \
ui/drivers/qt/options/playlists.o \
@ -369,25 +393,28 @@ ifeq ($(HAVE_QT), 1)
MOC_HEADERS += ui/drivers/ui_qt.h \
ui/drivers/qt/ui_qt_load_core_window.h \
ui/drivers/qt/gridview.h \
ui/drivers/qt/shaderparamsdialog.h \
ui/drivers/qt/coreoptionsdialog.h \
ui/drivers/qt/filedropwidget.h \
ui/drivers/qt/coreinfodialog.h \
ui/drivers/qt/playlistentrydialog.h \
ui/drivers/qt/viewoptionsdialog.h
ifeq ($(HAVE_SHADERS_COMMON), 1)
MOC_HEADERS += ui/drivers/qt/shaderparamsdialog.h
endif
ifeq ($(HAVE_MENU), 1)
MOC_HEADERS += ui/drivers/qt/settingswidgets.h \
ui/drivers/qt/options/options.h
endif
DEFINES += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS) -DHAVE_MAIN
#DEFINES += $(QT5WEBENGINE_CFLAGS)
DEFINES += -DHAVE_MAIN
DEF_FLAGS += $(QT5CORE_CFLAGS) $(QT5GUI_CFLAGS) $(QT5WIDGETS_CFLAGS) $(QT5CONCURRENT_CFLAGS) $(QT5NETWORK_CFLAGS)
#DEF_FLAGS += $(QT5WEBENGINE_CFLAGS)
LIBS += $(QT5CORE_LIBS) $(QT5GUI_LIBS) $(QT5WIDGETS_LIBS) $(QT5CONCURRENT_LIBS) $(QT5NETWORK_LIBS)
#LIBS += $(QT5WEBENGINE_LIBS)
NEED_CXX_LINKER = 1
ifneq ($(findstring Linux,$(OS)),)
DEFINES += -fPIC
DEF_FLAGS += -fPIC
endif
endif
@ -509,12 +536,6 @@ ifeq ($(HAVE_STDIN_CMD), 1)
DEFINES += -DHAVE_COMMAND -DHAVE_STDIN_CMD
endif
ifeq ($(HAVE_PYTHON), 1)
DEFINES += $(PYTHON_CFLAGS) -Wno-unused-parameter
LIBS += $(PYTHON_LIBS)
OBJ += gfx/drivers_tracker/video_state_python.o
endif
ifeq ($(HAVE_EMSCRIPTEN), 1)
OBJ += frontend/drivers/platform_emscripten.o \
input/drivers/rwebinput_input.o \
@ -582,7 +603,7 @@ ifeq ($(HAVE_ALSA), 1)
endif
LIBS += $(ALSA_LIBS)
DEFINES += $(ALSA_CFLAGS)
DEF_FLAGS += $(ALSA_CFLAGS)
endif
ifeq ($(HAVE_TINYALSA), 1)
@ -593,7 +614,7 @@ endif
ifeq ($(HAVE_ROAR), 1)
OBJ += audio/drivers/roar.o
LIBS += $(ROAR_LIBS)
DEFINES += $(ROAR_CFLAGS)
DEF_FLAGS += $(ROAR_CFLAGS)
endif
ifeq ($(HAVE_AL), 1)
@ -612,13 +633,13 @@ endif
ifeq ($(HAVE_JACK),1)
OBJ += audio/drivers/jack.o
LIBS += $(JACK_LIBS)
DEFINES += $(JACK_CFLAGS)
DEF_FLAGS += $(JACK_CFLAGS)
endif
ifeq ($(HAVE_PULSE), 1)
OBJ += audio/drivers/pulse.o
LIBS += $(PULSE_LIBS)
DEFINES += $(PULSE_CFLAGS)
DEF_FLAGS += $(PULSE_CFLAGS)
endif
ifeq ($(HAVE_OSS_LIB), 1)
@ -627,7 +648,7 @@ endif
ifeq ($(HAVE_RSOUND), 1)
OBJ += audio/drivers/rsound.o
DEFINES += $(RSOUND_CFLAGS)
DEF_FLAGS += $(RSOUND_CFLAGS)
LIBS += $(RSOUND_LIBS)
endif
@ -660,7 +681,6 @@ endif
ifeq ($(HAVE_NEON),1)
OBJ += $(LIBRETRO_COMM_DIR)/audio/resampler/drivers/sinc_resampler_neon.o \
audio/drivers_resampler/cc_resampler_neon.o \
memory/neon/memcpy-neon.o
DEFINES += -DHAVE_NEON
@ -670,7 +690,6 @@ endif
OBJ += $(LIBRETRO_COMM_DIR)/audio/conversion/s16_to_float.o \
$(LIBRETRO_COMM_DIR)/audio/conversion/float_to_s16.o \
$(LIBRETRO_COMM_DIR)/audio/audio_mix.o \
$(LIBRETRO_COMM_DIR)/formats/wav/rwav.o
ifeq ($(HAVE_NEON),1)
@ -768,14 +787,16 @@ ifeq ($(HAVE_LAKKA_SWITCH), 1)
DEFINES += -DHAVE_LAKKA_SWITCH
endif
OBJ += menu/menu_shader.o
# Does not depend on HAVE_MENU
ifeq ($(HAVE_SHADERS_COMMON), 1)
OBJ += menu/menu_shader.o
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/menu_driver.o \
menu/menu_content.o \
menu/menu_entries.o \
menu/menu_setting.o \
menu/menu_networking.o \
menu/widgets/menu_filebrowser.o \
menu/widgets/menu_dialog.o \
menu/widgets/menu_input_dialog.o \
@ -803,11 +824,8 @@ ifeq ($(HAVE_MENU_COMMON), 1)
menu/menu_animation.o \
menu/drivers/menu_generic.o \
menu/drivers/null.o \
menu/menu_thumbnail_path.o
ifeq ($(HAVE_MENU_COMMON),1)
OBJ += menu/drivers_display/menu_display_null.o
endif
menu/menu_thumbnail_path.o \
menu/drivers_display/menu_display_null.o
ifeq ($(HAVE_MENU_WIDGETS), 1)
OBJ += menu/widgets/menu_widgets.o
@ -817,8 +835,7 @@ endif
ifeq ($(HAVE_OVERLAY), 1)
DEFINES += -DHAVE_OVERLAY
OBJ += tasks/task_overlay.o \
input/input_overlay.o \
led/drivers/led_overlay.o
led/drivers/led_overlay.o
endif
ifeq ($(HAVE_VIDEO_LAYOUT), 1)
@ -841,7 +858,7 @@ endif
ifeq ($(HAVE_FREETYPE), 1)
OBJ += gfx/drivers_font_renderer/freetype.o
LIBS += $(FREETYPE_LIBS)
DEFINES += $(FREETYPE_CFLAGS)
DEF_FLAGS += $(FREETYPE_CFLAGS)
endif
ifeq ($(HAVE_THREADS), 1)
@ -880,7 +897,7 @@ ifeq ($(HAVE_VITA2D), 1)
OBJ += gfx/drivers/vita2d_gfx.o \
gfx/drivers_font/vita2d_font.o
DEF_FLAGS += -I$(DEPS_DIR)/libvita2d/include
INCLUDE_DIRS += -I$(DEPS_DIR)/libvita2d/include
endif
ifeq ($(TARGET), retroarch_3ds)
@ -919,10 +936,7 @@ ifeq ($(HAVE_WAYLAND), 1)
gfx/common/wayland/xdg-shell-unstable-v6.o \
gfx/common/wayland/idle-inhibit-unstable-v1.o \
gfx/common/wayland/xdg-decoration-unstable-v1.o
ifeq ($(HAVE_EGL), 1)
LIBS += $(EGL_LIBS)
endif
DEFINES += $(WAYLAND_CFLAGS) $(WAYLAND_CURSOR_CFLAGS)
DEF_FLAGS += $(WAYLAND_CFLAGS) $(WAYLAND_CURSOR_CFLAGS)
LIBS += $(WAYLAND_LIBS) $(WAYLAND_CURSOR_LIBS)
endif
@ -944,8 +958,6 @@ endif
ifeq ($(HAVE_OPENDINGUX_FBDEV), 1)
OBJ += gfx/drivers_context/opendingux_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_X11), 1)
@ -956,9 +968,10 @@ ifeq ($(HAVE_X11), 1)
gfx/display_servers/dispserv_x11.o
LIBS += $(X11_LIBS) $(XEXT_LIBS) $(XF86VM_LIBS) $(XINERAMA_LIBS) $(XRANDR_LIBS)
DEFINES += -DHAVE_X11 $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
DEFINES += -DHAVE_X11
DEF_FLAGS += $(X11_CFLAGS) $(XEXT_CFLAGS) $(XF86VM_CFLAGS) $(XINERAMA_CFLAGS)
ifeq ($(HAVE_XCB),1)
LIBS += -lX11-xcb
LIBS += -lX11-xcb
endif
ifneq ($(HAVE_OPENGLES), 1)
OBJ += gfx/drivers_context/x_ctx.o
@ -966,12 +979,12 @@ ifeq ($(HAVE_X11), 1)
endif
ifeq ($(HAVE_XCB),1)
DEFINES += $(XCB_CFLAGS)
LIBS += $(XCB_LIBS)
DEF_FLAGS += $(XCB_CFLAGS)
LIBS += $(XCB_LIBS)
endif
ifeq ($(HAVE_XKBCOMMON), 1)
DEFINES += $(XKBCOMMON_CFLAGS)
DEF_FLAGS += $(XKBCOMMON_CFLAGS)
OBJ += input/drivers_keyboard/keyboard_event_xkb.o
LIBS += $(XKBCOMMON_LIBS)
endif
@ -983,24 +996,17 @@ ifeq ($(HAVE_DBUS), 1)
endif
ifeq ($(HAVE_UDEV), 1)
DEFINES += $(UDEV_CFLAGS)
DEF_FLAGS += $(UDEV_CFLAGS)
LIBS += $(UDEV_LIBS)
OBJ += input/drivers/udev_input.o \
input/drivers_joypad/udev_joypad.o
endif
ifeq ($(HAVE_LIBUSB), 1)
ifeq ($(HAVE_THREADS), 1)
ifeq ($(HAVE_HID), 1)
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
ifneq ($(findstring BSD,$(OS)),)
LIBS += -lusb
else
LIBS += -lusb-1.0
endif
endif
endif
DEFINES += -DHAVE_LIBUSB
OBJ += input/drivers_hid/libusb_hid.o
DEF_FLAGS += $(LIBUSB_CFLAGS)
LIBS += $(LIBUSB_LIBS)
endif
ifeq ($(HAVE_IOHIDMANAGER), 1)
@ -1046,14 +1052,13 @@ endif
# Video
OBJ += gfx/drivers_context/gfx_null_ctx.o \
gfx/video_state_tracker.o
OBJ += gfx/drivers_context/gfx_null_ctx.o
ifeq ($(HAVE_KMS), 1)
HAVE_AND_WILL_USE_DRM = 1
OBJ += gfx/drivers_context/drm_ctx.o
DEFINES += $(GBM_CFLAGS) $(DRM_CFLAGS) $(EGL_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS)
DEF_FLAGS += $(GBM_CFLAGS) $(DRM_CFLAGS)
LIBS += $(GBM_LIBS) $(DRM_LIBS)
endif
ifeq ($(HAVE_CACA), 1)
@ -1068,10 +1073,10 @@ endif
ifeq ($(HAVE_SIXEL), 1)
DEFINES += -DHAVE_SIXEL
DEF_FLAGS += -I/usr/include/sixel
INCLUDE_DIRS += -I/usr/include/sixel
OBJ += gfx/drivers/sixel_gfx.o gfx/drivers_font/sixel_font.o \
gfx/drivers_context/sixel_ctx.o
LIBS += -lsixel
LIBS += $(SIXEL_LIBS)
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_sixel.o
@ -1080,7 +1085,7 @@ endif
ifeq ($(HAVE_PLAIN_DRM), 1)
OBJ += gfx/drivers/drm_gfx.o
DEF_FLAGS += -I/usr/include/libdrm
INCLUDE_DIRS += -I/usr/include/libdrm
LIBS += -ldrm
endif
@ -1112,8 +1117,6 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
ifeq ($(HAVE_VIDEOCORE), 1)
OBJ += gfx/drivers_context/vc_egl_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_EMSCRIPTEN), 1)
@ -1122,21 +1125,15 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
ifeq ($(HAVE_MALI_FBDEV), 1)
OBJ += gfx/drivers_context/mali_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_VIVANTE_FBDEV), 1)
OBJ += gfx/drivers_context/vivante_fbdev_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
ifeq ($(HAVE_X11), 1)
ifeq ($(HAVE_EGL), 1)
OBJ += gfx/drivers_context/xegl_ctx.o
DEFINES += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
endif
endif
@ -1148,7 +1145,8 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
ifeq ($(HAVE_FFMPEG), 1)
ifneq ($(HAVE_OPENGLES), 1)
OBJ += cores/libretro-ffmpeg/ffmpeg_fft.o
DEFINES += -I$(DEPS_DIR) -DHAVE_GL_FFT
DEFINES += -DHAVE_GL_FFT
INCLUDE_DIRS += -I$(DEPS_DIR)
endif
endif
@ -1171,13 +1169,15 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
ifeq ($(HAVE_MPV), 1)
OBJ += cores/libretro-mpv/mpv-libretro.o
DEFINES += -I$(DEPS_DIR) -DHAVE_MPV
DEFINES += -DHAVE_MPV
INCLUDE_DIRS += -I$(DEPS_DIR)
LIBS += -lmpv
endif
ifeq ($(HAVE_OPENGLES), 1)
DEFINES += -DHAVE_OPENGLES
LIBS += $(OPENGLES_LIBS)
DEFINES += $(OPENGLES_CFLAGS) -DHAVE_OPENGLES
DEF_FLAGS += $(OPENGLES_CFLAGS)
ifeq ($(HAVE_OPENGLES3), 1)
DEFINES += -DHAVE_OPENGLES3
else
@ -1198,14 +1198,11 @@ ifeq ($(HAVE_GL_CONTEXT), 1)
LIBS += $(GL_LIBS)
endif
ifeq ($(HAVE_GL_MODERN), 1)
DEFINES += -DHAVE_GLSL
OBJ += gfx/drivers_shader/shader_glsl.o
endif
endif
ifeq ($(HAVE_EGL), 1)
DEFINES += -DHAVE_EGL $(EGL_CFLAGS)
DEFINES += -DHAVE_EGL
DEF_FLAGS += $(EGL_CFLAGS)
LIBS += $(EGL_LIBS)
OBJ += gfx/common/egl_common.o
endif
@ -1213,12 +1210,12 @@ endif
ifeq ($(HAVE_SDL2), 1)
HAVE_SDL_COMMON = 1
OBJ += gfx/drivers/sdl2_gfx.o
DEFINES += $(SDL2_CFLAGS)
DEF_FLAGS += $(SDL2_CFLAGS)
LIBS += $(SDL2_LIBS)
else ifeq ($(HAVE_SDL), 1)
HAVE_SDL_COMMON = 1
OBJ += gfx/drivers/sdl_gfx.o
DEFINES += $(SDL_CFLAGS)
DEF_FLAGS += $(SDL_CFLAGS)
LIBS += $(SDL_LIBS)
endif
@ -1231,7 +1228,7 @@ ifeq ($(HAVE_SDL_COMMON), 1)
OBJ += gfx/drivers_context/sdl_gl_ctx.o
endif
DEFINES += $(BSD_LOCAL_INC)
INCLUDE_DIRS += $(BSD_LOCAL_INC)
endif
ifeq ($(HAVE_XSHM), 1)
@ -1250,8 +1247,11 @@ ifeq ($(HAVE_VULKAN), 1)
OBJ += gfx/drivers/vulkan.o \
gfx/common/vulkan_common.o \
$(LIBRETRO_COMM_DIR)/vulkan/vulkan_symbol_wrapper.o \
gfx/drivers_font/vulkan_raster_font.o \
gfx/drivers_shader/shader_vulkan.o
gfx/drivers_font/vulkan_raster_font.o
ifeq ($(HAVE_SLANG), 1)
OBJ += gfx/drivers_shader/shader_vulkan.o
endif
ifeq ($(HAVE_VULKAN_DISPLAY), 1)
OBJ += gfx/drivers_context/khr_display_ctx.o
@ -1262,24 +1262,17 @@ ifeq ($(HAVE_VULKAN), 1)
NEED_CXX_LINKER = 1
DEFINES += -DHAVE_VULKAN
INCLUDE_DIRS += -Igfx/include
HAVE_SLANG = 1
HAVE_GLSLANG = 1
HAVE_SPIRV_CROSS = 1
endif
ifeq ($(HAVE_OPENGL_CORE), 1)
OBJ += gfx/drivers/gl_core.o \
gfx/drivers_font/gl_core_raster_font.o \
gfx/drivers_shader/shader_gl_core.o
gfx/drivers_shader/shader_gl_core.o
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_gl_core.o
endif
DEFINES += -DHAVE_OPENGL_CORE
HAVE_SLANG = 1
HAVE_GLSLANG = 1
HAVE_SPIRV_CROSS = 1
NEED_CXX_LINKER = 1
endif
@ -1290,7 +1283,7 @@ endif
ifeq ($(HAVE_EXYNOS), 1)
OBJ += gfx/drivers/exynos_gfx.o
LIBS += $(DRM_LIBS) $(EXYNOS_LIBS)
DEFINES += $(DRM_CFLAGS) $(EXYNOS_CFLAGS)
DEF_FLAGS += $(DRM_CFLAGS) $(EXYNOS_CFLAGS)
HAVE_AND_WILL_USE_DRM = 1
endif
@ -1310,20 +1303,14 @@ endif
ifeq ($(HAVE_VG), 1)
OBJ += gfx/drivers/vg.o
DEFINES += $(VG_CFLAGS)
DEF_FLAGS += $(VG_CFLAGS)
LIBS += $(VG_LIBS)
endif
ifeq ($(HAVE_XVIDEO), 1)
OBJ += gfx/drivers/xvideo.o
LIBS += $(XVIDEO_LIBS)
DEFINES += $(XVIDEO_CFLAGS)
endif
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o
LIBS += $(CG_LIBS)
DEF_FLAGS += $(XVIDEO_CFLAGS)
endif
ifeq ($(HAVE_D3D9), 1)
@ -1344,13 +1331,10 @@ ifeq ($(HAVE_D3D9), 1)
LIBS += -lcgD3D9
OBJ += gfx/drivers_renderchain/d3d9_cg_renderchain.o
endif
ifeq ($(HAVE_HLSL), 1)
OBJ += gfx/drivers_renderchain/d3d9_hlsl_renderchain.o
endif
endif
ifeq ($(HAVE_D3D10), 1)
HAVE_D3D_COMMON = 1
OBJ += gfx/drivers/d3d10.o \
gfx/common/d3d10_common.o \
gfx/drivers_font/d3d10_font.o
@ -1361,6 +1345,7 @@ ifeq ($(HAVE_D3D10), 1)
endif
ifeq ($(HAVE_D3D11), 1)
HAVE_D3D_COMMON = 1
OBJ += gfx/drivers/d3d11.o \
gfx/common/d3d11_common.o \
gfx/drivers_font/d3d11_font.o
@ -1368,12 +1353,10 @@ ifeq ($(HAVE_D3D11), 1)
OBJ += menu/drivers_display/menu_display_d3d11.o
endif
DEFINES += -DHAVE_D3D11
HAVE_SLANG = 1
HAVE_GLSLANG = 1
HAVE_SPIRV_CROSS = 1
endif
ifeq ($(HAVE_D3D12), 1)
HAVE_D3D_COMMON = 1
OBJ += gfx/drivers/d3d12.o \
gfx/common/d3d12_common.o \
gfx/drivers_font/d3d12_font.o
@ -1381,9 +1364,6 @@ ifeq ($(HAVE_D3D12), 1)
OBJ += menu/drivers_display/menu_display_d3d12.o
endif
DEFINES += -DHAVE_D3D12
HAVE_SLANG = 1
HAVE_GLSLANG = 1
HAVE_SPIRV_CROSS = 1
endif
ifneq ($(findstring 1, $(HAVE_D3D10) $(HAVE_D3D11) $(HAVE_D3D12)),)
@ -1441,6 +1421,22 @@ ifeq ($(HAVE_D3D_COMMON), 1)
OBJ += gfx/common/d3d_common.o
endif
ifeq ($(HAVE_CG), 1)
DEFINES += -DHAVE_CG
OBJ += gfx/drivers_shader/shader_gl_cg.o
LIBS += $(CG_LIBS)
endif
ifeq ($(HAVE_GLSL), 1)
DEFINES += -DHAVE_GLSL
OBJ += gfx/drivers_shader/shader_glsl.o
endif
ifeq ($(HAVE_HLSL),1)
DEFINES += -DHAVE_HLSL
OBJ += gfx/drivers_renderchain/d3d9_hlsl_renderchain.o
endif
ifeq ($(HAVE_SLANG),1)
DEFINES += -DHAVE_SLANG
OBJ += gfx/drivers_shader/slang_process.o
@ -1449,6 +1445,10 @@ ifeq ($(HAVE_SLANG),1)
OBJ += gfx/drivers_shader/slang_reflection.o
endif
ifeq ($(HAVE_SHADERS_COMMON), 1)
OBJ += gfx/video_shader_parse.o
endif
ifeq ($(HAVE_GLSLANG), 1)
DEFINES += -DHAVE_GLSLANG
@ -1492,6 +1492,8 @@ ifeq ($(HAVE_SPIRV_CROSS), 1)
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_glsl.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_hlsl.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_msl.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_parser.o
OBJ += $(DEPS_DIR)/SPIRV-Cross/spirv_cross_parsed_ir.o
endif
ifeq ($(WANT_WGL), 1)
@ -1506,7 +1508,7 @@ OBJ += $(LIBRETRO_COMM_DIR)/file/archive_file.o \
$(LIBRETRO_COMM_DIR)/streams/trans_stream_pipe.o
ifeq ($(HAVE_7ZIP),1)
DEF_FLAGS += -I$(DEPS_DIR)/7zip
INCLUDE_DIRS += -I$(DEPS_DIR)/7zip
HAVE_COMPRESSION = 1
DEFINES += -DHAVE_7ZIP -D_7ZIP_ST
7ZOBJ = $(DEPS_DIR)/7zip/7zIn.o \
@ -1534,11 +1536,9 @@ endif
ifeq ($(HAVE_BUILTINFLAC),1)
HAVE_FLAC = 1
DEFINES += -DHAVE_DR_FLAC -I$(DEPS_DIR)
DEF_FLAGS += -DHAVE_DR_FLAC
DEF_FLAGS += -DHAVE_FLAC -I$(DEPS_DIR)/libFLAC/include
DEFINES += -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 \
DEFINES += -DHAVE_FLAC -DHAVE_DR_FLAC -DHAVE_STDINT_H -DHAVE_LROUND -DFLAC__HAS_OGG=0 \
-DFLAC_PACKAGE_VERSION="\"retroarch\""
INCLUDE_DIRS += -I$(DEPS_DIR) -I$(DEPS_DIR)/libFLAC/include
FLACOBJ = $(DEPS_DIR)/libFLAC/bitmath.o \
$(DEPS_DIR)/libFLAC/bitreader.o \
$(DEPS_DIR)/libFLAC/cpu.o \
@ -1584,7 +1584,7 @@ ifeq ($(HAVE_BUILTINZLIB), 1)
$(DEPS_DIR)/libz/zutil.o
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/include/compat/zlib
DEFINES += -DWANT_ZLIB
else
else ifeq ($(HAVE_ZLIB),1)
HAVE_ZLIB_COMMON = 1
LIBS += $(ZLIB_LIBS)
endif
@ -1596,7 +1596,7 @@ ifeq ($(HAVE_ZLIB_COMMON), 1)
HAVE_COMPRESSION = 1
ifeq ($(HAVE_CHD), 1)
DEF_FLAGS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr
INCLUDE_DIRS += -I$(LIBRETRO_COMM_DIR)/formats/libchdr
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 \
@ -1616,6 +1616,16 @@ ifeq ($(HAVE_ZLIB_COMMON), 1)
endif
endif
ifeq ($(HAVE_CDROM), 1)
ifeq ($(CDROM_DEBUG), 1)
DEFINES += -DCDROM_DEBUG
endif
DEFINES += -DHAVE_CDROM
OBJ += $(LIBRETRO_COMM_DIR)/cdrom/cdrom.o \
$(LIBRETRO_COMM_DIR)/vfs/vfs_implementation_cdrom.o
endif
ifeq ($(HAVE_RTGA), 1)
DEFINES += -DHAVE_RTGA
OBJ += $(LIBRETRO_COMM_DIR)/formats/tga/rtga.o
@ -1678,7 +1688,8 @@ ifeq ($(HAVE_NETWORKING), 1)
tasks/task_netplay_find_content.o
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += tasks/task_pl_thumbnail_download.o
OBJ += tasks/task_pl_thumbnail_download.o \
menu/menu_networking.o
endif
ifeq ($(HAVE_SSL), 1)
@ -1713,8 +1724,8 @@ ifeq ($(HAVE_NETWORKING), 1)
# RetroAchievements
ifeq ($(HAVE_CHEEVOS), 1)
DEFINES += -DHAVE_CHEEVOS \
-Ideps/rcheevos/include
DEFINES += -DHAVE_CHEEVOS
INCLUDE_DIRS += -Ideps/rcheevos/include
OBJ += cheevos-new/cheevos.o \
cheevos-new/badges.o \
@ -1737,8 +1748,8 @@ ifeq ($(HAVE_NETWORKING), 1)
ifeq ($(HAVE_LUA), 1)
DEFINES += -DHAVE_LUA \
-DLUA_32BITS \
-Ideps/lua/src
-DLUA_32BITS
INCLUDE_DIRS += -Ideps/lua/src
OBJ += deps/lua/src/lapi.o \
deps/lua/src/lcode.o \
deps/lua/src/lctype.o \
@ -1781,7 +1792,7 @@ ifeq ($(HAVE_NETWORKING), 1)
ifeq ($(HAVE_DISCORD), 1)
NEED_CXX_LINKER = 1
DEFINES += -DHAVE_DISCORD
DEFINES += -Ideps/discord-rpc/include/ -Ideps/discord-rpc/thirdparty/rapidjson-1.1.0/include/
INCLUDE_DIRS += -Ideps/discord-rpc/include/ -Ideps/discord-rpc/thirdparty/rapidjson-1.1.0/include/
ifneq ($(HAVE_THREADS), 1)
DEFINES += -DDISCORD_DISABLE_IO_THREAD
@ -1819,7 +1830,7 @@ ifeq ($(HAVE_NETWORKING), 1)
ifeq ($(HAVE_BUILTINMINIUPNPC), 1)
HAVE_MINIUPNPC = 1
DEFINES += -DHAVE_MINIUPNPC -DHAVE_BUILTINMINIUPNPC -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR
DEFINES += -I$(DEPS_DIR)
INCLUDE_DIRS += -I$(DEPS_DIR)
OBJ += $(DEPS_DIR)/miniupnpc/igd_desc_parse.o \
$(DEPS_DIR)/miniupnpc/upnpreplyparse.o \
$(DEPS_DIR)/miniupnpc/upnpcommands.o \
@ -1841,17 +1852,19 @@ endif
ifneq ($(findstring Win32,$(OS)),)
OBJ += media/rarch.o \
gfx/common/win32_common.o \
frontend/drivers/platform_win32.o
OBJ += gfx/drivers/gdi_gfx.o \
gfx/drivers_context/gdi_ctx.o \
gfx/drivers_font/gdi_font.o \
frontend/drivers/platform_win32.o \
gfx/display_servers/dispserv_win32.o
ifeq ($(HAVE_GDI), 1)
OBJ += gfx/drivers/gdi_gfx.o \
gfx/drivers_context/gdi_ctx.o \
gfx/drivers_font/gdi_font.o
LIBS += -lmsimg32
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_gdi.o
endif
LIBS += -lmsimg32 -lhid -lsetupapi
endif
LIBS += -lhid -lsetupapi
endif
# Record
@ -1861,8 +1874,10 @@ ifeq ($(HAVE_FFMPEG), 1)
cores/libretro-ffmpeg/ffmpeg_core.o
LIBS += $(AVCODEC_LIBS) $(AVFORMAT_LIBS) $(AVUTIL_LIBS) $(SWSCALE_LIBS) $(SWRESAMPLE_LIBS) $(FFMPEG_LIBS)
DEFINES += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS)
DEFINES += -Wno-deprecated-declarations -DHAVE_FFMPEG -Iffmpeg
DEFINES += -DHAVE_FFMPEG
DEF_FLAGS += $(AVCODEC_CFLAGS) $(AVFORMAT_CFLAGS) $(AVUTIL_CFLAGS) $(SWSCALE_CFLAGS) $(SWRESAMPLE_CFLAGS) \
-Wno-deprecated-declarations
INCLUDE_DIRS += -Iffmpeg
endif
ifeq ($(HAVE_COMPRESSION), 1)
@ -1888,8 +1903,7 @@ ifneq ($(findstring DOS,$(OS)),)
gfx/drivers_font/vga_font.o \
input/drivers/dos_input.o \
input/drivers_joypad/dos_joypad.o \
frontend/drivers/platform_dos.o \
input/drivers_keyboard/keyboard_event_dos.o
frontend/drivers/platform_dos.o
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_vga.o
@ -1913,7 +1927,7 @@ endif
ifeq ($(WANT_IOSUHAX), 1)
DEFINES += -DHAVE_IOSUHAX
DEF_FLAGS += -I$(DEPS_DIR)/libiosuhax
INCLUDE_DIRS += -I$(DEPS_DIR)/libiosuhax
OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \
$(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \
$(DEPS_DIR)/libiosuhax/iosuhax_disc_interface.o
@ -1921,7 +1935,7 @@ endif
ifeq ($(WANT_LIBFAT), 1)
DEFINES += -DHAVE_LIBFAT
DEF_FLAGS += -I$(DEPS_DIR)/libfat/include
INCLUDE_DIRS += -I$(DEPS_DIR)/libfat/include
OBJ += $(DEPS_DIR)/libfat/cache.o \
$(DEPS_DIR)/libfat/directory.o \
$(DEPS_DIR)/libfat/disc.o \
@ -1955,7 +1969,7 @@ endif
# Help at https://modmyclassic.com/comp
ifeq ($(HAVE_CLASSIC), 1)
DEF_FLAGS += -DHAVE_CLASSIC
DEFINES += -DHAVE_CLASSIC
endif
ifeq ($(HAVE_C_A7A7), 1)
@ -1980,6 +1994,6 @@ ifeq ($(HAVE_C_A7A7), 1)
endif
ifeq ($(HAVE_HAKCHI), 1)
DEF_FLAGS += -DHAVE_HAKCHI
DEFINES += -DHAVE_HAKCHI
endif
##################################

View File

@ -10,6 +10,7 @@ DEFINES := -DRARCH_INTERNAL -DHAVE_MAIN -s USE_PTHREADS=$(PTHREAD)
DEFINES += -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_GLSL -DHAVE_FILTERS_BUILTIN -DHAVE_STB_FONT
HAVE_OVERLAY = 1
HAVE_AUDIOMIXER = 1
HAVE_VIDEO_LAYOUT = 0
HAVE_CC_RESAMPLER = 1
HAVE_EGL = 1

View File

@ -33,13 +33,13 @@ endif
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
ifeq ($(shell uname -s),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
else ifneq ($(findstring MINGW,$(shell uname -s)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
else ifneq ($(findstring Darwin,$(shell uname -s)),)
platform = osx
else ifneq ($(findstring win,$(shell uname -a)),)
else ifneq ($(findstring win,$(shell uname -s)),)
platform = win
endif
endif
@ -47,12 +47,12 @@ endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
ifeq ($(shell uname -s),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
else ifneq ($(findstring Darwin,$(shell uname -s)),)
system_platform = osx
else ifneq ($(findstring MINGW,$(shell uname -a)),)
else ifneq ($(findstring MINGW,$(shell uname -s)),)
system_platform = win
endif
@ -77,9 +77,13 @@ endif
ifneq (,$(findstring msvc,$(platform)))
LIBS := $(WHOLE_START) $(WHOLE_END)
else
ifneq (,$(findstring unix,$(platform)))
LIBS := $(WHOLE_START) $(WHOLE_END)
else
LIBS := $(WHOLE_START) -lretro_$(platform) $(WHOLE_END)
endif
endif
libogc_platform :=
@ -180,6 +184,7 @@ else ifeq ($(libogc_platform), 1)
CFLAGS += -DGEKKO -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int
HAVE_AUDIOMIXER := 1
HAVE_RUNAHEAD := 1
HAVE_FILTERS_BUILTIN := 1
HAVE_THREADS := 1
@ -197,7 +202,8 @@ else ifeq ($(libogc_platform), 1)
RARCH_CONSOLE = 1
ifeq ($(platform), wii)
#HAVE_LANGEXTRA := 1
HAVE_AUDIOMIXER := 1
#HAVE_LANGEXTRA := 1
HAVE_WIIUSB_HID := 1
HAVE_RARCH_EXEC := 1
HAVE_RSOUND := 1
@ -360,6 +366,7 @@ else ifeq ($(platform), windows_msvc6_x86)
export INCLUDE := $(INCLUDE);$(INETSDK)\Include;libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
export LIB := $(LIB);$(INETSDK)\Lib
else ifeq ($(platform), windows_msvc2003_x86)
HAVE_GDI := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
@ -409,6 +416,7 @@ else ifeq ($(platform), windows_msvc2003_x86)
export LIB := $(LIB);$(INETSDK)\Lib
endif
else ifeq ($(platform), windows_msvc2005_x86)
HAVE_GDI := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
@ -459,6 +467,8 @@ else ifeq ($(platform), windows_msvc2005_x86)
export LIB := $(LIB);$(INETSDK)\Lib
endif
else ifneq (,$(findstring windows_msvc2010,$(platform)))
HAVE_GDI := 1
HAVE_AUDIOMIXER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
@ -469,7 +479,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
@ -483,6 +493,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
HAVE_DYLIB := 1
HAVE_DYNAMIC := 1
HAVE_GRIFFIN_CPP := 1
HAVE_RUNAHEAD := 1
HAVE_DIRECTX ?= 1
EXT_TARGET := $(TARGET_NAME).exe
@ -492,7 +503,7 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
LD = link.exe
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib msimg32.lib
PlatformSuffix = $(subst windows_msvc2010_,,$(platform))
@ -532,6 +543,8 @@ else ifneq (,$(findstring windows_msvc2010,$(platform)))
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
endif
else ifneq (,$(findstring windows_msvc2012,$(platform)))
HAVE_GDI := 1
HAVE_AUDIOMIXER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
@ -542,7 +555,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
@ -556,6 +569,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
HAVE_DYLIB := 1
HAVE_DYNAMIC := 1
HAVE_GRIFFIN_CPP := 1
HAVE_RUNAHEAD := 1
HAVE_DIRECTX ?= 1
EXT_TARGET := $(TARGET_NAME).exe
@ -565,7 +579,7 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
LD = link.exe
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
PlatformSuffix = $(subst windows_msvc2012_,,$(platform))
@ -609,6 +623,8 @@ else ifneq (,$(findstring windows_msvc2012,$(platform)))
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
endif
else ifneq (,$(findstring windows_msvc2013,$(platform)))
HAVE_GDI := 1
HAVE_AUDIOMIXER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
@ -619,7 +635,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
@ -633,6 +649,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
HAVE_DYLIB := 1
HAVE_DYNAMIC := 1
HAVE_GRIFFIN_CPP := 1
HAVE_RUNAHEAD := 1
HAVE_DIRECTX ?= 1
EXT_TARGET := $(TARGET_NAME).exe
@ -642,7 +659,7 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
LD = link.exe
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
PlatformSuffix = $(subst windows_msvc2013_,,$(platform))
@ -686,6 +703,8 @@ else ifneq (,$(findstring windows_msvc2013,$(platform)))
export LIB := $(LIB);$(WindowsSdkDir)\$(PlatLib)
endif
else ifneq (,$(findstring windows_msvc2015,$(platform)))
HAVE_GDI := 1
HAVE_AUDIOMIXER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
@ -696,7 +715,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
@ -710,6 +729,7 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
HAVE_DYLIB := 1
HAVE_DYNAMIC := 1
HAVE_GRIFFIN_CPP := 1
HAVE_RUNAHEAD := 1
HAVE_DIRECTX ?= 1
EXT_TARGET := $(TARGET_NAME).exe
@ -718,9 +738,9 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
CXX = cl.exe
LD = link.exe
PLATCFLAGS += -utf-8
PLATCFLAGS += -utf-8
PLATCFLAGS += -D_WIN32 -D__STDC_CONSTANT_MACROS -D_MBCS
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG
PLATCFLAGS += -D__i686__ -D__MMX__ -D__SSE__ -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINDOWS -DHAVE_CC_RESAMPLER -DHAVE_GL_SYNC -DHAVE_GLSL -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_OPENGL -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DWIN32 -DHAVE_EASTEREGG -DHAVE_CDROM
LDFLAGS += shell32.lib user32.lib gdi32.lib comdlg32.lib winmm.lib ole32.lib iphlpapi.lib
PlatformSuffix = $(subst windows_msvc2015_,,$(platform))
@ -778,10 +798,43 @@ else ifneq (,$(findstring windows_msvc2015,$(platform)))
export INCLUDE := $(INCLUDE);libretro-common\include;libretro-common\include\compat\msvc;gfx\include;deps;deps\stb
export LIB := $(LIB)
endif
else ifneq (,$(findstring unix,$(platform)))
HAVE_AUDIOMIXER := 1
HAVE_RPNG := 1
HAVE_RJPEG := 1
HAVE_RBMP := 1
HAVE_RTGA := 1
HAVE_BUILTINZLIB := 1
HAVE_ZLIB := 1
WANT_ZLIB := 1
HAVE_7ZIP := 1
HAVE_NETWORKING := 1
HAVE_NETWORK_CMD := 1
HAVE_NETPLAYDISCOVERY := 1
HAVE_OVERLAY := 1
HAVE_VIDEO_LAYOUT := 0
HAVE_MATERIALUI := 1
HAVE_XMB := 1
HAVE_STB_FONT := 1
HAVE_THREADS := 1
HAVE_LIBRETRODB := 1
HAVE_COMMAND := 1
HAVE_STDIN_CMD := 1
HAVE_CMD := 1
HAVE_DYLIB := 1
HAVE_DYNAMIC := 1
HAVE_GRIFFIN_CPP := 1
WANT_GLSLANG := 1
PLATCFLAGS += -DHAVE_EASTEREGG -D__MMX__ -D__SSE__ -DHAVE_OPENGL -DHAVE_OPENGL1 -DHAVE_GLSL -DHAVE_SHADERPIPELINE -DHAVE_OZONE -DHAVE_CC_RESAMPLER -DHAVE_CHEEVOS -DRC_DISABLE_LUA -DHAVE_FBO -DHAVE_GL_SYNC -DHAVE_SLANG -DHAVE_GLSLANG -DHAVE_IMAGEVIEWER -DHAVE_LANGEXTRA -DHAVE_RUNAHEAD -DHAVE_MENU_WIDGETS -DHAVE_SPIRV_CROSS -DHAVE_STB_FONT -DHAVE_UPDATE_ASSETS -DHAVE_VULKAN -DHAVE_XMB -DRARCH_INTERNAL -DWANT_GLSLANG -DHAVE_X11 -DHAVE_XCB -DHAVE_UDEV -DHAVE_PULSE
EXT_TARGET := $(TARGET_NAME)
EXT_INTER_TARGET := $(TARGET_NAME)
INCLUDE += -Ilibretro-common/include -Igfx/include -Ideps -Ideps/stb -Ideps/rcheevos/include -Ideps/SPIRV-Cross -Ideps/glslang -I.
LIBS += -ldl -lm -lpthread -lGL -ludev -lpulse -lX11 -lX11-xcb -lXxf86vm
endif
ifneq (,$(findstring msvc,$(platform)))
CFLAGS += -W2 $(MACHDEP) $(PLATCFLAGS)
CFLAGS += -W3 $(MACHDEP) $(PLATCFLAGS)
else
CFLAGS += -Wall -std=gnu99 $(MACHDEP) $(PLATCFLAGS) $(INCLUDE)
INCLUDE += -I./libretro-common/include \
@ -877,6 +930,10 @@ ifeq ($(HAVE_7ZIP), 1)
CFLAGS += -DHAVE_7ZIP
endif
ifeq ($(HAVE_AUDIOMIXER), 1)
CFLAGS += -DHAVE_AUDIOMIXER
endif
ifeq ($(HAVE_OVERLAY), 1)
CFLAGS += -DHAVE_OVERLAY
endif

View File

@ -21,6 +21,7 @@ OBJ :=
DEFINES := -D__SWITCH__=1 -U__linux__ -U__linux -DGLM_FORCE_PURE=1 -DRARCH_CONSOLE -DRARCH_INTERNAL -DGLOBAL_CONFIG_DIR='"/switch"' -DHAVE_STB_VORBIS
HAVE_AUDIOMIXER = 1
HAVE_CC_RESAMPLER = 1
HAVE_MENU_COMMON = 1
HAVE_RTGA = 1
@ -60,6 +61,7 @@ ifeq ($(HAVE_OPENGL), 1)
HAVE_OZONE = 1
HAVE_OVERLAY = 1
HAVE_VIDEO_LAYOUT = 0
HAVE_GLSL = 1
else
HAVE_RGUI = 1
HAVE_MATERIALUI = 0
@ -112,7 +114,7 @@ APP_ICON := pkg/libnx/retroarch.jpg
ARCH := -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd
CFLAGS := -g -Wall -O3 -ffast-math -ffunction-sections \
$(ARCH) $(DEFINES) -Ideps -Ideps/libz -Ilibretro-common/include -Ilibretro-common/include/compat/zlib -Ideps/stb -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h #$(shell $(PORTLIBS)/bin/freetype-config --cflags)
$(ARCH) $(DEFINES) $(INCLUDE_DIRS) -I$(LIBNX)/include -I$(PORTLIBS)/include/ -include $(LIBNX)/include/switch.h #$(shell $(PORTLIBS)/bin/freetype-config --cflags)
CFLAGS += $(INCLUDE) -DSWITCH=1 -DHAVE_LIBNX=1 -DNXLINK=1 -DHAVE_SHADERPIPELINE -DHAVE_UPDATE_ASSETS -DHAVE_STB_FONT #-DHAVE_FREETYPE
@ -125,6 +127,9 @@ CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
ASFLAGS := -g $(ARCH)
LDFLAGS = -specs=$(DEVKITPRO)/libnx/switch.specs $(ARCH) -Wl,--allow-multiple-definition -Wl,-Map,$(notdir $*.map)
# add things from Makefile.common
CFLAGS += $(DEF_FLAGS)
LIBS := -lswresample -lavformat -lavcodec -lavutil -lswscale -lstdc++ -lbz2 -lpng -lz -lnx -lm
ifeq ($(HAVE_OPENGL), 1)

View File

@ -11,6 +11,7 @@ WindowsSdkDir = C:\Program Files (x86)\Windows Kits\10\$(NOTHING)
WindowsSDKVersion := 10.0.14393.0\$(NOTHING)
VCINSTALLDIR := C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\$(NOTHING)
HAVE_AUDIOMIXER := 1
HAVE_D3DX := 1
HAVE_D3D8 := 0
HAVE_D3D9 := 1

View File

@ -35,6 +35,7 @@ else
HAVE_7ZIP := 1
HAVE_EGL := 1
HAVE_MENU_WIDGETS := 1
HAVE_GLSL := 1
HAVE_OPENGLES := 1
HAVE_NETWORKING := 0
HAVE_SOCKET_LEGACY := 0

View File

@ -14,6 +14,7 @@ ifeq ($(GRIFFIN_BUILD), 1)
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB
DEFINES += -DHAVE_RUNAHEAD -DHAVE_DYNAMIC
else
HAVE_AUDIOMIXER = 1
HAVE_CC_RESAMPLER = 1
HAVE_MENU_COMMON = 1
HAVE_RTGA = 1

View File

@ -47,6 +47,7 @@ else
HAVE_LIBRETRODB := 1
HAVE_CC_RESAMPLER := 1
HAVE_CHEEVOS := 1
HAVE_RUNAHEAD := 1
RARCH_CONSOLE := 1
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1

View File

@ -93,8 +93,6 @@ endif
OBJ += gfx/drivers/gx2_shaders/snow.o
OBJ += gfx/drivers/gx2_shaders/snow_simple.o
OBJ += gfx/drivers/gx2_shaders/snowflake.o
OBJ += gfx/drivers_shader/slang_preprocess.o
OBJ += gfx/drivers_shader/glslang_util.o
ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
@ -104,18 +102,23 @@ endif
INCDIRS += -Ideps -Ideps/libfat/include -Ideps/libiosuhax
# pad_functions uses wiiu/input.h
INCDIRS += -Iinput/include
INCDIRS += -Ideps/SPIRV-Cross
DEFINES += -DHAVE_AUDIOMIXER
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_LIBRETRODB
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_SPIRV_CROSS -DHAVE_SLANG
DEFINES += -DHAVE_STB_FONT -DHAVE_STB_VORBIS -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB -DHAVE_NETWORKING -DHAVE_NETPLAYDISCOVERY
#DEFINES += -DWANT_IFADDRS
#DEFINES += -DHAVE_FREETYPE
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
DEFINES += -DHAVE_HID
DEFINES += -DWANT_LIBFAT -DHAVE_LIBFAT -DWANT_IOSUHAX -DHAVE_IOSUHAX
DEFINES += -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
# $(GRIFFIN_BUILD),0
else
HAVE_AUDIOMIXER = 1
HAVE_MENU_COMMON = 1
HAVE_RTGA = 1
HAVE_RPNG = 1
@ -138,6 +141,8 @@ endif
HAVE_CHEEVOS = 1
#WANT_IFADDRS = 1
HAVE_OVERLAY = 1
HAVE_SPIRV_CROSS = 1
HAVE_SLANG = 1
HAVE_VIDEO_LAYOUT = 0
HAVE_STATIC_VIDEO_FILTERS = 1
HAVE_STATIC_AUDIO_FILTERS = 1
@ -201,7 +206,7 @@ CFLAGS := -mcpu=750 -meabi -mhard-float
CFLAGS += -ffast-math -Werror=implicit-function-declaration
CFLAGS += -ffunction-sections -fdata-sections
#CFLAGS += -fomit-frame-pointer -mword-relocations
#CFLAGS += -Wall
#CFLAGS += -Wall
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
@ -210,7 +215,6 @@ else
endif
ASFLAGS := $(CFLAGS) -mregnames
CXXFLAGS = $(CFLAGS) -fno-rtti -fno-exceptions
#-----------------------------
# Linking/library flags
@ -254,7 +258,7 @@ ifeq ($(strip $(DEVKITPRO)),)
$(error "Please set DEVKITPRO in your environment. export DEVKITPRO=<path to>devkitPRO")
endif
export PATH := $(PATH):$(DEVKITPPC)/bin
export PATH := $(PATH):$(DEVKITPPC)/bin
PREFIX := powerpc-eabi-

View File

@ -1,5 +1,6 @@
TARGET = retroarch.exe
HAVE_AUDIOMIXER = 1
HAVE_DINPUT = 1
HAVE_XAUDIO = 1
HAVE_DSOUND = 1

View File

@ -79,11 +79,6 @@ static INLINE unsigned write_avail(unsigned read_ptr,
return (read_ptr + buffer_size - write_ptr) % buffer_size;
}
static INLINE void get_positions(dsound_t *ds, DWORD *read_ptr, DWORD *write_ptr)
{
IDirectSoundBuffer_GetCurrentPosition(ds->dsb, read_ptr, write_ptr);
}
#define CHUNK_SIZE 256
struct audio_lock
@ -97,51 +92,44 @@ struct audio_lock
static INLINE bool grab_region(dsound_t *ds, uint32_t write_ptr,
struct audio_lock *region)
{
const char *err = NULL;
HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
&region->chunk1, &region->size1, &region->chunk2, &region->size2, 0);
if (res == DSERR_BUFFERLOST)
{
res = IDirectSoundBuffer_Restore(ds->dsb);
if (res != DS_OK)
if ((res = IDirectSoundBuffer_Restore(ds->dsb)) != DS_OK)
return false;
res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
&region->chunk1, &region->size1, &region->chunk2, &region->size2, 0);
if (res != DS_OK)
if ((res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE,
&region->chunk1, &region->size1, &region->chunk2, &region->size2, 0)) != DS_OK)
return false;
}
if (res == DS_OK)
return true;
#ifdef DEBUG
switch (res)
{
case DSERR_BUFFERLOST:
err = "DSERR_BUFFERLOST";
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_BUFFERLOST");
break;
case DSERR_INVALIDCALL:
err = "DSERR_INVALIDCALL";
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_INVALIDCALL");
break;
case DSERR_INVALIDPARAM:
err = "DSERR_INVALIDPARAM";
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_INVALIDPARAM");
break;
case DSERR_PRIOLEVELNEEDED:
err = "DSERR_PRIOLEVELNEEDED";
RARCH_WARN("[DirectSound error]: %s\n", "DSERR_PRIOLEVELNEEDED");
break;
default:
return true;
break;
}
#endif
RARCH_WARN("[DirectSound error]: %s\n", err);
return false;
}
static INLINE void release_region(dsound_t *ds, const struct audio_lock *region)
{
IDirectSoundBuffer_Unlock(ds->dsb, region->chunk1,
region->size1, region->chunk2, region->size2);
}
#ifdef HAVE_THREADS
static void dsound_thread(void *data)
#else
@ -153,15 +141,16 @@ static DWORD CALLBACK dsound_thread(PVOID data)
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
get_positions(ds, NULL, &write_ptr);
IDirectSoundBuffer_GetCurrentPosition(ds->dsb, NULL, &write_ptr);
write_ptr = (write_ptr + ds->buffer_size / 2) % ds->buffer_size;
while (ds->thread_alive)
{
bool is_pull = false;
struct audio_lock region;
DWORD read_ptr, avail, fifo_avail;
get_positions(ds, &read_ptr, NULL);
IDirectSoundBuffer_GetCurrentPosition(ds->dsb, &read_ptr, NULL);
avail = write_avail(read_ptr, write_ptr, ds->buffer_size);
EnterCriticalSection(&ds->crit);
@ -192,12 +181,8 @@ static DWORD CALLBACK dsound_thread(PVOID data)
{
/* Got space to write, but nothing in FIFO (underrun),
* fill block with silence. */
memset(region.chunk1, 0, region.size1);
memset(region.chunk2, 0, region.size2);
release_region(ds, &region);
write_ptr = (write_ptr + region.size1 + region.size2) % ds->buffer_size;
}
else
{
@ -210,11 +195,16 @@ static DWORD CALLBACK dsound_thread(PVOID data)
fifo_read(ds->buffer, region.chunk2, region.size2);
LeaveCriticalSection(&ds->crit);
release_region(ds, &region);
write_ptr = (write_ptr + region.size1 + region.size2) % ds->buffer_size;
SetEvent(ds->event);
is_pull = true;
}
IDirectSoundBuffer_Unlock(ds->dsb, region.chunk1,
region.size1, region.chunk2, region.size2);
write_ptr = (write_ptr + region.size1 + region.size2)
% ds->buffer_size;
if (is_pull)
SetEvent(ds->event);
}
ExitThread(0);

View File

@ -106,7 +106,7 @@ enum rsd_format
RSD_S32_NE = 0x1000,
RSD_U32_LE = 0x2000,
RSD_U32_BE = 0x4000,
RSD_U32_NE = 0x8000,
RSD_U32_NE = 0x8000
};
/* Defines operations that can be used with rsd_set_param() */

View File

@ -2257,7 +2257,7 @@ static void * tinyalsa_init(const char *devicestr, unsigned rate,
RARCH_LOG("[TINYALSA]: Can pause: %s.\n", tinyalsa->can_pause ? "yes" : "no");
RARCH_LOG("[TINYALSA]: Audio rate: %uHz.\n", config.rate);
RARCH_LOG("[TINYALSA]: Buffer size: %u frames.\n", buffer_size);
RARCH_LOG("[TINYALSA]: Buffer size: %u bytes.\n", tinyalsa->buffer_size);
RARCH_LOG("[TINYALSA]: Buffer size: %u bytes.\n", (unsigned int)tinyalsa->buffer_size);
RARCH_LOG("[TINYALSA]: Frame size: %u bytes.\n", tinyalsa->frame_bits / 8);
RARCH_LOG("[TINYALSA]: Latency: %ums.\n", buffer_size * 1000 / (rate * 4));

View File

@ -254,52 +254,6 @@ error:
return NULL;
}
static size_t xaudio2_write(xaudio2_t *handle, const uint8_t *buffer, size_t bytes_)
{
unsigned bytes = bytes_;
while (bytes)
{
unsigned need = MIN(bytes, handle->bufsize - handle->bufptr);
memcpy(handle->buf + handle->write_buffer *
handle->bufsize + handle->bufptr,
buffer, need);
handle->bufptr += need;
buffer += need;
bytes -= need;
if (handle->bufptr == handle->bufsize)
{
XAUDIO2_BUFFER xa2buffer;
while (handle->buffers == MAX_BUFFERS - 1)
WaitForSingleObject(handle->hEvent, INFINITE);
xa2buffer.Flags = 0;
xa2buffer.AudioBytes = handle->bufsize;
xa2buffer.pAudioData = handle->buf + handle->write_buffer * handle->bufsize;
xa2buffer.PlayBegin = 0;
xa2buffer.PlayLength = 0;
xa2buffer.LoopBegin = 0;
xa2buffer.LoopLength = 0;
xa2buffer.LoopCount = 0;
xa2buffer.pContext = NULL;
if (FAILED(IXAudio2SourceVoice_SubmitSourceBuffer(
handle->pSourceVoice, &xa2buffer, NULL)))
return 0;
InterlockedIncrement((LONG volatile*)&handle->buffers);
handle->bufptr = 0;
handle->write_buffer = (handle->write_buffer + 1) & MAX_BUFFERS_MASK;
}
}
return bytes_;
}
static void *xa_init(const char *device, unsigned rate, unsigned latency,
unsigned block_frames,
unsigned *new_rate)
@ -336,8 +290,10 @@ static void *xa_init(const char *device, unsigned rate, unsigned latency,
static ssize_t xa_write(void *data, const void *buf, size_t size)
{
size_t ret;
xa_t *xa = (xa_t*)data;
unsigned bytes;
xa_t *xa = (xa_t*)data;
xaudio2_t *handle = xa->xa;
const uint8_t *buffer = (const uint8_t*)buf;
if (xa->nonblock)
{
@ -349,10 +305,52 @@ static ssize_t xa_write(void *data, const void *buf, size_t size)
size = avail;
}
ret = xaudio2_write(xa->xa, (const uint8_t*)buf, size);
if (ret == 0 && size > 0)
return -1;
return ret;
bytes = size;
while (bytes)
{
unsigned need = MIN(bytes, handle->bufsize - handle->bufptr);
memcpy(handle->buf + handle->write_buffer *
handle->bufsize + handle->bufptr,
buffer, need);
handle->bufptr += need;
buffer += need;
bytes -= need;
if (handle->bufptr == handle->bufsize)
{
XAUDIO2_BUFFER xa2buffer;
while (handle->buffers == MAX_BUFFERS - 1)
WaitForSingleObject(handle->hEvent, INFINITE);
xa2buffer.Flags = 0;
xa2buffer.AudioBytes = handle->bufsize;
xa2buffer.pAudioData = handle->buf + handle->write_buffer * handle->bufsize;
xa2buffer.PlayBegin = 0;
xa2buffer.PlayLength = 0;
xa2buffer.LoopBegin = 0;
xa2buffer.LoopLength = 0;
xa2buffer.LoopCount = 0;
xa2buffer.pContext = NULL;
if (FAILED(IXAudio2SourceVoice_SubmitSourceBuffer(
handle->pSourceVoice, &xa2buffer, NULL)))
{
if (size > 0)
return -1;
return 0;
}
InterlockedIncrement((LONG volatile*)&handle->buffers);
handle->bufptr = 0;
handle->write_buffer = (handle->write_buffer + 1) & MAX_BUFFERS_MASK;
}
}
return size;
}
static bool xa_stop(void *data)

View File

@ -1771,7 +1771,10 @@ found:
coro->json, coro->k))
CHEEVOS_ERR(RCHEEVOS_TAG "error writing badge %s\n", coro->badge_fullpath);
else
{
CHEEVOS_FREE(coro->json);
coro->json = NULL;
}
}
}
}

View File

@ -467,7 +467,7 @@ static int rcheevos_read_number(void* userdata,
}
else if (ud->is_console_id)
{
ud->patchdata->console_id = strtol(number, NULL, 10);
ud->patchdata->console_id = (unsigned)strtol(number, NULL, 10);
ud->is_console_id = 0;
}

3102
command.c

File diff suppressed because it is too large Load Diff

View File

@ -72,11 +72,8 @@ enum event_command
CMD_EVENT_REWIND_INIT,
/* Toggles rewind. */
CMD_EVENT_REWIND_TOGGLE,
/* Deinitializes autosave. */
CMD_EVENT_AUTOSAVE_DEINIT,
/* Initializes autosave. */
CMD_EVENT_AUTOSAVE_INIT,
CMD_EVENT_AUTOSAVE_STATE,
/* Stops audio. */
CMD_EVENT_AUDIO_STOP,
/* Starts audio. */
@ -101,10 +98,6 @@ enum event_command
CMD_EVENT_OVERLAY_NEXT,
/* Deinitializes overlay. */
CMD_EVENT_DSP_FILTER_INIT,
/* Deinitializes graphics filter. */
CMD_EVENT_DSP_FILTER_DEINIT,
/* Deinitializes GPU recoring. */
CMD_EVENT_GPU_RECORD_DEINIT,
/* Initializes recording system. */
CMD_EVENT_RECORD_INIT,
/* Deinitializes recording system. */
@ -121,19 +114,12 @@ enum event_command
CMD_EVENT_CORE_DEINIT,
/* Initializes core. */
CMD_EVENT_CORE_INIT,
/* Set audio blocking state. */
CMD_EVENT_AUDIO_SET_BLOCKING_STATE,
/* Set audio nonblocking state. */
CMD_EVENT_AUDIO_SET_NONBLOCKING_STATE,
/* Apply video state changes. */
CMD_EVENT_VIDEO_APPLY_STATE_CHANGES,
/* Set video blocking state. */
CMD_EVENT_VIDEO_SET_BLOCKING_STATE,
/* Set video nonblocking state. */
CMD_EVENT_VIDEO_SET_NONBLOCKING_STATE,
/* Sets current aspect ratio index. */
CMD_EVENT_VIDEO_SET_ASPECT_RATIO,
CMD_EVENT_RESET_CONTEXT,
/* Restarts RetroArch. */
CMD_EVENT_RESTART_RETROARCH,
/* Shutdown the OS */
@ -152,7 +138,6 @@ enum event_command
CMD_EVENT_UNPAUSE,
/* Unpauses retroArch. */
CMD_EVENT_PAUSE,
CMD_EVENT_PAUSE_CHECKS,
CMD_EVENT_MENU_RESET_TO_DEFAULT_CONFIG,
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG,
CMD_EVENT_MENU_SAVE_CURRENT_CONFIG_OVERRIDE_CORE,
@ -166,20 +151,8 @@ enum event_command
CMD_EVENT_SHADERS_APPLY_CHANGES,
/* A new shader preset has been loaded */
CMD_EVENT_SHADER_PRESET_LOADED,
/* Initializes shader directory. */
CMD_EVENT_SHADER_DIR_INIT,
/* Deinitializes shader directory. */
CMD_EVENT_SHADER_DIR_DEINIT,
/* Initializes controllers. */
CMD_EVENT_CONTROLLERS_INIT,
/* Initializes cheats. */
CMD_EVENT_CHEATS_INIT,
/* Deinitializes cheats. */
CMD_EVENT_CHEATS_DEINIT,
/* Apply cheats. */
CMD_EVENT_CHEATS_APPLY,
/* Deinitializes network system. */
CMD_EVENT_NETWORK_DEINIT,
/* Initializes network system. */
CMD_EVENT_NETWORK_INIT,
/* Initializes netplay system with a string or no host specified. */
@ -196,22 +169,6 @@ enum event_command
CMD_EVENT_NETPLAY_ENABLE_HOST,
/* Disconnect from the netplay host. */
CMD_EVENT_NETPLAY_DISCONNECT,
/* Initializes BSV movie. */
CMD_EVENT_BSV_MOVIE_INIT,
/* Deinitializes BSV movie. */
CMD_EVENT_BSV_MOVIE_DEINIT,
/* Initializes command interface. */
CMD_EVENT_COMMAND_INIT,
/* Deinitialize command interface. */
CMD_EVENT_COMMAND_DEINIT,
/* Initializes remote gamepad interface. */
CMD_EVENT_REMOTE_INIT,
/* Deinitializes remote gamepad interface. */
CMD_EVENT_REMOTE_DEINIT,
/* Initializes keyboard to gamepad mapper interface. */
CMD_EVENT_MAPPER_INIT,
/* Deinitializes keyboard to gamepad mapper interface. */
CMD_EVENT_MAPPER_DEINIT,
/* Reinitializes audio driver. */
CMD_EVENT_AUDIO_REINIT,
/* Resizes windowed scale. Will reinitialize video driver. */
@ -235,16 +192,11 @@ enum event_command
CMD_EVENT_UI_COMPANION_TOGGLE,
/* Toggles fullscreen mode. */
CMD_EVENT_FULLSCREEN_TOGGLE,
CMD_EVENT_PERFCNT_REPORT_FRONTEND_LOG,
CMD_EVENT_VOLUME_UP,
CMD_EVENT_VOLUME_DOWN,
CMD_EVENT_MIXER_VOLUME_UP,
CMD_EVENT_MIXER_VOLUME_DOWN,
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_OSK_TOGGLE,
CMD_EVENT_RECORDING_TOGGLE,
@ -255,7 +207,8 @@ enum event_command
CMD_EVENT_SHADER_PREV,
CMD_EVENT_CHEAT_INDEX_PLUS,
CMD_EVENT_CHEAT_INDEX_MINUS,
CMD_EVENT_CHEAT_TOGGLE
CMD_EVENT_CHEAT_TOGGLE,
CMD_EVENT_AI_SERVICE_CALL
};
bool command_set_shader(const char *arg);

View File

@ -53,6 +53,46 @@
#define DEFAULT_ASPECT_RATIO -1.0f
#endif
#if defined(ANDROID)
#define DEFAULT_MAX_PADS 8
#define ANDROID_KEYBOARD_PORT DEFAULT_MAX_PADS
#elif defined(_3DS)
#define DEFAULT_MAX_PADS 1
#elif defined(SWITCH) || defined(HAVE_LIBNX)
#define DEFAULT_MAX_PADS 8
#elif defined(WIIU)
#ifdef WIIU_HID
#define DEFAULT_MAX_PADS 16
#else
#define DEFAULT_MAX_PADS 5
#endif
#elif defined(DJGPP)
#define DEFAULT_MAX_PADS 1
#define DOS_KEYBOARD_PORT DEFAULT_MAX_PADS
#elif defined(XENON)
#define DEFAULT_MAX_PADS 4
#elif defined(VITA) || defined(SN_TARGET_PSP2)
#define DEFAULT_MAX_PADS 4
#elif defined(PSP)
#define DEFAULT_MAX_PADS 1
#elif defined(PS2)
#define DEFAULT_MAX_PADS 2
#elif defined(GEKKO) || defined(HW_RVL)
#define DEFAULT_MAX_PADS 4
#elif defined(__linux__) || (defined(BSD) && !defined(__MACH__))
#define DEFAULT_MAX_PADS 8
#elif defined(__QNX__)
#define DEFAULT_MAX_PADS 8
#elif defined(__CELLOS_LV2__)
#define DEFAULT_MAX_PADS 7
#elif defined(_XBOX)
#define DEFAULT_MAX_PADS 4
#elif defined(HAVE_XINPUT) && !defined(HAVE_DINPUT)
#define DEFAULT_MAX_PADS 4
#else
#define DEFAULT_MAX_PADS 16
#endif
#if defined(RARCH_MOBILE) || defined(HAVE_LIBNX)
#define DEFAULT_POINTER_ENABLE true
#else
@ -155,7 +195,7 @@
#define DEFAULT_DISABLE_COMPOSITION false
/* Video VSYNC (recommended) */
#define DEFAULT_VSYNC false
#define DEFAULT_VSYNC true
#define DEFAULT_MAX_SWAPCHAIN_IMAGES 3
@ -192,7 +232,7 @@
/* Threaded video. Will possibly increase performance significantly
* at the cost of worse synchronization and latency.
*/
#if defined(HAVE_LIBNX)
#if defined(HAVE_LIBNX) || defined(ANDROID)
#define DEFAULT_VIDEO_THREADED true
#else
#define DEFAULT_VIDEO_THREADED false
@ -300,6 +340,7 @@ static bool quick_menu_show_undo_save_load_state = true;
static bool quick_menu_show_add_to_favorites = true;
static bool quick_menu_show_start_recording = true;
static bool quick_menu_show_start_streaming = true;
static bool quick_menu_show_set_core_association = true;
static bool quick_menu_show_reset_core_association = true;
static bool quick_menu_show_options = true;
static bool quick_menu_show_controls = true;
@ -321,6 +362,10 @@ static bool menu_horizontal_animation = true;
static bool menu_show_online_updater = true;
static bool menu_show_load_core = true;
static bool menu_show_load_content = true;
#ifdef HAVE_CDROM
static bool menu_show_load_disc = true;
static bool menu_show_dump_disc = true;
#endif
static bool menu_show_information = true;
static bool menu_show_configurations = true;
static bool menu_show_help = true;
@ -339,33 +384,39 @@ static bool menu_show_sublabels = true;
static unsigned menu_ticker_type = TICKER_TYPE_BOUNCE;
static float menu_ticker_speed = 1.0f;
static bool content_show_settings = true;
static bool content_show_favorites = true;
#ifdef HAVE_IMAGEVIEWER
static bool content_show_images = true;
#if defined(HAVE_THREADS)
static bool menu_savestate_resume = true;
#else
static bool menu_savestate_resume = false;
#endif
static bool content_show_music = true;
static bool content_show_settings = true;
static bool content_show_favorites = true;
#ifdef HAVE_IMAGEVIEWER
static bool content_show_images = true;
#endif
static bool content_show_music = true;
#if defined(HAVE_FFMPEG) || defined(HAVE_MPV)
static bool content_show_video = true;
static bool content_show_video = true;
#endif
#ifdef HAVE_NETWORKING
static bool content_show_netplay = true;
static bool content_show_netplay = true;
#endif
static bool content_show_history = true;
static bool content_show_history = true;
#ifdef HAVE_LIBRETRODB
static bool content_show_add = true;
static bool content_show_add = true;
#endif
static bool content_show_playlists = true;
static bool content_show_playlists = true;
#ifdef HAVE_XMB
static unsigned xmb_scale_factor = 100;
static unsigned xmb_alpha_factor = 75;
static unsigned menu_font_color_red = 255;
static unsigned xmb_scale_factor = 100;
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;
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__)
#define DEFAULT_XMB_SHADOWS_ENABLE false
@ -411,7 +462,7 @@ static bool rgui_extended_ascii = false;
#define DEFAULT_BLOCK_CONFIG_READ false
#endif
static bool automatically_add_content_to_playlist = false;
#define DEFAULT_AUTOMATICALLY_ADD_CONTENT_TO_PLAYLIST false
static bool default_game_specific_options = true;
static bool default_auto_overrides_enable = true;
@ -450,17 +501,16 @@ static unsigned input_backtouch_toggle = false;
#define DEFAULT_ALL_USERS_CONTROL_MENU false
#if defined(ANDROID) || defined(_WIN32)
static bool menu_swap_ok_cancel_buttons = true;
#define DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS true
#else
static bool menu_swap_ok_cancel_buttons = false;
#define DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS false
#endif
static bool quit_press_twice = false;
#define DEFAULT_QUIT_PRESS_TWICE true
static bool default_translation_service_enable = false;
#define DEFAULT_LOG_TO_FILE false
static bool default_log_to_file = false;
static bool log_to_file_timestamp = false;
#define DEFAULT_LOG_TO_FILE_TIMESTAMP false
/* Crop overscanned frames. */
#define DEFAULT_CROP_OVERSCAN true
@ -517,12 +567,13 @@ static const float message_bgcolor_opacity = 1.0f;
* If your monitor does not run at 60Hz, or something close to it,
* disable VSync, and leave this at its default. */
#ifdef _3DS
static const float refresh_rate = (32730.0 * 8192.0) / 4481134.0 ;
static const float crt_refresh_rate = (32730.0 * 8192.0) / 4481134.0 ;
#define DEFAULT_REFRESH_RATE ((32730.0 * 8192.0) / 4481134.0)
#elif defined(RARCH_CONSOLE)
#define DEFAULT_REFRESH_RATE (60/1.001)
#else
static const float refresh_rate = 60/1.001;
static const float crt_refresh_rate = 60/1.001;
#define DEFAULT_REFRESH_RATE (60)
#endif
#define DEFAULT_CRT_REFRESH_RATE (DEFAULT_REFRESH_RATE)
/* Allow games to set rotation. If false, rotation requests are
* honored, but ignored.
@ -766,18 +817,18 @@ static const bool playlist_fuzzy_archive_match = false;
/* Show Menu start-up screen on boot. */
static const bool default_menu_show_start_screen = true;
static const bool menu_dpi_override_enable = false;
#define DEFAULT_MENU_DPI_OVERRIDE_ENABLE false
#ifdef RARCH_MOBILE
static const unsigned menu_dpi_override_value = 72;
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 72
#elif defined(__CELLOS_LV2__)
static const unsigned menu_dpi_override_value = 360;
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 360
#else
static const unsigned menu_dpi_override_value = 200;
#define DEFAULT_MENU_DPI_OVERRIDE_VALUE 200
#endif
/* Log level for libretro cores (GET_LOG_INTERFACE). */
static const unsigned libretro_log_level = 1;
#define DEFAULT_LIBRETRO_LOG_LEVEL 1
#ifndef RARCH_DEFAULT_PORT
#define RARCH_DEFAULT_PORT 55435
@ -791,15 +842,15 @@ static const unsigned libretro_log_level = 1;
/* Axis threshold (between 0.0 and 1.0)
* How far an axis must be tilted to result in a button press. */
static const float axis_threshold = 0.5f;
static const float axis_threshold = 0.5f;
static const float analog_deadzone = 0.0f;
static const float analog_deadzone = 0.0f;
static const float analog_sensitivity = 1.0f;
static const float analog_sensitivity = 1.0f;
/* Describes speed of which turbo-enabled buttons toggle. */
static const unsigned turbo_period = 6;
static const unsigned turbo_duty_cycle = 3;
static const unsigned turbo_period = 6;
static const unsigned turbo_duty_cycle = 3;
/* Enable input auto-detection. Will attempt to autoconfigure
* gamepads, plug-and-play style. */
@ -851,6 +902,8 @@ static const bool content_runtime_log = false;
/* Keep track of how long each content has been running for over time (ignores core) */
static const bool content_runtime_log_aggregate = false;
#define DEFAULT_UI_MENUBAR_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) || defined(PS2)
@ -982,6 +1035,6 @@ static char buildbot_assets_server_url[] = "http://buildbot.libretro.com/assets/
static char default_discord_app_id[] = "475456035851599874";
static char default_translation_service_url[] = "http://localhost:4404/";
static char default_ai_service_url[] = "http://localhost:4404/";
#endif

View File

@ -22,214 +22,217 @@
/* User 1 */
static const struct retro_keybind retro_keybinds_1[] = {
/* | RetroPad button | enum | keyboard key | m-btn | js btn | js axis | */
/* | RetroPad button | enum | keyboard key | m-btn | js btn | js axis | */
#ifdef __QNX__
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_k, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_v, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_b, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_s, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_w, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_d, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_l, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_o, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_f, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_j, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_r, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_u, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_g, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_h, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_k, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_v, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_b, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_s, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_w, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_d, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_l, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_o, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_f, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_j, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_r, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_u, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_g, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_h, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_HOLD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_BSV_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_BSV_RECORD_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ 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 },
{ true, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_HOLD_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_BSV_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_BSV_RECORD_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_AI_SERVICE, MENU_ENUM_LABEL_VALUE_INPUT_META_AI_SERVICE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
#else
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_a, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_RSHIFT, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_RETURN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UP, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_DOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_LEFT, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_RIGHT, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_x, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_s, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_q, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_w, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_z, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_a, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_RSHIFT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_RETURN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UP, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_DOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_LEFT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_RIGHT, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_x, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_s, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_q, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_w, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY, RETROK_l, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_F4, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_F2, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY, RETROK_f, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_ESCAPE, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_F7, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_F6, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_r, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_BSV_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_BSV_RECORD_TOGGLE, RETROK_o, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_p, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_k, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_h, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_m, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_n, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_y, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_t, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_u, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_F8, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_F9, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_F12, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE, RETROK_F3, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO, RETROK_F10, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_KP_PLUS, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_KP_MINUS, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_DISK_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_PREV, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_GRAB_MOUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GRAB_MOUSE_TOGGLE, RETROK_F11, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_GAME_FOCUS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_GAME_FOCUS_TOGGLE, RETROK_SCROLLOCK, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_UI_COMPANION_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_UI_COMPANION_TOGGLE, RETROK_F5, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_MENU_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_MENU_TOGGLE, RETROK_F1, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_AI_SERVICE, MENU_ENUM_LABEL_VALUE_INPUT_META_AI_SERVICE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_FAST_FORWARD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_KEY, RETROK_SPACE, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FAST_FORWARD_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FAST_FORWARD_HOLD_KEY,RETROK_l, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SLOWMOTION_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SLOWMOTION_HOLD_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SLOWMOTION_KEY, RETROK_e, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LOAD_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_LOAD_STATE_KEY, RETROK_F4, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SAVE_STATE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_SAVE_STATE_KEY, RETROK_F2, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FULLSCREEN_TOGGLE_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_FULLSCREEN_TOGGLE_KEY,RETROK_f, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_QUIT_KEY, MENU_ENUM_LABEL_VALUE_INPUT_META_QUIT_KEY, RETROK_ESCAPE, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_STATE_SLOT_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_PLUS, RETROK_F7, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_STATE_SLOT_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_STATE_SLOT_MINUS, RETROK_F6, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_REWIND, MENU_ENUM_LABEL_VALUE_INPUT_META_REWIND, RETROK_r, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_BSV_RECORD_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_BSV_RECORD_TOGGLE, RETROK_o, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_PAUSE_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_PAUSE_TOGGLE, RETROK_p, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FRAMEADVANCE, MENU_ENUM_LABEL_VALUE_INPUT_META_FRAMEADVANCE, RETROK_k, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_RESET, MENU_ENUM_LABEL_VALUE_INPUT_META_RESET, RETROK_h, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SHADER_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_NEXT, RETROK_m, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SHADER_PREV, MENU_ENUM_LABEL_VALUE_INPUT_META_SHADER_PREV, RETROK_n, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_CHEAT_INDEX_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_PLUS, RETROK_y, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_CHEAT_INDEX_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_INDEX_MINUS, RETROK_t, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_CHEAT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_CHEAT_TOGGLE, RETROK_u, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SCREENSHOT, MENU_ENUM_LABEL_VALUE_INPUT_META_SCREENSHOT, RETROK_F8, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_MUTE, MENU_ENUM_LABEL_VALUE_INPUT_META_MUTE, RETROK_F9, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_OSK, MENU_ENUM_LABEL_VALUE_INPUT_META_OSK, RETROK_F12, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_FPS_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_FPS_TOGGLE, RETROK_F3, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_SEND_DEBUG_INFO, MENU_ENUM_LABEL_VALUE_INPUT_META_SEND_DEBUG_INFO, RETROK_F10, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_NETPLAY_HOST_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_HOST_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_NETPLAY_GAME_WATCH, MENU_ENUM_LABEL_VALUE_INPUT_META_NETPLAY_GAME_WATCH, RETROK_i, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ENABLE_HOTKEY, MENU_ENUM_LABEL_VALUE_INPUT_META_ENABLE_HOTKEY, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_VOLUME_UP, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_UP, RETROK_KP_PLUS, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_VOLUME_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_META_VOLUME_DOWN, RETROK_KP_MINUS,NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_OVERLAY_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_OVERLAY_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_DISK_EJECT_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_EJECT_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_DISK_NEXT, MENU_ENUM_LABEL_VALUE_INPUT_META_DISK_NEXT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ 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 },
{ true, RARCH_RECORDING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_RECORDING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_STREAMING_TOGGLE, MENU_ENUM_LABEL_VALUE_INPUT_META_STREAMING_TOGGLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
#endif
};
/* Users 2 to MAX_USERS */
static const struct retro_keybind retro_keybinds_rest[] = {
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
/* | RetroPad button | desc | keyboard key | js btn | js axis | */
{ true, RETRO_DEVICE_ID_JOYPAD_B, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_Y, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_Y, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_START, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_A, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_X, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_X, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R2, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R2, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_L3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_L3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RETRO_DEVICE_ID_JOYPAD_R3, MENU_ENUM_LABEL_VALUE_INPUT_JOYPAD_R3, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_ANALOG_LEFT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_LEFT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_LEFT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_X_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_X_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_X_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_Y_PLUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_PLUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_ANALOG_RIGHT_Y_MINUS, MENU_ENUM_LABEL_VALUE_INPUT_ANALOG_RIGHT_Y_MINUS, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_LIGHTGUN_TRIGGER, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_TRIGGER, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_RELOAD, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_RELOAD, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_A, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_A, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_B, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_B, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_AUX_C, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_AUX_C, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_START, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_START, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_SELECT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_SELECT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_UP, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_UP, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_DOWN, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_DOWN, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_LEFT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_LEFT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_LIGHTGUN_DPAD_RIGHT, MENU_ENUM_LABEL_VALUE_INPUT_LIGHTGUN_DPAD_RIGHT, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE },
{ true, RARCH_TURBO_ENABLE, MENU_ENUM_LABEL_VALUE_INPUT_TURBO_ENABLE, RETROK_UNKNOWN, NO_BTN, NO_BTN, 0, AXIS_NONE, AXIS_NONE, AXIS_NONE, NULL, NULL },
};
#endif

View File

@ -33,7 +33,6 @@
#endif
#include "file_path_special.h"
#include "input/input_driver.h"
#include "configuration.h"
#include "content.h"
#include "config.def.h"
@ -43,7 +42,6 @@
#include "led/led_defines.h"
#include "defaults.h"
#include "core.h"
#include "dirs.h"
#include "paths.h"
#include "retroarch.h"
#include "verbosity.h"
@ -52,7 +50,7 @@
#include "tasks/task_content.h"
#include "tasks/tasks_internal.h"
#include "../list_special.h"
#include "list_special.h"
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
#include "uwp/uwp_func.h"
@ -1133,8 +1131,6 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
return NULL;
/* Arrays */
SETTING_ARRAY("playlist_names", settings->arrays.playlist_names, false, NULL, true);
SETTING_ARRAY("playlist_cores", settings->arrays.playlist_cores, false, NULL, true);
SETTING_ARRAY("video_driver", settings->arrays.video_driver, false, NULL, true);
SETTING_ARRAY("record_driver", settings->arrays.record_driver, false, NULL, true);
SETTING_ARRAY("camera_driver", settings->arrays.camera_driver, false, NULL, true);
@ -1167,8 +1163,7 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
SETTING_ARRAY("youtube_stream_key", settings->arrays.youtube_stream_key, true, NULL, true);
SETTING_ARRAY("twitch_stream_key", settings->arrays.twitch_stream_key, true, NULL, true);
SETTING_ARRAY("discord_app_id", settings->arrays.discord_app_id, true, default_discord_app_id, true);
SETTING_ARRAY("translation_service_url", settings->arrays.translation_service_url, true, default_translation_service_url, true);
SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, "", true);
SETTING_ARRAY("ai_service_url", settings->arrays.ai_service_url, true, default_ai_service_url, true);
*size = count;
@ -1178,7 +1173,6 @@ static struct config_array_setting *populate_settings_array(settings_t *settings
static struct config_path_setting *populate_settings_path(settings_t *settings, int *size)
{
unsigned count = 0;
global_t *global = global_get_ptr();
struct config_path_setting *tmp = (struct config_path_setting*)calloc(1, (*size + 1) * sizeof(struct config_path_setting));
if (!tmp)
@ -1306,12 +1300,15 @@ static struct config_path_setting *populate_settings_path(settings_t *settings,
"screenshot_directory",
settings->paths.directory_screenshot, true, NULL, false);
if (global)
{
SETTING_PATH("recording_output_directory",
global->record.output_dir, false, NULL, true);
SETTING_PATH("recording_config_directory",
global->record.config_dir, false, NULL, true);
global_t *global = global_get_ptr();
if (global)
{
SETTING_PATH("recording_output_directory",
global->record.output_dir, false, NULL, true);
SETTING_PATH("recording_config_directory",
global->record.config_dir, false, NULL, true);
}
}
SETTING_ARRAY("log_dir", settings->paths.log_dir, true, NULL, true);
@ -1327,7 +1324,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
unsigned count = 0;
SETTING_BOOL("crt_switch_resolution_use_custom_refresh_rate", &settings->bools.crt_switch_custom_refresh_enable, true, false, false);
SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, automatically_add_content_to_playlist, false);
SETTING_BOOL("automatically_add_content_to_playlist", &settings->bools.automatically_add_content_to_playlist, true, DEFAULT_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);
@ -1335,7 +1332,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("video_gpu_record", &settings->bools.video_gpu_record, true, DEFAULT_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, DEFAULT_ALL_USERS_CONTROL_MENU, false);
SETTING_BOOL("menu_swap_ok_cancel_buttons", &settings->bools.input_menu_swap_ok_cancel_buttons, true, menu_swap_ok_cancel_buttons, false);
SETTING_BOOL("menu_swap_ok_cancel_buttons", &settings->bools.input_menu_swap_ok_cancel_buttons, true, DEFAULT_MENU_SWAP_OK_CANCEL_BUTTONS, false);
#ifdef HAVE_NETWORKING
SETTING_BOOL("netplay_public_announce", &settings->bools.netplay_public_announce, true, DEFAULT_NETPLAY_PUBLIC_ANNOUNCE, false);
SETTING_BOOL("netplay_start_as_spectator", &settings->bools.netplay_start_as_spectator, false, netplay_start_as_spectator, false);
@ -1372,7 +1369,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("statistics_show", &settings->bools.video_statistics_show, true, DEFAULT_STATISTICS_SHOW, false);
SETTING_BOOL("framecount_show", &settings->bools.video_framecount_show, true, DEFAULT_FRAMECOUNT_SHOW, false);
SETTING_BOOL("memory_show", &settings->bools.video_memory_show, true, DEFAULT_MEMORY_SHOW, false);
SETTING_BOOL("ui_menubar_enable", &settings->bools.ui_menubar_enable, true, true, false);
SETTING_BOOL("ui_menubar_enable", &settings->bools.ui_menubar_enable, true, DEFAULT_UI_MENUBAR_ENABLE, false);
SETTING_BOOL("suspend_screensaver_enable", &settings->bools.ui_suspend_screensaver_enable, true, true, false);
SETTING_BOOL("rewind_enable", &settings->bools.rewind_enable, true, DEFAULT_REWIND_ENABLE, false);
SETTING_BOOL("vrr_runloop_enable", &settings->bools.vrr_runloop_enable, true, DEFAULT_VRR_RUNLOOP_ENABLE, false);
@ -1418,7 +1415,9 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("audio_enable_menu_notice", &settings->bools.audio_enable_menu_notice, true, audio_enable_menu_notice, false);
SETTING_BOOL("audio_enable_menu_bgm", &settings->bools.audio_enable_menu_bgm, true, audio_enable_menu_bgm, false);
SETTING_BOOL("audio_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE), true, false, false);
#ifdef HAVE_AUDIOMIXER
SETTING_BOOL("audio_mixer_mute_enable", audio_get_bool_ptr(AUDIO_ACTION_MIXER_MUTE_ENABLE), true, false, false);
#endif
SETTING_BOOL("location_allow", &settings->bools.location_allow, true, false, false);
SETTING_BOOL("video_font_enable", &settings->bools.video_font_enable, true, DEFAULT_FONT_ENABLE, false);
SETTING_BOOL("core_updater_auto_extract_archive", &settings->bools.network_buildbot_auto_extract_archive, true, true, false);
@ -1442,8 +1441,9 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("menu_throttle_framerate", &settings->bools.menu_throttle_framerate, true, true, false);
SETTING_BOOL("menu_linear_filter", &settings->bools.menu_linear_filter, true, true, false);
SETTING_BOOL("menu_horizontal_animation", &settings->bools.menu_horizontal_animation, true, true, false);
SETTING_BOOL("dpi_override_enable", &settings->bools.menu_dpi_override_enable, true, menu_dpi_override_enable, false);
SETTING_BOOL("dpi_override_enable", &settings->bools.menu_dpi_override_enable, true, DEFAULT_MENU_DPI_OVERRIDE_ENABLE, false);
SETTING_BOOL("menu_pause_libretro", &settings->bools.menu_pause_libretro, true, true, false);
SETTING_BOOL("menu_savestate_resume", &settings->bools.menu_savestate_resume, true, menu_savestate_resume, false);
SETTING_BOOL("menu_mouse_enable", &settings->bools.menu_mouse_enable, true, DEFAULT_MOUSE_ENABLE, false);
SETTING_BOOL("menu_pointer_enable", &settings->bools.menu_pointer_enable, true, DEFAULT_POINTER_ENABLE, false);
SETTING_BOOL("menu_timedate_enable", &settings->bools.menu_timedate_enable, true, true, false);
@ -1460,6 +1460,7 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("quick_menu_show_add_to_favorites", &settings->bools.quick_menu_show_add_to_favorites, true, quick_menu_show_add_to_favorites, false);
SETTING_BOOL("quick_menu_show_start_recording", &settings->bools.quick_menu_show_start_recording, true, quick_menu_show_start_recording, false);
SETTING_BOOL("quick_menu_show_start_streaming", &settings->bools.quick_menu_show_start_streaming, true, quick_menu_show_start_streaming, false);
SETTING_BOOL("quick_menu_show_set_core_association", &settings->bools.quick_menu_show_set_core_association, true, quick_menu_show_set_core_association, false);
SETTING_BOOL("quick_menu_show_reset_core_association", &settings->bools.quick_menu_show_reset_core_association, true, quick_menu_show_reset_core_association, false);
SETTING_BOOL("quick_menu_show_options", &settings->bools.quick_menu_show_options, true, quick_menu_show_options, false);
SETTING_BOOL("quick_menu_show_controls", &settings->bools.quick_menu_show_controls, true, quick_menu_show_controls, false);
@ -1493,6 +1494,10 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
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);
#ifdef HAVE_CDROM
SETTING_BOOL("menu_show_load_disc", &settings->bools.menu_show_load_disc, true, menu_show_load_disc, false);
SETTING_BOOL("menu_show_dump_disc", &settings->bools.menu_show_dump_disc, true, menu_show_dump_disc, false);
#endif
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);
@ -1609,18 +1614,16 @@ static struct config_bool_setting *populate_settings_bool(settings_t *settings,
SETTING_BOOL("playlist_sort_alphabetical", &settings->bools.playlist_sort_alphabetical, true, playlist_sort_alphabetical, false);
SETTING_BOOL("playlist_fuzzy_archive_match", &settings->bools.playlist_fuzzy_archive_match, true, playlist_fuzzy_archive_match, false);
SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, quit_press_twice, false);
SETTING_BOOL("quit_press_twice", &settings->bools.quit_press_twice, true, DEFAULT_QUIT_PRESS_TWICE, false);
SETTING_BOOL("vibrate_on_keypress", &settings->bools.vibrate_on_keypress, true, vibrate_on_keypress, false);
SETTING_BOOL("enable_device_vibration", &settings->bools.enable_device_vibration, true, enable_device_vibration, false);
#ifdef HAVE_OZONE
SETTING_BOOL("ozone_collapse_sidebar", &settings->bools.ozone_collapse_sidebar, true, DEFAULT_OZONE_COLLAPSE_SIDEBAR, false);
#endif
SETTING_BOOL("translation_service_enable", &settings->bools.translation_service_enable, true, default_translation_service_enable, false);
SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, default_log_to_file, false);
SETTING_BOOL("log_to_file", &settings->bools.log_to_file, true, DEFAULT_LOG_TO_FILE, false);
SETTING_OVERRIDE(RARCH_OVERRIDE_SETTING_LOG_TO_FILE);
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, log_to_file_timestamp, false);
SETTING_BOOL("log_to_file_timestamp", &settings->bools.log_to_file_timestamp, true, DEFAULT_LOG_TO_FILE_TIMESTAMP, false);
SETTING_BOOL("ai_service_enable", &settings->bools.ai_service_enable, true, false, false);
*size = count;
@ -1638,12 +1641,14 @@ static struct config_float_setting *populate_settings_float(settings_t *settings
SETTING_FLOAT("video_aspect_ratio", &settings->floats.video_aspect_ratio, true, DEFAULT_ASPECT_RATIO, false);
SETTING_FLOAT("video_scale", &settings->floats.video_scale, false, 0.0f, false);
SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, crt_refresh_rate, false);
SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, refresh_rate, false);
SETTING_FLOAT("crt_video_refresh_rate", &settings->floats.crt_video_refresh_rate, true, DEFAULT_CRT_REFRESH_RATE, false);
SETTING_FLOAT("video_refresh_rate", &settings->floats.video_refresh_rate, true, DEFAULT_REFRESH_RATE, false);
SETTING_FLOAT("audio_rate_control_delta", audio_get_float_ptr(AUDIO_ACTION_RATE_CONTROL_DELTA), true, DEFAULT_RATE_CONTROL_DELTA, false);
SETTING_FLOAT("audio_max_timing_skew", &settings->floats.audio_max_timing_skew, true, DEFAULT_MAX_TIMING_SKEW, false);
SETTING_FLOAT("audio_volume", &settings->floats.audio_volume, true, DEFAULT_AUDIO_VOLUME, false);
#ifdef HAVE_AUDIOMIXER
SETTING_FLOAT("audio_mixer_volume", &settings->floats.audio_mixer_volume, true, DEFAULT_AUDIO_MIXER_VOLUME, false);
#endif
#ifdef HAVE_OVERLAY
SETTING_FLOAT("input_overlay_opacity", &settings->floats.input_overlay_opacity, true, DEFAULT_INPUT_OVERLAY_OPACITY, false);
SETTING_FLOAT("input_overlay_scale", &settings->floats.input_overlay_scale, true, 1.0f, false);
@ -1697,7 +1702,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("rewind_granularity", &settings->uints.rewind_granularity, true, DEFAULT_REWIND_GRANULARITY, false);
SETTING_UINT("rewind_buffer_size_step", &settings->uints.rewind_buffer_size_step, true, DEFAULT_REWIND_BUFFER_SIZE_STEP, false);
SETTING_UINT("autosave_interval", &settings->uints.autosave_interval, true, DEFAULT_AUTOSAVE_INTERVAL, false);
SETTING_UINT("libretro_log_level", &settings->uints.libretro_log_level, true, libretro_log_level, false);
SETTING_UINT("libretro_log_level", &settings->uints.libretro_log_level, true, DEFAULT_LIBRETRO_LOG_LEVEL, false);
SETTING_UINT("keyboard_gamepad_mapping_type",&settings->uints.input_keyboard_gamepad_mapping_type, true, 1, false);
SETTING_UINT("input_poll_type_behavior", &settings->uints.input_poll_type_behavior, true, 2, false);
SETTING_UINT("video_monitor_index", &settings->uints.video_monitor_index, true, DEFAULT_MONITOR_INDEX, false);
@ -1719,7 +1724,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("video_overscan_correction_bottom", &settings->uints.video_overscan_correction_bottom, true, DEFAULT_VIDEO_OVERSCAN_CORRECTION_BOTTOM, false);
#endif
#ifdef HAVE_MENU
SETTING_UINT("dpi_override_value", &settings->uints.menu_dpi_override_value, true, menu_dpi_override_value, false);
SETTING_UINT("dpi_override_value", &settings->uints.menu_dpi_override_value, true, DEFAULT_MENU_DPI_OVERRIDE_VALUE, false);
SETTING_UINT("menu_thumbnails", &settings->uints.menu_thumbnails, true, menu_thumbnails_default, false);
SETTING_UINT("menu_left_thumbnails", &settings->uints.menu_left_thumbnails, true, menu_left_thumbnails_default, false);
SETTING_UINT("menu_thumbnail_upscale_threshold", &settings->uints.menu_thumbnail_upscale_threshold, true, menu_thumbnail_upscale_threshold, false);
@ -2022,8 +2027,8 @@ void config_set_defaults(void)
strlcpy(settings->arrays.discord_app_id,
default_discord_app_id, sizeof(settings->arrays.discord_app_id));
strlcpy(settings->arrays.translation_service_url,
default_translation_service_url, sizeof(settings->arrays.translation_service_url));
strlcpy(settings->arrays.ai_service_url,
default_ai_service_url, sizeof(settings->arrays.ai_service_url));
#ifdef HAVE_MATERIALUI
@ -2039,15 +2044,14 @@ void config_set_defaults(void)
#endif
settings->floats.video_scale = DEFAULT_SCALE;
if (g_defaults.settings.video_threaded_enable != DEFAULT_VIDEO_THREADED)
video_driver_set_threaded(g_defaults.settings.video_threaded_enable);
video_driver_set_threaded(DEFAULT_VIDEO_THREADED);
settings->floats.video_msg_color_r = ((message_color >> 16) & 0xff) / 255.0f;
settings->floats.video_msg_color_g = ((message_color >> 8) & 0xff) / 255.0f;
settings->floats.video_msg_color_b = ((message_color >> 0) & 0xff) / 255.0f;
if (g_defaults.settings.video_refresh_rate > 0.0 &&
g_defaults.settings.video_refresh_rate != refresh_rate)
g_defaults.settings.video_refresh_rate != DEFAULT_REFRESH_RATE)
settings->floats.video_refresh_rate = g_defaults.settings.video_refresh_rate;
if (DEFAULT_AUDIO_DEVICE)
@ -2060,7 +2064,9 @@ void config_set_defaults(void)
settings->uints.audio_latency = g_defaults.settings.out_latency;
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
#ifdef HAVE_AUDIOMIXER
audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume);
#endif
#ifdef HAVE_LAKKA
settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH);
@ -2185,8 +2191,6 @@ void config_set_defaults(void)
*settings->paths.path_stream_url = '\0';
*settings->paths.path_softfilter_plugin = '\0';
*settings->arrays.playlist_names = '\0';
*settings->arrays.playlist_cores = '\0';
*settings->paths.directory_content_history = '\0';
*settings->paths.path_audio_dsp_plugin = '\0';
@ -2390,11 +2394,10 @@ static config_file_t *open_default_config_file(void)
config_file_t *conf = NULL;
(void)has_application_data;
(void)path_size;
application_data[0] = conf_path[0] = app_path[0] = '\0';
(void)path_size;
#if defined(_WIN32) && !defined(_XBOX)
#if defined(__WINRT__) || defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP
/* On UWP, the app install directory is not writable so use the writable LocalState dir instead */
@ -2405,7 +2408,7 @@ static config_file_t *open_default_config_file(void)
fill_pathname_resolve_relative(conf_path, app_path,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
conf = config_file_new(conf_path);
conf = config_file_new_from_path_to_string(conf_path);
if (!conf)
{
@ -2414,7 +2417,7 @@ static config_file_t *open_default_config_file(void)
{
fill_pathname_join(conf_path, application_data,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
conf = config_file_new(conf_path);
conf = config_file_new_from_path_to_string(conf_path);
}
}
@ -2423,7 +2426,7 @@ static config_file_t *open_default_config_file(void)
bool saved = false;
/* Try to create a new config file. */
conf = config_file_new(NULL);
conf = config_file_new_alloc();
if (conf)
{
@ -2457,12 +2460,12 @@ static config_file_t *open_default_config_file(void)
fill_pathname_join(conf_path, application_data,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
conf = config_file_new(conf_path);
conf = config_file_new_from_path_to_string(conf_path);
if (!conf)
{
bool saved = false;
conf = config_file_new(NULL);
conf = config_file_new_alloc();
if (conf)
{
@ -2490,7 +2493,7 @@ static config_file_t *open_default_config_file(void)
fill_pathname_join(conf_path, application_data,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
RARCH_LOG("Looking for config in: \"%s\".\n", conf_path);
conf = config_file_new(conf_path);
conf = config_file_new_from_path_to_string(conf_path);
}
/* Fallback to $HOME/.retroarch.cfg. */
@ -2499,14 +2502,15 @@ static config_file_t *open_default_config_file(void)
fill_pathname_join(conf_path, getenv("HOME"),
".retroarch.cfg", path_size);
RARCH_LOG("Looking for config in: \"%s\".\n", conf_path);
conf = config_file_new(conf_path);
conf = config_file_new_from_path_to_string(conf_path);
}
if (!conf && has_application_data)
{
char *basedir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
bool dir_created = false;
char *basedir = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
basedir[0] = '\0';
basedir[0] = '\0';
/* Try to create a new config file. */
@ -2517,30 +2521,33 @@ static config_file_t *open_default_config_file(void)
fill_pathname_join(conf_path, conf_path,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
if (path_mkdir(basedir))
dir_created = path_mkdir(basedir);
free(basedir);
if (dir_created)
{
char *skeleton_conf = (char*)malloc(PATH_MAX_LENGTH * sizeof(char));
bool saved = false;
skeleton_conf[0] = '\0';
free(basedir);
/* Build a retroarch.cfg path from the global config directory (/etc). */
/* Build a retroarch.cfg path from the
* global config directory (/etc). */
fill_pathname_join(skeleton_conf, GLOBAL_CONFIG_DIR,
file_path_str(FILE_PATH_MAIN_CONFIG), path_size);
conf = config_file_new(skeleton_conf);
conf = config_file_new_from_path_to_string(skeleton_conf);
if (conf)
RARCH_WARN("Config: using skeleton config \"%s\" as base for a new config file.\n", skeleton_conf);
else
conf = config_file_new(NULL);
conf = config_file_new_alloc();
free(skeleton_conf);
if (conf)
{
/* Since this is a clean config file, we can safely use config_save_on_exit. */
/* Since this is a clean config file, we can
* safely use config_save_on_exit. */
config_set_bool(conf, "config_save_on_exit", true);
saved = config_file_write(conf, conf_path, true);
}
@ -2554,10 +2561,6 @@ static config_file_t *open_default_config_file(void)
RARCH_WARN("Config: Created new config file in: \"%s\".\n", conf_path);
}
else
{
free(basedir);
}
}
#endif
@ -2652,7 +2655,7 @@ static bool config_load_file(const char *path, settings_t *settings)
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);
config_file_t *conf = path ? config_file_new(path) : open_default_config_file();
config_file_t *conf = path ? config_file_new_from_path_to_string(path) : open_default_config_file();
tmp_str[0] = '\0';
@ -2877,7 +2880,9 @@ static bool config_load_file(const char *path, settings_t *settings)
settings->uints.video_swap_interval = MIN(settings->uints.video_swap_interval, 4);
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
#ifdef HAVE_AUDIOMIXER
audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume);
#endif
path_config = path_get(RARCH_PATH_CONFIG);
path_core = path_get(RARCH_PATH_CORE);
@ -3450,7 +3455,7 @@ bool config_load_remap(void)
path_size);
/* Create a new config file from game_path */
new_conf = config_file_new(game_path);
new_conf = config_file_new_from_path_to_string(game_path);
/* If a game remap file exists, load it. */
if (new_conf)
@ -3472,7 +3477,7 @@ bool config_load_remap(void)
}
/* Create a new config file from content_path */
new_conf = config_file_new(content_path);
new_conf = config_file_new_from_path_to_string(content_path);
/* If a content-dir remap file exists, load it. */
if (new_conf)
@ -3494,7 +3499,7 @@ bool config_load_remap(void)
}
/* Create a new config file from core_path */
new_conf = config_file_new(core_path);
new_conf = config_file_new_from_path_to_string(core_path);
/* If a core remap file exists, load it. */
if (new_conf)
@ -3528,21 +3533,29 @@ success:
return true;
}
static void parse_config_file(void)
/**
* config_parse_file:
*
* Loads a config file and reads all the values into memory.
*
*/
void config_parse_file(void)
{
const char *config_path = path_get(RARCH_PATH_CONFIG);
if (path_is_empty(RARCH_PATH_CONFIG))
{
RARCH_LOG("[config] Loading default config.\n");
}
RARCH_LOG("[config] loading config from: %s.\n", config_path);
{
const char *config_path = path_get(RARCH_PATH_CONFIG);
RARCH_LOG("[config] loading config from: %s.\n", config_path);
if (config_load_file(config_path, config_get_ptr()))
return;
RARCH_ERR("[config] couldn't find config at path: \"%s\"\n",
config_path);
if (!config_load_file(config_path, config_get_ptr()))
{
RARCH_ERR("[config] couldn't find config at path: \"%s\"\n",
config_path);
}
}
}
/**
@ -3553,15 +3566,8 @@ static void parse_config_file(void)
*/
void config_load(void)
{
/* Flush out some states that could have been
* set by core environment variables */
core_unset_input_descriptors();
if (rarch_ctl(RARCH_CTL_IS_BLOCK_CONFIG_READ, NULL))
return;
config_set_defaults();
parse_config_file();
config_parse_file();
}
/**
@ -3631,11 +3637,11 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
free(buf);
free(path_new);
conf = config_file_new(autoconf_file);
conf = config_file_new_from_path_to_string(autoconf_file);
if (!conf)
{
conf = config_file_new(NULL);
conf = config_file_new_alloc();
if (!conf)
{
free(autoconf_file);
@ -3695,7 +3701,7 @@ bool config_save_file(const char *path)
struct config_float_setting *float_settings = NULL;
struct config_array_setting *array_settings = NULL;
struct config_path_setting *path_settings = NULL;
config_file_t *conf = config_file_new(path);
config_file_t *conf = config_file_new_from_path_to_string(path);
settings_t *settings = 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);
@ -3706,7 +3712,7 @@ bool config_save_file(const char *path)
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
if (!conf)
conf = config_file_new(NULL);
conf = config_file_new_alloc();
if (!conf || rarch_ctl(RARCH_CTL_IS_OVERRIDES_ACTIVE, NULL))
{
@ -3989,7 +3995,7 @@ bool config_save_overrides(int override_type)
path_size);
if (!conf)
conf = config_file_new(NULL);
conf = config_file_new_alloc();
/* Load the original config file in memory */
config_load_file(path_get(RARCH_PATH_CONFIG), settings);

View File

@ -144,6 +144,7 @@ typedef struct settings
bool menu_enable_widgets;
bool menu_show_start_screen;
bool menu_pause_libretro;
bool menu_savestate_resume;
bool menu_timedate_enable;
bool menu_battery_level_enable;
bool menu_core_enable;
@ -163,6 +164,8 @@ typedef struct settings
bool menu_show_core_updater;
bool menu_show_load_core;
bool menu_show_load_content;
bool menu_show_load_disc;
bool menu_show_dump_disc;
bool menu_show_information;
bool menu_show_configurations;
bool menu_show_help;
@ -206,6 +209,7 @@ typedef struct settings
bool quick_menu_show_add_to_favorites;
bool quick_menu_show_start_recording;
bool quick_menu_show_start_streaming;
bool quick_menu_show_set_core_association;
bool quick_menu_show_reset_core_association;
bool quick_menu_show_options;
bool quick_menu_show_controls;
@ -334,9 +338,6 @@ typedef struct settings
bool enable_device_vibration;
bool ozone_collapse_sidebar;
bool translation_service_enable;
bool log_to_file;
bool log_to_file_timestamp;
@ -569,8 +570,6 @@ typedef struct settings
char audio_device[255];
char camera_device[255];
char playlist_names[8192];
char playlist_cores[8192];
char bundle_assets_src[PATH_MAX_LENGTH];
char bundle_assets_dst[PATH_MAX_LENGTH];
char bundle_assets_dst_subdir[PATH_MAX_LENGTH];
@ -599,6 +598,7 @@ typedef struct settings
char network_buildbot_url[255];
char network_buildbot_assets_url[255];
char browse_url[4096];
char path_stream_url[8192];
char path_menu_xmb_font[PATH_MAX_LENGTH];
char menu_content_show_settings_password[PATH_MAX_LENGTH];
@ -611,7 +611,6 @@ typedef struct settings
#endif
char path_record_config[PATH_MAX_LENGTH];
char path_stream_config[PATH_MAX_LENGTH];
char path_stream_url[8192];
char path_menu_wallpaper[PATH_MAX_LENGTH];
char path_audio_dsp_plugin[PATH_MAX_LENGTH];
char path_softfilter_plugin[PATH_MAX_LENGTH];
@ -750,12 +749,12 @@ const char *config_get_midi_driver_options(void);
const char *config_get_default_record(void);
/**
* config_load:
* config_parse_file:
*
* Loads a config file and reads all the values into memory.
*
*/
void config_load(void);
void config_parse_file(void);
/**
* config_load_override:

43
core.h
View File

@ -153,10 +153,6 @@ typedef struct retro_callbacks
retro_input_poll_t poll_cb;
} retro_callbacks_t;
bool core_load(unsigned poll_type_behavior);
bool core_unload(void);
bool core_set_default_callbacks(struct retro_callbacks *cbs);
bool core_set_rewind_callbacks(void);
@ -167,46 +163,27 @@ bool core_set_netplay_callbacks(void);
bool core_unset_netplay_callbacks(void);
#endif
bool core_set_poll_type(unsigned *type);
bool core_set_poll_type(unsigned type);
/* Runs the core for one frame. */
bool core_run(void);
bool core_init(void);
bool core_deinit(void *data);
bool core_unload_game(void);
bool core_reset(void);
bool core_set_environment(retro_ctx_environ_info_t *info);
bool core_serialize_size(retro_ctx_size_info_t *info);
uint64_t core_serialization_quirks(void);
void core_set_serialization_quirks(uint64_t quirks);
bool core_serialize(retro_ctx_serialize_info_t *info);
bool core_unserialize(retro_ctx_serialize_info_t *info);
bool core_init_symbols(enum rarch_core_type *type);
bool core_set_cheat(retro_ctx_cheat_info_t *info);
bool core_reset_cheat(void);
bool core_api_version(retro_ctx_api_info_t *api);
bool core_get_region(retro_ctx_region_info_t *info);
bool core_get_memory(retro_ctx_memory_info_t *info);
/* Initialize system A/V information. */
bool core_get_system_av_info(struct retro_system_av_info *av_info);
/* Get system A/V information. */
bool core_get_system_info(struct retro_system_info *system);
@ -216,24 +193,6 @@ bool core_set_controller_port_device(retro_ctx_controller_info_t *pad);
bool core_has_set_input_descriptor(void);
void core_set_input_descriptors(void);
void core_unset_input_descriptors(void);
bool core_uninit_libretro_callbacks(void);
void core_uninit_symbols(void);
void core_set_input_state(retro_ctx_input_state_info_t *info);
bool core_is_symbols_inited(void);
bool core_is_inited(void);
bool core_is_game_loaded(void);
void core_free_retro_game_info(struct retro_game_info *dest);
RETRO_END_DECLS
#endif

View File

@ -27,6 +27,7 @@
#include "config.h"
#endif
#include "retroarch.h"
#include "verbosity.h"
#include "core_info.h"
@ -41,6 +42,16 @@ static const struct string_list *core_info_tmp_list = NULL;
static core_info_t *core_info_current = NULL;
static core_info_list_t *core_info_curr_list = NULL;
enum compare_op
{
COMPARE_OP_EQUAL,
COMPARE_OP_NOT_EQUAL,
COMPARE_OP_LESS,
COMPARE_OP_LESS_EQUAL,
COMPARE_OP_GREATER,
COMPARE_OP_GREATER_EQUAL
};
static void core_info_list_resolve_all_extensions(
core_info_list_t *core_info_list)
{
@ -163,6 +174,7 @@ static void core_info_list_free(core_info_list_t *core_info_list)
free(info->categories);
free(info->databases);
free(info->notes);
free(info->required_hw_api);
string_list_free(info->supported_extensions_list);
string_list_free(info->authors_list);
string_list_free(info->note_list);
@ -170,6 +182,7 @@ static void core_info_list_free(core_info_list_t *core_info_list)
string_list_free(info->licenses_list);
string_list_free(info->categories_list);
string_list_free(info->databases_list);
string_list_free(info->required_hw_api_list);
config_file_free((config_file_t*)info->config_data);
for (j = 0; j < info->firmware_count; j++)
@ -225,7 +238,7 @@ static config_file_t *core_info_list_iterate(
info_path_base = NULL;
if (path_is_valid(info_path))
conf = config_file_new(info_path);
conf = config_file_new_from_path_to_string(info_path);
free(info_path);
return conf;
@ -284,8 +297,8 @@ static core_info_list_t *core_info_list_new(const char *path,
for (i = 0; i < contents->size; i++)
{
const char *path = contents->elems[i].data;
config_file_t *conf = core_info_list_iterate(path,
const char *base_path = contents->elems[i].data;
config_file_t *conf = core_info_list_iterate(base_path,
path_basedir);
if (conf)
@ -420,6 +433,16 @@ static core_info_list_t *core_info_list_new(const char *path,
tmp = NULL;
}
if (config_get_string(conf, "required_hw_api", &tmp)
&& !string_is_empty(tmp))
{
core_info[i].required_hw_api = strdup(tmp);
core_info[i].required_hw_api_list = string_split(core_info[i].required_hw_api, "|");
free(tmp);
tmp = NULL;
}
if (tmp)
free(tmp);
tmp = NULL;
@ -438,8 +461,8 @@ static core_info_list_t *core_info_list_new(const char *path,
core_info[i].config_data = conf;
}
if (!string_is_empty(path))
core_info[i].path = strdup(path);
if (!string_is_empty(base_path))
core_info[i].path = strdup(base_path);
if (!core_info[i].display_name)
core_info[i].display_name =
@ -460,7 +483,7 @@ static core_info_list_t *core_info_list_new(const char *path,
*
* Data in *info is invalidated when the
* core_info_list is freed. */
static bool core_info_list_get_info(core_info_list_t *core_info_list,
bool core_info_list_get_info(core_info_list_t *core_info_list,
core_info_t *out_info, const char *path)
{
size_t i;
@ -914,8 +937,8 @@ bool core_info_list_get_display_name(core_info_list_t *core_info_list,
bool core_info_get_display_name(const char *path, char *s, size_t len)
{
char *tmp = NULL;
config_file_t *conf = config_file_new(path);
char *tmp = NULL;
config_file_t *conf = config_file_new_from_path_to_string(path);
if (!conf)
return false;
@ -929,3 +952,350 @@ bool core_info_get_display_name(const char *path, char *s, size_t len)
config_file_free(conf);
return true;
}
static int core_info_qsort_func_path(const core_info_t *a,
const core_info_t *b)
{
if (!a || !b)
return 0;
if (string_is_empty(a->path) || string_is_empty(b->path))
return 0;
return strcasecmp(a->path, b->path);
}
static int core_info_qsort_func_display_name(const core_info_t *a,
const core_info_t *b)
{
if (!a || !b)
return 0;
if (string_is_empty(a->display_name) || string_is_empty(b->display_name))
return 0;
return strcasecmp(a->display_name, b->display_name);
}
static int core_info_qsort_func_core_name(const core_info_t *a,
const core_info_t *b)
{
if (!a || !b)
return 0;
if (string_is_empty(a->core_name) || string_is_empty(b->core_name))
return 0;
return strcasecmp(a->core_name, b->core_name);
}
static int core_info_qsort_func_system_name(const core_info_t *a,
const core_info_t *b)
{
if (!a || !b)
return 0;
if (string_is_empty(a->systemname) || string_is_empty(b->systemname))
return 0;
return strcasecmp(a->systemname, b->systemname);
}
void core_info_qsort(core_info_list_t *core_info_list, enum core_info_list_qsort_type qsort_type)
{
if (!core_info_list)
return;
if (core_info_list->count < 2)
return;
switch (qsort_type)
{
case CORE_INFO_LIST_SORT_PATH:
qsort(core_info_list->list, core_info_list->count, sizeof(core_info_t),
(int (*)(const void *, const void *))core_info_qsort_func_path);
break;
case CORE_INFO_LIST_SORT_DISPLAY_NAME:
qsort(core_info_list->list, core_info_list->count, sizeof(core_info_t),
(int (*)(const void *, const void *))core_info_qsort_func_display_name);
break;
case CORE_INFO_LIST_SORT_CORE_NAME:
qsort(core_info_list->list, core_info_list->count, sizeof(core_info_t),
(int (*)(const void *, const void *))core_info_qsort_func_core_name);
break;
case CORE_INFO_LIST_SORT_SYSTEM_NAME:
qsort(core_info_list->list, core_info_list->count, sizeof(core_info_t),
(int (*)(const void *, const void *))core_info_qsort_func_system_name);
break;
default:
return;
}
}
static bool core_info_compare_api_version(int sys_major, int sys_minor, int major, int minor, enum compare_op op)
{
switch (op)
{
case COMPARE_OP_EQUAL:
if (sys_major == major && sys_minor == minor)
return true;
break;
case COMPARE_OP_NOT_EQUAL:
if (!(sys_major == major && sys_minor == minor))
return true;
break;
case COMPARE_OP_LESS:
if (sys_major < major || (sys_major == major && sys_minor < minor))
return true;
break;
case COMPARE_OP_LESS_EQUAL:
if (sys_major < major || (sys_major == major && sys_minor <= minor))
return true;
break;
case COMPARE_OP_GREATER:
if (sys_major > major || (sys_major == major && sys_minor > minor))
return true;
break;
case COMPARE_OP_GREATER_EQUAL:
if (sys_major > major || (sys_major == major && sys_minor >= minor))
return true;
break;
default:
break;
}
return false;
}
bool core_info_hw_api_supported(core_info_t *info)
{
enum gfx_ctx_api sys_api;
gfx_ctx_flags_t sys_flags = {0};
int i;
const char *sys_api_version_str = video_driver_get_gpu_api_version_string();
int sys_api_version_major = 0;
int sys_api_version_minor = 0;
enum api_parse_state
{
STATE_API_NAME,
STATE_API_COMPARE_OP,
STATE_API_VERSION
};
if (!info || !info->required_hw_api_list || info->required_hw_api_list->size == 0)
return true;
sys_api = video_context_driver_get_api();
video_context_driver_get_flags(&sys_flags);
for (i = 0; i < info->required_hw_api_list->size; i++)
{
char api_str[32] = {0};
char version[16] = {0};
char major_str[16] = {0};
char minor_str[16] = {0};
const char *cur_api = info->required_hw_api_list->elems[i].data;
int api_pos = 0;
int major_str_pos = 0;
int minor_str_pos = 0;
int cur_api_len = 0;
int j = 0;
int major = 0;
int minor = 0;
bool found_major = false;
bool found_minor = false;
enum compare_op op = COMPARE_OP_GREATER_EQUAL;
enum api_parse_state state = STATE_API_NAME;
if (string_is_empty(cur_api))
continue;
cur_api_len = strlen(cur_api);
for (j = 0; j < cur_api_len; j++)
{
if (cur_api[j] == ' ')
continue;
switch (state)
{
case STATE_API_NAME:
{
if (isupper(cur_api[j]) || islower(cur_api[j]))
api_str[api_pos++] = cur_api[j];
else
{
j--;
state = STATE_API_COMPARE_OP;
break;
}
break;
}
case STATE_API_COMPARE_OP:
{
if (j < cur_api_len - 1 && !(cur_api[j] >= '0' && cur_api[j] <= '9'))
{
if (cur_api[j] == '=' && cur_api[j + 1] == '=')
{
op = COMPARE_OP_EQUAL;
j++;
}
else if (cur_api[j] == '=')
{
op = COMPARE_OP_EQUAL;
}
else if (cur_api[j] == '!' && cur_api[j + 1] == '=')
{
op = COMPARE_OP_NOT_EQUAL;
j++;
}
else if (cur_api[j] == '<' && cur_api[j + 1] == '=')
{
op = COMPARE_OP_LESS_EQUAL;
j++;
}
else if (cur_api[j] == '>' && cur_api[j + 1] == '=')
{
op = COMPARE_OP_GREATER_EQUAL;
j++;
}
else if (cur_api[j] == '<')
{
op = COMPARE_OP_LESS;
}
else if (cur_api[j] == '>')
{
op = COMPARE_OP_GREATER;
}
}
state = STATE_API_VERSION;
break;
}
case STATE_API_VERSION:
{
if (!found_minor && cur_api[j] >= '0' && cur_api[j] <= '9' && cur_api[j] != '.')
{
found_major = true;
if (major_str_pos < sizeof(major_str) - 1)
major_str[major_str_pos++] = cur_api[j];
}
else if (found_major && found_minor && cur_api[j] >= '0' && cur_api[j] <= '9')
{
if (minor_str_pos < sizeof(minor_str) - 1)
minor_str[minor_str_pos++] = cur_api[j];
}
else if (cur_api[j] == '.')
{
found_minor = true;
}
break;
}
default:
break;
}
}
sscanf(major_str, "%d", &major);
sscanf(minor_str, "%d", &minor);
snprintf(version, sizeof(version), "%d.%d", major, minor);
#if 0
printf("Major: %d\n", major);
printf("Minor: %d\n", minor);
printf("API: %s\n", api_str);
printf("Version: %s\n", version);
fflush(stdout);
#endif
if ((string_is_equal_noncase(api_str, "opengl") && sys_api == GFX_CTX_OPENGL_API) ||
(string_is_equal_noncase(api_str, "openglcompat") && sys_api == GFX_CTX_OPENGL_API) ||
(string_is_equal_noncase(api_str, "openglcompatibility") && sys_api == GFX_CTX_OPENGL_API))
{
if (sys_flags.flags & (1 << GFX_CTX_FLAGS_GL_CORE_CONTEXT))
{
/* system is running a core context while compat is requested */
return false;
}
sscanf(sys_api_version_str, "%d.%d", &sys_api_version_major, &sys_api_version_minor);
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "openglcore") && sys_api == GFX_CTX_OPENGL_API)
{
sscanf(sys_api_version_str, "%d.%d", &sys_api_version_major, &sys_api_version_minor);
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "opengles") && sys_api == GFX_CTX_OPENGL_ES_API)
{
sscanf(sys_api_version_str, "OpenGL ES %d.%d", &sys_api_version_major, &sys_api_version_minor);
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "direct3d8") && sys_api == GFX_CTX_DIRECT3D8_API)
{
sys_api_version_major = 8;
sys_api_version_minor = 0;
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "direct3d9") && sys_api == GFX_CTX_DIRECT3D9_API)
{
sys_api_version_major = 9;
sys_api_version_minor = 0;
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "direct3d10") && sys_api == GFX_CTX_DIRECT3D10_API)
{
sys_api_version_major = 10;
sys_api_version_minor = 0;
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "direct3d11") && sys_api == GFX_CTX_DIRECT3D11_API)
{
sys_api_version_major = 11;
sys_api_version_minor = 0;
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "direct3d12") && sys_api == GFX_CTX_DIRECT3D12_API)
{
sys_api_version_major = 12;
sys_api_version_minor = 0;
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "vulkan") && sys_api == GFX_CTX_VULKAN_API)
{
sscanf(sys_api_version_str, "%d.%d", &sys_api_version_major, &sys_api_version_minor);
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
else if (string_is_equal_noncase(api_str, "metal") && sys_api == GFX_CTX_METAL_API)
{
sscanf(sys_api_version_str, "%d.%d", &sys_api_version_major, &sys_api_version_minor);
if (core_info_compare_api_version(sys_api_version_major, sys_api_version_minor, major, minor, op))
return true;
}
}
return false;
}

View File

@ -55,6 +55,7 @@ typedef struct
char *categories;
char *databases;
char *notes;
char *required_hw_api;
struct string_list *categories_list;
struct string_list *databases_list;
struct string_list *note_list;
@ -62,6 +63,7 @@ typedef struct
struct string_list *authors_list;
struct string_list *permissions_list;
struct string_list *licenses_list;
struct string_list *required_hw_api_list;
core_info_firmware_t *firmware;
void *userdata;
} core_info_t;
@ -88,6 +90,14 @@ typedef struct core_info_ctx_find
const char *path;
} core_info_ctx_find_t;
enum core_info_list_qsort_type
{
CORE_INFO_LIST_SORT_PATH = 0,
CORE_INFO_LIST_SORT_DISPLAY_NAME,
CORE_INFO_LIST_SORT_CORE_NAME,
CORE_INFO_LIST_SORT_SYSTEM_NAME
};
size_t core_info_list_num_info_files(core_info_list_t *list);
/* Non-reentrant, does not allocate. Returns pointer to internal state. */
@ -132,6 +142,13 @@ bool core_info_database_match_archive_member(const char *database_path);
bool core_info_unsupported_content_path(const char *path);
void core_info_qsort(core_info_list_t *core_info_list, enum core_info_list_qsort_type qsort_type);
bool core_info_list_get_info(core_info_list_t *core_info_list,
core_info_t *out_info, const char *path);
bool core_info_hw_api_supported(core_info_t *info);
RETRO_END_DECLS
#endif /* CORE_INFO_H_ */

View File

@ -1,5 +1,6 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2017 - Daniel De Matteis
* Copyright (C) 2016-2019 - Brad Parker
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-

View File

@ -159,7 +159,7 @@ static void check_variables(void)
int i;
g_state->refresh = atoi(var.value);
for (i = 0; i < sizeof(g_state->g_input) / sizeof(g_state->g_input[0]); i++)
for (i = 0; i < (int)(sizeof(g_state->g_input) / sizeof(g_state->g_input[0])); i++)
g_state->g_input[i].last_dt = 1.0f / g_state->refresh;
}
@ -257,8 +257,7 @@ static void save_state(void *data, size_t size)
for (i = 0; i < MAX_PLAYERS; i++)
{
unsigned py = swap_if_little32((unsigned)g_state->player[i].py.u);
unsigned dpy = swap_if_little32((unsigned)g_state->player[i].dpy.u);
memcpy(buf, &py, sizeof(unsigned));
buf += sizeof(uint16_t);
}
@ -387,7 +386,7 @@ void GONG_CORE_PREFIX(retro_init)(void)
else
GONG_CORE_PREFIX(log_cb) = NULL;
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned));
video_buf = (unsigned char*)calloc(1, WIDTH * HEIGHT * sizeof(unsigned char));
game_buffer.width = WIDTH;
game_buffer.height = HEIGHT;

View File

@ -62,7 +62,7 @@ static int image_width;
static int image_height;
static bool image_uploaded;
static bool slideshow_enable;
struct string_list *file_list;
static struct string_list *image_file_list;
#if 0
#define DUPE_TEST
@ -72,7 +72,7 @@ struct string_list *file_list;
static const char* IMAGE_CORE_PREFIX(valid_extensions) = "jpg|jpeg|png|bmp|psd|tga|gif|hdr|pic|ppm|pgm";
#else
static const char* IMAGE_CORE_PREFIX(valid_extensions) = 1+ /* to remove the first |, the alternative is 25 extra lines of ifdef/etc */
static const char image_formats[] =
#ifdef HAVE_RJPEG
"|jpg|jpeg"
@ -95,6 +95,9 @@ static const char* IMAGE_CORE_PREFIX(valid_extensions) = 1+ /* to remove the fir
#endif
;
/* to remove the first |, the alternative is 25 extra lines of ifdef/etc */
static const char* IMAGE_CORE_PREFIX(valid_extensions) = image_formats + 1;
#endif
void IMAGE_CORE_PREFIX(retro_get_system_info)(struct retro_system_info *info)
@ -287,9 +290,9 @@ bool IMAGE_CORE_PREFIX(retro_load_game)(const struct retro_game_info *info)
path_basedir(dir);
file_list = dir_list_new(dir, IMAGE_CORE_PREFIX(valid_extensions),
image_file_list = dir_list_new(dir, IMAGE_CORE_PREFIX(valid_extensions),
false,true,false,false);
dir_list_sort(file_list, false);
dir_list_sort(image_file_list, false);
free(dir);
if (!IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
@ -352,23 +355,22 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
if (slideshow_enable)
{
if ((frames % 120 == 0) && image_index < (signed)(file_list->size - 1))
if ((frames % 120 == 0) && image_index < (signed)(image_file_list->size - 1))
next_image = true;
}
for (i=0;i<16;i++)
{
if (IMAGE_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, i))
{
realinput |= 1<<i;
}
if (IMAGE_CORE_PREFIX(input_state_cb)(0, RETRO_DEVICE_JOYPAD, 0, i))
realinput |= 1<<i;
}
input = realinput & ~previnput;
input = realinput & ~previnput;
previnput = realinput;
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_UP))
{
if ((image_index + 5) < (signed)(file_list->size - 1))
if ((image_index + 5) < (signed)(image_file_list->size - 1))
forward_image = true;
else
last_image = true;
@ -389,7 +391,7 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
}
if (input & (1<<RETRO_DEVICE_ID_JOYPAD_RIGHT))
{
if (image_index < (signed)(file_list->size - 1))
if (image_index < (signed)(image_file_list->size - 1))
next_image = true;
}
@ -425,13 +427,13 @@ void IMAGE_CORE_PREFIX(retro_run)(void)
}
else if (last_image)
{
image_index = (int)(file_list->size - 1);
image_index = (int)(image_file_list->size - 1);
load_image = true;
}
if (load_image)
{
if (!imageviewer_load(file_list->elems[image_index].data, image_index))
if (!imageviewer_load(image_file_list->elems[image_index].data, image_index))
{
IMAGE_CORE_PREFIX(environ_cb)(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
}

View File

@ -102,7 +102,6 @@ struct defaults
{
int out_latency;
float video_refresh_rate;
bool video_threaded_enable;
char menu[32];
} settings;

View File

@ -3,7 +3,6 @@
*.txt
/test
/spirv-cross
*.spv
/obj
/msvc/x64
/msvc/Debug
@ -15,5 +14,7 @@
*.a
*.bc
/external
.vs/
*.vcxproj.user
!CMakeLists.txt

View File

@ -1,18 +1,72 @@
language: cpp
os:
- linux
- osx
osx_image: xcode9.3beta
language:
- cpp
- python
# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
sudo: required
dist: trusty
python: 3.7
matrix:
include:
- os: linux
dist: trusty
compiler: gcc
env:
- GENERATOR="Unix Makefiles"
- ARTIFACT=gcc-trusty-64bit
- os: linux
dist: trusty
compiler: clang
env:
- GENERATOR="Unix Makefiles"
- ARTIFACT=clang-trusty-64bit
- os: osx
compiler: clang
osx_image: xcode10
env:
- GENERATOR="Unix Makefiles"
- ARTIFACT=clang-macos-64bit
- os: windows
before_install:
- choco install python3
- export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
env:
- GENERATOR="Visual Studio 15 2017"
- ARTIFACT=vs2017-32bit
- os: windows
before_install:
- choco install python3
- export PATH="/c/Python37:/c/Python37/Scripts:$PATH"
env:
- GENERATOR="Visual Studio 15 2017 Win64"
- ARTIFACT=vs2017-64bit
before_script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew upgrade python3; fi
- ./checkout_glslang_spirv_tools.sh
- "./checkout_glslang_spirv_tools.sh"
script:
- ./build_glslang_spirv_tools.sh Debug 2
- make -j2
- ./test_shaders.sh
- if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then PYTHON3=$(which python); fi
- if [[ "$TRAVIS_OS_NAME" != "windows" ]]; then PYTHON3=$(which python3); fi
- "./build_glslang_spirv_tools.sh Release"
- mkdir build
- cd build
- cmake .. -DSPIRV_CROSS_SHARED=ON -DCMAKE_INSTALL_PREFIX=output -DCMAKE_BUILD_TYPE=Release -G "${GENERATOR}" -DPYTHON_EXECUTABLE:FILEPATH="${PYTHON3}" -DSPIRV_CROSS_ENABLE_TESTS=ON
- cmake --build . --config Release
- cmake --build . --config Release --target install
- ctest --verbose -C Release
- cd ..
before_deploy:
- REV=${ARTIFACT}-$(git rev-parse --short=10 HEAD)
- cd build/output
- tar cf spirv-cross-${REV}.tar *
- gzip spirv-cross-${REV}.tar
- cd ../..
- export FILE_TO_UPLOAD=build/output/spirv-cross-${REV}.tar.gz
deploy:
provider: releases
api_key:
secure: c7YEOyzhE19TFo76UnbLWk/kikRQxsHsOxzkOqN6Q2aL8joNRw5kmcG84rGd+Rf6isX62cykCzA6qHkyJCv9QTIzcyXnLju17rLvgib7cXDcseaq8x4mFvet2yUxCglthDpFY2M2LB0Aqws71lPeYIrKXa6hCFEh8jO3AWxnaor7O3RYfNZylM9d33HgH6KLT3sDx/cukwBstmKeg7EG9OUnrSvairkPW0W2+jlq3SXPlq/WeVhf8hQs3Yg0BluExGbmLOwe9EaeUpeGuJMyHRxXypnToQv1/KwoScKpap5tYxdNWiwRGZ4lYcmKrjAYVvilTioh654oX5LQpn34mE/oe8Ko9AaATkSaoiisRFp6meWtnB39oFBoL5Yn15DqLQpRXPr1AJsnBXSGAac3aDBO1j4MIqTHmYlYlfRw3n2ZsBaFaTZnv++438SNQ54nkivyoDTIWjoOmYa9+K4mQc3415RDdQmjZTJM+lu+GAlMmNBTVbfNvrbU55Usu9Lo6BZJKKdUMvdBB78kJ5FHvcBlL+eMgmk1pABQY0IZROCt7NztHcv1UmAxoWNxveSFs5glydPNNjNS8bogc4dzBGYG0KMmILbBHihVbY2toA1M9CMdDHdp+LucfDMmzECmYSEmlx0h8win+Jjb74/qpOhaXuUZ0NnzVgCOyeUYuMQ=
file: "${FILE_TO_UPLOAD}"
skip_cleanup: true
on:
tags: true

View File

@ -13,151 +13,522 @@
# limitations under the License.
cmake_minimum_required(VERSION 2.8)
project(SPIRV-Cross)
set(CMAKE_CXX_STANDARD 11)
project(SPIRV-Cross LANGUAGES CXX C)
enable_testing()
option(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS "Instead of throwing exceptions assert" OFF)
option(SPIRV_CROSS_SHARED "Build the C API as a single shared library." OFF)
option(SPIRV_CROSS_STATIC "Build the C and C++ API as static libraries." ON)
option(SPIRV_CROSS_CLI "Build the CLI binary. Requires SPIRV_CROSS_STATIC." ON)
option(SPIRV_CROSS_ENABLE_TESTS "Enable SPIRV-Cross tests." ON)
option(SPIRV_CROSS_ENABLE_GLSL "Enable GLSL support." ON)
option(SPIRV_CROSS_ENABLE_HLSL "Enable HLSL target support." ON)
option(SPIRV_CROSS_ENABLE_MSL "Enable MSL target support." ON)
option(SPIRV_CROSS_ENABLE_CPP "Enable C++ target support." ON)
option(SPIRV_CROSS_ENABLE_REFLECT "Enable JSON reflection target support." ON)
option(SPIRV_CROSS_ENABLE_C_API "Enable C API wrapper support in static library." ON)
option(SPIRV_CROSS_ENABLE_UTIL "Enable util module support." ON)
option(SPIRV_CROSS_SANITIZE_ADDRESS "Sanitize address" OFF)
option(SPIRV_CROSS_SANITIZE_MEMORY "Sanitize memory" OFF)
option(SPIRV_CROSS_SANITIZE_THREADS "Sanitize threads" OFF)
option(SPIRV_CROSS_SANITIZE_UNDEFINED "Sanitize undefined" OFF)
option(SPIRV_CROSS_NAMESPACE_OVERRIDE "" "Override the namespace used in the C++ API.")
option(SPIRV_CROSS_FORCE_STL_TYPES "Force use of STL types instead of STL replacements in certain places. Might reduce performance." OFF)
if(${CMAKE_GENERATOR} MATCHES "Makefile")
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
message(FATAL_ERROR "Build out of tree to avoid overwriting Makefile")
endif()
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
message(FATAL_ERROR "Build out of tree to avoid overwriting Makefile")
endif()
endif()
set(spirv-compiler-options "")
set(spirv-compiler-defines "")
set(spirv-cross-link-flags "")
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
set(spirv-compiler-defines ${spirv-compiler-defines} SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
message(STATUS "Finding Git version for SPIRV-Cross.")
set(spirv-cross-build-version "unknown")
find_package(Git)
if (GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
OUTPUT_VARIABLE spirv-cross-build-version
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
message(STATUS "Git hash: ${spirv-cross-build-version}")
else()
message(STATUS "Git not found, using unknown build version.")
endif()
# To specify special debug or optimization options, use
# -DCMAKE_CXX_COMPILE_FLAGS
# However, we require the C++11 dialect.
if (NOT "${MSVC}")
set(spirv-compiler-options ${spirv-compiler-options} -std=c++11 -Wall -Wextra -Werror -Wshadow)
set(spirv-compiler-defines ${spirv-compiler-defines} __STDC_LIMIT_MACROS)
string(TIMESTAMP spirv-cross-timestamp)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/gitversion.in.h ${CMAKE_CURRENT_BINARY_DIR}/gitversion.h @ONLY)
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
set(spirv-compiler-options ${spirv-compiler-options} -fno-exceptions)
endif()
if(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
set(spirv-compiler-defines ${spirv-compiler-defines} SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
endif()
if(SPIRV_CROSS_FORCE_STL_TYPES)
set(spirv-compiler-defines ${spirv-compiler-defines} SPIRV_CROSS_FORCE_STL_TYPES)
endif()
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
set(spirv-compiler-options ${spirv-compiler-options} -Wall -Wextra -Werror -Wshadow)
if (SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS)
set(spirv-compiler-options ${spirv-compiler-options} -fno-exceptions)
endif()
if (SPIRV_CROSS_SANITIZE_ADDRESS)
set(spirv-compiler-options ${spirv-compiler-options} -fsanitize=address)
set(spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=address")
endif()
if (SPIRV_CROSS_SANITIZE_UNDEFINED)
set(spirv-compiler-options ${spirv-compiler-options} -fsanitize=undefined)
set(spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=undefined")
endif()
if (SPIRV_CROSS_SANITIZE_MEMORY)
set(spirv-compiler-options ${spirv-compiler-options} -fsanitize=memory)
set(spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=memory")
endif()
if (SPIRV_CROSS_SANITIZE_THREADS)
set(spirv-compiler-options ${spirv-compiler-options} -fsanitize=thread)
set(spirv-cross-link-flags "${spirv-cross-link-flags} -fsanitize=thread")
endif()
elseif (MSVC)
set(spirv-compiler-options ${spirv-compiler-options} /wd4267)
endif()
macro(extract_headers out_abs file_list)
set(${out_abs}) # absolute paths
foreach(_a ${file_list})
# get_filename_component only returns the longest extension, so use a regex
string(REGEX REPLACE ".*\\.(h|hpp)" "\\1" ext ${_a})
if(("${ext}" STREQUAL "h") OR ("${ext}" STREQUAL "hpp"))
list(APPEND ${out_abs} "${_a}")
endif()
endforeach()
set(${out_abs}) # absolute paths
foreach(_a ${file_list})
# get_filename_component only returns the longest extension, so use a regex
string(REGEX REPLACE ".*\\.(h|hpp)" "\\1" ext ${_a})
# For shared library, we are only interested in the C header.
if (SPIRV_CROSS_STATIC)
if(("${ext}" STREQUAL "h") OR ("${ext}" STREQUAL "hpp"))
list(APPEND ${out_abs} "${_a}")
endif()
else()
if("${ext}" STREQUAL "h")
list(APPEND ${out_abs} "${_a}")
endif()
endif()
endforeach()
endmacro()
macro(spirv_cross_add_library name config_name)
add_library(${name} ${ARGN})
extract_headers(hdrs "${ARGN}")
target_include_directories(${name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/spirv_cross>)
set_target_properties(${name} PROPERTIES
PUBLIC_HEADERS "${hdrs}")
target_compile_options(${name} PRIVATE ${spirv-compiler-options})
target_compile_definitions(${name} PRIVATE ${spirv-compiler-defines})
install(TARGETS ${name}
EXPORT ${config_name}Config
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/spirv_cross)
install(FILES ${hdrs} DESTINATION include/spirv_cross)
install(EXPORT ${config_name}Config DESTINATION share/${config_name}/cmake)
export(TARGETS ${targets} FILE ${config_name}Config.cmake)
macro(spirv_cross_add_library name config_name library_type)
add_library(${name} ${library_type} ${ARGN})
extract_headers(hdrs "${ARGN}")
target_include_directories(${name} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<INSTALL_INTERFACE:include/spirv_cross>)
set_target_properties(${name} PROPERTIES
PUBLIC_HEADERS "${hdrs}")
target_compile_options(${name} PRIVATE ${spirv-compiler-options})
target_compile_definitions(${name} PRIVATE ${spirv-compiler-defines})
if (SPIRV_CROSS_NAMESPACE_OVERRIDE)
if (${library_type} MATCHES "STATIC")
target_compile_definitions(${name} PUBLIC SPIRV_CROSS_NAMESPACE_OVERRIDE=${SPIRV_CROSS_NAMESPACE_OVERRIDE})
else()
target_compile_definitions(${name} PRIVATE SPIRV_CROSS_NAMESPACE_OVERRIDE=${SPIRV_CROSS_NAMESPACE_OVERRIDE})
endif()
endif()
install(TARGETS ${name}
EXPORT ${config_name}Config
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/spirv_cross)
install(FILES ${hdrs} DESTINATION include/spirv_cross)
install(EXPORT ${config_name}Config DESTINATION share/${config_name}/cmake)
export(TARGETS ${name} FILE ${config_name}Config.cmake)
endmacro()
set(spirv-cross-core-sources
${CMAKE_CURRENT_SOURCE_DIR}/GLSL.std.450.h
${CMAKE_CURRENT_SOURCE_DIR}/spirv_common.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_containers.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_error_handling.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_parser.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_parser.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_parsed_ir.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_parsed_ir.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.cpp)
spirv_cross_add_library(spirv-cross-core spirv_cross_core STATIC
${CMAKE_CURRENT_SOURCE_DIR}/GLSL.std.450.h
${CMAKE_CURRENT_SOURCE_DIR}/spirv_common.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cfg.cpp)
set(spirv-cross-c-sources
spirv.h
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_c.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_c.h)
spirv_cross_add_library(spirv-cross-glsl spirv_cross_glsl STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.hpp)
set(spirv-cross-glsl-sources
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_glsl.hpp)
spirv_cross_add_library(spirv-cross-cpp spirv_cross_cpp STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.cpp)
set(spirv-cross-cpp-sources
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.hpp)
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)
set(spirv-cross-msl-sources
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.hpp)
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)
set(spirv-cross-hlsl-sources
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.hpp)
spirv_cross_add_library(spirv-cross-hlsl spirv_cross_hlsl STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_hlsl.cpp)
set(spirv-cross-reflect-sources
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.hpp)
spirv_cross_add_library(spirv-cross-util spirv_cross_util STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.cpp)
set(spirv-cross-util-sources
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.cpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cross_util.hpp)
add_executable(spirv-cross main.cpp)
target_compile_options(spirv-cross PRIVATE ${spirv-compiler-options})
target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines})
if (SPIRV_CROSS_STATIC)
spirv_cross_add_library(spirv-cross-core spirv_cross_core STATIC
${spirv-cross-core-sources})
install(TARGETS spirv-cross RUNTIME DESTINATION bin)
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)
target_link_libraries(spirv-cross-hlsl spirv-cross-glsl)
target_link_libraries(spirv-cross-cpp spirv-cross-glsl)
if (SPIRV_CROSS_ENABLE_GLSL)
spirv_cross_add_library(spirv-cross-glsl spirv_cross_glsl STATIC
${spirv-cross-glsl-sources})
target_link_libraries(spirv-cross-glsl PRIVATE spirv-cross-core)
endif()
# Set up tests, using only the simplest modes of the test_shaders
# script. You have to invoke the script manually to:
# - Update the reference files
# - Get cycle counts from malisc
# - Keep failing outputs
find_package(PythonInterp)
if (${PYTHONINTERP_FOUND})
if (${PYTHON_VERSION_MAJOR} GREATER 2)
add_test(NAME spirv-cross-test
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py
${CMAKE_CURRENT_SOURCE_DIR}/shaders)
add_test(NAME spirv-cross-test-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)
add_test(NAME spirv-cross-test-metal-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal --opt
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl)
add_test(NAME spirv-cross-test-hlsl-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl --opt
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl)
endif()
else()
message(WARNING "Testing disabled. Could not find python3. If you have python3 installed try running "
"cmake with -DPYTHON_EXECUTABLE:FILEPATH=/path/to/python3 to help it find the executable")
if (SPIRV_CROSS_ENABLE_CPP)
spirv_cross_add_library(spirv-cross-cpp spirv_cross_cpp STATIC
${spirv-cross-cpp-sources})
if (SPIRV_CROSS_ENABLE_GLSL)
target_link_libraries(spirv-cross-cpp PRIVATE spirv-cross-glsl)
else()
message(FATAL_ERROR "Must enable GLSL support to enable C++ support.")
endif()
endif()
if (SPIRV_CROSS_ENABLE_REFLECT)
if (SPIRV_CROSS_ENABLE_GLSL)
spirv_cross_add_library(spirv-cross-reflect spirv_cross_reflect STATIC
${spirv-cross-reflect-sources})
else()
message(FATAL_ERROR "Must enable GLSL support to enable JSON reflection support.")
endif()
endif()
if (SPIRV_CROSS_ENABLE_MSL)
spirv_cross_add_library(spirv-cross-msl spirv_cross_msl STATIC
${spirv-cross-msl-sources})
if (SPIRV_CROSS_ENABLE_GLSL)
target_link_libraries(spirv-cross-msl PRIVATE spirv-cross-glsl)
else()
message(FATAL_ERROR "Must enable GLSL support to enable MSL support.")
endif()
endif()
if (SPIRV_CROSS_ENABLE_HLSL)
spirv_cross_add_library(spirv-cross-hlsl spirv_cross_hlsl STATIC
${spirv-cross-hlsl-sources})
if (SPIRV_CROSS_ENABLE_GLSL)
target_link_libraries(spirv-cross-hlsl PRIVATE spirv-cross-glsl)
else()
message(FATAL_ERROR "Must enable GLSL support to enable HLSL support.")
endif()
endif()
if (SPIRV_CROSS_ENABLE_UTIL)
spirv_cross_add_library(spirv-cross-util spirv_cross_util STATIC
${spirv-cross-util-sources})
target_link_libraries(spirv-cross-util PRIVATE spirv-cross-core)
endif()
if (SPIRV_CROSS_ENABLE_C_API)
spirv_cross_add_library(spirv-cross-c spirv_cross_c STATIC
${spirv-cross-c-sources})
target_include_directories(spirv-cross-c PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_definitions(spirv-cross-c PRIVATE HAVE_SPIRV_CROSS_GIT_VERSION)
if (SPIRV_CROSS_ENABLE_GLSL)
target_link_libraries(spirv-cross-c PRIVATE spirv-cross-glsl)
target_compile_definitions(spirv-cross-c PRIVATE SPIRV_CROSS_C_API_GLSL=1)
endif()
if (SPIRV_CROSS_ENABLE_HLSL)
target_link_libraries(spirv-cross-c PRIVATE spirv-cross-hlsl)
target_compile_definitions(spirv-cross-c PRIVATE SPIRV_CROSS_C_API_HLSL=1)
endif()
if (SPIRV_CROSS_ENABLE_MSL)
target_link_libraries(spirv-cross-c PRIVATE spirv-cross-msl)
target_compile_definitions(spirv-cross-c PRIVATE SPIRV_CROSS_C_API_MSL=1)
endif()
if (SPIRV_CROSS_ENABLE_CPP)
target_link_libraries(spirv-cross-c PRIVATE spirv-cross-cpp)
target_compile_definitions(spirv-cross-c PRIVATE SPIRV_CROSS_C_API_CPP=1)
endif()
if (SPIRV_CROSS_ENABLE_REFLECT)
target_link_libraries(spirv-cross-c PRIVATE spirv-cross-reflect)
target_compile_definitions(spirv-cross-c PRIVATE SPIRV_CROSS_C_API_REFLECT=1)
endif()
endif()
endif()
set(spirv-cross-abi-major 0)
set(spirv-cross-abi-minor 16)
set(spirv-cross-abi-patch 0)
if (SPIRV_CROSS_SHARED)
set(SPIRV_CROSS_VERSION ${spirv-cross-abi-major}.${spirv-cross-abi-minor}.${spirv-cross-abi-patch})
set(SPIRV_CROSS_INSTALL_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib)
set(SPIRV_CROSS_INSTALL_INC_DIR ${CMAKE_INSTALL_PREFIX}/include/spirv_cross)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/pkg-config/spirv-cross-c-shared.pc.in
${CMAKE_CURRENT_BINARY_DIR}/spirv-cross-c-shared.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/spirv-cross-c-shared.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pkgconfig)
spirv_cross_add_library(spirv-cross-c-shared spirv_cross_c_shared SHARED
${spirv-cross-core-sources}
${spirv-cross-c-sources})
target_include_directories(spirv-cross-c-shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_definitions(spirv-cross-c-shared PRIVATE HAVE_SPIRV_CROSS_GIT_VERSION)
if (SPIRV_CROSS_ENABLE_GLSL)
target_sources(spirv-cross-c-shared PRIVATE ${spirv-cross-glsl-sources})
target_compile_definitions(spirv-cross-c-shared PRIVATE SPIRV_CROSS_C_API_GLSL=1)
endif()
if (SPIRV_CROSS_ENABLE_HLSL)
if (SPIRV_CROSS_ENABLE_GLSL)
target_sources(spirv-cross-c-shared PRIVATE ${spirv-cross-hlsl-sources})
else()
message(FATAL_ERROR "Must enable GLSL support to enable HLSL support.")
endif()
target_compile_definitions(spirv-cross-c-shared PRIVATE SPIRV_CROSS_C_API_HLSL=1)
endif()
if (SPIRV_CROSS_ENABLE_MSL)
if (SPIRV_CROSS_ENABLE_GLSL)
target_sources(spirv-cross-c-shared PRIVATE ${spirv-cross-msl-sources})
else()
message(FATAL_ERROR "Must enable GLSL support to enable MSL support.")
endif()
target_compile_definitions(spirv-cross-c-shared PRIVATE SPIRV_CROSS_C_API_MSL=1)
endif()
if (SPIRV_CROSS_ENABLE_CPP)
if (SPIRV_CROSS_ENABLE_GLSL)
target_sources(spirv-cross-c-shared PRIVATE ${spirv-cross-cpp-sources})
else()
message(FATAL_ERROR "Must enable GLSL support to enable C++ support.")
endif()
target_compile_definitions(spirv-cross-c-shared PRIVATE SPIRV_CROSS_C_API_CPP=1)
endif()
if (SPIRV_CROSS_ENABLE_REFLECT)
if (SPIRV_CROSS_ENABLE_GLSL)
target_sources(spirv-cross-c-shared PRIVATE ${spirv-cross-reflect-sources})
else()
message(FATAL_ERROR "Must enable GLSL support to enable JSON reflection support.")
endif()
target_compile_definitions(spirv-cross-c-shared PRIVATE SPIRV_CROSS_C_API_REFLECT=1)
endif()
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
# Only export the C API.
target_compile_options(spirv-cross-c-shared PRIVATE -fvisibility=hidden)
if (NOT APPLE)
set_target_properties(spirv-cross-c-shared PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
endif()
endif()
target_compile_definitions(spirv-cross-c-shared PRIVATE SPVC_EXPORT_SYMBOLS)
set_target_properties(spirv-cross-c-shared PROPERTIES
VERSION ${SPIRV_CROSS_VERSION}
SOVERSION ${spirv-cross-abi-major})
endif()
if (SPIRV_CROSS_CLI)
if (NOT SPIRV_CROSS_ENABLE_GLSL)
message(FATAL_ERROR "Must enable GLSL if building CLI.")
endif()
if (NOT SPIRV_CROSS_ENABLE_HLSL)
message(FATAL_ERROR "Must enable HLSL if building CLI.")
endif()
if (NOT SPIRV_CROSS_ENABLE_MSL)
message(FATAL_ERROR "Must enable MSL if building CLI.")
endif()
if (NOT SPIRV_CROSS_ENABLE_CPP)
message(FATAL_ERROR "Must enable C++ if building CLI.")
endif()
if (NOT SPIRV_CROSS_ENABLE_REFLECT)
message(FATAL_ERROR "Must enable reflection if building CLI.")
endif()
if (NOT SPIRV_CROSS_ENABLE_UTIL)
message(FATAL_ERROR "Must enable utils if building CLI.")
endif()
if (NOT SPIRV_CROSS_STATIC)
message(FATAL_ERROR "Must build static libraries if building CLI.")
endif()
add_executable(spirv-cross main.cpp)
target_compile_options(spirv-cross PRIVATE ${spirv-compiler-options})
target_include_directories(spirv-cross PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines} HAVE_SPIRV_CROSS_GIT_VERSION)
set_target_properties(spirv-cross PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
install(TARGETS spirv-cross RUNTIME DESTINATION bin)
target_link_libraries(spirv-cross PRIVATE
spirv-cross-glsl
spirv-cross-hlsl
spirv-cross-cpp
spirv-cross-reflect
spirv-cross-msl
spirv-cross-util
spirv-cross-core)
if (SPIRV_CROSS_ENABLE_TESTS)
# Set up tests, using only the simplest modes of the test_shaders
# script. You have to invoke the script manually to:
# - Update the reference files
# - Get cycle counts from malisc
# - Keep failing outputs
find_package(PythonInterp)
find_program(spirv-cross-glslang NAMES glslangValidator
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/glslang-build/output/bin
NO_DEFAULT_PATH)
find_program(spirv-cross-spirv-as NAMES spirv-as
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/spirv-tools-build/output/bin
NO_DEFAULT_PATH)
find_program(spirv-cross-spirv-val NAMES spirv-val
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/spirv-tools-build/output/bin
NO_DEFAULT_PATH)
find_program(spirv-cross-spirv-opt NAMES spirv-opt
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/external/spirv-tools-build/output/bin
NO_DEFAULT_PATH)
if ((${spirv-cross-glslang} MATCHES "NOTFOUND") OR (${spirv-cross-spirv-as} MATCHES "NOTFOUND") OR (${spirv-cross-spirv-val} MATCHES "NOTFOUND") OR (${spirv-cross-spirv-opt} MATCHES "NOTFOUND"))
set(SPIRV_CROSS_ENABLE_TESTS OFF)
message("Could not find glslang or SPIRV-Tools build under external/. Run ./checkout_glslang_spirv_tools.sh and ./build_glslang_spirv_tools.sh. Testing will be disabled.")
else()
set(SPIRV_CROSS_ENABLE_TESTS ON)
message("Found glslang and SPIRV-Tools. Enabling test suite.")
message("Found glslangValidator in: ${spirv-cross-glslang}.")
message("Found spirv-as in: ${spirv-cross-spirv-as}.")
message("Found spirv-val in: ${spirv-cross-spirv-val}.")
message("Found spirv-opt in: ${spirv-cross-spirv-opt}.")
endif()
set(spirv-cross-externals
--glslang "${spirv-cross-glslang}"
--spirv-as "${spirv-cross-spirv-as}"
--spirv-opt "${spirv-cross-spirv-opt}"
--spirv-val "${spirv-cross-spirv-val}")
if (${PYTHONINTERP_FOUND} AND SPIRV_CROSS_ENABLE_TESTS)
if (${PYTHON_VERSION_MAJOR} GREATER 2)
add_executable(spirv-cross-c-api-test tests-other/c_api_test.c)
target_link_libraries(spirv-cross-c-api-test spirv-cross-c)
set_target_properties(spirv-cross-c-api-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
add_executable(spirv-cross-small-vector-test tests-other/small_vector.cpp)
target_link_libraries(spirv-cross-small-vector-test spirv-cross-core)
set_target_properties(spirv-cross-small-vector-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
add_executable(spirv-cross-msl-constexpr-test tests-other/msl_constexpr_test.cpp)
target_link_libraries(spirv-cross-msl-constexpr-test spirv-cross-c)
set_target_properties(spirv-cross-msl-constexpr-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
add_executable(spirv-cross-msl-resource-binding-test tests-other/msl_resource_bindings.cpp)
target_link_libraries(spirv-cross-msl-resource-binding-test spirv-cross-c)
set_target_properties(spirv-cross-msl-resource-binding-test PROPERTIES LINK_FLAGS "${spirv-cross-link-flags}")
if (CMAKE_COMPILER_IS_GNUCXX OR (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang"))
target_compile_options(spirv-cross-c-api-test PRIVATE -std=c89 -Wall -Wextra)
endif()
add_test(NAME spirv-cross-c-api-test
COMMAND $<TARGET_FILE:spirv-cross-c-api-test> ${CMAKE_CURRENT_SOURCE_DIR}/tests-other/c_api_test.spv
${spirv-cross-abi-major}
${spirv-cross-abi-minor}
${spirv-cross-abi-patch})
add_test(NAME spirv-cross-small-vector-test
COMMAND $<TARGET_FILE:spirv-cross-small-vector-test>)
add_test(NAME spirv-cross-msl-constexpr-test
COMMAND $<TARGET_FILE:spirv-cross-msl-constexpr-test> ${CMAKE_CURRENT_SOURCE_DIR}/tests-other/msl_constexpr_test.spv)
add_test(NAME spirv-cross-msl-resource-binding-test
COMMAND $<TARGET_FILE:spirv-cross-msl-resource-binding-test> ${CMAKE_CURRENT_SOURCE_DIR}/tests-other/msl_resource_binding.spv)
add_test(NAME spirv-cross-test
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-no-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-no-opt
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-metal
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-metal-no-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl-no-opt
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-hlsl
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-hlsl-no-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl-no-opt
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --opt --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-metal-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --metal --opt --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-msl
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-hlsl-opt
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --hlsl --opt --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-hlsl
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
add_test(NAME spirv-cross-test-reflection
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_shaders.py --reflect --parallel
${spirv-cross-externals}
${CMAKE_CURRENT_SOURCE_DIR}/shaders-reflection
WORKING_DIRECTORY $<TARGET_FILE_DIR:spirv-cross>)
endif()
elseif(NOT ${PYTHONINTERP_FOUND})
message(WARNING "Testing disabled. Could not find python3. If you have python3 installed try running "
"cmake with -DPYTHON_EXECUTABLE:FILEPATH=/path/to/python3 to help it find the executable")
endif()
endif()
endif()

1
deps/SPIRV-Cross/CODE_OF_CONDUCT.md vendored Normal file
View File

@ -0,0 +1 @@
A reminder that this issue tracker is managed by the Khronos Group. Interactions here should follow the Khronos Code of Conduct (https://www.khronos.org/developers/code-of-conduct), which prohibits aggressive or derogatory language. Please keep the discussion friendly and civil.

View File

@ -10,7 +10,7 @@ STATIC_LIB := lib$(TARGET).a
DEPS := $(OBJECTS:.o=.d) $(CLI_OBJECTS:.o=.d)
CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow -D__STDC_LIMIT_MACROS
CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow
ifeq ($(DEBUG), 1)
CXXFLAGS += -O0 -g

View File

@ -3,14 +3,14 @@
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)
[![Build Status](https://ci.appveyor.com/api/projects/status/github/KhronosGroup/SPIRV-Cross?svg=true&branch=master)](https://ci.appveyor.com/project/HansKristian-Work/SPIRV-Cross)
## Features
- Convert SPIR-V to readable, usable and efficient GLSL
- 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 debuggable C++ [DEPRECATED]
- 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
@ -24,28 +24,47 @@ However, most missing features are expected to be "trivial" improvements at this
## Building
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.
SPIRV-Cross has been tested on Linux, iOS/OSX, Windows and Android. CMake is the main build system.
### Linux and macOS
Just run `make` on the command line. A recent GCC (4.8+) or Clang (3.x+) compiler is required as SPIRV-Cross uses C++11 extensively.
Building with CMake is recommended, as it is the only build system which is tested in continuous integration.
It is also the only build system which has install commands and other useful build system features.
However, you can just run `make` on the command line as a fallback if you only care about the CLI tool.
A non-ancient GCC (4.8+) or Clang (3.x+) compiler is required as SPIRV-Cross uses C++11 extensively.
### Windows
MinGW-w64 based compilation works with `make`, and an MSVC 2013 solution is also included.
Building with CMake is recommended, which is the only way to target MSVC.
MinGW-w64 based compilation works with `make` as a fallback.
### Android
SPIRV-Cross is only useful as a library here. Use the CMake build to link SPIRV-Cross to your project.
### C++ exceptions
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.
### Static, shared and CLI
You can use `-DSPIRV_CROSS_STATIC=ON/OFF` `-DSPIRV_CROSS_SHARED=ON/OFF` `-DSPIRV_CROSS_CLI=ON/OFF` to control which modules are built (and installed).
## Usage
### 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).
The C++ API is the main API for SPIRV-Cross. 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).
**NOTE**: This API is not guaranteed to be ABI-stable, and it is highly recommended to link against this API statically.
The API is generally quite stable, but it can change over time, see the C API for more stability.
To perform reflection and convert to other shader languages you can use the SPIRV-Cross API.
For example:
```
```c++
#include "spirv_glsl.hpp"
#include <vector>
#include <utility>
@ -87,19 +106,143 @@ int main()
}
```
### Using the C API wrapper
To facilitate C compatibility and compatibility with foreign programming languages, a C89-compatible API wrapper is provided. Unlike the C++ API,
the goal of this wrapper is to be fully stable, both API and ABI-wise.
This is the only interface which is supported when building SPIRV-Cross as a shared library.
An important point of the wrapper is that all memory allocations are contained in the `spvc_context`.
This simplifies the use of the API greatly. However, you should destroy the context as soon as reasonable,
or use `spvc_context_release_allocations()` if you intend to reuse the `spvc_context` object again soon.
Most functions return a `spvc_result`, where `SPVC_SUCCESS` is the only success code.
For brevity, the code below does not do any error checking.
```c
#include <spirv_cross_c.h>
const SpvId *spirv = get_spirv_data();
size_t word_count = get_spirv_word_count();
spvc_context context = NULL;
spvc_parsed_ir ir = NULL;
spvc_compiler compiler_glsl = NULL;
spvc_compiler_options options = NULL;
spvc_resources resources = NULL;
const spvc_reflected_resource *list = NULL;
const char *result = NULL;
size_t count;
size_t i;
// Create context.
spvc_context_create(&context);
// Set debug callback.
spvc_context_set_error_callback(context, error_callback, userdata);
// Parse the SPIR-V.
spvc_context_parse_spirv(context, spirv, word_count, &ir);
// Hand it off to a compiler instance and give it ownership of the IR.
spvc_context_create_compiler(context, SPVC_BACKEND_GLSL, ir, SPVC_CAPTURE_MODE_TAKE_OWNERSHIP, &compiler_glsl);
// Do some basic reflection.
spvc_compiler_create_shader_resources(compiler_glsl, &resources);
spvc_resources_get_resource_list_for_type(resources, SPVC_RESOURCE_TYPE_UNIFORM_BUFFER, &list, &count);
for (i = 0; i < count; i++)
{
printf("ID: %u, BaseTypeID: %u, TypeID: %u, Name: %s\n", list[i].id, list[i].base_type_id, list[i].type_id,
list[i].name);
printf(" Set: %u, Binding: %u\n",
spvc_compiler_get_decoration(compiler_glsl, list[i].id, SpvDecorationDescriptorSet),
spvc_compiler_get_decoration(compiler_glsl, list[i].id, SpvDecorationBinding));
}
// Modify options.
spvc_compiler_create_compiler_options(context, &options);
spvc_compiler_options_set_uint(options, SPVC_COMPILER_OPTION_GLSL_VERSION, 330);
spvc_compiler_options_set_bool(options, SPVC_COMPILER_OPTION_GLSL_ES, SPVC_FALSE);
spvc_compiler_install_compiler_options(compiler_glsl, options);
spvc_compiler_compile(compiler, &result);
printf("Cross-compiled source: %s\n", result);
// Frees all memory we allocated so far.
spvc_context_destroy(context);
```
### Linking
#### CMake add_subdirectory()
This is the recommended way if you are using CMake and want to link against SPIRV-Cross statically.
#### Integrating SPIRV-Cross in a custom build system
To add SPIRV-Cross to your own codebase, just copy the source and header files from root directory
and build the relevant .cpp files you need. Make sure to build with C++11 support, e.g. `-std=c++11` in GCC and Clang.
Alternatively, the Makefile generates a libspirv-cross.a static library during build that can be linked in.
### Creating a SPIR-V file from GLSL with glslang
#### Linking against SPIRV-Cross as a system library
It is possible to link against SPIRV-Cross when it is installed as a system library,
which would be mostly relevant for Unix-like platforms.
##### pkg-config
For Unix-based systems, a pkg-config is installed for the C API, e.g.:
```
$ pkg-config spirv-cross-c-shared --libs --cflags
-I/usr/local/include/spirv_cross -L/usr/local/lib -lspirv-cross-c-shared
```
##### CMake
If the project is installed, it can be found with `find_package()`, e.g.:
```
cmake_minimum_required(VERSION 3.5)
set(CMAKE_C_STANDARD 99)
project(Test LANGUAGES C)
find_package(spirv_cross_c_shared)
if (spirv_cross_c_shared_FOUND)
message(STATUS "Found SPIRV-Cross C API! :)")
else()
message(STATUS "Could not find SPIRV-Cross C API! :(")
endif()
add_executable(test test.c)
target_link_libraries(test spirv-cross-c-shared)
```
test.c:
```c
#include <spirv_cross_c.h>
int main(void)
{
spvc_context context;
spvc_context_create(&context);
spvc_context_destroy(context);
}
```
### CLI
The CLI is suitable for basic cross-compilation tasks, but it cannot support the full flexibility that the API can.
Some examples below.
#### Creating a SPIR-V file from GLSL with glslang
```
glslangValidator -H -V -o test.spv test.frag
```
### Converting a SPIR-V file to GLSL ES
#### Converting a SPIR-V file to GLSL ES
```
glslangValidator -H -V -o test.spv shaders/comp/basic.comp
@ -110,7 +253,7 @@ glslangValidator -H -V -o test.spv shaders/comp/basic.comp
```
glslangValidator -H -V -o test.spv shaders/comp/basic.comp
./spirv-cross --version 330 test.spv --output test.comp
./spirv-cross --version 330 --no-es test.spv --output test.comp
```
#### Disable prettifying optimizations
@ -150,7 +293,7 @@ Likely cause: If this SPIR-V was created from glslang HLSL, make sure the entry
HLSL relies on semantics in order to effectively link together shader stages. In the SPIR-V generated by glslang, the transformation from HLSL to GLSL ends up looking like
```
```c++
struct VSOutput {
// SV_Position is rerouted to gl_Position
float4 position : SV_Position;
@ -160,7 +303,7 @@ struct VSOutput {
VSOutput main(...) {}
```
```
```c++
struct VSOutput {
float4 coord;
}
@ -190,7 +333,7 @@ This is not supported in legacy GL/GLES targets, so to support this, varying str
This is done automatically, but the API user might need to be aware that this is happening in order to support all cases.
Modern GLES code like this:
```
```c++
struct Output {
vec4 a;
vec2 b;
@ -199,7 +342,7 @@ out Output vout;
```
Is transformed into:
```
```c++
struct Output {
vec4 a;
vec2 b;
@ -216,7 +359,7 @@ API users might want to ensure that both the struct names and member names match
Another thing you need to remember is when using samplers and textures in HLSL these are separable, and not directly compatible with GLSL. If you need to use this with desktop GL/GLES, you need to call `Compiler::build_combined_image_samplers` first before calling `Compiler::compile`, or you will get an exception.
```
```c++
// From main.cpp
// Builds a mapping for all combinations of images and samplers.
compiler->build_combined_image_samplers();
@ -266,43 +409,45 @@ Contributions to SPIRV-Cross are welcome. See Testing and Licensing sections for
### Testing
SPIRV-Cross maintains a test suite of shaders with reference output of how the output looks after going through a roundtrip through
glslangValidator then back through SPIRV-Cross again. The reference files are stored inside the repository in order to be able to track regressions.
glslangValidator/spirv-as then back through SPIRV-Cross again.
The reference files are stored inside the repository in order to be able to track regressions.
All pull requests should ensure that test output does not change unexpectedly. This can be tested with:
```
./test_shaders.py shaders
./test_shaders.py shaders --opt
./test_shaders.py shaders-hlsl --hlsl
./test_shaders.py shaders-hlsl --hlsl --opt
./test_shaders.py shaders-msl --msl
./test_shaders.py shaders-msl --msl --opt
```
although there are a couple of convenience script for doing this:
```
./checkout_glslang_spirv_tools.sh # Checks out glslang and SPIRV-Tools at a fixed revision which matches the reference output.
# NOTE: Some users have reported problems cloning from git:// paths. To use https:// instead pass in
# $ PROTOCOL=https ./checkout_glslang_spirv_tools.sh
# instead.
./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.
```
`./test_shaders.sh` currently requires a Makefile setup with GCC/Clang to be set up.
However, on Windows, this can be rather inconvenient if a MinGW environment is not set up.
To use a spirv-cross binary you built with CMake (or otherwise), you can pass in an environment variable as such:
```
SPIRV_CROSS_PATH=path/to/custom/spirv-cross ./test_shaders.sh
```
However, when improving SPIRV-Cross there are of course legitimate cases where reference output should change.
In these cases, run:
```
./update_test_shaders.sh
./update_test_shaders.sh # SPIRV_CROSS_PATH also works here.
```
to update the reference files and include these changes as part of the pull request.
Always make sure you are running the correct version of glslangValidator as well as SPIRV-Tools when updating reference files.
See `checkout_glslang_spirv_tools.sh`.
See `checkout_glslang_spirv_tools.sh` which revisions are currently expected. The revisions change regularly.
In short, the master branch should always be able to run `./test_shaders.py shaders` and friends without failure.
SPIRV-Cross uses Travis CI to test all pull requests, so it is not strictly needed to perform testing yourself if you have problems running it locally.
A pull request which does not pass testing on Travis will not be accepted however.
When adding support for new features to SPIRV-Cross, a new shader and reference file should be added which covers usage of the new shader features in question.
Travis CI runs the test suite with the CMake, by running `ctest`. This is a more straight-forward alternative to `./test_shaders.sh`.
### Licensing
@ -320,13 +465,6 @@ command line:
./format_all.sh
## ABI concerns
### SPIR-V headers
The current repository uses the latest SPIR-V and GLSL.std.450 headers.
SPIR-V files created from older headers could have ABI issues.
## Regression testing
In shaders/ a collection of shaders are maintained for purposes of regression testing.

View File

@ -1,26 +1,26 @@
#!/bin/bash
PROFILE=Release
if [ ! -z $1 ]; then
PROFILE=$1
fi
NPROC=$(nproc)
if [ ! -z $2 ]; then
NPROC=$2
NPROC="--parallel $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
cmake ../glslang -DCMAKE_BUILD_TYPE=$PROFILE -DCMAKE_INSTALL_PREFIX=output
cmake --build . --config $PROFILE --target install ${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
cmake ../spirv-tools -DCMAKE_BUILD_TYPE=$PROFILE -DSPIRV_WERROR=OFF -DCMAKE_INSTALL_PREFIX=output
cmake --build . --config $PROFILE --target install ${NPROC}
cd ../..

View File

@ -1,7 +1,14 @@
#!/bin/bash
GLSLANG_REV=461ea09943e0e88ea854ab9e3b42d17d728af2ad
SPIRV_TOOLS_REV=53bc1623ecd3cc304d0d6feed8385e70c7ab30d3
GLSLANG_REV=e291f7a09f6733f6634fe077a228056fabee881e
SPIRV_TOOLS_REV=89fe836fe22c3e5c2a062ebeade012e2c2f0839b
SPIRV_HEADERS_REV=c4f8f65792d4bf2657ca751904c511bbcf2ac77b
if [ -z $PROTOCOL ]; then
PROTOCOL=git
fi
echo "Using protocol \"$PROTOCOL\" for checking out repositories. If this is problematic, try PROTOCOL=https $0."
if [ -d external/glslang ]; then
echo "Updating glslang to revision $GLSLANG_REV."
@ -12,7 +19,7 @@ else
echo "Cloning glslang revision $GLSLANG_REV."
mkdir -p external
cd external
git clone git://github.com/KhronosGroup/glslang.git
git clone $PROTOCOL://github.com/KhronosGroup/glslang.git
cd glslang
git checkout $GLSLANG_REV
fi
@ -27,7 +34,7 @@ else
echo "Cloning SPIRV-Tools revision $SPIRV_TOOLS_REV."
mkdir -p external
cd external
git clone git://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
git clone $PROTOCOL://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
cd spirv-tools
git checkout $SPIRV_TOOLS_REV
fi
@ -35,9 +42,13 @@ fi
if [ -d external/spirv-headers ]; then
cd external/spirv-headers
git pull origin master
git checkout $SPIRV_HEADERS_REV
cd ../..
else
git clone git://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
git clone $PROTOCOL://github.com/KhronosGroup/SPIRV-Headers.git external/spirv-headers
cd external/spirv-headers
git checkout $SPIRV_HEADERS_REV
cd ../..
fi
cd ../..

View File

@ -0,0 +1,6 @@
#ifndef SPIRV_CROSS_GIT_VERSION_H_
#define SPIRV_CROSS_GIT_VERSION_H_
#define SPIRV_CROSS_GIT_REVISION "Git commit: @spirv-cross-build-version@ Timestamp: @spirv-cross-timestamp@"
#endif

View File

@ -1,12 +0,0 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CFLAGS += -std=c++11 -Wall -Wextra
LOCAL_MODULE := spirv-cross
LOCAL_SRC_FILES := ../spirv_cfg.cpp ../spirv_cross.cpp ../spirv_cross_util.cpp ../spirv_glsl.cpp ../spirv_hlsl.cpp ../spirv_msl.cpp ../spirv_cpp.cpp
LOCAL_CPP_FEATURES := exceptions
LOCAL_ARM_MODE := arm
LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS
include $(BUILD_STATIC_LIBRARY)

View File

@ -1,2 +0,0 @@
APP_STL := c++_static
APP_ABI := armeabi-v7a

View File

@ -1,5 +1,5 @@
/*
* Copyright 2015-2017 ARM Limited
* Copyright 2015-2019 Arm Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -19,6 +19,7 @@
#include "spirv_glsl.hpp"
#include "spirv_hlsl.hpp"
#include "spirv_msl.hpp"
#include "spirv_parser.hpp"
#include "spirv_reflect.hpp"
#include <algorithm>
#include <cstdio>
@ -30,12 +31,16 @@
#include <unordered_map>
#include <unordered_set>
#ifdef HAVE_SPIRV_CROSS_GIT_VERSION
#include "gitversion.h"
#endif
#ifdef _MSC_VER
#pragma warning(disable : 4996)
#endif
using namespace spv;
using namespace spirv_cross;
using namespace SPIRV_CROSS_NAMESPACE;
using namespace std;
#ifdef SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS
@ -190,7 +195,7 @@ static vector<uint32_t> read_spirv_file(const char *path)
FILE *file = fopen(path, "rb");
if (!file)
{
fprintf(stderr, "Failed to open SPIRV file: %s\n", path);
fprintf(stderr, "Failed to open SPIR-V file: %s\n", path);
return {};
}
@ -220,7 +225,7 @@ static bool write_string_to_file(const char *path, const char *string)
return true;
}
static void print_resources(const Compiler &compiler, const char *tag, const vector<Resource> &resources)
static void print_resources(const Compiler &compiler, const char *tag, const SmallVector<Resource> &resources)
{
fprintf(stderr, "%s\n", tag);
fprintf(stderr, "=============\n\n");
@ -244,8 +249,14 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
uint32_t fallback_id = !is_push_constant && is_block ? res.base_type_id : res.id;
uint32_t block_size = 0;
uint32_t runtime_array_stride = 0;
if (is_sized_block)
block_size = uint32_t(compiler.get_declared_struct_size(compiler.get_type(res.base_type_id)));
{
auto &base_type = compiler.get_type(res.base_type_id);
block_size = uint32_t(compiler.get_declared_struct_size(base_type));
runtime_array_stride = uint32_t(compiler.get_declared_struct_size_runtime_array(base_type, 1) -
compiler.get_declared_struct_size_runtime_array(base_type, 0));
}
Bitset mask;
if (print_ssbo)
@ -273,7 +284,11 @@ static void print_resources(const Compiler &compiler, const char *tag, const vec
if (mask.get(DecorationNonWritable))
fprintf(stderr, " readonly");
if (is_sized_block)
{
fprintf(stderr, " (BlockSize : %u bytes)", block_size);
if (runtime_array_stride)
fprintf(stderr, " (Unsized array stride: %u bytes)", runtime_array_stride);
}
uint32_t counter_id = 0;
if (print_ssbo && compiler.buffer_get_hlsl_counter_buffer(res.id, counter_id))
@ -299,6 +314,18 @@ static const char *execution_model_to_str(spv::ExecutionModel model)
return "fragment";
case ExecutionModelGLCompute:
return "compute";
case ExecutionModelRayGenerationNV:
return "raygenNV";
case ExecutionModelIntersectionNV:
return "intersectionNV";
case ExecutionModelCallableNV:
return "callableNV";
case ExecutionModelAnyHitNV:
return "anyhitNV";
case ExecutionModelClosestHitNV:
return "closesthitNV";
case ExecutionModelMissNV:
return "missNV";
default:
return "???";
}
@ -385,9 +412,10 @@ static void print_resources(const Compiler &compiler, const ShaderResources &res
print_resources(compiler, "ubos", res.uniform_buffers);
print_resources(compiler, "push", res.push_constant_buffers);
print_resources(compiler, "counters", res.atomic_counters);
print_resources(compiler, "acceleration structures", res.acceleration_structures);
}
static void print_push_constant_resources(const Compiler &compiler, const vector<Resource> &res)
static void print_push_constant_resources(const Compiler &compiler, const SmallVector<Resource> &res)
{
for (auto &block : res)
{
@ -479,13 +507,25 @@ struct CLIArguments
bool yflip = false;
bool sso = false;
bool support_nonzero_baseinstance = true;
vector<PLSArg> pls_in;
vector<PLSArg> pls_out;
vector<Remap> remaps;
vector<string> extensions;
vector<VariableTypeRemap> variable_type_remaps;
vector<InterfaceVariableRename> interface_variable_renames;
vector<HLSLVertexAttributeRemap> hlsl_attr_remap;
bool msl_capture_output_to_buffer = false;
bool msl_swizzle_texture_samples = false;
bool msl_ios = false;
bool msl_pad_fragment_output = false;
bool msl_domain_lower_left = false;
bool msl_argument_buffers = false;
bool msl_texture_buffer_native = false;
bool msl_multiview = false;
bool glsl_emit_push_constant_as_ubo = false;
bool glsl_emit_ubo_as_plain_uniforms = false;
bool emit_line_directives = false;
SmallVector<uint32_t> msl_discrete_descriptor_sets;
SmallVector<PLSArg> pls_in;
SmallVector<PLSArg> pls_out;
SmallVector<Remap> remaps;
SmallVector<string> extensions;
SmallVector<VariableTypeRemap> variable_type_remaps;
SmallVector<InterfaceVariableRename> interface_variable_renames;
SmallVector<HLSLVertexAttributeRemap> hlsl_attr_remap;
string entry;
string entry_stage;
@ -495,7 +535,7 @@ struct CLIArguments
string new_name;
ExecutionModel execution_model;
};
vector<Rename> entry_point_rename;
SmallVector<Rename> entry_point_rename;
uint32_t iterations = 1;
bool cpp = false;
@ -503,6 +543,7 @@ struct CLIArguments
bool msl = false;
bool hlsl = false;
bool hlsl_compat = false;
bool hlsl_support_nonzero_base = false;
bool vulkan_semantics = false;
bool flatten_multidimensional_arrays = false;
bool use_420pack_extension = true;
@ -510,8 +551,19 @@ struct CLIArguments
bool combined_samplers_inherit_bindings = false;
};
static void print_version()
{
#ifdef HAVE_SPIRV_CROSS_GIT_VERSION
fprintf(stderr, "%s\n", SPIRV_CROSS_GIT_REVISION);
#else
fprintf(stderr, "Git revision unknown. Build with CMake to create timestamp and revision info.\n");
#endif
}
static void print_help()
{
print_version();
fprintf(stderr, "Usage: spirv-cross\n"
"\t[--output <output path>]\n"
"\t[SPIR-V file]\n"
@ -520,6 +572,7 @@ static void print_help()
"\t[--version <GLSL version>]\n"
"\t[--dump-resources]\n"
"\t[--help]\n"
"\t[--revision]\n"
"\t[--force-temporary]\n"
"\t[--vulkan-semantics]\n"
"\t[--flatten-ubo]\n"
@ -528,12 +581,24 @@ static void print_help()
"\t[--iterations iter]\n"
"\t[--cpp]\n"
"\t[--cpp-interface-name <name>]\n"
"\t[--glsl-emit-push-constant-as-ubo]\n"
"\t[--glsl-emit-ubo-as-plain-uniforms]\n"
"\t[--msl]\n"
"\t[--msl-version <MMmmpp>]\n"
"\t[--msl-capture-output]\n"
"\t[--msl-swizzle-texture-samples]\n"
"\t[--msl-ios]\n"
"\t[--msl-pad-fragment-output]\n"
"\t[--msl-domain-lower-left]\n"
"\t[--msl-argument-buffers]\n"
"\t[--msl-texture-buffer-native]\n"
"\t[--msl-discrete-descriptor-set <index>]\n"
"\t[--msl-multiview]\n"
"\t[--hlsl]\n"
"\t[--reflect]\n"
"\t[--shader-model]\n"
"\t[--hlsl-enable-compat]\n"
"\t[--hlsl-support-nonzero-basevertex-baseinstance]\n"
"\t[--separate-shader-objects]\n"
"\t[--pls-in format input-name]\n"
"\t[--pls-out format output-name]\n"
@ -550,10 +615,11 @@ static void print_help()
"\t[--rename-entry-point <old> <new> <stage>]\n"
"\t[--combined-samplers-inherit-bindings]\n"
"\t[--no-support-nonzero-baseinstance]\n"
"\t[--emit-line-directives]\n"
"\n");
}
static bool remap_generic(Compiler &compiler, const vector<Resource> &resources, const Remap &remap)
static bool remap_generic(Compiler &compiler, const SmallVector<Resource> &resources, const Remap &remap)
{
auto itr =
find_if(begin(resources), end(resources), [&remap](const Resource &res) { return res.name == remap.src_name; });
@ -569,8 +635,8 @@ static bool remap_generic(Compiler &compiler, const vector<Resource> &resources,
return false;
}
static vector<PlsRemap> remap_pls(const vector<PLSArg> &pls_variables, const vector<Resource> &resources,
const vector<Resource> *secondary_resources)
static vector<PlsRemap> remap_pls(const SmallVector<PLSArg> &pls_variables, const SmallVector<Resource> &resources,
const SmallVector<Resource> *secondary_resources)
{
vector<PlsRemap> ret;
@ -655,6 +721,302 @@ static ExecutionModel stage_to_execution_model(const std::string &stage)
SPIRV_CROSS_THROW("Invalid stage.");
}
static string compile_iteration(const CLIArguments &args, std::vector<uint32_t> spirv_file)
{
Parser spirv_parser(move(spirv_file));
spirv_parser.parse();
unique_ptr<CompilerGLSL> compiler;
bool combined_image_samplers = false;
bool build_dummy_sampler = false;
if (args.cpp)
{
compiler.reset(new CompilerCPP(move(spirv_parser.get_parsed_ir())));
if (args.cpp_interface_name)
static_cast<CompilerCPP *>(compiler.get())->set_interface_name(args.cpp_interface_name);
}
else if (args.msl)
{
compiler.reset(new CompilerMSL(move(spirv_parser.get_parsed_ir())));
auto *msl_comp = static_cast<CompilerMSL *>(compiler.get());
auto msl_opts = msl_comp->get_msl_options();
if (args.set_msl_version)
msl_opts.msl_version = args.msl_version;
msl_opts.capture_output_to_buffer = args.msl_capture_output_to_buffer;
msl_opts.swizzle_texture_samples = args.msl_swizzle_texture_samples;
if (args.msl_ios)
msl_opts.platform = CompilerMSL::Options::iOS;
msl_opts.pad_fragment_output_components = args.msl_pad_fragment_output;
msl_opts.tess_domain_origin_lower_left = args.msl_domain_lower_left;
msl_opts.argument_buffers = args.msl_argument_buffers;
msl_opts.texture_buffer_native = args.msl_texture_buffer_native;
msl_opts.multiview = args.msl_multiview;
msl_comp->set_msl_options(msl_opts);
for (auto &v : args.msl_discrete_descriptor_sets)
msl_comp->add_discrete_descriptor_set(v);
}
else if (args.hlsl)
compiler.reset(new CompilerHLSL(move(spirv_parser.get_parsed_ir())));
else
{
combined_image_samplers = !args.vulkan_semantics;
if (!args.vulkan_semantics)
build_dummy_sampler = true;
compiler.reset(new CompilerGLSL(move(spirv_parser.get_parsed_ir())));
}
if (!args.variable_type_remaps.empty())
{
auto remap_cb = [&](const SPIRType &, const string &name, string &out) -> void {
for (const VariableTypeRemap &remap : args.variable_type_remaps)
if (name == remap.variable_name)
out = remap.new_variable_type;
};
compiler->set_variable_type_remap_callback(move(remap_cb));
}
for (auto &rename : args.entry_point_rename)
compiler->rename_entry_point(rename.old_name, rename.new_name, rename.execution_model);
auto entry_points = compiler->get_entry_points_and_stages();
auto entry_point = args.entry;
ExecutionModel model = ExecutionModelMax;
if (!args.entry_stage.empty())
{
model = stage_to_execution_model(args.entry_stage);
if (entry_point.empty())
{
// Just use the first entry point with this stage.
for (auto &e : entry_points)
{
if (e.execution_model == model)
{
entry_point = e.name;
break;
}
}
if (entry_point.empty())
{
fprintf(stderr, "Could not find an entry point with stage: %s\n", args.entry_stage.c_str());
exit(EXIT_FAILURE);
}
}
else
{
// Make sure both stage and name exists.
bool exists = false;
for (auto &e : entry_points)
{
if (e.execution_model == model && e.name == entry_point)
{
exists = true;
break;
}
}
if (!exists)
{
fprintf(stderr, "Could not find an entry point %s with stage: %s\n", entry_point.c_str(),
args.entry_stage.c_str());
exit(EXIT_FAILURE);
}
}
}
else if (!entry_point.empty())
{
// Make sure there is just one entry point with this name, or the stage
// is ambiguous.
uint32_t stage_count = 0;
for (auto &e : entry_points)
{
if (e.name == entry_point)
{
stage_count++;
model = e.execution_model;
}
}
if (stage_count == 0)
{
fprintf(stderr, "There is no entry point with name: %s\n", entry_point.c_str());
exit(EXIT_FAILURE);
}
else if (stage_count > 1)
{
fprintf(stderr, "There is more than one entry point with name: %s. Use --stage.\n", entry_point.c_str());
exit(EXIT_FAILURE);
}
}
if (!entry_point.empty())
compiler->set_entry_point(entry_point, model);
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();
exit(EXIT_FAILURE);
}
CompilerGLSL::Options opts = compiler->get_common_options();
if (args.set_version)
opts.version = args.version;
if (args.set_es)
opts.es = args.es;
opts.force_temporary = args.force_temporary;
opts.separate_shader_objects = args.sso;
opts.flatten_multidimensional_arrays = args.flatten_multidimensional_arrays;
opts.enable_420pack_extension = args.use_420pack_extension;
opts.vulkan_semantics = args.vulkan_semantics;
opts.vertex.fixup_clipspace = args.fixup;
opts.vertex.flip_vert_y = args.yflip;
opts.vertex.support_nonzero_base_instance = args.support_nonzero_baseinstance;
opts.emit_push_constant_as_uniform_buffer = args.glsl_emit_push_constant_as_ubo;
opts.emit_uniform_buffer_as_plain_uniforms = args.glsl_emit_ubo_as_plain_uniforms;
opts.emit_line_directives = args.emit_line_directives;
compiler->set_common_options(opts);
// Set HLSL specific options.
if (args.hlsl)
{
auto *hlsl = static_cast<CompilerHLSL *>(compiler.get());
auto hlsl_opts = hlsl->get_hlsl_options();
if (args.set_shader_model)
{
if (args.shader_model < 30)
{
fprintf(stderr, "Shader model earlier than 30 (3.0) not supported.\n");
exit(EXIT_FAILURE);
}
hlsl_opts.shader_model = args.shader_model;
}
if (args.hlsl_compat)
{
// Enable all compat options.
hlsl_opts.point_size_compat = true;
hlsl_opts.point_coord_compat = true;
}
if (hlsl_opts.shader_model <= 30)
{
combined_image_samplers = true;
build_dummy_sampler = true;
}
hlsl_opts.support_nonzero_base_vertex_base_instance = args.hlsl_support_nonzero_base;
hlsl->set_hlsl_options(hlsl_opts);
}
if (build_dummy_sampler)
{
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)
{
auto active = compiler->get_active_interface_variables();
res = compiler->get_shader_resources(active);
compiler->set_enabled_interface_variables(move(active));
}
else
res = compiler->get_shader_resources();
if (args.flatten_ubo)
{
for (auto &ubo : res.uniform_buffers)
compiler->flatten_buffer_block(ubo.id);
for (auto &ubo : res.push_constant_buffers)
compiler->flatten_buffer_block(ubo.id);
}
auto pls_inputs = remap_pls(args.pls_in, res.stage_inputs, &res.subpass_inputs);
auto pls_outputs = remap_pls(args.pls_out, res.stage_outputs, nullptr);
compiler->remap_pixel_local_storage(move(pls_inputs), move(pls_outputs));
for (auto &ext : args.extensions)
compiler->require_extension(ext);
for (auto &remap : args.remaps)
{
if (remap_generic(*compiler, res.stage_inputs, remap))
continue;
if (remap_generic(*compiler, res.stage_outputs, remap))
continue;
if (remap_generic(*compiler, res.subpass_inputs, remap))
continue;
}
for (auto &rename : args.interface_variable_renames)
{
if (rename.storageClass == StorageClassInput)
spirv_cross_util::rename_interface_variable(*compiler, res.stage_inputs, rename.location,
rename.variable_name);
else if (rename.storageClass == StorageClassOutput)
spirv_cross_util::rename_interface_variable(*compiler, res.stage_outputs, rename.location,
rename.variable_name);
else
{
fprintf(stderr, "error at --rename-interface-variable <in|out> ...\n");
exit(EXIT_FAILURE);
}
}
if (args.dump_resources)
{
print_resources(*compiler, res);
print_push_constant_resources(*compiler, res.push_constant_buffers);
print_spec_constants(*compiler);
print_capabilities_and_extensions(*compiler);
}
if (combined_image_samplers)
{
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())
{
compiler->set_name(remap.combined_id, join("SPIRV_Cross_Combined", compiler->get_name(remap.image_id),
compiler->get_name(remap.sampler_id)));
}
}
if (args.hlsl)
{
auto *hlsl_compiler = static_cast<CompilerHLSL *>(compiler.get());
uint32_t new_builtin = hlsl_compiler->remap_num_workgroups_builtin();
if (new_builtin)
{
hlsl_compiler->set_decoration(new_builtin, DecorationDescriptorSet, 0);
hlsl_compiler->set_decoration(new_builtin, DecorationBinding, 0);
}
}
if (args.hlsl)
{
for (auto &remap : args.hlsl_attr_remap)
static_cast<CompilerHLSL *>(compiler.get())->add_vertex_attribute_remap(remap);
}
return compiler->compile();
}
static int main_inner(int argc, char *argv[])
{
CLIArguments args;
@ -664,6 +1026,10 @@ static int main_inner(int argc, char *argv[])
print_help();
parser.end();
});
cbs.add("--revision", [](CLIParser &parser) {
print_version();
parser.end();
});
cbs.add("--output", [&args](CLIParser &parser) { args.output = parser.next_string(); });
cbs.add("--es", [&args](CLIParser &) {
args.es = true;
@ -687,12 +1053,26 @@ static int main_inner(int argc, char *argv[])
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("--glsl-emit-push-constant-as-ubo", [&args](CLIParser &) { args.glsl_emit_push_constant_as_ubo = true; });
cbs.add("--glsl-emit-ubo-as-plain-uniforms", [&args](CLIParser &) { args.glsl_emit_ubo_as_plain_uniforms = true; });
cbs.add("--msl", [&args](CLIParser &) { args.msl = true; });
cbs.add("--hlsl", [&args](CLIParser &) { args.hlsl = true; });
cbs.add("--hlsl-enable-compat", [&args](CLIParser &) { args.hlsl_compat = true; });
cbs.add("--hlsl-support-nonzero-basevertex-baseinstance",
[&args](CLIParser &) { args.hlsl_support_nonzero_base = true; });
cbs.add("--vulkan-semantics", [&args](CLIParser &) { args.vulkan_semantics = true; });
cbs.add("--flatten-multidimensional-arrays", [&args](CLIParser &) { args.flatten_multidimensional_arrays = true; });
cbs.add("--no-420pack-extension", [&args](CLIParser &) { args.use_420pack_extension = false; });
cbs.add("--msl-capture-output", [&args](CLIParser &) { args.msl_capture_output_to_buffer = true; });
cbs.add("--msl-swizzle-texture-samples", [&args](CLIParser &) { args.msl_swizzle_texture_samples = true; });
cbs.add("--msl-ios", [&args](CLIParser &) { args.msl_ios = true; });
cbs.add("--msl-pad-fragment-output", [&args](CLIParser &) { args.msl_pad_fragment_output = true; });
cbs.add("--msl-domain-lower-left", [&args](CLIParser &) { args.msl_domain_lower_left = true; });
cbs.add("--msl-argument-buffers", [&args](CLIParser &) { args.msl_argument_buffers = true; });
cbs.add("--msl-discrete-descriptor-set",
[&args](CLIParser &parser) { args.msl_discrete_descriptor_sets.push_back(parser.next_uint()); });
cbs.add("--msl-texture-buffer-native", [&args](CLIParser &) { args.msl_texture_buffer_native = true; });
cbs.add("--msl-multiview", [&args](CLIParser &) { args.msl_multiview = true; });
cbs.add("--extension", [&args](CLIParser &parser) { args.extensions.push_back(parser.next_string()); });
cbs.add("--rename-entry-point", [&args](CLIParser &parser) {
auto old_name = parser.next_string();
@ -760,19 +1140,16 @@ static int main_inner(int argc, char *argv[])
[&args](CLIParser &) { args.combined_samplers_inherit_bindings = true; });
cbs.add("--no-support-nonzero-baseinstance", [&](CLIParser &) { args.support_nonzero_baseinstance = false; });
cbs.add("--emit-line-directives", [&args](CLIParser &) { args.emit_line_directives = true; });
cbs.default_handler = [&args](const char *value) { args.input = value; };
cbs.error_handler = [] { print_help(); };
CLIParser parser{ move(cbs), argc - 1, argv + 1 };
if (!parser.parse())
{
return EXIT_FAILURE;
}
else if (parser.ended_state)
{
return EXIT_SUCCESS;
}
if (!args.input)
{
@ -781,10 +1158,17 @@ static int main_inner(int argc, char *argv[])
return EXIT_FAILURE;
}
auto spirv_file = read_spirv_file(args.input);
if (spirv_file.empty())
return EXIT_FAILURE;
// 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));
Parser spirv_parser(move(spirv_file));
spirv_parser.parse();
CompilerReflection compiler(move(spirv_parser.get_parsed_ir()));
compiler.set_format(args.reflect);
auto json = compiler.compile();
if (args.output)
@ -794,278 +1178,20 @@ static int main_inner(int argc, char *argv[])
return EXIT_SUCCESS;
}
unique_ptr<CompilerGLSL> compiler;
bool combined_image_samplers = false;
bool build_dummy_sampler = false;
string compiled_output;
if (args.cpp)
{
compiler = unique_ptr<CompilerGLSL>(new CompilerCPP(read_spirv_file(args.input)));
if (args.cpp_interface_name)
static_cast<CompilerCPP *>(compiler.get())->set_interface_name(args.cpp_interface_name);
}
else if (args.msl)
{
compiler = unique_ptr<CompilerMSL>(new CompilerMSL(read_spirv_file(args.input)));
auto *msl_comp = static_cast<CompilerMSL *>(compiler.get());
auto msl_opts = msl_comp->get_msl_options();
if (args.set_msl_version)
msl_opts.msl_version = args.msl_version;
msl_comp->set_msl_options(msl_opts);
}
else if (args.hlsl)
compiler = unique_ptr<CompilerHLSL>(new CompilerHLSL(read_spirv_file(args.input)));
if (args.iterations == 1)
compiled_output = compile_iteration(args, move(spirv_file));
else
{
combined_image_samplers = !args.vulkan_semantics;
build_dummy_sampler = true;
compiler = unique_ptr<CompilerGLSL>(new CompilerGLSL(read_spirv_file(args.input)));
}
if (!args.variable_type_remaps.empty())
{
auto remap_cb = [&](const SPIRType &, const string &name, string &out) -> void {
for (const VariableTypeRemap &remap : args.variable_type_remaps)
if (name == remap.variable_name)
out = remap.new_variable_type;
};
compiler->set_variable_type_remap_callback(move(remap_cb));
}
for (auto &rename : args.entry_point_rename)
compiler->rename_entry_point(rename.old_name, rename.new_name, rename.execution_model);
auto entry_points = compiler->get_entry_points_and_stages();
auto entry_point = args.entry;
ExecutionModel model = ExecutionModelMax;
if (!args.entry_stage.empty())
{
model = stage_to_execution_model(args.entry_stage);
if (entry_point.empty())
{
// Just use the first entry point with this stage.
for (auto &e : entry_points)
{
if (e.execution_model == model)
{
entry_point = e.name;
break;
}
}
if (entry_point.empty())
{
fprintf(stderr, "Could not find an entry point with stage: %s\n", args.entry_stage.c_str());
return EXIT_FAILURE;
}
}
else
{
// Make sure both stage and name exists.
bool exists = false;
for (auto &e : entry_points)
{
if (e.execution_model == model && e.name == entry_point)
{
exists = true;
break;
}
}
if (!exists)
{
fprintf(stderr, "Could not find an entry point %s with stage: %s\n", entry_point.c_str(),
args.entry_stage.c_str());
return EXIT_FAILURE;
}
}
}
else if (!entry_point.empty())
{
// Make sure there is just one entry point with this name, or the stage
// is ambiguous.
uint32_t stage_count = 0;
for (auto &e : entry_points)
{
if (e.name == entry_point)
{
stage_count++;
model = e.execution_model;
}
}
if (stage_count == 0)
{
fprintf(stderr, "There is no entry point with name: %s\n", entry_point.c_str());
return EXIT_FAILURE;
}
else if (stage_count > 1)
{
fprintf(stderr, "There is more than one entry point with name: %s. Use --stage.\n", entry_point.c_str());
return EXIT_FAILURE;
}
}
if (!entry_point.empty())
compiler->set_entry_point(entry_point, model);
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_common_options();
if (args.set_version)
opts.version = args.version;
if (args.set_es)
opts.es = args.es;
opts.force_temporary = args.force_temporary;
opts.separate_shader_objects = args.sso;
opts.flatten_multidimensional_arrays = args.flatten_multidimensional_arrays;
opts.enable_420pack_extension = args.use_420pack_extension;
opts.vulkan_semantics = args.vulkan_semantics;
opts.vertex.fixup_clipspace = args.fixup;
opts.vertex.flip_vert_y = args.yflip;
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<CompilerHLSL *>(compiler.get());
auto hlsl_opts = hlsl->get_hlsl_options();
if (args.set_shader_model)
{
if (args.shader_model < 30)
{
fprintf(stderr, "Shader model earlier than 30 (3.0) not supported.\n");
return EXIT_FAILURE;
}
hlsl_opts.shader_model = args.shader_model;
}
if (args.hlsl_compat)
{
// Enable all compat options.
hlsl_opts.point_size_compat = true;
hlsl_opts.point_coord_compat = true;
}
hlsl->set_hlsl_options(hlsl_opts);
}
if (build_dummy_sampler)
{
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)
{
auto active = compiler->get_active_interface_variables();
res = compiler->get_shader_resources(active);
compiler->set_enabled_interface_variables(move(active));
}
else
res = compiler->get_shader_resources();
if (args.flatten_ubo)
{
for (auto &ubo : res.uniform_buffers)
compiler->flatten_buffer_block(ubo.id);
for (auto &ubo : res.push_constant_buffers)
compiler->flatten_buffer_block(ubo.id);
}
auto pls_inputs = remap_pls(args.pls_in, res.stage_inputs, &res.subpass_inputs);
auto pls_outputs = remap_pls(args.pls_out, res.stage_outputs, nullptr);
compiler->remap_pixel_local_storage(move(pls_inputs), move(pls_outputs));
for (auto &ext : args.extensions)
compiler->require_extension(ext);
for (auto &remap : args.remaps)
{
if (remap_generic(*compiler, res.stage_inputs, remap))
continue;
if (remap_generic(*compiler, res.stage_outputs, remap))
continue;
if (remap_generic(*compiler, res.subpass_inputs, remap))
continue;
}
for (auto &rename : args.interface_variable_renames)
{
if (rename.storageClass == StorageClassInput)
spirv_cross_util::rename_interface_variable(*compiler, res.stage_inputs, rename.location,
rename.variable_name);
else if (rename.storageClass == StorageClassOutput)
spirv_cross_util::rename_interface_variable(*compiler, res.stage_outputs, rename.location,
rename.variable_name);
else
{
fprintf(stderr, "error at --rename-interface-variable <in|out> ...\n");
return EXIT_FAILURE;
}
}
if (args.dump_resources)
{
print_resources(*compiler, res);
print_push_constant_resources(*compiler, res.push_constant_buffers);
print_spec_constants(*compiler);
print_capabilities_and_extensions(*compiler);
}
if (combined_image_samplers)
{
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())
{
compiler->set_name(remap.combined_id, join("SPIRV_Cross_Combined", compiler->get_name(remap.image_id),
compiler->get_name(remap.sampler_id)));
}
}
if (args.hlsl)
{
auto *hlsl_compiler = static_cast<CompilerHLSL *>(compiler.get());
uint32_t new_builtin = hlsl_compiler->remap_num_workgroups_builtin();
if (new_builtin)
{
hlsl_compiler->set_decoration(new_builtin, DecorationDescriptorSet, 0);
hlsl_compiler->set_decoration(new_builtin, DecorationBinding, 0);
}
}
string glsl;
for (uint32_t i = 0; i < args.iterations; i++)
{
if (args.hlsl)
glsl = static_cast<CompilerHLSL *>(compiler.get())->compile(move(args.hlsl_attr_remap));
else
glsl = compiler->compile();
for (unsigned i = 0; i < args.iterations; i++)
compiled_output = compile_iteration(args, spirv_file);
}
if (args.output)
write_string_to_file(args.output, glsl.c_str());
write_string_to_file(args.output, compiled_output.c_str());
else
printf("%s", glsl.c_str());
printf("%s", compiled_output.c_str());
return EXIT_SUCCESS;
}

View File

@ -1,28 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2013 for Windows Desktop
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SPIRV-Cross", "SPIRV-Cross.vcxproj", "{977E3701-1A21-4425-B7E5-6BDF5EA062CD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|Win32.ActiveCfg = Debug|Win32
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|Win32.Build.0 = Debug|Win32
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|x64.ActiveCfg = Debug|x64
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Debug|x64.Build.0 = Debug|x64
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|Win32.ActiveCfg = Release|Win32
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|Win32.Build.0 = Release|Win32
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|x64.ActiveCfg = Release|x64
{977E3701-1A21-4425-B7E5-6BDF5EA062CD}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,152 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{977E3701-1A21-4425-B7E5-6BDF5EA062CD}</ProjectGuid>
<RootNamespace>SPIRV-Cross</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\main.cpp" />
<ClCompile Include="..\spirv_cpp.cpp" />
<ClCompile Include="..\spirv_cross.cpp" />
<ClCompile Include="..\spirv_glsl.cpp" />
<ClCompile Include="..\spirv_reflect.cpp" />
<ClCompile Include="..\spirv_hlsl.cpp" />
<ClCompile Include="..\spirv_msl.cpp" />
<ClCompile Include="..\spirv_cfg.cpp" />
<ClCompile Include="..\spirv_cross_util.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\GLSL.std.450.h" />
<ClInclude Include="..\spirv_common.hpp" />
<ClInclude Include="..\spirv_cpp.hpp" />
<ClInclude Include="..\spirv_cross.hpp" />
<ClInclude Include="..\spirv_glsl.hpp" />
<ClInclude Include="..\spirv_reflect.hpp" />
<ClInclude Include="..\spirv.hpp" />
<ClInclude Include="..\spirv_hlsl.hpp" />
<ClInclude Include="..\spirv_msl.hpp" />
<ClInclude Include="..\spirv_cfg.hpp" />
<ClInclude Include="..\spirv_cross_util.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -1,81 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_cross.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_glsl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_reflect.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_cpp.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_msl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_cfg.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_hlsl.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\spirv_cross_util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\GLSL.std.450.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_cross.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_glsl.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_reflect.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_common.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_cpp.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_msl.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_cfg.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_hlsl.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\spirv_cross_util.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@SPIRV_CROSS_INSTALL_LIB_DIR@
sharedlibdir=@SPIRV_CROSS_INSTALL_LIB_DIR@
includedir=@SPIRV_CROSS_INSTALL_INC_DIR@
Name: spirv-cross-c-shared
Description: C API for SPIRV-Cross
Version: @SPIRV_CROSS_VERSION@
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lspirv-cross-c-shared
Cflags: -I${includedir}

View File

@ -0,0 +1,19 @@
RWByteAddressBuffer _4 : register(u0);
void comp_main()
{
uint _21 = _4.Load(_4.Load(0) * 4 + 4);
for (uint _23 = 0u; _23 < 64u; )
{
_4.Store(_23 * 4 + 4, 0u);
_23++;
continue;
}
_4.Store(_4.Load(0) * 4 + 4, _21);
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -0,0 +1,22 @@
RWByteAddressBuffer u0_counter : register(u1);
RWBuffer<uint> u0 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
uint _29;
u0_counter.InterlockedAdd(0, -1, _29);
u0[asint(asfloat(_29))] = uint(int(gl_GlobalInvocationID.x)).x;
}
[numthreads(4, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,22 @@
RWByteAddressBuffer u0_counter : register(u1);
RWBuffer<uint> u0 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
uint _29;
u0_counter.InterlockedAdd(0, 1, _29);
u0[asint(asfloat(_29))] = uint(int(gl_GlobalInvocationID.x)).x;
}
[numthreads(4, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,45 @@
struct A
{
int a;
int b;
};
struct A_1
{
int a;
int b;
};
RWByteAddressBuffer C1 : register(u1);
cbuffer C2 : register(b2)
{
A_1 C2_1_Data[1024] : packoffset(c0);
};
RWByteAddressBuffer C3 : register(u0);
cbuffer B : register(b3)
{
A_1 C4_Data[1024] : packoffset(c0);
};
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
C1.Store(gl_GlobalInvocationID.x * 8 + 0, uint(C2_1_Data[gl_GlobalInvocationID.x].a));
C1.Store(gl_GlobalInvocationID.x * 8 + 4, uint(C2_1_Data[gl_GlobalInvocationID.x].b));
C3.Store(gl_GlobalInvocationID.x * 8 + 0, uint(C4_Data[gl_GlobalInvocationID.x].a));
C3.Store(gl_GlobalInvocationID.x * 8 + 4, uint(C4_Data[gl_GlobalInvocationID.x].b));
}
[numthreads(1, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,9 @@
void comp_main()
{
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -0,0 +1,87 @@
RWByteAddressBuffer _4 : register(u0);
void comp_main()
{
_4.Store(0, asuint(isnan(asfloat(_4.Load(96))) ? asfloat(_4.Load(48)) : (isnan(asfloat(_4.Load(48))) ? asfloat(_4.Load(96)) : min(asfloat(_4.Load(48)), asfloat(_4.Load(96))))));
bool2 _146 = isnan(asfloat(_4.Load2(56)));
bool2 _147 = isnan(asfloat(_4.Load2(104)));
float2 _148 = min(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)));
float2 _149 = float2(_146.x ? asfloat(_4.Load2(104)).x : _148.x, _146.y ? asfloat(_4.Load2(104)).y : _148.y);
_4.Store2(8, asuint(float2(_147.x ? asfloat(_4.Load2(56)).x : _149.x, _147.y ? asfloat(_4.Load2(56)).y : _149.y)));
bool3 _151 = isnan(asfloat(_4.Load3(64)));
bool3 _152 = isnan(asfloat(_4.Load3(112)));
float3 _153 = min(asfloat(_4.Load3(64)), asfloat(_4.Load3(112)));
float3 _154 = float3(_151.x ? asfloat(_4.Load3(112)).x : _153.x, _151.y ? asfloat(_4.Load3(112)).y : _153.y, _151.z ? asfloat(_4.Load3(112)).z : _153.z);
_4.Store3(16, asuint(float3(_152.x ? asfloat(_4.Load3(64)).x : _154.x, _152.y ? asfloat(_4.Load3(64)).y : _154.y, _152.z ? asfloat(_4.Load3(64)).z : _154.z)));
bool4 _156 = isnan(asfloat(_4.Load4(80)));
bool4 _157 = isnan(asfloat(_4.Load4(128)));
float4 _158 = min(asfloat(_4.Load4(80)), asfloat(_4.Load4(128)));
float4 _159 = float4(_156.x ? asfloat(_4.Load4(128)).x : _158.x, _156.y ? asfloat(_4.Load4(128)).y : _158.y, _156.z ? asfloat(_4.Load4(128)).z : _158.z, _156.w ? asfloat(_4.Load4(128)).w : _158.w);
_4.Store4(32, asuint(float4(_157.x ? asfloat(_4.Load4(80)).x : _159.x, _157.y ? asfloat(_4.Load4(80)).y : _159.y, _157.z ? asfloat(_4.Load4(80)).z : _159.z, _157.w ? asfloat(_4.Load4(80)).w : _159.w)));
_4.Store(0, asuint(isnan(asfloat(_4.Load(96))) ? asfloat(_4.Load(48)) : (isnan(asfloat(_4.Load(48))) ? asfloat(_4.Load(96)) : max(asfloat(_4.Load(48)), asfloat(_4.Load(96))))));
bool2 _166 = isnan(asfloat(_4.Load2(56)));
bool2 _167 = isnan(asfloat(_4.Load2(104)));
float2 _168 = max(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)));
float2 _169 = float2(_166.x ? asfloat(_4.Load2(104)).x : _168.x, _166.y ? asfloat(_4.Load2(104)).y : _168.y);
_4.Store2(8, asuint(float2(_167.x ? asfloat(_4.Load2(56)).x : _169.x, _167.y ? asfloat(_4.Load2(56)).y : _169.y)));
bool3 _171 = isnan(asfloat(_4.Load3(64)));
bool3 _172 = isnan(asfloat(_4.Load3(112)));
float3 _173 = max(asfloat(_4.Load3(64)), asfloat(_4.Load3(112)));
float3 _174 = float3(_171.x ? asfloat(_4.Load3(112)).x : _173.x, _171.y ? asfloat(_4.Load3(112)).y : _173.y, _171.z ? asfloat(_4.Load3(112)).z : _173.z);
_4.Store3(16, asuint(float3(_172.x ? asfloat(_4.Load3(64)).x : _174.x, _172.y ? asfloat(_4.Load3(64)).y : _174.y, _172.z ? asfloat(_4.Load3(64)).z : _174.z)));
bool4 _176 = isnan(asfloat(_4.Load4(80)));
bool4 _177 = isnan(asfloat(_4.Load4(128)));
float4 _178 = max(asfloat(_4.Load4(80)), asfloat(_4.Load4(128)));
float4 _179 = float4(_176.x ? asfloat(_4.Load4(128)).x : _178.x, _176.y ? asfloat(_4.Load4(128)).y : _178.y, _176.z ? asfloat(_4.Load4(128)).z : _178.z, _176.w ? asfloat(_4.Load4(128)).w : _178.w);
_4.Store4(32, asuint(float4(_177.x ? asfloat(_4.Load4(80)).x : _179.x, _177.y ? asfloat(_4.Load4(80)).y : _179.y, _177.z ? asfloat(_4.Load4(80)).z : _179.z, _177.w ? asfloat(_4.Load4(80)).w : _179.w)));
float _180 = isnan(asfloat(_4.Load(48))) ? asfloat(_4.Load(0)) : (isnan(asfloat(_4.Load(0))) ? asfloat(_4.Load(48)) : max(asfloat(_4.Load(0)), asfloat(_4.Load(48))));
_4.Store(0, asuint(isnan(asfloat(_4.Load(96))) ? _180 : (isnan(_180) ? asfloat(_4.Load(96)) : min(_180, asfloat(_4.Load(96))))));
bool2 _193 = isnan(asfloat(_4.Load2(8)));
bool2 _194 = isnan(asfloat(_4.Load2(56)));
float2 _195 = max(asfloat(_4.Load2(8)), asfloat(_4.Load2(56)));
float2 _196 = float2(_193.x ? asfloat(_4.Load2(56)).x : _195.x, _193.y ? asfloat(_4.Load2(56)).y : _195.y);
float2 _191 = float2(_194.x ? asfloat(_4.Load2(8)).x : _196.x, _194.y ? asfloat(_4.Load2(8)).y : _196.y);
bool2 _198 = isnan(_191);
bool2 _199 = isnan(asfloat(_4.Load2(104)));
float2 _200 = min(_191, asfloat(_4.Load2(104)));
float2 _201 = float2(_198.x ? asfloat(_4.Load2(104)).x : _200.x, _198.y ? asfloat(_4.Load2(104)).y : _200.y);
_4.Store2(8, asuint(float2(_199.x ? _191.x : _201.x, _199.y ? _191.y : _201.y)));
bool3 _204 = isnan(asfloat(_4.Load3(16)));
bool3 _205 = isnan(asfloat(_4.Load3(64)));
float3 _206 = max(asfloat(_4.Load3(16)), asfloat(_4.Load3(64)));
float3 _207 = float3(_204.x ? asfloat(_4.Load3(64)).x : _206.x, _204.y ? asfloat(_4.Load3(64)).y : _206.y, _204.z ? asfloat(_4.Load3(64)).z : _206.z);
float3 _202 = float3(_205.x ? asfloat(_4.Load3(16)).x : _207.x, _205.y ? asfloat(_4.Load3(16)).y : _207.y, _205.z ? asfloat(_4.Load3(16)).z : _207.z);
bool3 _209 = isnan(_202);
bool3 _210 = isnan(asfloat(_4.Load3(112)));
float3 _211 = min(_202, asfloat(_4.Load3(112)));
float3 _212 = float3(_209.x ? asfloat(_4.Load3(112)).x : _211.x, _209.y ? asfloat(_4.Load3(112)).y : _211.y, _209.z ? asfloat(_4.Load3(112)).z : _211.z);
_4.Store3(16, asuint(float3(_210.x ? _202.x : _212.x, _210.y ? _202.y : _212.y, _210.z ? _202.z : _212.z)));
bool4 _215 = isnan(asfloat(_4.Load4(32)));
bool4 _216 = isnan(asfloat(_4.Load4(80)));
float4 _217 = max(asfloat(_4.Load4(32)), asfloat(_4.Load4(80)));
float4 _218 = float4(_215.x ? asfloat(_4.Load4(80)).x : _217.x, _215.y ? asfloat(_4.Load4(80)).y : _217.y, _215.z ? asfloat(_4.Load4(80)).z : _217.z, _215.w ? asfloat(_4.Load4(80)).w : _217.w);
float4 _213 = float4(_216.x ? asfloat(_4.Load4(32)).x : _218.x, _216.y ? asfloat(_4.Load4(32)).y : _218.y, _216.z ? asfloat(_4.Load4(32)).z : _218.z, _216.w ? asfloat(_4.Load4(32)).w : _218.w);
bool4 _220 = isnan(_213);
bool4 _221 = isnan(asfloat(_4.Load4(128)));
float4 _222 = min(_213, asfloat(_4.Load4(128)));
float4 _223 = float4(_220.x ? asfloat(_4.Load4(128)).x : _222.x, _220.y ? asfloat(_4.Load4(128)).y : _222.y, _220.z ? asfloat(_4.Load4(128)).z : _222.z, _220.w ? asfloat(_4.Load4(128)).w : _222.w);
_4.Store4(32, asuint(float4(_221.x ? _213.x : _223.x, _221.y ? _213.y : _223.y, _221.z ? _213.z : _223.z, _221.w ? _213.w : _223.w)));
for (int _139 = 0; _139 < 2; )
{
bool2 _225 = isnan(asfloat(_4.Load2(56)));
bool2 _226 = isnan(asfloat(_4.Load2(104)));
float2 _227 = min(asfloat(_4.Load2(56)), asfloat(_4.Load2(104)));
float2 _228 = float2(_225.x ? asfloat(_4.Load2(104)).x : _227.x, _225.y ? asfloat(_4.Load2(104)).y : _227.y);
_4.Store2(8, asuint(float2(_226.x ? asfloat(_4.Load2(56)).x : _228.x, _226.y ? asfloat(_4.Load2(56)).y : _228.y)));
float _229 = isnan(asfloat(_4.Load(56))) ? asfloat(_4.Load(0)) : (isnan(asfloat(_4.Load(0))) ? asfloat(_4.Load(56)) : max(asfloat(_4.Load(0)), asfloat(_4.Load(56))));
_4.Store(0, asuint(isnan(asfloat(_4.Load(60))) ? _229 : (isnan(_229) ? asfloat(_4.Load(60)) : min(_229, asfloat(_4.Load(60))))));
_139++;
continue;
}
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -1,5 +1,11 @@
static const uint _3 = 1u;
static const uint _4 = 3u;
#ifndef SPIRV_CROSS_CONSTANT_ID_0
#define SPIRV_CROSS_CONSTANT_ID_0 1u
#endif
static const uint _3 = SPIRV_CROSS_CONSTANT_ID_0;
#ifndef SPIRV_CROSS_CONSTANT_ID_2
#define SPIRV_CROSS_CONSTANT_ID_2 3u
#endif
static const uint _4 = SPIRV_CROSS_CONSTANT_ID_2;
static const uint3 gl_WorkGroupSize = uint3(_3, 2u, _4);
RWByteAddressBuffer _8 : register(u0);
@ -18,7 +24,7 @@ void comp_main()
_8.Store(gl_WorkGroupID.x * 4 + 0, asuint(asfloat(_9.Load(gl_WorkGroupID.x * 4 + 0)) + asfloat(_8.Load(gl_WorkGroupID.x * 4 + 0))));
}
[numthreads(1, 2, 3)]
[numthreads(SPIRV_CROSS_CONSTANT_ID_0, 2, SPIRV_CROSS_CONSTANT_ID_2)]
void main(SPIRV_Cross_Input stage_input)
{
gl_WorkGroupID = stage_input.gl_WorkGroupID;

View File

@ -1,9 +1,10 @@
cbuffer _5 : register(b0)
cbuffer _4_5 : register(b0)
{
column_major float2x4 _5_m0 : packoffset(c0);
float4 _5_m1 : packoffset(c4);
};
static float2 _3;
struct SPIRV_Cross_Output

View File

@ -7,7 +7,7 @@ struct SPIRV_Cross_Output
void frag_main()
{
FragColor = float3(asfloat(0x7f800000u), asfloat(0xff800000u), asfloat(0xffc00000u));
FragColor = float3(asfloat(0x7f800000u), asfloat(0xff800000u), asfloat(0x7fc00000u));
}
SPIRV_Cross_Output main()

View File

@ -0,0 +1,88 @@
static float FragColor;
static float vColor;
struct SPIRV_Cross_Input
{
float vColor : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
#line 8 "test.frag"
void frag_main()
{
float _80;
#line 8 "test.frag"
FragColor = 1.0f;
#line 9 "test.frag"
FragColor = 2.0f;
#line 10 "test.frag"
_80 = vColor;
if (_80 < 0.0f)
{
#line 12 "test.frag"
FragColor = 3.0f;
}
else
{
#line 16 "test.frag"
FragColor = 4.0f;
}
for (int _126 = 0; float(_126) < (40.0f + _80); )
{
#line 21 "test.frag"
FragColor += 0.20000000298023223876953125f;
#line 22 "test.frag"
FragColor += 0.300000011920928955078125f;
_126 += (int(_80) + 5);
continue;
}
switch (int(_80))
{
case 0:
{
#line 28 "test.frag"
FragColor += 0.20000000298023223876953125f;
#line 29 "test.frag"
break;
}
case 1:
{
#line 32 "test.frag"
FragColor += 0.4000000059604644775390625f;
#line 33 "test.frag"
break;
}
default:
{
#line 36 "test.frag"
FragColor += 0.800000011920928955078125f;
#line 37 "test.frag"
break;
}
}
for (;;)
{
FragColor += (10.0f + _80);
#line 43 "test.frag"
if (FragColor < 100.0f)
{
}
else
{
break;
}
}
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vColor = stage_input.vColor;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,25 @@
cbuffer Registers
{
float registers_foo : packoffset(c0);
};
static float FragColor;
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = 10.0f + registers_foo;
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,30 @@
Texture2D<float4> g_Texture : register(t0);
SamplerState g_Sampler : register(s0);
SamplerComparisonState g_CompareSampler : register(s1);
static float2 in_var_TEXCOORD0;
static float out_var_SV_Target;
struct SPIRV_Cross_Input
{
float2 in_var_TEXCOORD0 : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float out_var_SV_Target : SV_Target0;
};
void frag_main()
{
out_var_SV_Target = g_Texture.Sample(g_Sampler, in_var_TEXCOORD0).x + g_Texture.SampleCmpLevelZero(g_CompareSampler, in_var_TEXCOORD0, 0.5f);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
in_var_TEXCOORD0 = stage_input.in_var_TEXCOORD0;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.out_var_SV_Target = out_var_SV_Target;
return stage_output;
}

View File

@ -0,0 +1,62 @@
struct myType
{
float data;
};
static const myType _18 = { 0.0f };
static const myType _20 = { 1.0f };
static const myType _21[5] = { { 0.0f }, { 1.0f }, { 0.0f }, { 1.0f }, { 0.0f } };
static float4 gl_FragCoord;
static float4 o_color;
struct SPIRV_Cross_Input
{
float4 gl_FragCoord : SV_Position;
};
struct SPIRV_Cross_Output
{
float4 o_color : SV_Target0;
};
float mod(float x, float y)
{
return x - y * floor(x / y);
}
float2 mod(float2 x, float2 y)
{
return x - y * floor(x / y);
}
float3 mod(float3 x, float3 y)
{
return x - y * floor(x / y);
}
float4 mod(float4 x, float4 y)
{
return x - y * floor(x / y);
}
void frag_main()
{
if (_21[int(mod(gl_FragCoord.x, 4.0f))].data > 0.0f)
{
o_color = float4(0.0f, 1.0f, 0.0f, 1.0f);
}
else
{
o_color = float4(1.0f, 0.0f, 0.0f, 1.0f);
}
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
gl_FragCoord = stage_input.gl_FragCoord;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.o_color = o_color;
return stage_output;
}

View File

@ -0,0 +1,23 @@
static const float4 _20[2] = { float4(1.0f, 2.0f, 3.0f, 4.0f), 10.0f.xxxx };
static float4 FragColors[2] = _20;
static float4 FragColor = 5.0f.xxxx;
struct SPIRV_Cross_Output
{
float4 FragColors[2] : SV_Target0;
float4 FragColor : SV_Target2;
};
void frag_main()
{
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColors = FragColors;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,29 @@
Texture2D<float4> uTexture : register(t0);
SamplerState _uTexture_sampler : register(s0);
static min16float4 FragColor;
static min16float2 UV;
struct SPIRV_Cross_Input
{
min16float2 UV : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
min16float4 FragColor : SV_Target0;
};
void frag_main()
{
FragColor = min16float4(uTexture.Sample(_uTexture_sampler, UV));
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
UV = stage_input.UV;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -13,21 +13,21 @@ struct SPIRV_Cross_Output
void frag_main()
{
bool _29;
float4 _33;
for (;;)
{
_29 = counter == 10;
if (_29)
if (counter == 10)
{
_33 = 10.0f.xxxx;
break;
}
else
{
_33 = 30.0f.xxxx;
break;
}
}
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);
FragColor = _33;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -0,0 +1,45 @@
struct InstanceData
{
column_major float4x4 MATRIX_MVP;
float4 Color;
};
cbuffer gInstanceData : register(b0)
{
InstanceData gInstanceData_1_data[32] : packoffset(c0);
};
static float4 gl_Position;
static int gl_InstanceIndex;
static float3 PosL;
static float4 _entryPointOutput_Color;
struct SPIRV_Cross_Input
{
float3 PosL : TEXCOORD0;
uint gl_InstanceIndex : SV_InstanceID;
};
struct SPIRV_Cross_Output
{
float4 _entryPointOutput_Color : TEXCOORD0;
float4 gl_Position : SV_Position;
};
void vert_main()
{
gl_Position = mul(float4(PosL, 1.0f), gInstanceData_1_data[uint(gl_InstanceIndex)].MATRIX_MVP);
_entryPointOutput_Color = gInstanceData_1_data[uint(gl_InstanceIndex)].Color;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
PosL = stage_input.PosL;
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
stage_output._entryPointOutput_Color = _entryPointOutput_Color;
return stage_output;
}

View File

@ -1,8 +1,17 @@
static const int _7 = -10;
static const uint _8 = 100u;
#ifndef SPIRV_CROSS_CONSTANT_ID_201
#define SPIRV_CROSS_CONSTANT_ID_201 -10
#endif
static const int _7 = SPIRV_CROSS_CONSTANT_ID_201;
static const int _20 = (_7 + 2);
#ifndef SPIRV_CROSS_CONSTANT_ID_202
#define SPIRV_CROSS_CONSTANT_ID_202 100u
#endif
static const uint _8 = SPIRV_CROSS_CONSTANT_ID_202;
static const uint _25 = (_8 % 5u);
static const int4 _30 = int4(20, 30, _20, _20);
#ifndef SPIRV_CROSS_CONSTANT_ID_0
#define SPIRV_CROSS_CONSTANT_ID_0 int4(20, 30, _20, _20)
#endif
static const int4 _30 = SPIRV_CROSS_CONSTANT_ID_0;
static const int2 _32 = int2(_30.y, _30.x);
static const int _33 = _30.y;
@ -17,11 +26,11 @@ struct SPIRV_Cross_Output
void vert_main()
{
float4 _64 = 0.0f.xxxx;
_64.y = float(_20);
float4 _68 = _64;
_68.z = float(_25);
float4 _52 = _68 + float4(_30);
float4 _63 = 0.0f.xxxx;
_63.y = float(_20);
float4 _66 = _63;
_66.z = float(_25);
float4 _52 = _66 + float4(_30);
float2 _56 = _52.xy + float2(_32);
gl_Position = float4(_56.x, _56.y, _52.z, _52.w);
_4 = _33;

View File

@ -1,10 +1,10 @@
static float4 gl_Position;
static int gl_VertexID;
static int gl_InstanceID;
static int gl_VertexIndex;
static int gl_InstanceIndex;
struct SPIRV_Cross_Input
{
uint gl_VertexID : SV_VertexID;
uint gl_InstanceID : SV_InstanceID;
uint gl_VertexIndex : SV_VertexID;
uint gl_InstanceIndex : SV_InstanceID;
};
struct SPIRV_Cross_Output
@ -14,13 +14,13 @@ struct SPIRV_Cross_Output
void vert_main()
{
gl_Position = float(gl_VertexID + gl_InstanceID).xxxx;
gl_Position = float(gl_VertexIndex + gl_InstanceIndex).xxxx;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
gl_VertexID = int(stage_input.gl_VertexID);
gl_InstanceID = int(stage_input.gl_InstanceID);
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;

View File

@ -0,0 +1,22 @@
RWByteAddressBuffer u0_counter : register(u1);
RWBuffer<uint> u0 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
uint _29;
u0_counter.InterlockedAdd(0, -1, _29);
u0[uint(asint(asfloat(_29))) + 0u] = uint(int(gl_GlobalInvocationID.x)).x;
}
[numthreads(4, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,22 @@
RWByteAddressBuffer u0_counter : register(u1);
RWBuffer<uint> u0 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
uint _29;
u0_counter.InterlockedAdd(0, 1, _29);
u0[uint(asint(asfloat(_29))) + 0u] = uint(int(gl_GlobalInvocationID.x)).x;
}
[numthreads(4, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,50 @@
struct Data
{
float a;
float b;
};
#ifndef SPIRV_CROSS_CONSTANT_ID_0
#define SPIRV_CROSS_CONSTANT_ID_0 4.0f
#endif
static const float X = SPIRV_CROSS_CONSTANT_ID_0;
static const uint3 gl_WorkGroupSize = uint3(2u, 1u, 1u);
static const Data _21 = { 1.0f, 2.0f };
static const Data _24 = { 3.0f, 4.0f };
static const Data _25[2] = { { 1.0f, 2.0f }, { 3.0f, 4.0f } };
static const Data _30 = { 3.0f, 5.0f };
RWByteAddressBuffer _61 : register(u0);
static uint3 gl_WorkGroupID;
static uint3 gl_LocalInvocationID;
static uint gl_LocalInvocationIndex;
struct SPIRV_Cross_Input
{
uint3 gl_WorkGroupID : SV_GroupID;
uint3 gl_LocalInvocationID : SV_GroupThreadID;
uint gl_LocalInvocationIndex : SV_GroupIndex;
};
void comp_main()
{
Data _28 = { X, 2.0f };
Data _31[2] = { _28, _30 };
Data data2[2] = _31;
if (gl_LocalInvocationIndex == 0u)
{
_61.Store(gl_WorkGroupID.x * 8 + 0, asuint(_25[gl_LocalInvocationID.x].a + data2[gl_LocalInvocationID.x].a));
_61.Store(gl_WorkGroupID.x * 8 + 4, asuint(_25[gl_LocalInvocationID.x].b + data2[gl_LocalInvocationID.x].b));
}
}
[numthreads(2, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_WorkGroupID = stage_input.gl_WorkGroupID;
gl_LocalInvocationID = stage_input.gl_LocalInvocationID;
gl_LocalInvocationIndex = stage_input.gl_LocalInvocationIndex;
comp_main();
}

View File

@ -1,12 +1,13 @@
RWByteAddressBuffer _10 : register(u0);
cbuffer SPIRV_Cross_NumWorkgroups : register(b0)
{
uint3 SPIRV_Cross_NumWorkgroups_count : packoffset(c0);
uint3 SPIRV_Cross_NumWorkgroups_1_count : packoffset(c0);
};
void comp_main()
{
_10.Store3(0, SPIRV_Cross_NumWorkgroups_count);
_10.Store3(0, SPIRV_Cross_NumWorkgroups_1_count);
}
[numthreads(1, 1, 1)]

View File

@ -1,9 +1,10 @@
RWByteAddressBuffer _10 : register(u0);
cbuffer SPIRV_Cross_NumWorkgroups : register(b0)
{
uint3 SPIRV_Cross_NumWorkgroups_count : packoffset(c0);
uint3 SPIRV_Cross_NumWorkgroups_1_count : packoffset(c0);
};
static uint3 gl_WorkGroupID;
struct SPIRV_Cross_Input
{
@ -12,7 +13,7 @@ struct SPIRV_Cross_Input
void comp_main()
{
_10.Store3(0, SPIRV_Cross_NumWorkgroups_count + gl_WorkGroupID);
_10.Store3(0, SPIRV_Cross_NumWorkgroups_1_count + gl_WorkGroupID);
}
[numthreads(1, 1, 1)]

View File

@ -0,0 +1,48 @@
RWByteAddressBuffer _21 : register(u0);
ByteAddressBuffer _26 : register(t1);
void comp_main()
{
float2x2 _32 = float2x2(asfloat(_26.Load2(0)) * asfloat(_26.Load2(0)).x, asfloat(_26.Load2(0)) * asfloat(_26.Load2(0)).y);
_21.Store2(0, asuint(_32[0]));
_21.Store2(8, asuint(_32[1]));
float2x3 _41 = float2x3(asfloat(_26.Load3(16)) * asfloat(_26.Load2(0)).x, asfloat(_26.Load3(16)) * asfloat(_26.Load2(0)).y);
_21.Store3(16, asuint(_41[0]));
_21.Store3(32, asuint(_41[1]));
float2x4 _50 = float2x4(asfloat(_26.Load4(32)) * asfloat(_26.Load2(0)).x, asfloat(_26.Load4(32)) * asfloat(_26.Load2(0)).y);
_21.Store4(48, asuint(_50[0]));
_21.Store4(64, asuint(_50[1]));
float3x2 _58 = float3x2(asfloat(_26.Load2(0)) * asfloat(_26.Load3(16)).x, asfloat(_26.Load2(0)) * asfloat(_26.Load3(16)).y, asfloat(_26.Load2(0)) * asfloat(_26.Load3(16)).z);
_21.Store2(80, asuint(_58[0]));
_21.Store2(88, asuint(_58[1]));
_21.Store2(96, asuint(_58[2]));
float3x3 _66 = float3x3(asfloat(_26.Load3(16)) * asfloat(_26.Load3(16)).x, asfloat(_26.Load3(16)) * asfloat(_26.Load3(16)).y, asfloat(_26.Load3(16)) * asfloat(_26.Load3(16)).z);
_21.Store3(112, asuint(_66[0]));
_21.Store3(128, asuint(_66[1]));
_21.Store3(144, asuint(_66[2]));
float3x4 _74 = float3x4(asfloat(_26.Load4(32)) * asfloat(_26.Load3(16)).x, asfloat(_26.Load4(32)) * asfloat(_26.Load3(16)).y, asfloat(_26.Load4(32)) * asfloat(_26.Load3(16)).z);
_21.Store4(160, asuint(_74[0]));
_21.Store4(176, asuint(_74[1]));
_21.Store4(192, asuint(_74[2]));
float4x2 _82 = float4x2(asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).x, asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).y, asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).z, asfloat(_26.Load2(0)) * asfloat(_26.Load4(32)).w);
_21.Store2(208, asuint(_82[0]));
_21.Store2(216, asuint(_82[1]));
_21.Store2(224, asuint(_82[2]));
_21.Store2(232, asuint(_82[3]));
float4x3 _90 = float4x3(asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).x, asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).y, asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).z, asfloat(_26.Load3(16)) * asfloat(_26.Load4(32)).w);
_21.Store3(240, asuint(_90[0]));
_21.Store3(256, asuint(_90[1]));
_21.Store3(272, asuint(_90[2]));
_21.Store3(288, asuint(_90[3]));
float4x4 _98 = float4x4(asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).x, asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).y, asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).z, asfloat(_26.Load4(32)) * asfloat(_26.Load4(32)).w);
_21.Store4(304, asuint(_98[0]));
_21.Store4(320, asuint(_98[1]));
_21.Store4(336, asuint(_98[2]));
_21.Store4(352, asuint(_98[3]));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -1,10 +1,11 @@
RWByteAddressBuffer _28 : register(u0);
cbuffer _68 : register(b1)
cbuffer UBO : register(b1)
{
int _68_index0 : packoffset(c0);
int _68_index1 : packoffset(c0.y);
};
void comp_main()
{
float4x4 _253 = asfloat(uint4x4(_28.Load(64), _28.Load(80), _28.Load(96), _28.Load(112), _28.Load(68), _28.Load(84), _28.Load(100), _28.Load(116), _28.Load(72), _28.Load(88), _28.Load(104), _28.Load(120), _28.Load(76), _28.Load(92), _28.Load(108), _28.Load(124)));

View File

@ -0,0 +1,14 @@
RWByteAddressBuffer _9 : register(u0);
void comp_main()
{
_9.Store(8, asuint(distance(asfloat(_9.Load(0)), asfloat(_9.Load(4)))));
_9.Store(12, asuint(length(asfloat(_9.Load(0)))));
_9.Store(16, asuint(sign(asfloat(_9.Load(0)))));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -0,0 +1,50 @@
#ifndef SPIRV_CROSS_CONSTANT_ID_0
#define SPIRV_CROSS_CONSTANT_ID_0 100
#endif
static const int a = SPIRV_CROSS_CONSTANT_ID_0;
#ifndef SPIRV_CROSS_CONSTANT_ID_1
#define SPIRV_CROSS_CONSTANT_ID_1 200
#endif
static const int b = SPIRV_CROSS_CONSTANT_ID_1;
struct A
{
int member0[a];
int member1[b];
};
struct B
{
int member0[b];
int member1[a];
};
#ifndef SPIRV_CROSS_CONSTANT_ID_2
#define SPIRV_CROSS_CONSTANT_ID_2 300
#endif
static const int c = SPIRV_CROSS_CONSTANT_ID_2;
static const int d = (c + 50);
#ifndef SPIRV_CROSS_CONSTANT_ID_3
#define SPIRV_CROSS_CONSTANT_ID_3 400
#endif
static const int e = SPIRV_CROSS_CONSTANT_ID_3;
RWByteAddressBuffer _22 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
_22.Store(gl_GlobalInvocationID.x * 4 + 2800, uint(int(_22.Load(gl_GlobalInvocationID.x * 4 + 2800)) + (int(_22.Load(gl_GlobalInvocationID.x * 4 + 2400)) + e)));
}
[numthreads(1, 1, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,43 @@
#ifndef SPIRV_CROSS_CONSTANT_ID_1
#define SPIRV_CROSS_CONSTANT_ID_1 2
#endif
static const int b = SPIRV_CROSS_CONSTANT_ID_1;
#ifndef SPIRV_CROSS_CONSTANT_ID_0
#define SPIRV_CROSS_CONSTANT_ID_0 1
#endif
static const int a = SPIRV_CROSS_CONSTANT_ID_0;
static const uint _26 = (uint(a) + 0u);
#ifndef SPIRV_CROSS_CONSTANT_ID_10
#define SPIRV_CROSS_CONSTANT_ID_10 1u
#endif
static const uint _27 = SPIRV_CROSS_CONSTANT_ID_10;
static const uint3 gl_WorkGroupSize = uint3(_27, 20u, 1u);
static const uint _32 = gl_WorkGroupSize.x;
static const uint _33 = (_26 + _32);
static const uint _34 = gl_WorkGroupSize.y;
static const uint _35 = (_33 + _34);
static const int _42 = (1 - a);
RWByteAddressBuffer _23 : register(u0);
static uint3 gl_GlobalInvocationID;
struct SPIRV_Cross_Input
{
uint3 gl_GlobalInvocationID : SV_DispatchThreadID;
};
void comp_main()
{
int spec_const_array_size[b];
spec_const_array_size[0] = 10;
spec_const_array_size[1] = 40;
spec_const_array_size[a] = a;
_23.Store((_35 + gl_GlobalInvocationID.x) * 4 + 0, uint(b + spec_const_array_size[_42]));
}
[numthreads(SPIRV_CROSS_CONSTANT_ID_10, 20, 1)]
void main(SPIRV_Cross_Input stage_input)
{
gl_GlobalInvocationID = stage_input.gl_GlobalInvocationID;
comp_main();
}

View File

@ -0,0 +1,15 @@
RWByteAddressBuffer _11 : register(u1);
void comp_main()
{
uint _14;
_11.GetDimensions(_14);
_14 = (_14 - 16) / 16;
_11.Store(0, uint(int(_14)));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -0,0 +1,26 @@
static float3 FragColor;
static float4 vColor;
struct SPIRV_Cross_Input
{
float4 vColor : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 FragColor : COLOR0;
};
void frag_main()
{
FragColor = vColor.xyz;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vColor = stage_input.vColor;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = float4(FragColor, 0.0);
return stage_output;
}

View File

@ -0,0 +1,26 @@
static float3 FragColor;
static float4 vColor;
struct SPIRV_Cross_Input
{
float4 vColor : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float3 FragColor : SV_Target0;
};
void frag_main()
{
FragColor = vColor.xyz;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vColor = stage_input.vColor;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -11,9 +11,11 @@ struct SPIRV_Cross_Output
float4 FragColor : SV_Target0;
};
bool _47;
void frag_main()
{
bool2 _25 = bool2(value.x == 0.0f, value.y == 0.0f);
bool2 _25 = bool2(value.x == 0.0f, _47);
FragColor = float4(1.0f, 0.0f, float(bool2(!_25.x, !_25.y).x), float(bool2(value.x <= float2(1.5f, 0.5f).x, value.y <= float2(1.5f, 0.5f).y).x));
}

View File

@ -0,0 +1,37 @@
RWByteAddressBuffer _34 : register(u0);
Texture2D<int4> Buf : register(t1);
SamplerState _Buf_sampler : register(s1);
static float4 gl_FragCoord;
static int vIn;
static int vIn2;
static float4 FragColor;
struct SPIRV_Cross_Input
{
nointerpolation int vIn : TEXCOORD0;
nointerpolation int vIn2 : TEXCOORD1;
float4 gl_FragCoord : SV_Position;
};
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
int _40 = Buf.Load(int3(int2(gl_FragCoord.xy), 0)).x % 16;
FragColor = (asfloat(_34.Load4(_40 * 16 + 0)) + asfloat(_34.Load4(_40 * 16 + 0))) + asfloat(_34.Load4(((vIn * vIn) + (vIn2 * vIn2)) * 16 + 0));
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
gl_FragCoord = stage_input.gl_FragCoord;
vIn = stage_input.vIn;
vIn2 = stage_input.vIn2;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -7,7 +7,7 @@ struct CBO_1
};
ConstantBuffer<CBO_1> cbo[2][4] : register(b4, space0);
cbuffer push
cbuffer PushMe
{
float4 push_a : packoffset(c0);
float4 push_b : packoffset(c1);
@ -15,6 +15,7 @@ cbuffer push
float4 push_d : packoffset(c3);
};
static float4 FragColor;
struct SPIRV_Cross_Output

View File

@ -22,15 +22,10 @@ struct SPIRV_Cross_Output
float4 FragColor : SV_Target0;
};
static float lut[4];
static Foo foos[2];
void frag_main()
{
lut = _16;
foos = _28;
FragColor = lut[_line].xxxx;
FragColor += (foos[_line].a * foos[1 - _line].a).xxxx;
FragColor = _16[_line].xxxx;
FragColor += (_28[_line].a * _28[1 - _line].a).xxxx;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -0,0 +1,19 @@
static float gl_FragDepth;
struct SPIRV_Cross_Output
{
float gl_FragDepth : SV_DepthGreaterEqual;
};
void frag_main()
{
gl_FragDepth = 0.5f;
}
[earlydepthstencil]
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_FragDepth = gl_FragDepth;
return stage_output;
}

View File

@ -0,0 +1,19 @@
static float gl_FragDepth;
struct SPIRV_Cross_Output
{
float gl_FragDepth : SV_DepthLessEqual;
};
void frag_main()
{
gl_FragDepth = 0.5f;
}
[earlydepthstencil]
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_FragDepth = gl_FragDepth;
return stage_output;
}

View File

@ -0,0 +1,23 @@
static float4 FragColor0;
static float4 FragColor1;
struct SPIRV_Cross_Output
{
float4 FragColor0 : SV_Target0;
float4 FragColor1 : SV_Target1;
};
void frag_main()
{
FragColor0 = 1.0f.xxxx;
FragColor1 = 2.0f.xxxx;
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor0 = FragColor0;
stage_output.FragColor1 = FragColor1;
return stage_output;
}

View File

@ -0,0 +1,25 @@
static float4 FragColor;
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
FragColor = 0.0f.xxxx;
for (int _43 = 0; _43 < 3; )
{
FragColor[_43] += float(_43);
_43++;
continue;
}
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -1,127 +1,5 @@
Texture1D<uint4> uSampler1DUint : register(t0);
SamplerState _uSampler1DUint_sampler : register(s0);
Texture1D<int4> uSampler1DInt : register(t0);
SamplerState _uSampler1DInt_sampler : register(s0);
Texture1D<float4> uSampler1DFloat : register(t0);
SamplerState _uSampler1DFloat_sampler : register(s0);
Texture2DArray<int4> uSampler2DArray : register(t2);
SamplerState _uSampler2DArray_sampler : register(s2);
Texture3D<float4> uSampler3D : register(t3);
SamplerState _uSampler3D_sampler : register(s3);
TextureCube<float4> uSamplerCube : register(t4);
SamplerState _uSamplerCube_sampler : register(s4);
TextureCubeArray<uint4> uSamplerCubeArray : register(t5);
SamplerState _uSamplerCubeArray_sampler : register(s5);
Buffer<float4> uSamplerBuffer : register(t6);
Texture2DMS<int4> uSamplerMS : register(t7);
SamplerState _uSamplerMS_sampler : register(s7);
Texture2DMSArray<float4> uSamplerMSArray : register(t8);
SamplerState _uSamplerMSArray_sampler : register(s8);
Texture2D<float4> uSampler2D : register(t1);
SamplerState _uSampler2D_sampler : register(s1);
uint SPIRV_Cross_textureSize(Texture1D<float4> Tex, uint Level, out uint Param)
{
uint ret;
Tex.GetDimensions(Level, ret.x, Param);
return ret;
}
uint SPIRV_Cross_textureSize(Texture1D<int4> Tex, uint Level, out uint Param)
{
uint ret;
Tex.GetDimensions(Level, ret.x, Param);
return ret;
}
uint SPIRV_Cross_textureSize(Texture1D<uint4> Tex, uint Level, out uint Param)
{
uint ret;
Tex.GetDimensions(Level, ret.x, Param);
return ret;
}
uint2 SPIRV_Cross_textureSize(Texture2D<float4> Tex, uint Level, out uint Param)
{
uint2 ret;
Tex.GetDimensions(Level, ret.x, ret.y, Param);
return ret;
}
uint3 SPIRV_Cross_textureSize(Texture2DArray<int4> 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<float4> 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<float4> Tex, uint Level, out uint Param)
{
uint ret;
Tex.GetDimensions(ret.x);
Param = 0u;
return ret;
}
uint2 SPIRV_Cross_textureSize(TextureCube<float4> Tex, uint Level, out uint Param)
{
uint2 ret;
Tex.GetDimensions(Level, ret.x, ret.y, Param);
return ret;
}
uint3 SPIRV_Cross_textureSize(TextureCubeArray<uint4> 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<int4> Tex, uint Level, out uint Param)
{
uint2 ret;
Tex.GetDimensions(ret.x, ret.y, Param);
return ret;
}
uint3 SPIRV_Cross_textureSize(Texture2DMSArray<float4> 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()

View File

@ -1,112 +1,5 @@
Texture1D<float4> uSampler1D : register(t0);
SamplerState _uSampler1D_sampler : register(s0);
Texture2D<float4> uSampler2D : register(t1);
SamplerState _uSampler2D_sampler : register(s1);
Texture2DArray<float4> uSampler2DArray : register(t2);
SamplerState _uSampler2DArray_sampler : register(s2);
Texture3D<float4> uSampler3D : register(t3);
SamplerState _uSampler3D_sampler : register(s3);
TextureCube<float4> uSamplerCube : register(t4);
SamplerState _uSamplerCube_sampler : register(s4);
TextureCubeArray<float4> uSamplerCubeArray : register(t5);
SamplerState _uSamplerCubeArray_sampler : register(s5);
Buffer<float4> uSamplerBuffer : register(t6);
Texture2DMS<float4> uSamplerMS : register(t7);
SamplerState _uSamplerMS_sampler : register(s7);
Texture2DMSArray<float4> uSamplerMSArray : register(t8);
SamplerState _uSamplerMSArray_sampler : register(s8);
uint SPIRV_Cross_textureSize(Texture1D<float4> Tex, uint Level, out uint Param)
{
uint ret;
Tex.GetDimensions(Level, ret.x, Param);
return ret;
}
uint2 SPIRV_Cross_textureSize(Texture2D<float4> Tex, uint Level, out uint Param)
{
uint2 ret;
Tex.GetDimensions(Level, ret.x, ret.y, Param);
return ret;
}
uint3 SPIRV_Cross_textureSize(Texture2DArray<float4> 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<float4> 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<float4> Tex, uint Level, out uint Param)
{
uint ret;
Tex.GetDimensions(ret.x);
Param = 0u;
return ret;
}
uint2 SPIRV_Cross_textureSize(TextureCube<float4> Tex, uint Level, out uint Param)
{
uint2 ret;
Tex.GetDimensions(Level, ret.x, ret.y, Param);
return ret;
}
uint3 SPIRV_Cross_textureSize(TextureCubeArray<float4> 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<float4> Tex, uint Level, out uint Param)
{
uint2 ret;
Tex.GetDimensions(ret.x, ret.y, Param);
return ret;
}
uint3 SPIRV_Cross_textureSize(Texture2DMSArray<float4> 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()

View File

@ -42,9 +42,7 @@ void frag_main()
}
int _91 = index & 3;
FragColor += foobar[_91].z;
float4 baz[4] = _60;
baz = _104;
FragColor += baz[_91].z;
FragColor += _104[_91].z;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -0,0 +1,46 @@
struct UBO_1_1
{
float4 v[64];
};
ConstantBuffer<UBO_1_1> ubos[] : register(b0, space3);
ByteAddressBuffer ssbos[] : register(t0, space4);
Texture2D<float4> uSamplers[] : register(t0, space0);
SamplerState uSamps[] : register(s0, space2);
Texture2D<float4> uCombinedSamplers[] : register(t0, space1);
SamplerState _uCombinedSamplers_sampler[] : register(s0, space1);
static int vIndex;
static float4 FragColor;
static float2 vUV;
struct SPIRV_Cross_Input
{
nointerpolation int vIndex : TEXCOORD0;
float2 vUV : TEXCOORD1;
};
struct SPIRV_Cross_Output
{
float4 FragColor : SV_Target0;
};
void frag_main()
{
int _22 = vIndex + 10;
int _32 = vIndex + 40;
FragColor = uSamplers[NonUniformResourceIndex(_22)].Sample(uSamps[NonUniformResourceIndex(_32)], vUV);
FragColor = uCombinedSamplers[NonUniformResourceIndex(_22)].Sample(_uCombinedSamplers_sampler[NonUniformResourceIndex(_22)], vUV);
FragColor += ubos[NonUniformResourceIndex(vIndex + 20)].v[_32];
FragColor += asfloat(ssbos[NonUniformResourceIndex(vIndex + 50)].Load4((vIndex + 60) * 16 + 0));
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vIndex = stage_input.vIndex;
vUV = stage_input.vUV;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -1,11 +1,13 @@
cbuffer cbuf : register(b3)
cbuffer CBuffer : register(b3)
{
float4 cbuf_a : packoffset(c0);
};
cbuffer registers
cbuffer PushMe
{
float4 registers_a : packoffset(c0);
float4 registers_d : packoffset(c0);
};
Texture2D<float4> uSampledImage : register(t4);
SamplerState _uSampledImage_sampler : register(s4);
Texture2D<float4> uTexture : register(t5);
@ -26,7 +28,7 @@ struct SPIRV_Cross_Output
void frag_main()
{
FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_a);
FragColor = (uSampledImage.Sample(_uSampledImage_sampler, vTex) + uTexture.Sample(uSampler, vTex)) + (cbuf_a + registers_d);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -4,11 +4,12 @@ struct Foo
row_major float4x4 w;
};
cbuffer _17 : register(b0)
cbuffer UBO : register(b0)
{
Foo _17_foo : packoffset(c0);
};
static float4 FragColor;
static float4 vUV;

View File

@ -22,26 +22,11 @@ struct SPIRV_Cross_Output
float FragColor : SV_Target0;
};
float SPIRV_Cross_projectTextureCoordinate(float2 coord)
{
return coord.x / coord.y;
}
float2 SPIRV_Cross_projectTextureCoordinate(float3 coord)
{
return float2(coord.x, coord.y) / coord.z;
}
float3 SPIRV_Cross_projectTextureCoordinate(float4 coord)
{
return float3(coord.x, coord.y, coord.z) / coord.w;
}
void frag_main()
{
float4 _80 = vDirRef;
_80.z = vDirRef.w;
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));
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, _80.xy / _80.z, vDirRef.z / _80.z, int2(1, 1))) + uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, _80.xy / _80.z, vDirRef.z / _80.z, int2(1, 1));
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -0,0 +1,49 @@
static float FragColor;
static float3 vRefract;
struct SPIRV_Cross_Input
{
float3 vRefract : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
float SPIRV_Cross_Reflect(float i, float n)
{
return i - 2.0 * dot(n, i) * n;
}
float SPIRV_Cross_Refract(float i, float n, float eta)
{
float NoI = n * i;
float NoI2 = NoI * NoI;
float k = 1.0 - eta * eta * (1.0 - NoI2);
if (k < 0.0)
{
return 0.0;
}
else
{
return eta * i - (eta * NoI + sqrt(k)) * n;
}
}
void frag_main()
{
FragColor = SPIRV_Cross_Refract(vRefract.x, vRefract.y, vRefract.z);
FragColor += SPIRV_Cross_Reflect(vRefract.x, vRefract.y);
FragColor += refract(vRefract.xy, vRefract.yz, vRefract.z).y;
FragColor += reflect(vRefract.xy, vRefract.zy).y;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vRefract = stage_input.vRefract;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,22 @@
uniform sampler2D uSamp;
uniform sampler2D SPIRV_Cross_CombineduTuS;
static float4 FragColor;
struct SPIRV_Cross_Output
{
float4 FragColor : COLOR0;
};
void frag_main()
{
FragColor = tex2D(uSamp, 0.5f.xx) + tex2D(SPIRV_Cross_CombineduTuS, 0.5f.xx);
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = float4(FragColor);
return stage_output;
}

Some files were not shown because too many files have changed in this diff Show More