From f81f8299e1d6fcb526f8429be7f46138595ba349 Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Sat, 18 Jan 2020 20:02:21 +0100 Subject: [PATCH] Update Lego Star Wars packs to v4 Even though the game isn't playable with Vulkan, let's just have everything converted for tidiness sake. --- .../66681ef93c67091e_0000000000000000_vs.txt | 39 +++++++++++++++---- Resolutions/LegoStarWars_Resolution/rules.txt | 2 +- docs/_data/GameTitles.yml | 2 +- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/Resolutions/LegoStarWars_Resolution/66681ef93c67091e_0000000000000000_vs.txt b/Resolutions/LegoStarWars_Resolution/66681ef93c67091e_0000000000000000_vs.txt index 2b329517..63602e00 100644 --- a/Resolutions/LegoStarWars_Resolution/66681ef93c67091e_0000000000000000_vs.txt +++ b/Resolutions/LegoStarWars_Resolution/66681ef93c67091e_0000000000000000_vs.txt @@ -1,17 +1,42 @@ #version 420 #extension GL_ARB_texture_gather : enable #extension GL_ARB_separate_shader_objects : enable -#extension GL_ARB_shading_language_packing : enable +#ifdef VULKAN +#define ATTR_LAYOUT(__vkSet, __location) layout(set = __vkSet, location = __location) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation, std140) +#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(set = __vkSet, binding = __vkLocation) +#define SET_POSITION(_v) gl_Position = _v; gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0 +#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale.xy,gl_FragCoord.zw) +#define gl_VertexID gl_VertexIndex +#define gl_InstanceID gl_InstanceIndex +#else +#define ATTR_LAYOUT(__vkSet, __location) layout(location = __location) +#define UNIFORM_BUFFER_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation, std140) +#define TEXTURE_LAYOUT(__glLocation, __vkSet, __vkLocation) layout(binding = __glLocation) +#define SET_POSITION(_v) gl_Position = _v +#define GET_FRAGCOORD() vec4(gl_FragCoord.xy*uf_fragCoordScale,gl_FragCoord.zw) +#endif +// This shader was automatically converted to be cross-compatible with Vulkan and OpenGL. + // shader 66681ef93c67091e // Used for: Bloom and motion blur const float resXScale = ($width/$gameWidth); +#ifdef VULKAN +layout(set = 0, binding = 0) uniform ufBlock +{ uniform ivec4 uf_remappedVS[7]; -uniform vec2 uf_windowSpaceToClipSpaceTransform; -layout(location = 0) in uvec4 attrDataSem0; -layout(location = 1) in uvec4 attrDataSem1; -layout(location = 2) in uvec4 attrDataSem2; -layout(location = 3) in uvec4 attrDataSem5; +// uniform vec2 uf_windowSpaceToClipSpaceTransform; // Cemu optimized this uf_variable away in Cemu 1.15.7 +}; +#else +uniform ivec4 uf_remappedVS[7]; +// uniform vec2 uf_windowSpaceToClipSpaceTransform; // Cemu optimized this uf_variable away in Cemu 1.15.7 +#endif +// uf_windowSpaceToClipSpaceTransform was moved to the ufBlock +ATTR_LAYOUT(0, 0) in uvec4 attrDataSem0; +ATTR_LAYOUT(0, 1) in uvec4 attrDataSem1; +ATTR_LAYOUT(0, 2) in uvec4 attrDataSem2; +ATTR_LAYOUT(0, 3) in uvec4 attrDataSem5; out gl_PerVertex { vec4 gl_Position; @@ -123,7 +148,7 @@ R5f.y = (mul_nonIEEE(R125f.w,intBitsToFloat(uf_remappedVS[6].y)) + intBitsToFloa // 11 R5f.z = intBitsToFloat(uf_remappedVS[5].z) * (intBitsToFloat(0x3e4cc000)/resXScale); // export -gl_Position = vec4(R1f.x, R1f.y, R1f.z, R1f.w); +SET_POSITION(vec4(R1f.x, R1f.y, R1f.z, R1f.w)); // export passParameterSem128 = vec4(R0f.x, R0f.y, R0f.z, R0f.w); // export diff --git a/Resolutions/LegoStarWars_Resolution/rules.txt b/Resolutions/LegoStarWars_Resolution/rules.txt index 4d893f63..84bda203 100644 --- a/Resolutions/LegoStarWars_Resolution/rules.txt +++ b/Resolutions/LegoStarWars_Resolution/rules.txt @@ -3,7 +3,7 @@ titleIds = 00050000101DAA00,00050000101DAB00,00050000101EA000 name = Resolution path = "LEGO Star Wars: The Force Awakens/Graphics/Resolution" description = Changes the resolution of the game. -version = 3 +version = 4 [Preset] name = 1280x720 (Default) diff --git a/docs/_data/GameTitles.yml b/docs/_data/GameTitles.yml index 9fb296f5..0a224104 100644 --- a/docs/_data/GameTitles.yml +++ b/docs/_data/GameTitles.yml @@ -169,7 +169,7 @@ "LEGO Star Wars: The Force Awakens": nativeRes: 720 compatLink: "http://compat.cemu.info/wiki/LEGO_Star_Wars:_The_Force_Awakens" - version: 3 + version: 4 "Mario Party 10": nativeRes: 720 compatLink: "http://compat.cemu.info/wiki/Mario_Party_10"