Parcourir la source

Fix rlSetUniformSampler (#3759)

Fix rlSetUniformSampler not setting sampler uniform if the same texture was already passed to a different sampler uniform
pull/3769/head
veins1 il y a 1 an
committed by GitHub
Parent
révision
f4add5f10d
Aucune clé connue n'a été trouvée dans la base pour cette signature ID de la clé GPG: B5690EEEBB952194
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. +8
    -1
      src/rlgl.h

+ 8
- 1
src/rlgl.h Voir le fichier

@ -4135,7 +4135,14 @@ void rlSetUniformSampler(int locIndex, unsigned int textureId)
{
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
// Check if texture is already active
for (int i = 0; i < RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS; i++) if (RLGL.State.activeTextureId[i] == textureId) return;
for (int i = 0; i < RL_DEFAULT_BATCH_MAX_TEXTURE_UNITS; i++)
{
if (RLGL.State.activeTextureId[i] == textureId)
{
glUniform1i(locIndex, 1 + i);
return;
}
}
// Register a new active texture for the internal batch system
// NOTE: Default texture is always activated as GL_TEXTURE0

Chargement…
Annuler
Enregistrer