Disable Fast Depth->Color Copies in Turing+ GPUs.
This commit is contained in:
committed by
FernandoS27
parent
7cb17834c7
commit
b0d9e128ab
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <glad/glad.h>
|
||||
|
||||
namespace OpenGL {
|
||||
|
||||
@@ -20,6 +21,10 @@ public:
|
||||
return has_variable_aoffi;
|
||||
}
|
||||
|
||||
bool IsTuringGPU() const {
|
||||
return GLAD_GL_NV_mesh_shader;
|
||||
}
|
||||
|
||||
private:
|
||||
static bool TestVariableAoffi();
|
||||
|
||||
|
||||
@@ -73,6 +73,10 @@ public:
|
||||
static_assert(MaxConstbufferSize % sizeof(GLvec4) == 0,
|
||||
"The maximum size of a constbuffer must be a multiple of the size of GLvec4");
|
||||
|
||||
const Device& GetDevice() const {
|
||||
return device;
|
||||
}
|
||||
|
||||
private:
|
||||
struct FramebufferConfigState {
|
||||
bool using_color_fb{};
|
||||
|
||||
@@ -872,7 +872,7 @@ void CachedSurface::UpdateSwizzle(Tegra::Texture::SwizzleSource swizzle_x,
|
||||
}
|
||||
|
||||
RasterizerCacheOpenGL::RasterizerCacheOpenGL(RasterizerOpenGL& rasterizer)
|
||||
: RasterizerCache{rasterizer} {
|
||||
: RasterizerCache{rasterizer}, rasterizer{rasterizer} {
|
||||
read_framebuffer.Create();
|
||||
draw_framebuffer.Create();
|
||||
copy_pbo.Create();
|
||||
@@ -1198,9 +1198,12 @@ Surface RasterizerCacheOpenGL::RecreateSurface(const Surface& old_surface,
|
||||
GetFormatTuple(old_params.pixel_format, old_params.component_type).compressed;
|
||||
const bool new_compressed =
|
||||
GetFormatTuple(new_params.pixel_format, new_params.component_type).compressed;
|
||||
const bool compatible_formats =
|
||||
bool compatible_formats =
|
||||
GetFormatBpp(old_params.pixel_format) == GetFormatBpp(new_params.pixel_format) &&
|
||||
!(old_compressed || new_compressed);
|
||||
if (rasterizer.GetDevice().IsTuringGPU()) {
|
||||
compatible_formats &= old_params.type == new_params.type;
|
||||
}
|
||||
// For compatible surfaces, we can just do fast glCopyImageSubData based copy
|
||||
if (old_params.target == new_params.target && old_params.depth == new_params.depth &&
|
||||
old_params.depth == 1 && compatible_formats) {
|
||||
|
||||
@@ -501,6 +501,8 @@ private:
|
||||
const GLuint copy_pbo_handle, const GLenum src_attachment = 0,
|
||||
const GLenum dst_attachment = 0, const std::size_t cubemap_face = 0);
|
||||
|
||||
RasterizerOpenGL& rasterizer;
|
||||
|
||||
/// The surface reserve is a "backup" cache, this is where we put unique surfaces that have
|
||||
/// previously been used. This is to prevent surfaces from being constantly created and
|
||||
/// destroyed when used with different surface parameters.
|
||||
|
||||
Reference in New Issue
Block a user