mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-28 05:11:37 +00:00
Replace CSD vertex shaders to get rid of pixel snapping.
This commit is contained in:
parent
41a6ab1f08
commit
c592727757
5 changed files with 156 additions and 2 deletions
|
|
@ -380,7 +380,9 @@ function(compile_pixel_shader FILE_PATH)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
compile_vertex_shader(copy_vs)
|
compile_vertex_shader(copy_vs)
|
||||||
compile_pixel_shader(csd_filter_ps)
|
compile_pixel_shader(csd_filter_ps)
|
||||||
|
compile_vertex_shader(csd_no_tex_vs)
|
||||||
|
compile_vertex_shader(csd_vs)
|
||||||
compile_pixel_shader(enhanced_motion_blur_ps)
|
compile_pixel_shader(enhanced_motion_blur_ps)
|
||||||
compile_pixel_shader(gaussian_blur_3x3)
|
compile_pixel_shader(gaussian_blur_3x3)
|
||||||
compile_pixel_shader(gaussian_blur_5x5)
|
compile_pixel_shader(gaussian_blur_5x5)
|
||||||
|
|
|
||||||
67
UnleashedRecomp/gpu/shader/csd_no_tex_vs.hlsl
Normal file
67
UnleashedRecomp/gpu/shader/csd_no_tex_vs.hlsl
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
||||||
|
|
||||||
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
#define g_ViewportSize vk::RawBufferLoad<float4>(g_PushConstants.VertexShaderConstants + 2880, 0x10)
|
||||||
|
#define g_Z vk::RawBufferLoad<float4>(g_PushConstants.VertexShaderConstants + 3936, 0x10)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
cbuffer VertexShaderConstants : register(b0, space4)
|
||||||
|
{
|
||||||
|
float4 g_ViewportSize : packoffset(c180);
|
||||||
|
float4 g_Z : packoffset(c246);
|
||||||
|
};
|
||||||
|
|
||||||
|
cbuffer SharedConstants : register(b2, space4)
|
||||||
|
{
|
||||||
|
DEFINE_SHARED_CONSTANTS();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void main(
|
||||||
|
[[vk::location(0)]] in float4 iPosition0 : POSITION0,
|
||||||
|
[[vk::location(8)]] in float4 iColor0 : COLOR0,
|
||||||
|
out float4 oPos : SV_Position,
|
||||||
|
out float4 oTexCoord0 : TEXCOORD0,
|
||||||
|
out float4 oTexCoord1 : TEXCOORD1,
|
||||||
|
out float4 oTexCoord2 : TEXCOORD2,
|
||||||
|
out float4 oTexCoord3 : TEXCOORD3,
|
||||||
|
out float4 oTexCoord4 : TEXCOORD4,
|
||||||
|
out float4 oTexCoord5 : TEXCOORD5,
|
||||||
|
out float4 oTexCoord6 : TEXCOORD6,
|
||||||
|
out float4 oTexCoord7 : TEXCOORD7,
|
||||||
|
out float4 oTexCoord8 : TEXCOORD8,
|
||||||
|
out float4 oTexCoord9 : TEXCOORD9,
|
||||||
|
out float4 oTexCoord10 : TEXCOORD10,
|
||||||
|
out float4 oTexCoord11 : TEXCOORD11,
|
||||||
|
out float4 oTexCoord12 : TEXCOORD12,
|
||||||
|
out float4 oTexCoord13 : TEXCOORD13,
|
||||||
|
out float4 oTexCoord14 : TEXCOORD14,
|
||||||
|
out float4 oTexCoord15 : TEXCOORD15,
|
||||||
|
out float4 oColor0 : COLOR0,
|
||||||
|
out float4 oColor1 : COLOR1)
|
||||||
|
{
|
||||||
|
oPos.xy = (iPosition0.xy - 0.5) * g_ViewportSize.zw * float2(2.0, -2.0) + float2(-1.0, 1.0);
|
||||||
|
oPos.z = g_Z.x;
|
||||||
|
oPos.w = 1.0;
|
||||||
|
oTexCoord0 = iColor0.wxyz;
|
||||||
|
oTexCoord1 = 0.0;
|
||||||
|
oTexCoord2 = 0.0;
|
||||||
|
oTexCoord3 = 0.0;
|
||||||
|
oTexCoord4 = 0.0;
|
||||||
|
oTexCoord5 = 0.0;
|
||||||
|
oTexCoord6 = 0.0;
|
||||||
|
oTexCoord7 = 0.0;
|
||||||
|
oTexCoord8 = 0.0;
|
||||||
|
oTexCoord9 = 0.0;
|
||||||
|
oTexCoord10 = 0.0;
|
||||||
|
oTexCoord11 = 0.0;
|
||||||
|
oTexCoord12 = 0.0;
|
||||||
|
oTexCoord13 = 0.0;
|
||||||
|
oTexCoord14 = 0.0;
|
||||||
|
oTexCoord15 = 0.0;
|
||||||
|
oColor0 = 0.0;
|
||||||
|
oColor1 = 0.0;
|
||||||
|
}
|
||||||
69
UnleashedRecomp/gpu/shader/csd_vs.hlsl
Normal file
69
UnleashedRecomp/gpu/shader/csd_vs.hlsl
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
#include "../../../tools/ShaderRecomp/ShaderRecomp/shader_common.h"
|
||||||
|
|
||||||
|
#ifdef __spirv__
|
||||||
|
|
||||||
|
#define g_ViewportSize vk::RawBufferLoad<float4>(g_PushConstants.VertexShaderConstants + 2880, 0x10)
|
||||||
|
#define g_Z vk::RawBufferLoad<float4>(g_PushConstants.VertexShaderConstants + 3936, 0x10)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
cbuffer VertexShaderConstants : register(b0, space4)
|
||||||
|
{
|
||||||
|
float4 g_ViewportSize : packoffset(c180);
|
||||||
|
float4 g_Z : packoffset(c246);
|
||||||
|
};
|
||||||
|
|
||||||
|
cbuffer SharedConstants : register(b2, space4)
|
||||||
|
{
|
||||||
|
DEFINE_SHARED_CONSTANTS();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void main(
|
||||||
|
[[vk::location(0)]] in float4 iPosition0 : POSITION0,
|
||||||
|
[[vk::location(8)]] in float4 iColor0 : COLOR0,
|
||||||
|
[[vk::location(4)]] in float4 iTexCoord0 : TEXCOORD0,
|
||||||
|
out float4 oPos : SV_Position,
|
||||||
|
out float4 oTexCoord0 : TEXCOORD0,
|
||||||
|
out float4 oTexCoord1 : TEXCOORD1,
|
||||||
|
out float4 oTexCoord2 : TEXCOORD2,
|
||||||
|
out float4 oTexCoord3 : TEXCOORD3,
|
||||||
|
out float4 oTexCoord4 : TEXCOORD4,
|
||||||
|
out float4 oTexCoord5 : TEXCOORD5,
|
||||||
|
out float4 oTexCoord6 : TEXCOORD6,
|
||||||
|
out float4 oTexCoord7 : TEXCOORD7,
|
||||||
|
out float4 oTexCoord8 : TEXCOORD8,
|
||||||
|
out float4 oTexCoord9 : TEXCOORD9,
|
||||||
|
out float4 oTexCoord10 : TEXCOORD10,
|
||||||
|
out float4 oTexCoord11 : TEXCOORD11,
|
||||||
|
out float4 oTexCoord12 : TEXCOORD12,
|
||||||
|
out float4 oTexCoord13 : TEXCOORD13,
|
||||||
|
out float4 oTexCoord14 : TEXCOORD14,
|
||||||
|
out float4 oTexCoord15 : TEXCOORD15,
|
||||||
|
out float4 oColor0 : COLOR0,
|
||||||
|
out float4 oColor1 : COLOR1)
|
||||||
|
{
|
||||||
|
oPos.xy = (iPosition0.xy - 0.5) * g_ViewportSize.zw * float2(2.0, -2.0) + float2(-1.0, 1.0);
|
||||||
|
oPos.z = g_Z.x;
|
||||||
|
oPos.w = 1.0;
|
||||||
|
oTexCoord0 = iColor0.wxyz;
|
||||||
|
oTexCoord1.xy = iTexCoord0.xy;
|
||||||
|
oTexCoord1.zw = 0.0;
|
||||||
|
oTexCoord2 = 0.0;
|
||||||
|
oTexCoord3 = 0.0;
|
||||||
|
oTexCoord4 = 0.0;
|
||||||
|
oTexCoord5 = 0.0;
|
||||||
|
oTexCoord6 = 0.0;
|
||||||
|
oTexCoord7 = 0.0;
|
||||||
|
oTexCoord8 = 0.0;
|
||||||
|
oTexCoord9 = 0.0;
|
||||||
|
oTexCoord10 = 0.0;
|
||||||
|
oTexCoord11 = 0.0;
|
||||||
|
oTexCoord12 = 0.0;
|
||||||
|
oTexCoord13 = 0.0;
|
||||||
|
oTexCoord14 = 0.0;
|
||||||
|
oTexCoord15 = 0.0;
|
||||||
|
oColor0 = 0.0;
|
||||||
|
oColor1 = 0.0;
|
||||||
|
}
|
||||||
|
|
@ -38,6 +38,8 @@
|
||||||
#ifdef SWA_D3D12
|
#ifdef SWA_D3D12
|
||||||
#include "shader/copy_vs.hlsl.dxil.h"
|
#include "shader/copy_vs.hlsl.dxil.h"
|
||||||
#include "shader/csd_filter_ps.hlsl.dxil.h"
|
#include "shader/csd_filter_ps.hlsl.dxil.h"
|
||||||
|
#include "shader/csd_no_tex_vs.hlsl.dxil.h"
|
||||||
|
#include "shader/csd_vs.hlsl.dxil.h"
|
||||||
#include "shader/enhanced_motion_blur_ps.hlsl.dxil.h"
|
#include "shader/enhanced_motion_blur_ps.hlsl.dxil.h"
|
||||||
#include "shader/gamma_correction_ps.hlsl.dxil.h"
|
#include "shader/gamma_correction_ps.hlsl.dxil.h"
|
||||||
#include "shader/gaussian_blur_3x3.hlsl.dxil.h"
|
#include "shader/gaussian_blur_3x3.hlsl.dxil.h"
|
||||||
|
|
@ -55,6 +57,8 @@
|
||||||
|
|
||||||
#include "shader/copy_vs.hlsl.spirv.h"
|
#include "shader/copy_vs.hlsl.spirv.h"
|
||||||
#include "shader/csd_filter_ps.hlsl.spirv.h"
|
#include "shader/csd_filter_ps.hlsl.spirv.h"
|
||||||
|
#include "shader/csd_no_tex_vs.hlsl.spirv.h"
|
||||||
|
#include "shader/csd_vs.hlsl.spirv.h"
|
||||||
#include "shader/enhanced_motion_blur_ps.hlsl.spirv.h"
|
#include "shader/enhanced_motion_blur_ps.hlsl.spirv.h"
|
||||||
#include "shader/gamma_correction_ps.hlsl.spirv.h"
|
#include "shader/gamma_correction_ps.hlsl.spirv.h"
|
||||||
#include "shader/gaussian_blur_3x3.hlsl.spirv.h"
|
#include "shader/gaussian_blur_3x3.hlsl.spirv.h"
|
||||||
|
|
@ -4160,7 +4164,13 @@ static GuestShader* CreateShader(const be<uint32_t>* function, ResourceType reso
|
||||||
if (findResult->guestShader == nullptr)
|
if (findResult->guestShader == nullptr)
|
||||||
{
|
{
|
||||||
shader = g_userHeap.AllocPhysical<GuestShader>(resourceType);
|
shader = g_userHeap.AllocPhysical<GuestShader>(resourceType);
|
||||||
shader->shaderCacheEntry = findResult;
|
|
||||||
|
if (hash == 0xB1086A4947A797DE)
|
||||||
|
shader->shader = CREATE_SHADER(csd_no_tex_vs);
|
||||||
|
else if (hash == 0xB4CAFC034A37C8A8)
|
||||||
|
shader->shader = CREATE_SHADER(csd_vs);
|
||||||
|
else
|
||||||
|
shader->shaderCacheEntry = findResult;
|
||||||
|
|
||||||
findResult->guestShader = shader;
|
findResult->guestShader = shader;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,10 @@ static const ankerl::unordered_dense::map<XXH64_hash_t, uint32_t> g_flags =
|
||||||
// ui_lcursor_enemy
|
// ui_lcursor_enemy
|
||||||
{ HashStr("ui_lcursor/cursor"), UNSTRETCH_CENTER },
|
{ HashStr("ui_lcursor/cursor"), UNSTRETCH_CENTER },
|
||||||
|
|
||||||
|
// ui_loading
|
||||||
|
{ HashStr("ui_loading/bg_1"), STRETCH },
|
||||||
|
{ HashStr("ui_loading/bg_2"), STRETCH },
|
||||||
|
|
||||||
// ui_mediaroom
|
// ui_mediaroom
|
||||||
{ HashStr("ui_mediaroom/header/bg/img_1"), EXTEND_LEFT },
|
{ HashStr("ui_mediaroom/header/bg/img_1"), EXTEND_LEFT },
|
||||||
{ HashStr("ui_mediaroom/header/bg/img_10"), EXTEND_RIGHT },
|
{ HashStr("ui_mediaroom/header/bg/img_10"), EXTEND_RIGHT },
|
||||||
|
|
@ -399,6 +403,8 @@ static const ankerl::unordered_dense::map<XXH64_hash_t, uint32_t> g_flags =
|
||||||
{ HashStr("ui_townscreen/cam"), ALIGN_TOP_RIGHT },
|
{ HashStr("ui_townscreen/cam"), ALIGN_TOP_RIGHT },
|
||||||
|
|
||||||
// ui_worldmap
|
// ui_worldmap
|
||||||
|
{ HashStr("ui_worldmap/contents/active_parts/cts_parts_flag"), UNSTRETCH_CENTER },
|
||||||
|
{ HashStr("ui_worldmap/contents/active_parts/cts_parts_sun_moon"), UNSTRETCH_CENTER },
|
||||||
{ HashStr("ui_worldmap/contents/guide/cts_guide_1_hiscore"), ALIGN_RIGHT },
|
{ HashStr("ui_worldmap/contents/guide/cts_guide_1_hiscore"), ALIGN_RIGHT },
|
||||||
{ HashStr("ui_worldmap/contents/guide/cts_guide_2_besttime"), ALIGN_RIGHT },
|
{ HashStr("ui_worldmap/contents/guide/cts_guide_2_besttime"), ALIGN_RIGHT },
|
||||||
{ HashStr("ui_worldmap/contents/guide/cts_guide_3_rank"), ALIGN_RIGHT },
|
{ HashStr("ui_worldmap/contents/guide/cts_guide_3_rank"), ALIGN_RIGHT },
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue