Merge branch 'master' into qt_grid

This commit is contained in:
Brad Parker 2018-07-22 20:03:55 -04:00
commit 75ce796c34
283 changed files with 17320 additions and 2701 deletions

4
.gitignore vendored
View File

@ -68,6 +68,10 @@ menu/driverspzarch.c
.pc
/media/shaders_glsl/
/obj-w32/
.cproject
.settings
libretro-super
run.sh
# Wii U
*.depend

View File

@ -5,7 +5,23 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.core.ccnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

View File

@ -1,8 +1,12 @@
# 1.7.4 (future)
- ANDROID: Add sustained performance mode, can be turned on/off in Power Management settings menu.
- ANDROID: Powerstate/battery level support.
- CHEEVOS: Fix crash when scrolling Achievement List while Unofficial Achievements enabled (#6732).
- CHEEVOS: Added hitcounts support for PauseIf/ResetIf (#6817).
- COMMON: Automatically hide "Configuration Override options" in Quick Menu.
- COMMON: Small Bugfix to not trigger savestate code when pressing Reset.
- COMMON: Added libsixel video driver.
- EMSCRIPTEN: Fix Game Focus Toggle.
- HID/OSX: Fix to set hid device registration deterministic (#6497), to address issue #6640 re-adding dynamic device registration.
- LOCALIZATION: Update Italian translation.
- LOCALIZATION: Update Japanese translation.
@ -14,8 +18,10 @@
- MIDI: Add a Windows driver for MIDI, based on winmm.
- MENU/QT/WIMP: QT QSlider styling for Dark Theme.
- MENU/QT/WIMP: Remove button ghostly inside highlighting.
- METAL: Initial work-in-progress video driver for Metal. macOS-only right now, and currently requires macOS 10.13. Works with RGUI right now.
- METAL: Initial work-in-progress video driver for Metal. macOS-only right now, and currently requires macOS 10.13.
- METAL: Supports XMB/MaterialUI, has a menu display driver. Has a font rendering driver.
- METAL/SLANG: Slang shaders should be compatible with Metal video driver.
- QNX: Fix Game Focus Toggle.
- PS3: Add audio mixer support for FLAC and MP3.
- PSP: Use proper button labels, fix inverted R-Stick Y axis.
- REMAPS: Fix the way offsets are calculated for keyboard remapping.
@ -24,9 +30,14 @@
- VULKAN: Fix two validation errors.
- VULKAN: Try to avoid creating swapchains redundantly. Should fix black screen and having to alt tab out of window again to get display working on Nvidia GPUs (Windows).
- VULKAN/OSX: Initial MoltenVK support. Not enabled yet, several MoltenVK bugs should be fixed first before we can have it fully working.
- WINDOWS/DINPUT: Add rumble support.
- WINDOWS/DINPUT: Fix Game Focus Toggle.
- WINDOWS/RAWINPUT: Fix Game Focus Toggle.
- X11: Fix Game Focus Toggle.
- WII: Change deflicker setting to work in 480p or higher, and always enables vfilter so that the user can easily change brightness.
- WIIU: Fix out-of-bounds rendering bug
- WIIU: Implement UDP broadcast network logging on Wii U.
- WIIU: Audio should no longer clip.
# 1.7.3
- AUDIO: Audio mixer supports FLAC/MP3 file types now!

View File

@ -743,11 +743,16 @@ ifeq ($(HW_CONTEXT_MENU_DRIVERS), 1)
ifeq ($(HAVE_XMB),)
HAVE_XMB = 1
endif
ifeq ($(HAVE_STRIPES),)
HAVE_STRIPES = 1
endif
else
HAVE_ZARCH ?= 0
HAVE_MATERIALUI ?= 0
#HAVE_NUKLEAR ?= 0
HAVE_XMB ?= 0
HAVE_STRIPES ?= 0
endif
ifeq ($(HAVE_RGUI), 1)
@ -779,6 +784,12 @@ ifeq ($(HAVE_XMB), 1)
HAVE_MENU_COMMON = 1
endif
ifeq ($(HAVE_STRIPES), 1)
OBJ += menu/drivers/stripes.o
DEFINES += -DHAVE_STRIPES
HAVE_MENU_COMMON = 1
endif
ifeq ($(HAVE_LAKKA), 1)
DEFINES += -DHAVE_LAKKA
endif
@ -1046,6 +1057,18 @@ ifeq ($(HAVE_CACA), 1)
endif
endif
ifeq ($(HAVE_SIXEL), 1)
DEFINES += -DHAVE_SIXEL
CFLAGS += -I/usr/include/sixel
OBJ += gfx/drivers/sixel_gfx.o gfx/drivers_font/sixel_font.o \
gfx/drivers_context/sixel_ctx.o
LIBS += -lsixel
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += menu/drivers_display/menu_display_sixel.o
endif
endif
ifeq ($(HAVE_PLAIN_DRM), 1)
OBJ += gfx/drivers/drm_gfx.o
CFLAGS += -I/usr/include/libdrm
@ -1107,6 +1130,20 @@ endif
endif
endif
ifeq ($(HAVE_METAL), 1)
DEFINES += -DHAVE_METAL
OBJ += gfx/common/metal/Context.o \
gfx/common/metal/Filter.o \
gfx/common/metal/RendererCommon.o \
gfx/common/metal/View.o \
gfx/common/metal/TexturedView.o \
gfx/common/metal/MenuDisplay.o \
gfx/common/metal_common.o \
gfx/drivers/metal.o \
menu/drivers_display/menu_display_metal.o \
gfx/drivers_font/metal_raster_font.o
endif
ifeq ($(HAVE_MPV), 1)
OBJ += cores/libretro-mpv/mpv-libretro.o
DEFINES += -I$(DEPS_DIR) -DHAVE_MPV

View File

@ -84,7 +84,7 @@ static void* ax_audio_init(const char* device, unsigned rate, unsigned latency,
u16 setup_buf[0x30] = {0};
setup_buf[0x25] = 2; /* we request 2 channels */
AXInitParams init = {AX_INIT_RENDERER_48KHZ, 0, 0};
AXVoiceVeData ve = {0xF000, 0};
AXVoiceVeData ve = {0x8000, 0};
ax_audio_t* ax = (ax_audio_t*)calloc(1, sizeof(ax_audio_t));
if (!ax)

View File

@ -1051,8 +1051,11 @@ static void command_event_deinit_core(bool reinit)
cheevos_unload();
#endif
RARCH_LOG("Unloading game..\n");
core_unload_game();
RARCH_LOG("Unloading core..\n");
core_unload();
RARCH_LOG("Unloading core symbols..\n");
core_uninit_symbols();
if (reinit)
@ -1395,7 +1398,6 @@ static bool command_event_save_config(
static bool command_event_save_core_config(void)
{
char msg[128];
bool ret = false;
bool found_path = false;
bool overrides_active = false;
const char *core_path = NULL;
@ -1502,7 +1504,7 @@ static bool command_event_save_core_config(void)
free(config_dir);
free(config_name);
free(config_path);
return ret;
return true;
}
/**
@ -1835,14 +1837,21 @@ bool command_event(enum event_command cmd, void *data)
if (cheevos_hardcore_active)
return false;
#endif
return command_event_main_state(cmd);
if (!command_event_main_state(cmd))
return false;
break;
case CMD_EVENT_UNDO_LOAD_STATE:
return command_event_main_state(cmd);
if (!command_event_main_state(cmd))
return false;
break;
case CMD_EVENT_UNDO_SAVE_STATE:
return command_event_main_state(cmd);
if (!command_event_main_state(cmd))
return false;
break;
case CMD_EVENT_RESIZE_WINDOWED_SCALE:
return command_event_resize_windowed_scale();
if (!command_event_resize_windowed_scale())
return false;
break;
case CMD_EVENT_MENU_TOGGLE:
#ifdef HAVE_MENU
if (menu_driver_is_alive())
@ -1883,7 +1892,9 @@ bool command_event(enum event_command cmd, void *data)
configuration_set_int(settings, settings->ints.state_slot, new_state_slot);
}
}
return command_event_main_state(cmd);
if (!command_event_main_state(cmd))
return false;
break;
case CMD_EVENT_SAVE_STATE_DECREMENT:
{
settings_t *settings = config_get_ptr();
@ -1933,7 +1944,9 @@ bool command_event(enum event_command cmd, void *data)
}
break;
case CMD_EVENT_QUIT:
return retroarch_main_quit();
if (!retroarch_main_quit())
return false;
break;
case CMD_EVENT_CHEEVOS_HARDCORE_MODE_TOGGLE:
#ifdef HAVE_CHEEVOS
cheevos_toggle_hardcore_mode();
@ -1997,7 +2010,7 @@ TODO: Add a setting for these tweaks */
if (!netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_ENABLED, NULL))
#endif
{
state_manager_event_init((unsigned)settings->rewind_buffer_size);
state_manager_event_init((unsigned)settings->sizes.rewind_buffer_size);
}
}
}
@ -2043,9 +2056,13 @@ TODO: Add a setting for these tweaks */
break;
case CMD_EVENT_AUDIO_STOP:
midi_driver_set_all_sounds_off();
return audio_driver_stop();
if (!audio_driver_stop())
return false;
break;
case CMD_EVENT_AUDIO_START:
return audio_driver_start(rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL));
if (!audio_driver_start(rarch_ctl(RARCH_CTL_IS_SHUTDOWN, NULL)))
return false;
break;
case CMD_EVENT_AUDIO_MUTE_TOGGLE:
{
bool audio_mute_enable = *(audio_get_bool_ptr(AUDIO_ACTION_MUTE_ENABLE));
@ -2630,14 +2647,13 @@ TODO: Add a setting for these tweaks */
command_event(CMD_EVENT_REMOTE_DEINIT, NULL);
input_driver_init_remote();
break;
case CMD_EVENT_MAPPER_DEINIT:
input_driver_deinit_mapper();
break;
case CMD_EVENT_MAPPER_INIT:
command_event(CMD_EVENT_MAPPER_DEINIT, NULL);
input_driver_init_mapper();
break;
break;
case CMD_EVENT_LOG_FILE_DEINIT:
retro_main_log_file_deinit();
break;
@ -2646,8 +2662,10 @@ TODO: Add a setting for these tweaks */
const char *path = (const char*)data;
if (string_is_empty(path))
return false;
return command_event_disk_control_append_image(path);
if (!command_event_disk_control_append_image(path))
return false;
}
break;
case CMD_EVENT_DISK_EJECT_TOGGLE:
{
rarch_system_info_t *info = runloop_get_system_info();
@ -2754,10 +2772,8 @@ TODO: Add a setting for these tweaks */
}
break;
case CMD_EVENT_UI_COMPANION_TOGGLE:
{
ui_companion_driver_toggle(true);
break;
}
ui_companion_driver_toggle(true);
break;
case CMD_EVENT_GAME_FOCUS_TOGGLE:
{
static bool game_focus_state = false;

View File

@ -524,6 +524,9 @@ static const bool rewind_enable = false;
* 15-20MB per minute. Very game dependant. */
static const unsigned rewind_buffer_size = 20 << 20; /* 20MiB */
/* The amount of MB to increase/decrease the rewind_buffer_size when it is changed via the UI. */
static const unsigned rewind_buffer_size_step = 10; /* 10MB */
/* How many frames to rewind at a time. */
static const unsigned rewind_granularity = 1;
@ -701,12 +704,16 @@ static const unsigned midi_volume = 100;
static const bool sustained_performance_mode = false;
#if defined(ANDROID)
#if defined(ANDROID_ARM)
#if defined(ANDROID_ARM_V7)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi-v7a/";
#elif defined(ANDROID_ARM)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/armeabi/";
#elif defined(ANDROID_AARCH64)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/arm64-v8a/";
#elif defined(ANDROID_X86)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/x86/";
#elif defined(ANDROID_X64)
static char buildbot_server_url[] = "http://buildbot.libretro.com/nightly/android/latest/x86_64/";
#else
static char buildbot_server_url[] = "";
#endif

View File

@ -92,6 +92,16 @@ struct config_uint_setting
enum rarch_override_setting override;
};
struct config_size_setting
{
const char *ident;
size_t *ptr;
bool def_enable;
size_t def;
bool handle;
enum rarch_override_setting override;
};
struct config_float_setting
{
const char *ident;
@ -125,6 +135,7 @@ enum video_driver_enum
{
VIDEO_GL = 0,
VIDEO_VULKAN,
VIDEO_METAL,
VIDEO_DRM,
VIDEO_XVIDEO,
VIDEO_SDL,
@ -273,6 +284,7 @@ enum menu_driver_enum
MENU_XUI,
MENU_MATERIALUI,
MENU_XMB,
MENU_STRIPES,
MENU_NUKLEAR,
MENU_NULL
};
@ -291,6 +303,8 @@ enum midi_driver_enum
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) || defined(__CELLOS_LV2__)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_GL;
#elif defined(HAVE_METAL)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_METAL;
#elif defined(GEKKO)
static enum video_driver_enum VIDEO_DEFAULT_DRIVER = VIDEO_WII;
#elif defined(WIIU)
@ -515,6 +529,8 @@ static enum location_driver_enum LOCATION_DEFAULT_DRIVER = LOCATION_NULL;
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XUI;
#elif defined(HAVE_MATERIALUI) && defined(RARCH_MOBILE)
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_MATERIALUI;
#elif defined(HAVE_STRIPES) && !defined(_XBOX)
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_STRIPES;
#elif defined(HAVE_XMB) && !defined(_XBOX)
static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_XMB;
#elif defined(HAVE_RGUI)
@ -547,6 +563,9 @@ static enum menu_driver_enum MENU_DEFAULT_DRIVER = MENU_NULL;
#define SETTING_UINT(key, configval, default_enable, default_setting, handle_setting) \
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_uint_setting, handle_setting)
#define SETTING_SIZE(key, configval, default_enable, default_setting, handle_setting) \
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_size_setting, handle_setting)
#define SETTING_PATH(key, configval, default_enable, default_setting, handle_setting) \
GENERAL_SETTING(key, configval, default_enable, default_setting, struct config_path_setting, handle_setting)
@ -711,6 +730,8 @@ const char *config_get_default_video(void)
return "gl";
case VIDEO_VULKAN:
return "vulkan";
case VIDEO_METAL:
return "metal";
case VIDEO_DRM:
return "drm";
case VIDEO_WII:
@ -1008,6 +1029,8 @@ const char *config_get_default_menu(void)
return "glui";
case MENU_XMB:
return "xmb";
case MENU_STRIPES:
return "stripes";
case MENU_NUKLEAR:
return "nuklear";
case MENU_NULL:
@ -1503,6 +1526,7 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("audio_resampler_quality", &settings->uints.audio_resampler_quality, true, audio_resampler_quality_level, false);
SETTING_UINT("audio_block_frames", &settings->uints.audio_block_frames, true, 0, false);
SETTING_UINT("rewind_granularity", &settings->uints.rewind_granularity, true, rewind_granularity, false);
SETTING_UINT("rewind_buffer_size_step", &settings->uints.rewind_buffer_size_step, true, rewind_buffer_size_step, false);
SETTING_UINT("autosave_interval", &settings->uints.autosave_interval, true, autosave_interval, false);
SETTING_UINT("libretro_log_level", &settings->uints.libretro_log_level, true, libretro_log_level, false);
SETTING_UINT("keyboard_gamepad_mapping_type",&settings->uints.input_keyboard_gamepad_mapping_type, true, 1, false);
@ -1579,6 +1603,18 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
return tmp;
}
static struct config_size_setting *populate_settings_size(settings_t *settings, int *size)
{
unsigned count = 0;
struct config_size_setting *tmp = (struct config_size_setting*)malloc((*size + 1) * sizeof(struct config_size_setting));
SETTING_SIZE("rewind_buffer_size", &settings->sizes.rewind_buffer_size, true, rewind_buffer_size, false);
*size = count;
return tmp;
}
static struct config_int_setting *populate_settings_int(settings_t *settings, int *size)
{
unsigned count = 0;
@ -1614,6 +1650,7 @@ static void config_set_defaults(void)
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
const char *def_video = config_get_default_video();
const char *def_audio = config_get_default_audio();
const char *def_audio_resampler = config_get_default_audio_resampler();
@ -1633,6 +1670,7 @@ static void config_set_defaults(void)
struct config_bool_setting *bool_settings = populate_settings_bool (settings, &bool_settings_size);
struct config_int_setting *int_settings = populate_settings_int (settings, &int_settings_size);
struct config_uint_setting *uint_settings = populate_settings_uint (settings, &uint_settings_size);
struct config_size_setting *size_settings = populate_settings_size (settings, &size_settings_size);
if (bool_settings && (bool_settings_size > 0))
{
@ -1667,6 +1705,17 @@ static void config_set_defaults(void)
free(uint_settings);
}
if (size_settings && (size_settings_size > 0))
{
for (i = 0; i < (unsigned)size_settings_size; i++)
{
if (size_settings[i].def_enable)
*size_settings[i].ptr = size_settings[i].def;
}
free(size_settings);
}
if (float_settings && (float_settings_size > 0))
{
for (i = 0; i < (unsigned)float_settings_size; i++)
@ -1758,8 +1807,6 @@ static void config_set_defaults(void)
audio_set_float(AUDIO_ACTION_VOLUME_GAIN, settings->floats.audio_volume);
audio_set_float(AUDIO_ACTION_MIXER_VOLUME_GAIN, settings->floats.audio_mixer_volume);
settings->rewind_buffer_size = rewind_buffer_size;
#ifdef HAVE_LAKKA
settings->bools.ssh_enable = filestream_exists(LAKKA_SSH_PATH);
settings->bools.samba_enable = filestream_exists(LAKKA_SAMBA_PATH);
@ -2357,6 +2404,7 @@ static bool check_shader_compatibility(enum file_path_enum enum_idx)
settings_t *settings = config_get_ptr();
if (string_is_equal(settings->arrays.video_driver, "vulkan") ||
string_is_equal(settings->arrays.video_driver, "metal") ||
string_is_equal(settings->arrays.video_driver, "d3d11") ||
string_is_equal(settings->arrays.video_driver, "d3d12") ||
string_is_equal(settings->arrays.video_driver, "gx2"))
@ -2457,12 +2505,14 @@ static bool config_load_file(const char *path, bool set_defaults,
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder);
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
struct config_bool_setting *bool_settings = populate_settings_bool (settings, &bool_settings_size);
struct config_float_setting *float_settings = populate_settings_float (settings, &float_settings_size);
struct config_int_setting *int_settings = populate_settings_int (settings, &int_settings_size);
struct config_uint_setting *uint_settings = populate_settings_uint (settings, &uint_settings_size);
struct config_size_setting *size_settings = populate_settings_size (settings, &size_settings_size);
struct config_array_setting *array_settings = populate_settings_array (settings, &array_settings_size);
struct config_path_setting *path_settings = populate_settings_path (settings, &path_settings_size);
@ -2587,6 +2637,23 @@ static bool config_load_file(const char *path, bool set_defaults,
*uint_settings[i].ptr = tmp;
}
for (i = 0; i < (unsigned)size_settings_size; i++)
{
size_t tmp = 0;
if (config_get_size_t(conf, size_settings[i].ident, &tmp))
*size_settings[i].ptr = tmp ;
/* Special case for rewind_buffer_size - need to convert low values to what they were
* intended to be based on the default value in config.def.h
* If the value is less than 10000 then multiple by 1MB because if the retroarch.cfg
* file contains rewind_buffer_size = "100" then that ultimately gets interpreted as
* 100MB, so ensure the internal values represent that.*/
if ( strcmp(size_settings[i].ident, "rewind_buffer_size") == 0 ) {
if ( *size_settings[i].ptr < 10000) {
*size_settings[i].ptr = *size_settings[i].ptr * 1024 * 1024 ;
}
}
}
for (i = 0; i < MAX_USERS; i++)
{
char buf[64];
@ -2618,13 +2685,6 @@ static bool config_load_file(const char *path, bool set_defaults,
CONFIG_GET_INT_BASE(conf, settings, uints.led_map[i], buf);
}
{
/* ugly hack around C89 not allowing mixing declarations and code */
int buffer_size = 0;
if (config_get_int(conf, "rewind_buffer_size", &buffer_size))
settings->rewind_buffer_size = buffer_size * UINT64_C(1000000);
}
/* Hexadecimal settings */
@ -3948,6 +4008,7 @@ bool config_save_file(const char *path)
struct config_bool_setting *bool_settings = NULL;
struct config_int_setting *int_settings = NULL;
struct config_uint_setting *uint_settings = NULL;
struct config_size_setting *size_settings = NULL;
struct config_float_setting *float_settings = NULL;
struct config_array_setting *array_settings = NULL;
struct config_path_setting *path_settings = NULL;
@ -3957,6 +4018,7 @@ bool config_save_file(const char *path)
int float_settings_size = sizeof(settings->floats)/ sizeof(settings->floats.placeholder);
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
int array_settings_size = sizeof(settings->arrays)/ sizeof(settings->arrays.placeholder);
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
@ -3973,6 +4035,7 @@ bool config_save_file(const char *path)
bool_settings = populate_settings_bool (settings, &bool_settings_size);
int_settings = populate_settings_int (settings, &int_settings_size);
uint_settings = populate_settings_uint (settings, &uint_settings_size);
size_settings = populate_settings_size (settings, &size_settings_size);
float_settings = populate_settings_float (settings, &float_settings_size);
array_settings = populate_settings_array (settings, &array_settings_size);
path_settings = populate_settings_path (settings, &path_settings_size);
@ -4050,6 +4113,18 @@ bool config_save_file(const char *path)
free(uint_settings);
}
if (size_settings && (size_settings_size > 0))
{
for (i = 0; i < (unsigned)size_settings_size; i++)
if (!size_settings[i].override ||
!retroarch_override_setting_is_set(size_settings[i].override, NULL))
config_set_int(conf,
size_settings[i].ident,
*size_settings[i].ptr);
free(size_settings);
}
for (i = 0; i < MAX_USERS; i++)
{
char cfg[64];
@ -4169,8 +4244,10 @@ bool config_save_overrides(int override_type)
struct config_bool_setting *bool_overrides = NULL;
struct config_int_setting *int_settings = NULL;
struct config_uint_setting *uint_settings = NULL;
struct config_size_setting *size_settings = NULL;
struct config_int_setting *int_overrides = NULL;
struct config_uint_setting *uint_overrides = NULL;
struct config_size_setting *size_overrides = NULL;
struct config_float_setting *float_settings = NULL;
struct config_float_setting *float_overrides= NULL;
struct config_array_setting *array_settings = NULL;
@ -4187,6 +4264,7 @@ bool config_save_overrides(int override_type)
int float_settings_size = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
int int_settings_size = sizeof(settings->ints) / sizeof(settings->ints.placeholder);
int uint_settings_size = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
int size_settings_size = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
int array_settings_size = sizeof(settings->arrays) / sizeof(settings->arrays.placeholder);
int path_settings_size = sizeof(settings->paths) / sizeof(settings->paths.placeholder);
rarch_system_info_t *system = runloop_get_system_info();
@ -4255,6 +4333,10 @@ bool config_save_overrides(int override_type)
tmp_i = sizeof(settings->uints) / sizeof(settings->uints.placeholder);
uint_overrides = populate_settings_uint (overrides, &tmp_i);
size_settings = populate_settings_size(settings, &size_settings_size);
tmp_i = sizeof(settings->sizes) / sizeof(settings->sizes.placeholder);
size_overrides = populate_settings_size (overrides, &tmp_i);
float_settings = populate_settings_float(settings, &float_settings_size);
tmp_i = sizeof(settings->floats) / sizeof(settings->floats.placeholder);
float_overrides = populate_settings_float(overrides, &tmp_i);
@ -4307,6 +4389,18 @@ bool config_save_overrides(int override_type)
(*uint_overrides[i].ptr));
}
}
for (i = 0; i < (unsigned)size_settings_size; i++)
{
if ((*size_settings[i].ptr) != (*size_overrides[i].ptr))
{
RARCH_LOG(" original: %s=%d\n",
size_settings[i].ident, (*size_settings[i].ptr));
RARCH_LOG(" override: %s=%d\n",
size_overrides[i].ident, (*size_overrides[i].ptr));
config_set_int(conf, size_overrides[i].ident,
(*size_overrides[i].ptr));
}
}
for (i = 0; i < (unsigned)float_settings_size; i++)
{
if ((*float_settings[i].ptr) != (*float_overrides[i].ptr))
@ -4423,6 +4517,8 @@ bool config_save_overrides(int override_type)
free(int_settings);
if (uint_settings)
free(uint_settings);
if (size_settings)
free(size_settings);
if (int_overrides)
free(int_overrides);
if (uint_overrides)

View File

@ -348,6 +348,7 @@ typedef struct settings
unsigned content_history_size;
unsigned libretro_log_level;
unsigned rewind_granularity;
unsigned rewind_buffer_size_step;
unsigned autosave_interval;
unsigned network_cmd_port;
unsigned network_remote_base_port;
@ -411,6 +412,12 @@ typedef struct settings
unsigned midi_volume;
} uints;
struct
{
size_t placeholder;
size_t rewind_buffer_size;
} sizes;
struct
{
char placeholder;
@ -509,7 +516,6 @@ typedef struct settings
video_viewport_t video_viewport_custom;
size_t rewind_buffer_size;
} settings_t;
/**

View File

@ -290,6 +290,8 @@ bool core_load_game(retro_ctx_load_content_info_t *load_info)
bool contentless = false;
bool is_inited = false;
video_driver_set_cached_frame_ptr(NULL);
#ifdef HAVE_RUNAHEAD
set_load_content_info(load_info);
clear_controller_port_map();
@ -373,12 +375,16 @@ bool core_get_system_av_info(struct retro_system_av_info *av_info)
bool core_reset(void)
{
video_driver_set_cached_frame_ptr(NULL);
current_core.retro_reset();
return true;
}
bool core_init(void)
{
video_driver_set_cached_frame_ptr(NULL);
current_core.retro_init();
current_core.inited = true;
return true;
@ -386,6 +392,8 @@ bool core_init(void)
bool core_unload(void)
{
video_driver_set_cached_frame_ptr(NULL);
current_core.retro_deinit();
return true;
}
@ -396,9 +404,12 @@ bool core_unload_game(void)
video_driver_free_hw_context();
audio_driver_stop();
video_driver_set_cached_frame_ptr(NULL);
current_core.retro_unload_game();
current_core.game_loaded = false;
return true;
}

View File

@ -93,6 +93,10 @@ spirv_cross_add_library(spirv-cross-cpp spirv_cross_cpp STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_cpp.cpp)
spirv_cross_add_library(spirv-cross-reflect spirv_cross_reflect STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_reflect.cpp)
spirv_cross_add_library(spirv-cross-msl spirv_cross_msl STATIC
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.hpp
${CMAKE_CURRENT_SOURCE_DIR}/spirv_msl.cpp)
@ -110,7 +114,7 @@ target_compile_options(spirv-cross PRIVATE ${spirv-compiler-options})
target_compile_definitions(spirv-cross PRIVATE ${spirv-compiler-defines})
install(TARGETS spirv-cross RUNTIME DESTINATION bin)
target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-hlsl spirv-cross-cpp spirv-cross-msl spirv-cross-util spirv-cross-core)
target_link_libraries(spirv-cross spirv-cross-glsl spirv-cross-hlsl spirv-cross-cpp spirv-cross-reflect spirv-cross-msl spirv-cross-util spirv-cross-core)
target_link_libraries(spirv-cross-util spirv-cross-core)
target_link_libraries(spirv-cross-glsl spirv-cross-core)
target_link_libraries(spirv-cross-msl spirv-cross-glsl)

View File

@ -11,6 +11,7 @@ SPIRV-Cross is a tool designed for parsing and converting SPIR-V to other shader
- Convert SPIR-V to readable, usable and efficient Metal Shading Language (MSL)
- Convert SPIR-V to readable, usable and efficient HLSL
- Convert SPIR-V to debuggable C++ [EXPERIMENTAL]
- Convert SPIR-V to a JSON reflection format [EXPERIMENTAL]
- Reflection API to simplify the creation of Vulkan pipeline layouts
- Reflection API to modify and tweak OpDecorations
- Supports "all" of vertex, fragment, tessellation, geometry and compute shaders.

View File

@ -19,6 +19,7 @@
#include "spirv_glsl.hpp"
#include "spirv_hlsl.hpp"
#include "spirv_msl.hpp"
#include "spirv_reflect.hpp"
#include <algorithm>
#include <cstdio>
#include <cstring>
@ -149,6 +150,22 @@ struct CLIParser
return val;
}
// Return a string only if it's not prefixed with `--`, otherwise return the default value
const char *next_value_string(const char *default_value)
{
if (!argc)
{
return default_value;
}
if (0 == strncmp("--", *argv, 2))
{
return default_value;
}
return next_string();
}
const char *next_string()
{
if (!argc)
@ -461,6 +478,7 @@ struct CLIArguments
bool fixup = false;
bool yflip = false;
bool sso = false;
bool support_nonzero_baseinstance = true;
vector<PLSArg> pls_in;
vector<PLSArg> pls_out;
vector<Remap> remaps;
@ -481,6 +499,7 @@ struct CLIArguments
uint32_t iterations = 1;
bool cpp = false;
string reflect;
bool msl = false;
bool hlsl = false;
bool hlsl_compat = false;
@ -512,6 +531,7 @@ static void print_help()
"\t[--msl]\n"
"\t[--msl-version <MMmmpp>]\n"
"\t[--hlsl]\n"
"\t[--reflect]\n"
"\t[--shader-model]\n"
"\t[--hlsl-enable-compat]\n"
"\t[--separate-shader-objects]\n"
@ -528,7 +548,8 @@ static void print_help()
"\t[--rename-interface-variable <in|out> <location> <new_variable_name>]\n"
"\t[--set-hlsl-vertex-input-semantic <location> <semantic>]\n"
"\t[--rename-entry-point <old> <new> <stage>]\n"
"\t[--combined-samplers-inherit-bindings]"
"\t[--combined-samplers-inherit-bindings]\n"
"\t[--no-support-nonzero-baseinstance]\n"
"\n");
}
@ -663,6 +684,7 @@ static int main_inner(int argc, char *argv[])
cbs.add("--flip-vert-y", [&args](CLIParser &) { args.yflip = true; });
cbs.add("--iterations", [&args](CLIParser &parser) { args.iterations = parser.next_uint(); });
cbs.add("--cpp", [&args](CLIParser &) { args.cpp = true; });
cbs.add("--reflect", [&args](CLIParser &parser) { args.reflect = parser.next_value_string("json"); });
cbs.add("--cpp-interface-name", [&args](CLIParser &parser) { args.cpp_interface_name = parser.next_string(); });
cbs.add("--metal", [&args](CLIParser &) { args.msl = true; }); // Legacy compatibility
cbs.add("--msl", [&args](CLIParser &) { args.msl = true; });
@ -737,6 +759,8 @@ static int main_inner(int argc, char *argv[])
cbs.add("--combined-samplers-inherit-bindings",
[&args](CLIParser &) { args.combined_samplers_inherit_bindings = true; });
cbs.add("--no-support-nonzero-baseinstance", [&](CLIParser &) { args.support_nonzero_baseinstance = false; });
cbs.default_handler = [&args](const char *value) { args.input = value; };
cbs.error_handler = [] { print_help(); };
@ -757,8 +781,20 @@ static int main_inner(int argc, char *argv[])
return EXIT_FAILURE;
}
unique_ptr<CompilerGLSL> compiler;
// Special case reflection because it has little to do with the path followed by code-outputting compilers
if (!args.reflect.empty())
{
CompilerReflection compiler(read_spirv_file(args.input));
compiler.set_format(args.reflect);
auto json = compiler.compile();
if (args.output)
write_string_to_file(args.output, json.c_str());
else
printf("%s", json.c_str());
return EXIT_SUCCESS;
}
unique_ptr<CompilerGLSL> compiler;
bool combined_image_samplers = false;
bool build_dummy_sampler = false;
@ -895,6 +931,7 @@ static int main_inner(int argc, char *argv[])
opts.vulkan_semantics = args.vulkan_semantics;
opts.vertex.fixup_clipspace = args.fixup;
opts.vertex.flip_vert_y = args.yflip;
opts.vertex.support_nonzero_base_instance = args.support_nonzero_baseinstance;
compiler->set_common_options(opts);
// Set HLSL specific options.

View File

@ -127,6 +127,7 @@
<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" />
@ -138,6 +139,7 @@
<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" />

View File

@ -24,6 +24,9 @@
<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>
@ -50,6 +53,9 @@
<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>

View File

@ -0,0 +1,32 @@
RWByteAddressBuffer bar : register(u0);
RWByteAddressBuffer foo : register(u1);
void comp_main()
{
[unroll]
for (int _135 = 0; _135 < 16; )
{
bar.Store4(_135 * 16 + 0, asuint(asfloat(foo.Load4(_135 * 16 + 0))));
_135++;
continue;
}
[loop]
for (int _136 = 0; _136 < 16; )
{
bar.Store4((15 - _136) * 16 + 0, asuint(asfloat(foo.Load4(_136 * 16 + 0))));
_136++;
continue;
}
[branch]
if (asfloat(bar.Load(160)) > 10.0f)
{
foo.Store4(320, asuint(5.0f.xxxx));
}
foo.Store4(320, asuint(20.0f.xxxx));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -0,0 +1,57 @@
static const float _46[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
static const float4 _76[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
static const float4 _90[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
static float FragColor;
static int index;
struct SPIRV_Cross_Input
{
nointerpolation int index : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
float4 foobar[4] = _76;
float4 baz[4] = _76;
FragColor = _46[index];
if (index < 10)
{
FragColor += _46[index ^ 1];
}
else
{
FragColor += _46[index & 1];
}
bool _99 = index > 30;
if (_99)
{
FragColor += _76[index & 3].y;
}
else
{
FragColor += _76[index & 1].x;
}
if (_99)
{
foobar[1].z = 20.0f;
}
int _37 = index & 3;
FragColor += foobar[_37].z;
baz = _90;
FragColor += baz[_37].z;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
index = stage_input.index;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,31 @@
Texture2D<float4> uShadow : register(t0);
SamplerComparisonState _uShadow_sampler : register(s0);
Texture2D<float4> uTexture : register(t1);
SamplerComparisonState uSampler : register(s2);
static float3 vUV;
static float FragColor;
struct SPIRV_Cross_Input
{
float3 vUV : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = uShadow.SampleCmp(_uShadow_sampler, vUV.xy, vUV.z) + uTexture.SampleCmp(uSampler, vUV.xy, vUV.z);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vUV = stage_input.vUV;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,28 @@
static float4 gl_Position;
static int gl_VertexIndex;
static int gl_InstanceIndex;
struct SPIRV_Cross_Input
{
uint gl_VertexIndex : SV_VertexID;
uint gl_InstanceIndex : SV_InstanceID;
};
struct SPIRV_Cross_Output
{
float4 gl_Position : SV_Position;
};
void vert_main()
{
gl_Position = float(uint(gl_VertexIndex) + uint(gl_InstanceIndex)).xxxx;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
gl_VertexIndex = int(stage_input.gl_VertexIndex);
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
return stage_output;
}

View File

@ -0,0 +1,16 @@
globallycoherent RWByteAddressBuffer _29 : register(u3);
ByteAddressBuffer _33 : register(t2);
RWTexture2D<float> uImageIn : register(u0);
globallycoherent RWTexture2D<float> uImageOut : register(u1);
void comp_main()
{
uImageOut[int2(9, 7)] = uImageIn[int2(9, 7)].x;
_29.Store(0, asuint(asfloat(_33.Load(0))));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -15,11 +15,10 @@ struct SPIRV_Cross_Output
void frag_main()
{
float lut[5] = _17;
for (int _46 = 0; _46 < 4; )
{
int _33 = _46 + 1;
FragColor += lut[_33].xxxx;
FragColor += _17[_33].xxxx;
_46 = _33;
continue;
}

View File

@ -30,7 +30,7 @@ void frag_main()
lut = _16;
foos = _28;
FragColor = lut[_line].xxxx;
FragColor += (foos[_line].a * (foos[1 - _line].a)).xxxx;
FragColor += (foos[_line].a * foos[1 - _line].a).xxxx;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -0,0 +1,57 @@
static const float _16[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
static const float4 _60[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
static const float4 _104[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
static float FragColor;
static int index;
struct SPIRV_Cross_Input
{
nointerpolation int index : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = _16[index];
if (index < 10)
{
FragColor += _16[index ^ 1];
}
else
{
FragColor += _16[index & 1];
}
bool _63 = index > 30;
if (_63)
{
FragColor += _60[index & 3].y;
}
else
{
FragColor += _60[index & 1].x;
}
float4 foobar[4] = _60;
if (_63)
{
foobar[1].z = 20.0f;
}
int _91 = index & 3;
FragColor += foobar[_91].z;
float4 baz[4] = _60;
baz = _104;
FragColor += baz[_91].z;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
index = stage_input.index;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,23 @@
static const uint s = 10u;
static const bool _13 = (s > 20u);
static const uint _16 = _13 ? 30u : 50u;
static float FragColor;
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = float(_16);
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,69 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant float _46[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0};
constant float4 _76[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
constant float4 _90[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)};
struct main0_out
{
float FragColor [[color(0)]];
};
struct main0_in
{
int index [[user(locn0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0(main0_in in [[stage_in]])
{
float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
main0_out out = {};
out.FragColor = _46[in.index];
if (in.index < 10)
{
out.FragColor += _46[in.index ^ 1];
}
else
{
out.FragColor += _46[in.index & 1];
}
bool _99 = in.index > 30;
if (_99)
{
out.FragColor += _76[in.index & 3].y;
}
else
{
out.FragColor += _76[in.index & 1].x;
}
if (_99)
{
foobar[1].z = 20.0;
}
int _37 = in.index & 3;
out.FragColor += foobar[_37].z;
spvArrayCopyConstant(baz, _90);
out.FragColor += baz[_37].z;
return out;
}

View File

@ -0,0 +1,22 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float FragColor [[color(0)]];
};
struct main0_in
{
float3 vUV [[user(locn0)]];
};
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(2)]])
{
main0_out out = {};
out.FragColor = uShadow.sample_compare(uShadowSmplr, in.vUV.xy, in.vUV.z) + uTexture.sample_compare(uSampler, in.vUV.xy, in.vUV.z);
return out;
}

View File

@ -0,0 +1,17 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 gl_Position [[position]];
};
vertex main0_out main0(uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
{
main0_out out = {};
out.gl_Position = float4(float(gl_VertexIndex + gl_InstanceIndex));
return out;
}

View File

@ -1,5 +1,3 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
@ -12,28 +10,13 @@ struct main0_out
float4 FragColor [[color(0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0()
{
main0_out out = {};
float lut[5] = {1.0, 2.0, 3.0, 4.0, 5.0};
for (int _46 = 0; _46 < 4; )
{
int _33 = _46 + 1;
out.FragColor += float4(lut[_33]);
out.FragColor += float4(_17[_33]);
_46 = _33;
continue;
}

View File

@ -44,10 +44,8 @@ void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
float4 indexable[3] = {float4(1.0), float4(2.0), float4(3.0)};
float4 indexable_1[2][2] = {{float4(1.0), float4(2.0)}, {float4(8.0), float4(10.0)}};
Foobar indexable_2[2] = {{10.0, 40.0}, {90.0, 70.0}};
out.FragColor = ((indexable[in.index] + (indexable_1[in.index][in.index + 1])) + float4(30.0)) + float4(indexable_2[in.index].a + indexable_2[in.index].b);
Foobar indexable[2] = {{10.0, 40.0}, {90.0, 70.0}};
out.FragColor = ((_37[in.index] + _55[in.index][in.index + 1]) + float4(30.0)) + float4(indexable[in.index].a + indexable[in.index].b);
return out;
}

View File

@ -44,7 +44,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
float lut[4] = {1.0, 4.0, 3.0, 2.0};
Foo foos[2] = {{10.0, 20.0}, {30.0, 40.0}};
out.FragColor = float4(lut[in.line]);
out.FragColor += float4(foos[in.line].a * (foos[1 - in.line].a));
out.FragColor += float4(foos[in.line].a * foos[1 - in.line].a);
return out;
}

View File

@ -0,0 +1,69 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant float _16[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0};
constant float4 _60[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
constant float4 _104[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)};
struct main0_out
{
float FragColor [[color(0)]];
};
struct main0_in
{
int index [[user(locn0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
out.FragColor = _16[in.index];
if (in.index < 10)
{
out.FragColor += _16[in.index ^ 1];
}
else
{
out.FragColor += _16[in.index & 1];
}
bool _63 = in.index > 30;
if (_63)
{
out.FragColor += _60[in.index & 3].y;
}
else
{
out.FragColor += _60[in.index & 1].x;
}
float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
if (_63)
{
foobar[1].z = 20.0;
}
int _91 = in.index & 3;
out.FragColor += foobar[_91].z;
float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
spvArrayCopyConstant(baz, _104);
out.FragColor += baz[_91].z;
return out;
}

View File

@ -0,0 +1,22 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant uint s_tmp [[function_constant(0)]];
constant uint s = is_function_constant_defined(s_tmp) ? s_tmp : 10u;
constant bool _13 = (s > 20u);
constant uint _16 = _13 ? 30u : 50u;
struct main0_out
{
float FragColor [[color(0)]];
};
fragment main0_out main0()
{
main0_out out = {};
out.FragColor = float(_16);
return out;
}

View File

@ -0,0 +1,19 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 gl_Position [[position]];
float gl_PointSize [[point_size]];
};
vertex main0_out main0()
{
main0_out out = {};
out.gl_PointSize = 1.0;
out.gl_Position = float4(out.gl_PointSize);
return out;
}

View File

@ -1,3 +1,5 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
@ -8,10 +10,16 @@ struct main0_out
float4 gl_Position [[position]];
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
vertex main0_out main0(texture2d<float> uSamp [[texture(4)]], texture2d<float> uSampo [[texture(5)]])
{
main0_out out = {};
out.gl_Position = uSamp.read(uint2(10, 0)) + uSampo.read(uint2(100, 0));
out.gl_Position = uSamp.read(spvTexelBufferCoord(10)) + uSampo.read(spvTexelBufferCoord(100));
return out;
}

View File

@ -0,0 +1,42 @@
#version 310 es
precision mediump float;
precision highp int;
const float _46[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0);
const vec4 _76[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0));
layout(location = 0) out float FragColor;
layout(location = 0) flat in mediump int index;
void main()
{
vec4 foobar[4] = _76;
vec4 baz[4] = _76;
FragColor = _46[index];
if (index < 10)
{
FragColor += _46[index ^ 1];
}
else
{
FragColor += _46[index & 1];
}
bool _99 = index > 30;
if (_99)
{
FragColor += _76[index & 3].y;
}
else
{
FragColor += _76[index & 1].x;
}
if (_99)
{
foobar[1].z = 20.0;
}
mediump int _37 = index & 3;
FragColor += foobar[_37].z;
baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0));
FragColor += baz[_37].z;
}

View File

@ -0,0 +1,33 @@
#version 310 es
precision mediump float;
precision highp int;
layout(location = 0) flat in mediump int vIndex;
layout(location = 0) out float FragColor;
void main()
{
highp float _19;
switch (vIndex)
{
case 0:
case 2:
{
_19 = 1.0;
break;
}
case 1:
default:
{
_19 = 3.0;
break;
}
case 8:
{
_19 = 8.0;
break;
}
}
FragColor = _19;
}

View File

@ -0,0 +1,13 @@
#version 450
layout(binding = 0) uniform sampler2DShadow uShadow;
uniform sampler2DShadow SPIRV_Cross_CombineduTextureuSampler;
layout(location = 0) in vec3 vUV;
layout(location = 0) out float FragColor;
void main()
{
FragColor = texture(uShadow, vec3(vUV.xy, vUV.z)) + texture(SPIRV_Cross_CombineduTextureuSampler, vec3(vUV.xy, vUV.z));
}

View File

@ -0,0 +1,14 @@
#version 450
layout(set = 0, binding = 0) uniform sampler2DShadow uShadow;
layout(set = 0, binding = 1) uniform texture2D uTexture;
layout(set = 0, binding = 2) uniform samplerShadow uSampler;
layout(location = 0) in vec3 vUV;
layout(location = 0) out float FragColor;
void main()
{
FragColor = texture(uShadow, vec3(vUV.xy, vUV.z)) + texture(sampler2DShadow(uTexture, uSampler), vec3(vUV.xy, vUV.z));
}

View File

@ -0,0 +1,41 @@
#version 450
layout(triangles) in;
layout(max_vertices = 3, triangle_strip) out;
struct VertexOutput
{
vec4 pos;
};
struct GeometryOutput
{
vec4 pos;
uint layer;
};
void _main(VertexOutput _input[3], GeometryOutput stream)
{
GeometryOutput _output;
_output.layer = 1u;
for (int v = 0; v < 3; v++)
{
_output.pos = _input[v].pos;
gl_Position = _output.pos;
gl_Layer = int(_output.layer);
EmitVertex();
}
EndPrimitive();
}
void main()
{
VertexOutput _input[3];
_input[0].pos = gl_in[0].gl_Position;
_input[1].pos = gl_in[1].gl_Position;
_input[2].pos = gl_in[2].gl_Position;
VertexOutput param[3] = _input;
GeometryOutput param_1;
_main(param, param_1);
GeometryOutput stream = param_1;
}

View File

@ -0,0 +1,9 @@
#version 450
uniform int SPIRV_Cross_BaseInstance;
void main()
{
gl_Position = vec4(float(uint(gl_VertexID) + uint((gl_InstanceID + SPIRV_Cross_BaseInstance))));
}

View File

@ -48,8 +48,8 @@ void main()
vec2 _387 = _316.xx;
vec2 _392 = _316.yy;
vec2 _395 = _392 * _137.distribution[_280].yx;
vec2 _421 = _392 * (_137.distribution[(_476 * _448) + _475]).yx;
vec2 _429 = ((_137.distribution[(_476 * _448) + _475]) * _387) + vec2(-_421.x, _421.y);
vec2 _421 = _392 * _137.distribution[(_476 * _448) + _475].yx;
vec2 _429 = (_137.distribution[(_476 * _448) + _475] * _387) + vec2(-_421.x, _421.y);
_225.heights[_280] = packHalf2x16(((_137.distribution[_280] * _387) + vec2(-_395.x, _395.y)) + vec2(_429.x, -_429.y));
}

View File

@ -19,7 +19,7 @@ void main()
for (int _96 = 0; _96 < 4; )
{
vec3 _68 = aVertex.xyz - Light(UBO[_96 * 2 + 4].xyz, UBO[_96 * 2 + 4].w, UBO[_96 * 2 + 5]).Position;
vColor += (((UBO[_96 * 2 + 5]) * clamp(1.0 - (length(_68) / Light(UBO[_96 * 2 + 4].xyz, UBO[_96 * 2 + 4].w, UBO[_96 * 2 + 5]).Radius), 0.0, 1.0)) * dot(aNormal, normalize(_68)));
vColor += ((UBO[_96 * 2 + 5] * clamp(1.0 - (length(_68) / Light(UBO[_96 * 2 + 4].xyz, UBO[_96 * 2 + 4].w, UBO[_96 * 2 + 5]).Radius), 0.0, 1.0)) * dot(aNormal, normalize(_68)));
_96++;
continue;
}

View File

@ -18,8 +18,8 @@ void main()
vColor = vec4(0.0);
for (int _82 = 0; _82 < 4; )
{
vec3 _54 = aVertex.xyz - (UBO[_82 * 2 + 4].xyz);
vColor += (((UBO[_82 * 2 + 5]) * clamp(1.0 - (length(_54) / (UBO[_82 * 2 + 4].w)), 0.0, 1.0)) * dot(aNormal, normalize(_54)));
vec3 _54 = aVertex.xyz - UBO[_82 * 2 + 4].xyz;
vColor += ((UBO[_82 * 2 + 5] * clamp(1.0 - (length(_54) / UBO[_82 * 2 + 4].w), 0.0, 1.0)) * dot(aNormal, normalize(_54)));
_82++;
continue;
}

View File

@ -25,6 +25,6 @@ void main()
}
}
}
FragColor = ((values3[1 * 3 * 1 + 2 * 1 + 0]) + (values3[0 * 3 * 1 + 2 * 1 + 0])) + (values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex]);
FragColor = (values3[1 * 3 * 1 + 2 * 1 + 0] + values3[0 * 3 * 1 + 2 * 1 + 0]) + values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex];
}

View File

@ -2,15 +2,16 @@
precision mediump float;
precision highp int;
const float _17[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0);
layout(location = 0) out vec4 FragColor;
void main()
{
float lut[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0);
for (int _46 = 0; _46 < 4; )
{
mediump int _33 = _46 + 1;
FragColor += vec4(lut[_33]);
FragColor += vec4(_17[_33]);
_46 = _33;
continue;
}

View File

@ -2,6 +2,9 @@
precision mediump float;
precision highp int;
const vec4 _37[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0));
const vec4 _55[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0)));
struct Foobar
{
float a;
@ -13,9 +16,7 @@ layout(location = 0) flat in mediump int index;
void main()
{
highp vec4 indexable[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0));
highp vec4 indexable_1[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0)));
Foobar indexable_2[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0));
FragColor = ((indexable[index] + (indexable_1[index][index + 1])) + vec4(30.0)) + vec4(indexable_2[index].a + indexable_2[index].b);
Foobar indexable[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0));
FragColor = ((_37[index] + _55[index][index + 1]) + vec4(30.0)) + vec4(indexable[index].a + indexable[index].b);
}

View File

@ -18,6 +18,6 @@ void main()
lut = float[](1.0, 4.0, 3.0, 2.0);
foos = Foo[](Foo(10.0, 20.0), Foo(30.0, 40.0));
FragColor = vec4(lut[line]);
FragColor += vec4(foos[line].a * (foos[1 - line].a));
FragColor += vec4(foos[line].a * foos[1 - line].a);
}

View File

@ -0,0 +1,42 @@
#version 310 es
precision mediump float;
precision highp int;
const float _16[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0);
const vec4 _60[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0));
layout(location = 0) out float FragColor;
layout(location = 0) flat in mediump int index;
void main()
{
FragColor = _16[index];
if (index < 10)
{
FragColor += _16[index ^ 1];
}
else
{
FragColor += _16[index & 1];
}
bool _63 = index > 30;
if (_63)
{
FragColor += _60[index & 3].y;
}
else
{
FragColor += _60[index & 1].x;
}
vec4 foobar[4] = _60;
if (_63)
{
foobar[1].z = 20.0;
}
mediump int _91 = index & 3;
FragColor += foobar[_91].z;
vec4 baz[4] = _60;
baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0));
FragColor += baz[_91].z;
}

View File

@ -0,0 +1,9 @@
#version 450
layout(location = 0) out float FragColor;
void main()
{
FragColor = float((10u > 20u) ? 30u : 50u);
}

View File

@ -0,0 +1,13 @@
#version 450
layout(constant_id = 0) const uint s = 10u;
const bool _13 = (s > 20u);
const uint _16 = _13 ? 30u : 50u;
layout(location = 0) out float FragColor;
void main()
{
FragColor = float(_16);
}

View File

@ -0,0 +1,41 @@
RWByteAddressBuffer bar : register(u0);
RWByteAddressBuffer foo : register(u1);
void _main()
{
[unroll]
for (int i = 0; i < 16; i++)
{
bar.Store4(i * 16 + 0, asuint(asfloat(foo.Load4(i * 16 + 0))));
}
[loop]
for (int i_1 = 0; i_1 < 16; i_1++)
{
bar.Store4((15 - i_1) * 16 + 0, asuint(asfloat(foo.Load4(i_1 * 16 + 0))));
}
float v = asfloat(bar.Load(160));
float w = asfloat(foo.Load(160));
[branch]
if (v > 10.0f)
{
foo.Store4(320, asuint(5.0f.xxxx));
}
float value = 20.0f;
[flatten]
if (w > 40.0f)
{
value = 20.0f;
}
foo.Store4(320, asuint(value.xxxx));
}
void comp_main()
{
_main();
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -0,0 +1,55 @@
static const float _46[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
static const float4 _76[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
static const float4 _90[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
static float FragColor;
static int index;
struct SPIRV_Cross_Input
{
nointerpolation int index : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
float4 foobar[4] = _76;
float4 baz[4] = _76;
FragColor = _46[index];
if (index < 10)
{
FragColor += _46[index ^ 1];
}
else
{
FragColor += _46[index & 1];
}
if (index > 30)
{
FragColor += _76[index & 3].y;
}
else
{
FragColor += _76[index & 1].x;
}
if (index > 30)
{
foobar[1].z = 20.0f;
}
FragColor += foobar[index & 3].z;
baz = _90;
FragColor += baz[index & 3].z;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
index = stage_input.index;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,41 @@
Texture2D<float4> uShadow : register(t0);
SamplerComparisonState _uShadow_sampler : register(s0);
Texture2D<float4> uTexture : register(t1);
SamplerComparisonState uSampler : register(s2);
static float3 vUV;
static float FragColor;
struct SPIRV_Cross_Input
{
float3 vUV : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
float sample_combined()
{
return uShadow.SampleCmp(_uShadow_sampler, vUV.xy, vUV.z);
}
float sample_separate()
{
return uTexture.SampleCmp(uSampler, vUV.xy, vUV.z);
}
void frag_main()
{
FragColor = sample_combined() + sample_separate();
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
vUV = stage_input.vUV;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,37 @@
static float4 gl_Position;
static int gl_VertexIndex;
static int gl_InstanceIndex;
struct SPIRV_Cross_Input
{
uint gl_VertexIndex : SV_VertexID;
uint gl_InstanceIndex : SV_InstanceID;
};
struct SPIRV_Cross_Output
{
float4 gl_Position : SV_Position;
};
float4 _main(uint vid, uint iid)
{
return float(vid + iid).xxxx;
}
void vert_main()
{
uint vid = uint(gl_VertexIndex);
uint iid = uint(gl_InstanceIndex);
uint param = vid;
uint param_1 = iid;
gl_Position = _main(param, param_1);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
gl_VertexIndex = int(stage_input.gl_VertexIndex);
gl_InstanceIndex = int(stage_input.gl_InstanceIndex);
vert_main();
SPIRV_Cross_Output stage_output;
stage_output.gl_Position = gl_Position;
return stage_output;
}

View File

@ -0,0 +1,18 @@
globallycoherent RWByteAddressBuffer _29 : register(u3);
ByteAddressBuffer _33 : register(t2);
RWTexture2D<float> uImageIn : register(u0);
globallycoherent RWTexture2D<float> uImageOut : register(u1);
void comp_main()
{
int2 coord = int2(9, 7);
float4 indata = uImageIn[coord].xxxx;
uImageOut[coord] = indata.x;
_29.Store(0, asuint(asfloat(_33.Load(0))));
}
[numthreads(1, 1, 1)]
void main()
{
comp_main();
}

View File

@ -15,8 +15,7 @@ struct SPIRV_Cross_Output
void frag_main()
{
float lut[5] = _17;
for (int i = 0; i < 4; i++, FragColor += lut[i].xxxx)
for (int i = 0; i < 4; i++, FragColor += _17[i].xxxx)
{
}
}

View File

@ -30,7 +30,7 @@ void frag_main()
lut = _16;
foos = _28;
FragColor = lut[_line].xxxx;
FragColor += (foos[_line].a * (foos[1 - _line].a)).xxxx;
FragColor += (foos[_line].a * foos[1 - _line].a).xxxx;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)

View File

@ -0,0 +1,55 @@
static const float _16[16] = { 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f, 1.0f, 2.0f, 3.0f, 4.0f };
static const float4 _60[4] = { 0.0f.xxxx, 1.0f.xxxx, 8.0f.xxxx, 5.0f.xxxx };
static const float4 _104[4] = { 20.0f.xxxx, 30.0f.xxxx, 50.0f.xxxx, 60.0f.xxxx };
static float FragColor;
static int index;
struct SPIRV_Cross_Input
{
nointerpolation int index : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = _16[index];
if (index < 10)
{
FragColor += _16[index ^ 1];
}
else
{
FragColor += _16[index & 1];
}
if (index > 30)
{
FragColor += _60[index & 3].y;
}
else
{
FragColor += _60[index & 1].x;
}
float4 foobar[4] = _60;
if (index > 30)
{
foobar[1].z = 20.0f;
}
FragColor += foobar[index & 3].z;
float4 baz[4] = _60;
baz = _104;
FragColor += baz[index & 3].z;
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
index = stage_input.index;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -0,0 +1,23 @@
static const uint s = 10u;
static const bool _13 = (s > 20u);
static const uint _16 = _13 ? 30u : 50u;
static float FragColor;
struct SPIRV_Cross_Output
{
float FragColor : SV_Target0;
};
void frag_main()
{
FragColor = float(_16);
}
SPIRV_Cross_Output main()
{
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.FragColor = FragColor;
return stage_output;
}

View File

@ -36,6 +36,12 @@ struct main0_out
float4 gl_Position [[position]];
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
attr_desc fetch_desc(thread const int& location, constant VertexBuffer& v_227)
{
int attribute_flags = v_227.input_attributes[location].w;
@ -76,10 +82,10 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr
{
int _131 = first_byte;
first_byte = _131 + 1;
tmp.x = input_stream.read(uint2(_131, 0)).x;
tmp.x = input_stream.read(spvTexelBufferCoord(_131)).x;
int _138 = first_byte;
first_byte = _138 + 1;
tmp.y = input_stream.read(uint2(_138, 0)).x;
tmp.y = input_stream.read(spvTexelBufferCoord(_138)).x;
uint4 param = tmp;
int param_1 = desc.swap_bytes;
result[n] = float(get_bits(param, param_1));
@ -89,16 +95,16 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr
{
int _156 = first_byte;
first_byte = _156 + 1;
tmp.x = input_stream.read(uint2(_156, 0)).x;
tmp.x = input_stream.read(spvTexelBufferCoord(_156)).x;
int _163 = first_byte;
first_byte = _163 + 1;
tmp.y = input_stream.read(uint2(_163, 0)).x;
tmp.y = input_stream.read(spvTexelBufferCoord(_163)).x;
int _170 = first_byte;
first_byte = _170 + 1;
tmp.z = input_stream.read(uint2(_170, 0)).x;
tmp.z = input_stream.read(spvTexelBufferCoord(_170)).x;
int _177 = first_byte;
first_byte = _177 + 1;
tmp.w = input_stream.read(uint2(_177, 0)).x;
tmp.w = input_stream.read(spvTexelBufferCoord(_177)).x;
uint4 param_2 = tmp;
int param_3 = desc.swap_bytes;
result[n] = as_type<float>(get_bits(param_2, param_3));
@ -108,7 +114,7 @@ float4 fetch_attr(thread const attr_desc& desc, thread const int& vertex_id, thr
{
int _195 = first_byte;
first_byte = _195 + 1;
result[n] = float(input_stream.read(uint2(_195, 0)).x);
result[n] = float(input_stream.read(spvTexelBufferCoord(_195)).x);
reverse_order = desc.swap_bytes != 0;
break;
}

View File

@ -0,0 +1,67 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant float _46[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0};
constant float4 _76[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
constant float4 _90[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)};
struct main0_out
{
float FragColor [[color(0)]];
};
struct main0_in
{
int index [[user(locn0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0(main0_in in [[stage_in]])
{
float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
main0_out out = {};
out.FragColor = _46[in.index];
if (in.index < 10)
{
out.FragColor += _46[in.index ^ 1];
}
else
{
out.FragColor += _46[in.index & 1];
}
if (in.index > 30)
{
out.FragColor += _76[in.index & 3].y;
}
else
{
out.FragColor += _76[in.index & 1].x;
}
if (in.index > 30)
{
foobar[1].z = 20.0;
}
out.FragColor += foobar[in.index & 3].z;
spvArrayCopyConstant(baz, _90);
out.FragColor += baz[in.index & 3].z;
return out;
}

View File

@ -1,5 +1,3 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
@ -18,20 +16,6 @@ struct main0_out
float FragColor [[color(0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0()
{
main0_out out = {};
@ -39,7 +23,6 @@ fragment main0_out main0()
float4 b = float4(0.0);
float2x3 c = float2x3(float3(0.0), float3(0.0));
D d = {float4(0.0), 0.0};
float4 e[4] = {float4(0.0), float4(0.0), float4(0.0), float4(0.0)};
out.FragColor = a;
return out;
}

View File

@ -0,0 +1,34 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float FragColor [[color(0)]];
};
struct main0_in
{
float3 vUV [[user(locn0)]];
};
float sample_combined(thread float3& vUV, thread depth2d<float> uShadow, thread const sampler uShadowSmplr)
{
return uShadow.sample_compare(uShadowSmplr, vUV.xy, vUV.z);
}
float sample_separate(thread float3& vUV, thread depth2d<float> uTexture, thread sampler uSampler)
{
return uTexture.sample_compare(uSampler, vUV.xy, vUV.z);
}
fragment main0_out main0(main0_in in [[stage_in]], depth2d<float> uShadow [[texture(0)]], depth2d<float> uTexture [[texture(1)]], sampler uShadowSmplr [[sampler(0)]], sampler uSampler [[sampler(2)]])
{
main0_out out = {};
out.FragColor = sample_combined(in.vUV, uShadow, uShadowSmplr) + sample_separate(in.vUV, uTexture, uSampler);
return out;
}

View File

@ -0,0 +1,28 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 gl_Position [[position]];
};
float4 _main(thread const uint& vid, thread const uint& iid)
{
return float4(float(vid + iid));
}
vertex main0_out main0(uint gl_VertexIndex [[vertex_id]], uint gl_InstanceIndex [[instance_id]])
{
main0_out out = {};
uint vid = gl_VertexIndex;
uint iid = gl_InstanceIndex;
uint param = vid;
uint param_1 = iid;
out.gl_Position = _main(param, param_1);
return out;
}

View File

@ -42,8 +42,7 @@ kernel void main0(device SSBO0& _16 [[buffer(0)]], device SSBO1& _32 [[buffer(1)
float4 _37[2] = { _16.as[gl_GlobalInvocationID.x], _32.bs[gl_GlobalInvocationID.x] };
float4 values[2];
spvArrayCopy(values, _37);
float4 copy_values[2] = {float4(20.0), float4(40.0)};
Composite c = Composite{ values[0], copy_values[1] };
Composite c = Composite{ values[0], _43[1] };
_16.as[0] = values[gl_LocalInvocationIndex];
_32.bs[1] = c.b;
}

View File

@ -1,5 +1,3 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
@ -12,25 +10,10 @@ struct main0_out
float4 FragColor [[color(0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0()
{
main0_out out = {};
float lut[5] = {1.0, 2.0, 3.0, 4.0, 5.0};
for (int i = 0; i < 4; i++, out.FragColor += float4(lut[i]))
for (int i = 0; i < 4; i++, out.FragColor += float4(_17[i]))
{
}
return out;

View File

@ -49,12 +49,10 @@ float4 resolve(thread const Foobar& f)
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
float4 indexable[3] = {float4(1.0), float4(2.0), float4(3.0)};
float4 indexable_1[2][2] = {{float4(1.0), float4(2.0)}, {float4(8.0), float4(10.0)}};
Foobar param = {10.0, 20.0};
Foobar indexable_2[2] = {{10.0, 40.0}, {90.0, 70.0}};
Foobar param_1 = indexable_2[in.index];
out.FragColor = ((indexable[in.index] + (indexable_1[in.index][in.index + 1])) + resolve(param)) + resolve(param_1);
Foobar indexable[2] = {{10.0, 40.0}, {90.0, 70.0}};
Foobar param_1 = indexable[in.index];
out.FragColor = ((_37[in.index] + _55[in.index][in.index + 1]) + resolve(param)) + resolve(param_1);
return out;
}

View File

@ -44,7 +44,7 @@ fragment main0_out main0(main0_in in [[stage_in]])
float lut[4] = {1.0, 4.0, 3.0, 2.0};
Foo foos[2] = {{10.0, 20.0}, {30.0, 40.0}};
out.FragColor = float4(lut[in.line]);
out.FragColor += float4(foos[in.line].a * (foos[1 - in.line].a));
out.FragColor += float4(foos[in.line].a * foos[1 - in.line].a);
return out;
}

View File

@ -0,0 +1,67 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant float _16[16] = {1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0};
constant float4 _60[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
constant float4 _104[4] = {float4(20.0), float4(30.0), float4(50.0), float4(60.0)};
struct main0_out
{
float FragColor [[color(0)]];
};
struct main0_in
{
int index [[user(locn0)]];
};
// Implementation of an array copy function to cover GLSL's ability to copy an array via assignment.
template<typename T, uint N>
void spvArrayCopy(thread T (&dst)[N], thread const T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
// An overload for constant arrays.
template<typename T, uint N>
void spvArrayCopyConstant(thread T (&dst)[N], constant T (&src)[N])
{
for (uint i = 0; i < N; dst[i] = src[i], i++);
}
fragment main0_out main0(main0_in in [[stage_in]])
{
main0_out out = {};
out.FragColor = _16[in.index];
if (in.index < 10)
{
out.FragColor += _16[in.index ^ 1];
}
else
{
out.FragColor += _16[in.index & 1];
}
if (in.index > 30)
{
out.FragColor += _60[in.index & 3].y;
}
else
{
out.FragColor += _60[in.index & 1].x;
}
float4 foobar[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
if (in.index > 30)
{
foobar[1].z = 20.0;
}
out.FragColor += foobar[in.index & 3].z;
float4 baz[4] = {float4(0.0), float4(1.0), float4(8.0), float4(5.0)};
spvArrayCopyConstant(baz, _104);
out.FragColor += baz[in.index & 3].z;
return out;
}

View File

@ -0,0 +1,22 @@
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
constant uint s_tmp [[function_constant(0)]];
constant uint s = is_function_constant_defined(s_tmp) ? s_tmp : 10u;
constant bool _13 = (s > 20u);
constant uint _16 = _13 ? 30u : 50u;
struct main0_out
{
float FragColor [[color(0)]];
};
fragment main0_out main0()
{
main0_out out = {};
out.FragColor = float(_16);
return out;
}

View File

@ -0,0 +1,26 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct main0_out
{
float4 gl_Position [[position]];
float gl_PointSize [[point_size]];
};
void write_outblock(thread float4& gl_Position, thread float& gl_PointSize)
{
gl_PointSize = 1.0;
gl_Position = float4(gl_PointSize);
}
vertex main0_out main0()
{
main0_out out = {};
write_outblock(out.gl_Position, out.gl_PointSize);
return out;
}

View File

@ -1,3 +1,5 @@
#pragma clang diagnostic ignored "-Wmissing-prototypes"
#include <metal_stdlib>
#include <simd/simd.h>
@ -8,10 +10,16 @@ struct main0_out
float4 gl_Position [[position]];
};
// Returns 2D texture coords corresponding to 1D texel buffer coords
uint2 spvTexelBufferCoord(uint tc)
{
return uint2(tc % 4096, tc / 4096);
}
vertex main0_out main0(texture2d<float> uSamp [[texture(4)]], texture2d<float> uSampo [[texture(5)]])
{
main0_out out = {};
out.gl_Position = uSamp.read(uint2(10, 0)) + uSampo.read(uint2(100, 0));
out.gl_Position = uSamp.read(spvTexelBufferCoord(10)) + uSampo.read(spvTexelBufferCoord(100));
return out;
}

View File

@ -0,0 +1,49 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "vert"
},
{
"name" : "main2",
"mode" : "vert"
},
{
"name" : "main",
"mode" : "frag"
},
{
"name" : "main2",
"mode" : "frag"
}
],
"types" : {
"_8" : {
"name" : "_8",
"members" : [
{
"name" : "_m0",
"type" : "vec4"
},
{
"name" : "_m1",
"type" : "float"
},
{
"name" : "_m2",
"type" : "float",
"array" : [
1
]
},
{
"name" : "_m3",
"type" : "float",
"array" : [
1
]
}
]
}
}
}

View File

@ -0,0 +1,64 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "comp"
}
],
"types" : {
"_19" : {
"name" : "Foo",
"members" : [
{
"name" : "m",
"type" : "mat4",
"offset" : 0
}
]
},
"_21" : {
"name" : "SSBO2",
"members" : [
{
"name" : "out_data",
"type" : "_19",
"array" : [
0
],
"offset" : 0
}
]
},
"_28" : {
"name" : "SSBO",
"members" : [
{
"name" : "in_data",
"type" : "_19",
"array" : [
0
],
"offset" : 0
}
]
}
},
"ssbos" : [
{
"type" : "_21",
"name" : "SSBO2",
"writeonly" : true,
"block_size" : 0,
"set" : 0,
"binding" : 1
},
{
"type" : "_28",
"name" : "SSBO",
"readonly" : true,
"block_size" : 0,
"set" : 0,
"binding" : 0
}
]
}

View File

@ -0,0 +1,474 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "comp"
}
],
"types" : {
"_11" : {
"name" : "S0",
"members" : [
{
"name" : "a",
"type" : "vec2",
"array" : [
1
],
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 8
}
]
},
"_14" : {
"name" : "S1",
"members" : [
{
"name" : "a",
"type" : "vec3",
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 12
}
]
},
"_17" : {
"name" : "S2",
"members" : [
{
"name" : "a",
"type" : "vec3",
"array" : [
1
],
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 16
}
]
},
"_19" : {
"name" : "S3",
"members" : [
{
"name" : "a",
"type" : "vec2",
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 8
}
]
},
"_20" : {
"name" : "S4",
"members" : [
{
"name" : "c",
"type" : "vec2",
"offset" : 0
}
]
},
"_23" : {
"name" : "Content",
"members" : [
{
"name" : "m0s",
"type" : "_11",
"array" : [
1
],
"offset" : 0
},
{
"name" : "m1s",
"type" : "_14",
"array" : [
1
],
"offset" : 16
},
{
"name" : "m2s",
"type" : "_17",
"array" : [
1
],
"offset" : 32
},
{
"name" : "m0",
"type" : "_11",
"offset" : 64
},
{
"name" : "m1",
"type" : "_14",
"offset" : 80
},
{
"name" : "m2",
"type" : "_17",
"offset" : 96
},
{
"name" : "m3",
"type" : "_19",
"offset" : 128
},
{
"name" : "m4",
"type" : "float",
"offset" : 144
},
{
"name" : "m3s",
"type" : "_20",
"array" : [
8
],
"offset" : 152
}
]
},
"_36" : {
"name" : "SSBO1",
"members" : [
{
"name" : "content",
"type" : "_23",
"offset" : 0
},
{
"name" : "content1",
"type" : "_23",
"array" : [
2
],
"offset" : 224
},
{
"name" : "content2",
"type" : "_23",
"offset" : 672
},
{
"name" : "m0",
"type" : "mat2",
"offset" : 896
},
{
"name" : "m1",
"type" : "mat2",
"offset" : 912
},
{
"name" : "m2",
"type" : "mat2x3",
"array" : [
4
],
"offset" : 928
},
{
"name" : "m3",
"type" : "mat3x2",
"offset" : 1056
},
{
"name" : "m4",
"type" : "mat2",
"row_major" : true,
"offset" : 1080
},
{
"name" : "m5",
"type" : "mat2",
"row_major" : true,
"array" : [
9
],
"offset" : 1096
},
{
"name" : "m6",
"type" : "mat2x3",
"row_major" : true,
"array" : [
2,
4
],
"offset" : 1240
},
{
"name" : "m7",
"type" : "mat3x2",
"row_major" : true,
"offset" : 1440
},
{
"name" : "array",
"type" : "float",
"array" : [
0
],
"offset" : 1472
}
]
},
"_42" : {
"name" : "S0",
"members" : [
{
"name" : "a",
"type" : "vec2",
"array" : [
1
],
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 16
}
]
},
"_44" : {
"name" : "S1",
"members" : [
{
"name" : "a",
"type" : "vec3",
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 12
}
]
},
"_47" : {
"name" : "S2",
"members" : [
{
"name" : "a",
"type" : "vec3",
"array" : [
1
],
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 16
}
]
},
"_49" : {
"name" : "S3",
"members" : [
{
"name" : "a",
"type" : "vec2",
"offset" : 0
},
{
"name" : "b",
"type" : "float",
"offset" : 8
}
]
},
"_50" : {
"name" : "S4",
"members" : [
{
"name" : "c",
"type" : "vec2",
"offset" : 0
}
]
},
"_52" : {
"name" : "Content",
"members" : [
{
"name" : "m0s",
"type" : "_42",
"array" : [
1
],
"offset" : 0
},
{
"name" : "m1s",
"type" : "_44",
"array" : [
1
],
"offset" : 32
},
{
"name" : "m2s",
"type" : "_47",
"array" : [
1
],
"offset" : 48
},
{
"name" : "m0",
"type" : "_42",
"offset" : 80
},
{
"name" : "m1",
"type" : "_44",
"offset" : 112
},
{
"name" : "m2",
"type" : "_47",
"offset" : 128
},
{
"name" : "m3",
"type" : "_49",
"offset" : 160
},
{
"name" : "m4",
"type" : "float",
"offset" : 176
},
{
"name" : "m3s",
"type" : "_50",
"array" : [
8
],
"offset" : 192
}
]
},
"_59" : {
"name" : "SSBO0",
"members" : [
{
"name" : "content",
"type" : "_52",
"offset" : 0
},
{
"name" : "content1",
"type" : "_52",
"array" : [
2
],
"offset" : 320
},
{
"name" : "content2",
"type" : "_52",
"offset" : 960
},
{
"name" : "m0",
"type" : "mat2",
"offset" : 1280
},
{
"name" : "m1",
"type" : "mat2",
"offset" : 1312
},
{
"name" : "m2",
"type" : "mat2x3",
"array" : [
4
],
"offset" : 1344
},
{
"name" : "m3",
"type" : "mat3x2",
"offset" : 1472
},
{
"name" : "m4",
"type" : "mat2",
"row_major" : true,
"offset" : 1520
},
{
"name" : "m5",
"type" : "mat2",
"row_major" : true,
"array" : [
9
],
"offset" : 1552
},
{
"name" : "m6",
"type" : "mat2x3",
"row_major" : true,
"array" : [
2,
4
],
"offset" : 1840
},
{
"name" : "m7",
"type" : "mat3x2",
"row_major" : true,
"offset" : 2224
},
{
"name" : "array",
"type" : "float",
"array" : [
0
],
"offset" : 2256
}
]
}
},
"ssbos" : [
{
"type" : "_36",
"name" : "SSBO1",
"restrict" : true,
"block_size" : 1472,
"set" : 0,
"binding" : 1
},
{
"type" : "_59",
"name" : "SSBO0",
"restrict" : true,
"block_size" : 2256,
"set" : 0,
"binding" : 0
}
]
}

View File

@ -0,0 +1,37 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"outputs" : [
{
"type" : "float",
"name" : "FragColor",
"location" : 0
}
],
"separate_images" : [
{
"type" : "texture2D",
"name" : "uDepth",
"set" : 0,
"binding" : 2
}
],
"separate_samplers" : [
{
"type" : "sampler",
"name" : "uSampler",
"set" : 0,
"binding" : 0
},
{
"type" : "sampler",
"name" : "uSampler1",
"set" : 0,
"binding" : 1
}
]
}

View File

@ -0,0 +1,50 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"inputs" : [
{
"type" : "vec2",
"name" : "vTex",
"location" : 0
}
],
"outputs" : [
{
"type" : "vec4",
"name" : "FragColor",
"location" : 0
}
],
"separate_images" : [
{
"type" : "texture2D",
"name" : "uTexture0",
"set" : 0,
"binding" : 2
},
{
"type" : "texture2D",
"name" : "uTexture1",
"set" : 0,
"binding" : 3
}
],
"separate_samplers" : [
{
"type" : "sampler",
"name" : "uSampler0",
"set" : 0,
"binding" : 0
},
{
"type" : "sampler",
"name" : "uSampler1",
"set" : 0,
"binding" : 1
}
]
}

View File

@ -0,0 +1,47 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"outputs" : [
{
"type" : "vec4",
"name" : "_entryPointOutput",
"location" : 0
}
],
"textures" : [
{
"type" : "sampler2D",
"name" : "ROIm",
"set" : 0,
"binding" : 1
}
],
"separate_images" : [
{
"type" : "samplerBuffer",
"name" : "ROBuf",
"set" : 0,
"binding" : 0
}
],
"images" : [
{
"type" : "image2D",
"name" : "RWIm",
"set" : 0,
"binding" : 1,
"format" : "rgba32f"
},
{
"type" : "imageBuffer",
"name" : "RWBuf",
"set" : 0,
"binding" : 0,
"format" : "rgba32f"
}
]
}

View File

@ -0,0 +1,31 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"subpass_inputs" : [
{
"type" : "subpassInputMS",
"name" : "uSubpass0",
"set" : 0,
"binding" : 0,
"input_attachment_index" : 0
},
{
"type" : "subpassInputMS",
"name" : "uSubpass1",
"set" : 0,
"binding" : 1,
"input_attachment_index" : 1
}
],
"outputs" : [
{
"type" : "vec4",
"name" : "FragColor",
"location" : 0
}
]
}

View File

@ -0,0 +1,31 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"subpass_inputs" : [
{
"type" : "subpassInput",
"name" : "uSubpass0",
"set" : 0,
"binding" : 0,
"input_attachment_index" : 0
},
{
"type" : "subpassInput",
"name" : "uSubpass1",
"set" : 0,
"binding" : 1,
"input_attachment_index" : 1
}
],
"outputs" : [
{
"type" : "vec4",
"name" : "FragColor",
"location" : 0
}
]
}

View File

@ -0,0 +1,46 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"types" : {
"_13" : {
"name" : "PushConstants",
"members" : [
{
"name" : "value0",
"type" : "vec4",
"offset" : 0
},
{
"name" : "value1",
"type" : "vec4",
"offset" : 16
}
]
}
},
"inputs" : [
{
"type" : "vec4",
"name" : "vColor",
"location" : 0
}
],
"outputs" : [
{
"type" : "vec4",
"name" : "FragColor",
"location" : 0
}
],
"push_constants" : [
{
"type" : "_13",
"name" : "push",
"push_constant" : true
}
]
}

View File

@ -0,0 +1,73 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"inputs" : [
{
"type" : "vec2",
"name" : "vTex",
"location" : 0
},
{
"type" : "vec3",
"name" : "vTex3",
"location" : 1
}
],
"outputs" : [
{
"type" : "vec4",
"name" : "FragColor",
"location" : 0
}
],
"separate_images" : [
{
"type" : "texture2D",
"name" : "uTexture",
"array" : [
4
],
"set" : 0,
"binding" : 1
},
{
"type" : "texture2DArray",
"name" : "uTextureArray",
"array" : [
4
],
"set" : 0,
"binding" : 4
},
{
"type" : "textureCube",
"name" : "uTextureCube",
"array" : [
4
],
"set" : 0,
"binding" : 3
},
{
"type" : "texture3D",
"name" : "uTexture3D",
"array" : [
4
],
"set" : 0,
"binding" : 2
}
],
"separate_samplers" : [
{
"type" : "sampler",
"name" : "uSampler",
"set" : 0,
"binding" : 0
}
]
}

View File

@ -0,0 +1,71 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "frag"
}
],
"types" : {
"_137" : {
"name" : "Foo",
"members" : [
{
"name" : "elems",
"type" : "float",
"array" : [
135
]
}
]
}
},
"outputs" : [
{
"type" : "vec4",
"name" : "FragColor",
"location" : 0
}
],
"specialization_constants" : [
{
"id" : 1,
"type" : "float",
"default_value" : 1.5
},
{
"id" : 2,
"type" : "float",
"default_value" : 2.5
},
{
"id" : 3,
"type" : "int",
"default_value" : 3
},
{
"id" : 4,
"type" : "int",
"default_value" : 4
},
{
"id" : 5,
"type" : "uint",
"default_value" : 5
},
{
"id" : 6,
"type" : "uint",
"default_value" : 6
},
{
"id" : 7,
"type" : "bool",
"default_value" : false
},
{
"id" : 8,
"type" : "bool",
"default_value" : true
}
]
}

View File

@ -0,0 +1,61 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "vert"
}
],
"types" : {
"_89" : {
"name" : "gl_PerVertex",
"members" : [
{
"name" : "gl_Position",
"type" : "vec4"
},
{
"name" : "gl_PointSize",
"type" : "float"
}
]
},
"_102" : {
"name" : "Block",
"members" : [
{
"name" : "var",
"type" : "mat2x3",
"row_major" : true,
"array" : [
4,
3
],
"offset" : 0
}
]
}
},
"inputs" : [
{
"type" : "vec4",
"name" : "a_position",
"location" : 0
}
],
"outputs" : [
{
"type" : "float",
"name" : "v_vtxResult",
"location" : 0
}
],
"ubos" : [
{
"type" : "_102",
"name" : "Block",
"block_size" : 576,
"set" : 0,
"binding" : 0
}
]
}

View File

@ -0,0 +1,40 @@
{
"entryPoints" : [
{
"name" : "main",
"mode" : "vert"
}
],
"types" : {
"_8" : {
"name" : "gl_PerVertex",
"members" : [
{
"name" : "gl_Position",
"type" : "vec4"
},
{
"name" : "gl_PointSize",
"type" : "float"
}
]
}
},
"textures" : [
{
"type" : "samplerBuffer",
"name" : "uSamp",
"set" : 0,
"binding" : 4
}
],
"images" : [
{
"type" : "imageBuffer",
"name" : "uSampo",
"set" : 0,
"binding" : 5,
"format" : "rgba32f"
}
]
}

View File

@ -0,0 +1,40 @@
#version 310 es
precision mediump float;
precision highp int;
const float _46[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0);
const vec4 _76[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0));
layout(location = 0) out float FragColor;
layout(location = 0) flat in mediump int index;
void main()
{
vec4 foobar[4] = _76;
vec4 baz[4] = _76;
FragColor = _46[index];
if (index < 10)
{
FragColor += _46[index ^ 1];
}
else
{
FragColor += _46[index & 1];
}
if (index > 30)
{
FragColor += _76[index & 3].y;
}
else
{
FragColor += _76[index & 1].x;
}
if (index > 30)
{
foobar[1].z = 20.0;
}
FragColor += foobar[index & 3].z;
baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0));
FragColor += baz[index & 3].z;
}

View File

@ -2,6 +2,8 @@
precision mediump float;
precision highp int;
const vec4 _14[4] = vec4[](vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0));
struct D
{
vec4 a;
@ -16,7 +18,6 @@ void main()
vec4 b = vec4(0.0);
mat2x3 c = mat2x3(vec3(0.0), vec3(0.0));
D d = D(vec4(0.0), 0.0);
vec4 e[4] = vec4[](vec4(0.0), vec4(0.0), vec4(0.0), vec4(0.0));
FragColor = a;
}

View File

@ -0,0 +1,33 @@
#version 310 es
precision mediump float;
precision highp int;
layout(location = 0) flat in mediump int vIndex;
layout(location = 0) out float FragColor;
void main()
{
highp float _19;
switch (vIndex)
{
case 0:
case 2:
{
_19 = 1.0;
break;
}
case 1:
default:
{
_19 = 3.0;
break;
}
case 8:
{
_19 = 8.0;
break;
}
}
FragColor = _19;
}

View File

@ -0,0 +1,23 @@
#version 450
layout(binding = 0) uniform sampler2DShadow uShadow;
uniform sampler2DShadow SPIRV_Cross_CombineduTextureuSampler;
layout(location = 0) in vec3 vUV;
layout(location = 0) out float FragColor;
float sample_combined()
{
return texture(uShadow, vec3(vUV.xy, vUV.z));
}
float sample_separate()
{
return texture(SPIRV_Cross_CombineduTextureuSampler, vec3(vUV.xy, vUV.z));
}
void main()
{
FragColor = sample_combined() + sample_separate();
}

View File

@ -0,0 +1,24 @@
#version 450
layout(set = 0, binding = 0) uniform sampler2DShadow uShadow;
layout(set = 0, binding = 1) uniform texture2D uTexture;
layout(set = 0, binding = 2) uniform samplerShadow uSampler;
layout(location = 0) in vec3 vUV;
layout(location = 0) out float FragColor;
float sample_combined()
{
return texture(uShadow, vec3(vUV.xy, vUV.z));
}
float sample_separate()
{
return texture(sampler2DShadow(uTexture, uSampler), vec3(vUV.xy, vUV.z));
}
void main()
{
FragColor = sample_combined() + sample_separate();
}

View File

@ -0,0 +1,41 @@
#version 450
layout(triangles) in;
layout(max_vertices = 3, triangle_strip) out;
struct VertexOutput
{
vec4 pos;
};
struct GeometryOutput
{
vec4 pos;
uint layer;
};
void _main(VertexOutput _input[3], GeometryOutput stream)
{
GeometryOutput _output;
_output.layer = 1u;
for (int v = 0; v < 3; v++)
{
_output.pos = _input[v].pos;
gl_Position = _output.pos;
gl_Layer = int(_output.layer);
EmitVertex();
}
EndPrimitive();
}
void main()
{
VertexOutput _input[3];
_input[0].pos = gl_in[0].gl_Position;
_input[1].pos = gl_in[1].gl_Position;
_input[2].pos = gl_in[2].gl_Position;
VertexOutput param[3] = _input;
GeometryOutput param_1;
_main(param, param_1);
GeometryOutput stream = param_1;
}

View File

@ -0,0 +1,18 @@
#version 450
uniform int SPIRV_Cross_BaseInstance;
vec4 _main(uint vid, uint iid)
{
return vec4(float(vid + iid));
}
void main()
{
uint vid = uint(gl_VertexID);
uint iid = uint((gl_InstanceID + SPIRV_Cross_BaseInstance));
uint param = vid;
uint param_1 = iid;
gl_Position = _main(param, param_1);
}

View File

@ -1,6 +1,9 @@
#version 310 es
layout(local_size_x = 1, local_size_y = 1, local_size_z = 1) in;
const vec4 _66[2] = vec4[](vec4(10.0), vec4(30.0));
const float _94[2][3] = float[][](float[](1.0, 1.0, 1.0), float[](2.0, 2.0, 2.0));
struct Composite
{
vec4 a[2];
@ -25,13 +28,11 @@ vec4 summe(vec4 values[3][2])
void main()
{
vec4 values[2] = vec4[](_41.as[gl_GlobalInvocationID.x], _55.bs[gl_GlobalInvocationID.x]);
vec4 const_values[2] = vec4[](vec4(10.0), vec4(30.0));
vec4 copy_values[2] = const_values;
vec4 copy_values[2] = _66;
vec4 copy_values2[2] = values;
vec4 param[3][2] = vec4[][](values, copy_values, copy_values2);
_41.as[gl_GlobalInvocationID.x] = summe(param);
Composite c = Composite(values, copy_values);
float arrayofarray[2][3] = float[][](float[](1.0, 1.0, 1.0), float[](2.0, 2.0, 2.0));
float b = 10.0;
float values_scalar[4] = float[](b, b, b, b);
}

View File

@ -23,7 +23,7 @@ void main()
light.Radius = Light(UBO[i * 2 + 4].xyz, UBO[i * 2 + 4].w, UBO[i * 2 + 5]).Radius;
light.Color = Light(UBO[i * 2 + 4].xyz, UBO[i * 2 + 4].w, UBO[i * 2 + 5]).Color;
vec3 L = aVertex.xyz - light.Position;
vColor += (((UBO[i * 2 + 5]) * clamp(1.0 - (length(L) / light.Radius), 0.0, 1.0)) * dot(aNormal, normalize(L)));
vColor += ((UBO[i * 2 + 5] * clamp(1.0 - (length(L) / light.Radius), 0.0, 1.0)) * dot(aNormal, normalize(L)));
}
}

View File

@ -18,8 +18,8 @@ void main()
vColor = vec4(0.0);
for (int i = 0; i < 4; i++)
{
vec3 L = aVertex.xyz - (UBO[i * 2 + 4].xyz);
vColor += (((UBO[i * 2 + 5]) * clamp(1.0 - (length(L) / (UBO[i * 2 + 4].w)), 0.0, 1.0)) * dot(aNormal, normalize(L)));
vec3 L = aVertex.xyz - UBO[i * 2 + 4].xyz;
vColor += ((UBO[i * 2 + 5] * clamp(1.0 - (length(L) / UBO[i * 2 + 4].w), 0.0, 1.0)) * dot(aNormal, normalize(L)));
}
}

View File

@ -19,6 +19,6 @@ void main()
}
}
}
FragColor = ((values3[1 * 3 * 1 + 2 * 1 + 0]) + (values3[0 * 3 * 1 + 2 * 1 + 0])) + (values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex]);
FragColor = (values3[1 * 3 * 1 + 2 * 1 + 0] + values3[0 * 3 * 1 + 2 * 1 + 0]) + values3[(vIndex + 1) * 3 * 1 + 2 * 1 + vIndex];
}

View File

@ -2,12 +2,13 @@
precision mediump float;
precision highp int;
const float _17[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0);
layout(location = 0) out vec4 FragColor;
void main()
{
float lut[5] = float[](1.0, 2.0, 3.0, 4.0, 5.0);
for (mediump int i = 0; i < 4; i++, FragColor += vec4(lut[i]))
for (mediump int i = 0; i < 4; i++, FragColor += vec4(_17[i]))
{
}
}

View File

@ -2,6 +2,9 @@
precision mediump float;
precision highp int;
const vec4 _37[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0));
const vec4 _55[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0)));
struct Foobar
{
float a;
@ -18,11 +21,9 @@ vec4 resolve(Foobar f)
void main()
{
highp vec4 indexable[3] = vec4[](vec4(1.0), vec4(2.0), vec4(3.0));
highp vec4 indexable_1[2][2] = vec4[][](vec4[](vec4(1.0), vec4(2.0)), vec4[](vec4(8.0), vec4(10.0)));
Foobar param = Foobar(10.0, 20.0);
Foobar indexable_2[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0));
Foobar param_1 = indexable_2[index];
FragColor = ((indexable[index] + (indexable_1[index][index + 1])) + resolve(param)) + resolve(param_1);
Foobar indexable[2] = Foobar[](Foobar(10.0, 40.0), Foobar(90.0, 70.0));
Foobar param_1 = indexable[index];
FragColor = ((_37[index] + _55[index][index + 1]) + resolve(param)) + resolve(param_1);
}

View File

@ -18,6 +18,6 @@ void main()
lut = float[](1.0, 4.0, 3.0, 2.0);
foos = Foo[](Foo(10.0, 20.0), Foo(30.0, 40.0));
FragColor = vec4(lut[line]);
FragColor += vec4(foos[line].a * (foos[1 - line].a));
FragColor += vec4(foos[line].a * foos[1 - line].a);
}

View File

@ -0,0 +1,40 @@
#version 310 es
precision mediump float;
precision highp int;
const float _16[16] = float[](1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 4.0);
const vec4 _60[4] = vec4[](vec4(0.0), vec4(1.0), vec4(8.0), vec4(5.0));
layout(location = 0) out float FragColor;
layout(location = 0) flat in mediump int index;
void main()
{
FragColor = _16[index];
if (index < 10)
{
FragColor += _16[index ^ 1];
}
else
{
FragColor += _16[index & 1];
}
if (index > 30)
{
FragColor += _60[index & 3].y;
}
else
{
FragColor += _60[index & 1].x;
}
vec4 foobar[4] = _60;
if (index > 30)
{
foobar[1].z = 20.0;
}
FragColor += foobar[index & 3].z;
vec4 baz[4] = _60;
baz = vec4[](vec4(20.0), vec4(30.0), vec4(50.0), vec4(60.0));
FragColor += baz[index & 3].z;
}

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