mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix vertex shader generator bug. Got caught by the new test
This commit is contained in:
parent
34874238ac
commit
085900adb5
1 changed files with 3 additions and 3 deletions
|
@ -858,14 +858,14 @@ bool GenerateVertexShader(const VShaderID &id, char *buffer, const ShaderLanguag
|
||||||
|
|
||||||
// Uncomment this to screw up bone shaders to check the vertex shader software fallback
|
// Uncomment this to screw up bone shaders to check the vertex shader software fallback
|
||||||
// WRITE(p, "THIS SHOULD ERROR! #error");
|
// WRITE(p, "THIS SHOULD ERROR! #error");
|
||||||
if (numBoneWeights == 1 && compat.shaderLanguage != GLSL_VULKAN)
|
if (numBoneWeights == 1 && ShaderLanguageIsOpenGL(compat.shaderLanguage))
|
||||||
WRITE(p, " %s skinMatrix = w1 * u_bone0", boneMatrix);
|
WRITE(p, " %s skinMatrix = w1 * u_bone0", boneMatrix);
|
||||||
else
|
else
|
||||||
WRITE(p, " %s skinMatrix = w1.x * u_bone0", boneMatrix);
|
WRITE(p, " %s skinMatrix = w1.x * u_bone0", boneMatrix);
|
||||||
for (int i = 1; i < numBoneWeights; i++) {
|
for (int i = 1; i < numBoneWeights; i++) {
|
||||||
const char *weightAttr = boneWeightAttr[i];
|
const char *weightAttr = boneWeightAttr[i];
|
||||||
// workaround for "cant do .x of scalar" issue
|
// workaround for "cant do .x of scalar" issue.
|
||||||
if (compat.shaderLanguage != GLSL_VULKAN) {
|
if (ShaderLanguageIsOpenGL(compat.shaderLanguage)) {
|
||||||
if (numBoneWeights == 1 && i == 0) weightAttr = "w1";
|
if (numBoneWeights == 1 && i == 0) weightAttr = "w1";
|
||||||
if (numBoneWeights == 5 && i == 4) weightAttr = "w2";
|
if (numBoneWeights == 5 && i == 4) weightAttr = "w2";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue