Browse Source

use new utilCStrMatch function instead of hashing

main
cinnaboot 4 years ago
parent
commit
48556e6c2b
  1. 5
      src/shader.cpp

5
src/shader.cpp

@ -143,11 +143,8 @@ getShaderByHash(GLContext* gl_ctx, u64 hash)
ShaderProgram* ShaderProgram*
getShaderByName(const char* name, GLContext* gl_ctx) getShaderByName(const char* name, GLContext* gl_ctx)
{ {
// FIXME: no reason to use hashes here. should use std::strncmp instead
u64 hash = utilFNV64a_str(name);
for (u32 i = 0; i < gl_ctx->num_shaders; i++) { for (u32 i = 0; i < gl_ctx->num_shaders; i++) {
if (utilFNV64a_str(gl_ctx->shaders[i].name) == hash) if (utilCStrMatch(name, gl_ctx->shaders[i].name))
return &gl_ctx->shaders[i]; return &gl_ctx->shaders[i];
} }

Loading…
Cancel
Save