mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-05 18:23:39 -04:00
renderer_gl: Implement TextureRuntime::ClearTexture MSAA clears
When ArbClearTexture is not available, ensure the fallback implementation also clears the MSAA texture as well.
This commit is contained in:
parent
3b3a5e5130
commit
f01b8fcdcd
1 changed files with 33 additions and 24 deletions
|
|
@ -247,8 +247,7 @@ void TextureRuntime::ClearTexture(Surface& surface, const VideoCore::TextureClea
|
|||
state.draw.draw_framebuffer = draw_fbos[FboIndex(surface.type)].handle;
|
||||
state.Apply();
|
||||
|
||||
surface.Attach(GL_DRAW_FRAMEBUFFER, clear.texture_level, 0);
|
||||
|
||||
const auto ClearBuffer = [&surface, &state, &clear]() {
|
||||
switch (surface.type) {
|
||||
case SurfaceType::Color:
|
||||
case SurfaceType::Texture:
|
||||
|
|
@ -273,6 +272,16 @@ void TextureRuntime::ClearTexture(Surface& surface, const VideoCore::TextureClea
|
|||
default:
|
||||
UNREACHABLE_MSG("Unknown surface type {}", surface.type);
|
||||
}
|
||||
};
|
||||
|
||||
surface.Attach(GL_DRAW_FRAMEBUFFER, clear.texture_level, 0);
|
||||
ClearBuffer();
|
||||
|
||||
if (surface.GetSampleCount() > 1) {
|
||||
// Clear MSAA too
|
||||
surface.Attach(GL_DRAW_FRAMEBUFFER, clear.texture_level, 0, 3);
|
||||
ClearBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
bool TextureRuntime::CopyTextures(Surface& source, Surface& dest,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue