VERY experimental Nintendo Switch 2 emulator
C++
GPU: Ignore disabled textures and textures with an invalid address.
Subv9819aa1298cc
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cppindex 62ee45a368..45560fbee0 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.cppindex 63f5999eae..44054f338f 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) {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 surfacesconst auto& surface_key{SurfaceKey::Create(params)};const auto& search{surface_cache.find(surface_key)};