Enable GPU skinning for GL 3.3+, (#5902)

only do GPU skinning if the shader supports bone IDs.
This commit is contained in:
Jeffery Myers
2026-06-01 11:25:09 -07:00
committed by GitHub
parent 10a889c482
commit f1d602029c
2 changed files with 9 additions and 2 deletions

View File

@@ -322,7 +322,11 @@
#endif
#ifndef SUPPORT_GPU_SKINNING
// GPU skinning disabled by default, some GPUs do not support more than 8 VBOs
#define SUPPORT_GPU_SKINNING 0
#if defined (GRAPHICS_API_OPENGL_33) || defined (GRAPHICS_API_OPENGL_43)
#define SUPPORT_GPU_SKINNING 1
#else
#define SUPPORT_GPU_SKINNING 0
#endif
#endif
//------------------------------------------------------------------------------------

View File

@@ -2487,9 +2487,12 @@ static void UpdateModelAnimationVertexBuffers(Model model)
float boneWeight = 0.0f;
bool bufferUpdateRequired = false; // Flag to check when anim vertex information is updated
#if defined (SUPPORT_GPU_SKINNING)
Material material = model.materials[model.meshMaterial[m]];
// Skip if missing bone data or missing anim buffers initialization
if ((mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) ||
if ((material.shader.locs[SHADER_LOC_VERTEX_BONEIDS] != -1) && (mesh.boneWeights == NULL) || (mesh.boneIndices == NULL) ||
(mesh.animVertices == NULL) || (mesh.animNormals == NULL)) continue;
#endif
for (int vCounter = 0; vCounter < vertexValuesCount; vCounter += 3)
{