From 4d4b833a001a9b1022ee3c4a694cb007ad294515 Mon Sep 17 00:00:00 2001 From: wwylele Date: Sat, 30 Jun 2018 11:36:39 +0300 Subject: [PATCH] swrasterizer, gl_shader_gen: return 0.0 for Disabled texture unit 0 --- src/video_core/renderer_opengl/gl_shader_gen.cpp | 2 ++ src/video_core/swrasterizer/rasterizer.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 0c71c93459..6df682c5b5 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -319,6 +319,8 @@ static std::string SampleTexture(const PicaFSConfig& config, unsigned texture_un return "shadowTexture(texcoord0, texcoord0_w)"; case TexturingRegs::TextureConfig::ShadowCube: return "shadowTextureCube(texcoord0, texcoord0_w)"; + case TexturingRegs::TextureConfig::Disabled: + return "vec4(0.0)"; default: LOG_CRITICAL(HW_GPU, "Unhandled texture type {:x}", static_cast(state.texture0_type)); diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp index d6d5256bfa..2e41e35b88 100644 --- a/src/video_core/swrasterizer/rasterizer.cpp +++ b/src/video_core/swrasterizer/rasterizer.cpp @@ -361,9 +361,10 @@ static void ProcessTriangleInternal(const Vertex& v0, const Vertex& v1, const Ve shadow_z = float24::FromFloat32(std::abs(tc0_w.ToFloat32())); break; } + case TexturingRegs::TextureConfig::Disabled: + continue; // skip this unit and continue to the next unit default: - // TODO: Change to LOG_ERROR when more types are handled. - LOG_DEBUG(HW_GPU, "Unhandled texture type {:x}", (int)texture.config.type); + LOG_ERROR(HW_GPU, "Unhandled texture type {:x}", (int)texture.config.type); UNIMPLEMENTED(); break; }