Browse Source

fix to LoadShaderFromMemory (#1851)

- the shader.locs now match the LoadShader function

Without this change, the lighting sample looks incorrect when
using LoadShaderFromMemory

Co-authored-by: Ruminant <psp5150+git@gmail.com>
pull/1856/head
Ruminant 3 years ago
committed by GitHub
parent
commit
f3eff740ce
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/core.c

+ 2
- 1
src/core.c View File

@ -2414,8 +2414,9 @@ RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode)
// Get handles to GLSL uniform locations (vertex shader)
shader.locs[SHADER_LOC_MATRIX_MVP] = rlGetLocationUniform(shader.id, "mvp");
shader.locs[SHADER_LOC_MATRIX_PROJECTION] = rlGetLocationUniform(shader.id, "projection");
shader.locs[SHADER_LOC_MATRIX_VIEW] = rlGetLocationUniform(shader.id, "view");
shader.locs[SHADER_LOC_MATRIX_PROJECTION] = rlGetLocationUniform(shader.id, "projection");
shader.locs[SHADER_LOC_MATRIX_NORMAL] = rlGetLocationUniform(shader.id, "matNormal");
// Get handles to GLSL uniform locations (fragment shader)
shader.locs[SHADER_LOC_COLOR_DIFFUSE] = rlGetLocationUniform(shader.id, "colDiffuse");

Loading…
Cancel
Save