From c0f2067dbadecbc0130acb08f931361ebaed4d54 Mon Sep 17 00:00:00 2001 From: Ray Date: Sat, 28 Dec 2024 16:35:42 +0100 Subject: [PATCH] REVIEWED: `LoadShaderFromMemory()`, use default locations for default shader #4641 --- src/rcore.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rcore.c b/src/rcore.c index 5ba24a5b..17634a52 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -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