mirror of
https://github.com/azahar-emu/azahar.git
synced 2026-06-06 02:33:44 -04:00
renderer_gl: Add layer/level specifier to MSAA resolves
This commit is contained in:
parent
ddfc28e593
commit
96d0f71a91
5 changed files with 12 additions and 12 deletions
|
|
@ -162,7 +162,7 @@ bool BlitHelper::ConvertDS24S8ToRGBA8(Surface& source, Surface& dest,
|
|||
|
||||
if (multisample) {
|
||||
// Resolve the destination image if needed
|
||||
ResolveTexture(dest);
|
||||
ResolveTexture(dest, copy.dst_level, copy.dst_layer);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -188,13 +188,13 @@ bool BlitHelper::ConvertRGBA4ToRGB5A1(Surface& source, Surface& dest,
|
|||
|
||||
if (multisample) {
|
||||
// Resolve the destination image if needed
|
||||
ResolveTexture(dest);
|
||||
ResolveTexture(dest, copy.dst_level, copy.dst_layer);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void BlitHelper::ResolveTexture(Surface& surface) {
|
||||
void BlitHelper::ResolveTexture(Surface& surface, u32 level, u32 layer) {
|
||||
OpenGLState prev_state = OpenGLState::GetCurState();
|
||||
SCOPE_EXIT({ prev_state.Apply(); });
|
||||
|
||||
|
|
@ -205,8 +205,8 @@ void BlitHelper::ResolveTexture(Surface& surface) {
|
|||
state.texture_units[2].texture_2d = 0;
|
||||
state.Apply();
|
||||
|
||||
surface.Attach(GL_READ_FRAMEBUFFER, 0, 0, 3);
|
||||
surface.Attach(GL_DRAW_FRAMEBUFFER, 0, 0, 1);
|
||||
surface.Attach(GL_READ_FRAMEBUFFER, level, layer, 3);
|
||||
surface.Attach(GL_DRAW_FRAMEBUFFER, level, layer, 1);
|
||||
const GLbitfield buffer_mask = surface.type == SurfaceType::Depth ? GL_DEPTH_BUFFER_BIT
|
||||
: surface.type == SurfaceType::DepthStencil
|
||||
? (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
bool ConvertRGBA4ToRGB5A1(Surface& source, Surface& dest, const VideoCore::TextureCopy& copy);
|
||||
|
||||
void ResolveTexture(Surface& surface);
|
||||
void ResolveTexture(Surface& surface, u32 level = 0, u32 layer = 0);
|
||||
|
||||
private:
|
||||
void FilterAnime4K(Surface& surface, const VideoCore::TextureBlit& blit);
|
||||
|
|
|
|||
|
|
@ -652,14 +652,14 @@ bool RasterizerOpenGL::Draw(bool accelerate, bool is_indexed) {
|
|||
if (framebuffer->color_id != VideoCore::SurfaceId{}) {
|
||||
Surface& color_surface = res_cache.GetSurface(framebuffer->color_id);
|
||||
if (color_surface.GetSampleCount() > 1) {
|
||||
runtime.ResolveTexture(color_surface);
|
||||
runtime.ResolveTexture(color_surface, framebuffer->color_level);
|
||||
}
|
||||
}
|
||||
|
||||
if (framebuffer->depth_id != VideoCore::SurfaceId{}) {
|
||||
Surface& depth_surface = res_cache.GetSurface(framebuffer->depth_id);
|
||||
if (depth_surface.GetSampleCount() > 1) {
|
||||
runtime.ResolveTexture(depth_surface);
|
||||
runtime.ResolveTexture(depth_surface, framebuffer->depth_level);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -306,10 +306,10 @@ bool TextureRuntime::BlitTextures(Surface& source, Surface& dest,
|
|||
// 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);
|
||||
blit_helper.ResolveTexture(source, blit.src_level, blit.src_layer);
|
||||
}
|
||||
if (dest.sample_count > 1) {
|
||||
blit_helper.ResolveTexture(dest);
|
||||
blit_helper.ResolveTexture(dest, blit.dst_level, blit.dst_layer);
|
||||
}
|
||||
|
||||
OpenGLState state = OpenGLState::GetCurState();
|
||||
|
|
|
|||
|
|
@ -79,8 +79,8 @@ public:
|
|||
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);
|
||||
void ResolveTexture(Surface& surface, u32 level = 0, u32 layer = 0) {
|
||||
blit_helper.ResolveTexture(surface, level, layer);
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue