mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-07 11:13:40 -04:00
renderer_gl: Implement TextureRuntime::BlitTextures direct MSAA bits
Re-implement `TextureRuntime::BlitTextures` such that the MSAA render textures are directly blit rather than just resolving an blitting the current texture. Helps ensure that the MSAA and non-MSAA textures are in parity.
This commit is contained in:
parent
02d7b33b57
commit
9dfa91f77a
1 changed files with 9 additions and 9 deletions
|
|
@ -303,15 +303,6 @@ bool TextureRuntime::CopyTextures(Surface& source, Surface& dest,
|
|||
|
||||
bool TextureRuntime::BlitTextures(Surface& source, Surface& dest,
|
||||
const VideoCore::TextureBlit& blit) {
|
||||
// Must resolve images first
|
||||
// Todo(wunk): Add a "dirty" flag for msaa resolves to avoid redundant image resolves
|
||||
if (source.sample_count > 1) {
|
||||
blit_helper.ResolveTexture(source);
|
||||
}
|
||||
if (dest.sample_count > 1) {
|
||||
blit_helper.ResolveTexture(dest);
|
||||
}
|
||||
|
||||
OpenGLState state = OpenGLState::GetCurState();
|
||||
state.scissor.enabled = false;
|
||||
state.draw.read_framebuffer = read_fbos[FboIndex(source.type)].handle;
|
||||
|
|
@ -331,6 +322,15 @@ bool TextureRuntime::BlitTextures(Surface& source, Surface& dest,
|
|||
blit.src_rect.top, blit.dst_rect.left, blit.dst_rect.bottom,
|
||||
blit.dst_rect.right, blit.dst_rect.top, buffer_mask, filter);
|
||||
|
||||
if (source.GetSampleCount() == dest.GetSampleCount() && source.GetSampleCount() > 1) {
|
||||
// Blit MSAA too
|
||||
source.Attach(GL_READ_FRAMEBUFFER, blit.src_level, blit.src_layer, 3);
|
||||
dest.Attach(GL_DRAW_FRAMEBUFFER, blit.dst_level, blit.dst_layer, 3);
|
||||
glBlitFramebuffer(blit.src_rect.left, blit.src_rect.bottom, blit.src_rect.right,
|
||||
blit.src_rect.top, blit.dst_rect.left, blit.dst_rect.bottom,
|
||||
blit.dst_rect.right, blit.dst_rect.top, buffer_mask, filter);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue