diff --git a/XenosRecomp/shader_common.h b/XenosRecomp/shader_common.h index 7f32cd0..1c74034 100644 --- a/XenosRecomp/shader_common.h +++ b/XenosRecomp/shader_common.h @@ -28,7 +28,8 @@ struct PushConstants #define g_Booleans vk::RawBufferLoad(g_PushConstants.SharedConstants + 256) #define g_SwappedTexcoords vk::RawBufferLoad(g_PushConstants.SharedConstants + 260) -#define g_AlphaThreshold vk::RawBufferLoad(g_PushConstants.SharedConstants + 264) +#define g_HalfPixelOffset vk::RawBufferLoad(g_PushConstants.SharedConstants + 264) +#define g_AlphaThreshold vk::RawBufferLoad(g_PushConstants.SharedConstants + 272) [[vk::constant_id(0)]] const uint g_SpecConstants = 0; @@ -39,7 +40,8 @@ struct PushConstants #define DEFINE_SHARED_CONSTANTS() \ uint g_Booleans : packoffset(c16.x); \ uint g_SwappedTexcoords : packoffset(c16.y); \ - float g_AlphaThreshold : packoffset(c16.z) \ + float2 g_HalfPixelOffset : packoffset(c16.z); \ + float g_AlphaThreshold : packoffset(c17.x); uint g_SpecConstants(); diff --git a/XenosRecomp/shader_recompiler.cpp b/XenosRecomp/shader_recompiler.cpp index 78a1eb3..d4cbd50 100644 --- a/XenosRecomp/shader_recompiler.cpp +++ b/XenosRecomp/shader_recompiler.cpp @@ -1826,6 +1826,10 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi out += '}'; #endif } + else + { + out += "\toPos.xy += g_HalfPixelOffset * oPos.w;\n"; + } if (simpleControlFlow) {