mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 23:25:41 +00:00
GPU/HW: Fix shader sampling with MSAA on
This commit is contained in:
parent
1185f8f6aa
commit
e3b0050ca1
|
@ -590,8 +590,10 @@ void ShaderGen::DeclareFragmentEntryPoint(
|
|||
#ifdef ENABLE_VULKAN
|
||||
if (m_render_api == RenderAPI::Vulkan)
|
||||
{
|
||||
ss << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform subpassInput u_input_rt;\n";
|
||||
ss << "#define LAST_FRAG_COLOR subpassLoad(u_input_rt)\n";
|
||||
ss << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform "
|
||||
<< (msaa ? "subpassInputMS" : "subpassInput") << " u_input_rt; \n";
|
||||
ss << "#define LAST_FRAG_COLOR " << (msaa ? "subpassLoad(u_input_rt, gl_SampleID)" : "subpassLoad(u_input_rt)")
|
||||
<< "\n";
|
||||
}
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
|
@ -600,13 +602,16 @@ void ShaderGen::DeclareFragmentEntryPoint(
|
|||
if (m_supports_framebuffer_fetch)
|
||||
{
|
||||
// Set doesn't matter, because it's transformed to color0.
|
||||
ss << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform subpassInput u_input_rt;\n";
|
||||
ss << "#define LAST_FRAG_COLOR subpassLoad(u_input_rt)\n";
|
||||
ss << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform "
|
||||
<< (msaa ? "subpassInputMS" : "subpassInput") << " u_input_rt; \n";
|
||||
ss << "#define LAST_FRAG_COLOR "
|
||||
<< (msaa ? "subpassLoad(u_input_rt, gl_SampleID)" : "subpassLoad(u_input_rt)") << "\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
ss << "layout(set = 2, binding = 0) uniform texture2D u_input_rt;\n";
|
||||
ss << "#define LAST_FRAG_COLOR texelFetch(u_input_rt, int2(gl_FragCoord.xy), 0)\n";
|
||||
ss << "layout(set = 2, binding = 0) uniform " << (msaa ? "texture2D" : "texture2DMS") << "u_input_rt;\n";
|
||||
ss << "#define LAST_FRAG_COLOR texelFetch(u_input_rt, int2(gl_FragCoord.xy), " << (msaa ? "gl_SampleID" : "0")
|
||||
<< ")\n";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue