renderer_gl: Resolve framebuffer after each draw

Brute force approach while trying to determine a better heuristic. Framebuffer changes are not enough to determine the end of a "render pass". An 'msaa dirty flag' is likely the better way here.
This commit is contained in:
Wunkolo 2026-05-16 23:42:36 -07:00
parent 200a4632e5
commit 37cf609931
2 changed files with 23 additions and 1 deletions

View file

@ -647,6 +647,22 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
}
}
// Resolve after drawing, slow initial approach to ensure the MSAA and non-MSAA buffers are
// always in sync
if (framebuffer->color_id != VideoCore::SurfaceId{}) {
Surface& color_surface = res_cache.GetSurface(framebuffer->color_id);
if (color_surface.GetSampleCount() > 1) {
runtime.ResolveTexture(color_surface);
}
}
if (framebuffer->depth_id != VideoCore::SurfaceId{}) {
Surface& depth_surface = res_cache.GetSurface(framebuffer->depth_id);
if (depth_surface.GetSampleCount() > 1) {
runtime.ResolveTexture(depth_surface);
}
}
vertex_batch.clear();
if (shadow_rendering) {
@ -996,7 +1012,8 @@ void RasterizerOpenGL::SyncAndUploadLUTs() {
}
void RasterizerOpenGL::UploadUniforms(bool accelerate_draw) {
// glBindBufferRange also changes the generic buffer binding point, so we sync the state first.
// glBindBufferRange also changes the generic buffer binding point, so we sync the state
// first.
state.draw.uniform_buffer = uniform_buffer.GetHandle();
state.Apply();

View file

@ -78,6 +78,11 @@ public:
/// Generates mipmaps for all the available levels of the texture
void GenerateMipmaps(Surface& surface);
/// Resolve a surface's MSAA texture into the surface's appropriate non-MSAA texture
void ResolveTexture(Surface& surface) {
blit_helper.ResolveTexture(surface);
}
private:
/// Returns the OpenGL driver class
const Driver& GetDriver() const {