1
0
Fork 0
forked from suyu/suyu

Merge pull request #1029 from bunnei/fix-out-attrib

gl_shader_decompiler: Fix SetOutputAttributeToRegister empty check.
This commit is contained in:
bunnei 2018-08-12 04:09:41 -04:00 committed by GitHub
commit 5926fbd3d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -356,13 +356,13 @@ public:
* @param reg The register to use as the source value. * @param reg The register to use as the source value.
*/ */
void SetOutputAttributeToRegister(Attribute::Index attribute, u64 elem, const Register& reg) { void SetOutputAttributeToRegister(Attribute::Index attribute, u64 elem, const Register& reg) {
std::string dest = GetOutputAttribute(attribute) + GetSwizzle(elem); std::string dest = GetOutputAttribute(attribute);
std::string src = GetRegisterAsFloat(reg); std::string src = GetRegisterAsFloat(reg);
if (!dest.empty()) { if (!dest.empty()) {
// Can happen with unknown/unimplemented output attributes, in which case we ignore the // Can happen with unknown/unimplemented output attributes, in which case we ignore the
// instruction for now. // instruction for now.
shader.AddLine(dest + " = " + src + ';'); shader.AddLine(dest + GetSwizzle(elem) + " = " + src + ';');
} }
} }