mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-18 13:41:26 +01:00
Fix rlSetUniformSampler (#3759)
Fix rlSetUniformSampler not setting sampler uniform if the same texture was already passed to a different sampler uniform
This commit is contained in:
@ -4135,7 +4135,14 @@ void rlSetUniformSampler(int locIndex, unsigned int textureId)
|
|||||||
{
|
{
|
||||||
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2)
|
||||||
// Check if texture is already active
|
// 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
|
// Register a new active texture for the internal batch system
|
||||||
// NOTE: Default texture is always activated as GL_TEXTURE0
|
// NOTE: Default texture is always activated as GL_TEXTURE0
|
||||||
|
|||||||
Reference in New Issue
Block a user