Skip to content

Commit

Permalink
REVIEWED: LoadShaderFromMemory(), use default locations for default…
Browse files Browse the repository at this point in the history
… shader #4641
  • Loading branch information
raysan5 committed Dec 28, 2024
1 parent 5b82258 commit c0f2067
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1326,9 +1326,10 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode)

shader.id = rlLoadShaderCode(vsCode, fsCode);

// After shader loading, we TRY to set default location names
if (shader.id > 0)
if (shader.id == rlGetShaderIdDefault()) shader.locs = rlGetShaderLocsDefault();
else if (shader.id > 0)
{
// After custom shader loading, we TRY to set default location names
// Default shader attribute locations have been binded before linking:
// vertex position location = 0
// vertex texcoord location = 1
Expand Down

0 comments on commit c0f2067

Please sign in to comment.