[MODELS] Better fix for GPU skinning issues (#4353)

* Make the max VBO match the animation flag.

* re-enable GPU skinning for mac, and fix the max buffer to be correct based on the GPU skinning support flag.
This commit is contained in:
Jeffery Myers
2024-10-02 01:49:56 -07:00
committed by GitHub
parent d9c10ed264
commit 09987b01cc
3 changed files with 13 additions and 10 deletions

View File

@@ -1345,7 +1345,7 @@ void UploadMesh(Mesh *mesh, bool dynamic)
rlDisableVertexAttribute(RL_DEFAULT_SHADER_ATTRIB_LOCATION_TEXCOORD2);
}
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
if (mesh->boneIds != NULL)
{
// Enable vertex attribute: boneIds (shader-location = 6)
@@ -1492,7 +1492,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
// Upload model normal matrix (if locations available)
if (material.shader.locs[SHADER_LOC_MATRIX_NORMAL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_NORMAL], MatrixTranspose(MatrixInvert(matModel)));
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
// Upload Bone Transforms
if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices)
{
@@ -1578,7 +1578,7 @@ void DrawMesh(Mesh mesh, Material material, Matrix transform)
rlEnableVertexAttribute(material.shader.locs[SHADER_LOC_VERTEX_TEXCOORD02]);
}
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
// Bind mesh VBO data: vertex bone ids (shader-location = 6, if available)
if (material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1)
{
@@ -1738,7 +1738,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
// Upload model normal matrix (if locations available)
if (material.shader.locs[SHADER_LOC_MATRIX_NORMAL] != -1) rlSetUniformMatrix(material.shader.locs[SHADER_LOC_MATRIX_NORMAL], MatrixTranspose(MatrixInvert(matModel)));
#ifdef RL_SUPPORT_MESH_ANIMATION_VBO
#ifdef RL_SUPPORT_MESH_GPU_SKINNING
// Upload Bone Transforms
if (material.shader.locs[SHADER_LOC_BONE_MATRICES] != -1 && mesh.boneMatrices)
{