mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
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:
parent
15be844ed8
commit
3b3a5e5130
2 changed files with 23 additions and 1 deletions
|
|
@ -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();
|
vertex_batch.clear();
|
||||||
|
|
||||||
if (shadow_rendering) {
|
if (shadow_rendering) {
|
||||||
|
|
@ -1009,7 +1025,8 @@ void RasterizerOpenGL::SyncAndUploadLUTs() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::UploadUniforms(bool accelerate_draw) {
|
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.draw.uniform_buffer = uniform_buffer.GetHandle();
|
||||||
state.Apply();
|
state.Apply();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -78,6 +78,11 @@ public:
|
||||||
/// Generates mipmaps for all the available levels of the texture
|
/// Generates mipmaps for all the available levels of the texture
|
||||||
void GenerateMipmaps(Surface& surface);
|
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:
|
private:
|
||||||
/// Returns the OpenGL driver class
|
/// Returns the OpenGL driver class
|
||||||
const Driver& GetDriver() const {
|
const Driver& GetDriver() const {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue