Shader Decompiler: Fix vertex attribute upload

This commit is contained in:
wheremyfoodat 2024-07-26 00:21:26 +03:00
parent efcb42af2c
commit d9f4f3736f
3 changed files with 34 additions and 21 deletions

View file

@ -364,7 +364,8 @@ void GPU::drawArrays() {
PICA::Vertex& out = vertices[i];
for (int j = 0; j < totalAttribCount; j++) {
const u32 mapping = (inputAttrCfg >> (j * 4)) & 0xf;
std::memcpy(&out.raw[mapping], &currentAttributes[j], sizeof(vec4f));
// Multiply mapping * 4 as mapping refers to a vec4 whereas out.raw is an array of floats
std::memcpy(&out.raw[mapping * 4], &currentAttributes[j], sizeof(vec4f));
}
}
}