Compare commits

...

1 Commits

Author SHA1 Message Date
Fernando Sahmkow
b0d9e128ab Disable Fast Depth->Color Copies in Turing+ GPUs. 2019-05-13 21:54:47 -04:00
4 changed files with 16 additions and 2 deletions

View File

@@ -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();

View File

@@ -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{};

View File

@@ -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) {

View File

@@ -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.