mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 12:19:12 +00:00
FramebufferManager: Support saving EFB to save state
This commit is contained in:
parent
1082468133
commit
137009affe
5 changed files with 149 additions and 0 deletions
|
@ -644,4 +644,24 @@ std::string GenerateTextureReinterpretShader(TextureFormat from_format, TextureF
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
std::string GenerateEFBRestorePixelShader()
|
||||
{
|
||||
std::stringstream ss;
|
||||
EmitSamplerDeclarations(ss, 0, 2, false);
|
||||
EmitPixelMainDeclaration(ss, 1, 0, "float4",
|
||||
GetAPIType() == APIType::D3D ? "out float depth : SV_Depth, " : "");
|
||||
ss << "{\n";
|
||||
ss << " float3 coords = float3(v_tex0.x, "
|
||||
<< (g_ActiveConfig.backend_info.bUsesLowerLeftOrigin ? "1.0 - " : "")
|
||||
<< "v_tex0.y, v_tex0.z);\n";
|
||||
ss << " ocol0 = ";
|
||||
EmitSampleTexture(ss, 0, "coords");
|
||||
ss << ";\n";
|
||||
ss << " " << (GetAPIType() == APIType::D3D ? "depth" : "gl_FragDepth") << " = ";
|
||||
EmitSampleTexture(ss, 1, "coords");
|
||||
ss << ".r;\n";
|
||||
ss << "}\n";
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
} // namespace FramebufferShaderGen
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue