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
|
#ifdef ENABLE_VULKAN
|
||||||
if (m_render_api == RenderAPI::Vulkan)
|
if (m_render_api == RenderAPI::Vulkan)
|
||||||
{
|
{
|
||||||
ss << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform subpassInput u_input_rt;\n";
|
ss << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform "
|
||||||
ss << "#define LAST_FRAG_COLOR subpassLoad(u_input_rt)\n";
|
<< (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
|
#endif
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
@ -600,13 +602,16 @@ void ShaderGen::DeclareFragmentEntryPoint(
|
||||||
if (m_supports_framebuffer_fetch)
|
if (m_supports_framebuffer_fetch)
|
||||||
{
|
{
|
||||||
// Set doesn't matter, because it's transformed to color0.
|
// 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 << "layout(input_attachment_index = 0, set = 2, binding = 0) uniform "
|
||||||
ss << "#define LAST_FRAG_COLOR subpassLoad(u_input_rt)\n";
|
<< (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
|
else
|
||||||
{
|
{
|
||||||
ss << "layout(set = 2, binding = 0) uniform texture2D u_input_rt;\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), 0)\n";
|
ss << "#define LAST_FRAG_COLOR texelFetch(u_input_rt, int2(gl_FragCoord.xy), " << (msaa ? "gl_SampleID" : "0")
|
||||||
|
<< ")\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue