diff options
| author | 2018-07-02 09:43:38 -0500 | |
|---|---|---|
| committer | 2018-07-02 09:43:38 -0500 | |
| commit | 80c5e8ae99255fd2871e9500a5b26e5b5cb6b167 (patch) | |
| tree | b66edd9bd08bfa3b59345cf94e253c298f1374a2 | |
| parent | GPU: Allow GpuToCpuAddress to return boost::none for unmapped addresses. (diff) | |
| download | yuzu-80c5e8ae99255fd2871e9500a5b26e5b5cb6b167.tar.gz yuzu-80c5e8ae99255fd2871e9500a5b26e5b5cb6b167.tar.xz yuzu-80c5e8ae99255fd2871e9500a5b26e5b5cb6b167.zip | |
GPU: Ignore disabled textures and textures with an invalid address.
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 62ee45a36..45560fbee 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -636,7 +636,11 @@ u32 RasterizerOpenGL::SetupTextures(Maxwell::ShaderStage stage, GLuint program, | |||
| 636 | glProgramUniform1i(program, uniform, current_bindpoint); | 636 | glProgramUniform1i(program, uniform, current_bindpoint); |
| 637 | 637 | ||
| 638 | const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset()); | 638 | const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset()); |
| 639 | ASSERT(texture.enabled); | 639 | |
| 640 | if (!texture.enabled) { | ||
| 641 | state.texture_units[current_bindpoint].texture_2d = 0; | ||
| 642 | continue; | ||
| 643 | } | ||
| 640 | 644 | ||
| 641 | texture_samplers[current_bindpoint].SyncWithConfig(texture.tsc); | 645 | texture_samplers[current_bindpoint].SyncWithConfig(texture.tsc); |
| 642 | Surface surface = res_cache.GetTextureSurface(texture); | 646 | Surface surface = res_cache.GetTextureSurface(texture); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 63f5999ea..44054f338 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | |||
| @@ -454,6 +454,11 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params) { | |||
| 454 | return {}; | 454 | return {}; |
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | const auto& gpu = Core::System::GetInstance().GPU(); | ||
| 458 | // Don't try to create any entries in the cache if the address of the texture is invalid. | ||
| 459 | if (gpu.memory_manager->GpuToCpuAddress(params.addr) == boost::none) | ||
| 460 | return {}; | ||
| 461 | |||
| 457 | // Check for an exact match in existing surfaces | 462 | // Check for an exact match in existing surfaces |
| 458 | const auto& surface_key{SurfaceKey::Create(params)}; | 463 | const auto& surface_key{SurfaceKey::Create(params)}; |
| 459 | const auto& search{surface_cache.find(surface_key)}; | 464 | const auto& search{surface_cache.find(surface_key)}; |