diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-12 01:56:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-12 01:56:28 +0200 |
commit | 403dfd68fc41cec2261915d1647305c016a93440 (patch) | |
tree | b6490574200d79a0a8de65f5e491616b08517d59 /src/video_core/renderer_opengl/gl_shader_decompiler.cpp | |
parent | Merge pull request #1009 from bunnei/rg8-rgba8-snorm (diff) | |
parent | gl_shader_decompiler: Improve handling of unknown input/output attributes. (diff) | |
download | yuzu-403dfd68fc41cec2261915d1647305c016a93440.tar yuzu-403dfd68fc41cec2261915d1647305c016a93440.tar.gz yuzu-403dfd68fc41cec2261915d1647305c016a93440.tar.bz2 yuzu-403dfd68fc41cec2261915d1647305c016a93440.tar.lz yuzu-403dfd68fc41cec2261915d1647305c016a93440.tar.xz yuzu-403dfd68fc41cec2261915d1647305c016a93440.tar.zst yuzu-403dfd68fc41cec2261915d1647305c016a93440.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_decompiler.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 8954deb81..85297bd00 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -358,7 +358,12 @@ public: void SetOutputAttributeToRegister(Attribute::Index attribute, u64 elem, const Register& reg) { std::string dest = GetOutputAttribute(attribute) + GetSwizzle(elem); std::string src = GetRegisterAsFloat(reg); - shader.AddLine(dest + " = " + src + ';'); + + if (!dest.empty()) { + // Can happen with unknown/unimplemented output attributes, in which case we ignore the + // instruction for now. + shader.AddLine(dest + " = " + src + ';'); + } } /// Generates code representing a uniform (C buffer) register, interpreted as the input type. @@ -534,20 +539,16 @@ private: // shader. ASSERT(stage == Maxwell3D::Regs::ShaderStage::Vertex); return "vec4(0, 0, uintBitsToFloat(gl_InstanceID), uintBitsToFloat(gl_VertexID))"; - case Attribute::Index::Unknown_63: - // TODO(bunnei): Figure out what this is used for. Super Mario Odyssey uses this. - LOG_CRITICAL(HW_GPU, "Unhandled input attribute Unknown_63"); - UNREACHABLE(); - break; default: const u32 index{static_cast<u32>(attribute) - static_cast<u32>(Attribute::Index::Attribute_0)}; - if (attribute >= Attribute::Index::Attribute_0) { + if (attribute >= Attribute::Index::Attribute_0 && + attribute <= Attribute::Index::Attribute_31) { declr_input_attribute.insert(attribute); return "input_attribute_" + std::to_string(index); } - LOG_CRITICAL(HW_GPU, "Unhandled input attribute: {}", index); + LOG_CRITICAL(HW_GPU, "Unhandled input attribute: {}", static_cast<u32>(attribute)); UNREACHABLE(); } @@ -569,6 +570,7 @@ private: LOG_CRITICAL(HW_GPU, "Unhandled output attribute: {}", index); UNREACHABLE(); + return {}; } } |