summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-02 17:48:18 +0200
committerGitHub <noreply@github.com>2018-07-02 17:48:18 +0200
commit3d41fdfbba48f92e8d433085cc66cd4ef50b03ab (patch)
treea7441d8c1c03d0e1ebe7a81b5e4a01f1de45251c /src/video_core/renderer_opengl
parentMerge pull request #602 from Subv/mufu_subop (diff)
parentGPU: Ignore disabled textures and textures with an invalid address. (diff)
downloadyuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.tar
yuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.tar.gz
yuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.tar.bz2
yuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.tar.lz
yuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.tar.xz
yuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.tar.zst
yuzu-3d41fdfbba48f92e8d433085cc66cd4ef50b03ab.zip
Diffstat (limited to 'src/video_core/renderer_opengl')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp6
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer_cache.cpp5
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,
glProgramUniform1i(program, uniform, current_bindpoint);
const auto texture = maxwell3d.GetStageTexture(entry.GetStage(), entry.GetOffset());
- ASSERT(texture.enabled);
+
+ if (!texture.enabled) {
+ state.texture_units[current_bindpoint].texture_2d = 0;
+ continue;
+ }
texture_samplers[current_bindpoint].SyncWithConfig(texture.tsc);
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 ae48378f3..9410ddb4e 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp
@@ -461,6 +461,11 @@ Surface RasterizerCacheOpenGL::GetSurface(const SurfaceParams& params) {
return {};
}
+ const auto& gpu = Core::System::GetInstance().GPU();
+ // Don't try to create any entries in the cache if the address of the texture is invalid.
+ if (gpu.memory_manager->GpuToCpuAddress(params.addr) == boost::none)
+ return {};
+
// Check for an exact match in existing surfaces
const auto& surface_key{SurfaceKey::Create(params)};
const auto& search{surface_cache.find(surface_key)};