summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-06-11 07:20:27 -0400
committerGravatar ReinUsesLisp2019-06-20 21:38:34 -0300
commitb01f9c8a7090fa056ca564593eabcebab946ef41 (patch)
tree5f231b6ee3552e609c718f849b8312dd95ed48d0 /src
parenttexture_cache: correct mutex locks (diff)
downloadyuzu-b01f9c8a7090fa056ca564593eabcebab946ef41.tar.gz
yuzu-b01f9c8a7090fa056ca564593eabcebab946ef41.tar.xz
yuzu-b01f9c8a7090fa056ca564593eabcebab946ef41.zip
texture_cache: eliminate accelerated depth->color/color->depth copies due to driver instability.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_device.cpp1
-rw-r--r--src/video_core/renderer_opengl/gl_device.h5
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp13
-rw-r--r--src/video_core/texture_cache/texture_cache.h9
4 files changed, 6 insertions, 22 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.cpp b/src/video_core/renderer_opengl/gl_device.cpp
index ad15ea54e..65a88b06c 100644
--- a/src/video_core/renderer_opengl/gl_device.cpp
+++ b/src/video_core/renderer_opengl/gl_device.cpp
@@ -28,7 +28,6 @@ Device::Device() {
28 max_varyings = GetInteger<u32>(GL_MAX_VARYING_VECTORS); 28 max_varyings = GetInteger<u32>(GL_MAX_VARYING_VECTORS);
29 has_variable_aoffi = TestVariableAoffi(); 29 has_variable_aoffi = TestVariableAoffi();
30 has_component_indexing_bug = TestComponentIndexingBug(); 30 has_component_indexing_bug = TestComponentIndexingBug();
31 is_turing_plus = GLAD_GL_NV_mesh_shader;
32} 31}
33 32
34Device::Device(std::nullptr_t) { 33Device::Device(std::nullptr_t) {
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h
index 1afe16779..8c8c93760 100644
--- a/src/video_core/renderer_opengl/gl_device.h
+++ b/src/video_core/renderer_opengl/gl_device.h
@@ -34,10 +34,6 @@ public:
34 return has_component_indexing_bug; 34 return has_component_indexing_bug;
35 } 35 }
36 36
37 bool IsTuringGPU() const {
38 return is_turing_plus;
39 }
40
41private: 37private:
42 static bool TestVariableAoffi(); 38 static bool TestVariableAoffi();
43 static bool TestComponentIndexingBug(); 39 static bool TestComponentIndexingBug();
@@ -47,7 +43,6 @@ private:
47 u32 max_varyings{}; 43 u32 max_varyings{};
48 bool has_variable_aoffi{}; 44 bool has_variable_aoffi{};
49 bool has_component_indexing_bug{}; 45 bool has_component_indexing_bug{};
50 bool is_turing_plus{};
51}; 46};
52 47
53} // namespace OpenGL 48} // namespace OpenGL
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index 71f6888c6..7c1d14138 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -439,7 +439,6 @@ TextureCacheOpenGL::TextureCacheOpenGL(Core::System& system,
439 VideoCore::RasterizerInterface& rasterizer, 439 VideoCore::RasterizerInterface& rasterizer,
440 const Device& device) 440 const Device& device)
441 : TextureCacheBase{system, rasterizer} { 441 : TextureCacheBase{system, rasterizer} {
442 support_info.depth_color_image_copies = !device.IsTuringGPU();
443 src_framebuffer.Create(); 442 src_framebuffer.Create();
444 dst_framebuffer.Create(); 443 dst_framebuffer.Create();
445} 444}
@@ -452,13 +451,11 @@ Surface TextureCacheOpenGL::CreateSurface(GPUVAddr gpu_addr, const SurfaceParams
452 451
453void TextureCacheOpenGL::ImageCopy(Surface& src_surface, Surface& dst_surface, 452void TextureCacheOpenGL::ImageCopy(Surface& src_surface, Surface& dst_surface,
454 const VideoCommon::CopyParams& copy_params) { 453 const VideoCommon::CopyParams& copy_params) {
455 if (!support_info.depth_color_image_copies) { 454 const auto& src_params = src_surface->GetSurfaceParams();
456 const auto& src_params = src_surface->GetSurfaceParams(); 455 const auto& dst_params = dst_surface->GetSurfaceParams();
457 const auto& dst_params = dst_surface->GetSurfaceParams(); 456 if (src_params.type != dst_params.type) {
458 if (src_params.type != dst_params.type) { 457 // A fallback is needed
459 // A fallback is needed 458 return;
460 return;
461 }
462 } 459 }
463 const auto src_handle = src_surface->GetTexture(); 460 const auto src_handle = src_surface->GetTexture();
464 const auto src_target = src_surface->GetTarget(); 461 const auto src_target = src_surface->GetTarget();
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index 503bd2b43..c95b1b976 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -218,12 +218,6 @@ public:
218 } 218 }
219 219
220protected: 220protected:
221 // This structure is used for communicating with the backend, on which behaviors
222 // it supports and what not, to avoid assuming certain things about hardware.
223 // The backend is RESPONSIBLE for filling this settings on creation.
224 struct Support {
225 bool depth_color_image_copies;
226 } support_info;
227 221
228 TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer) 222 TextureCache(Core::System& system, VideoCore::RasterizerInterface& rasterizer)
229 : system{system}, rasterizer{rasterizer} { 223 : system{system}, rasterizer{rasterizer} {
@@ -389,8 +383,7 @@ private:
389 const auto gpu_addr = current_surface->GetGpuAddr(); 383 const auto gpu_addr = current_surface->GetGpuAddr();
390 TSurface new_surface = GetUncachedSurface(gpu_addr, params); 384 TSurface new_surface = GetUncachedSurface(gpu_addr, params);
391 const auto& cr_params = current_surface->GetSurfaceParams(); 385 const auto& cr_params = current_surface->GetSurfaceParams();
392 if (cr_params.type != params.type && (!support_info.depth_color_image_copies || 386 if (cr_params.type != params.type || (cr_params.component_type != params.component_type)) {
393 cr_params.component_type != params.component_type)) {
394 BufferCopy(current_surface, new_surface); 387 BufferCopy(current_surface, new_surface);
395 } else { 388 } else {
396 std::vector<CopyParams> bricks = current_surface->BreakDown(params); 389 std::vector<CopyParams> bricks = current_surface->BreakDown(params);