Skip to content

Commit

Permalink
vulkan: fix crash when using wrong uniform name
Browse files Browse the repository at this point in the history
  • Loading branch information
nikeinikei committed Oct 9, 2023
1 parent 88272c6 commit 2749209
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/graphics/vulkan/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,8 @@ int Shader::getVertexAttributeIndex(const std::string &name)

const Shader::UniformInfo *Shader::getUniformInfo(const std::string &name) const
{
return &uniformInfos.at(name);
const auto it = uniformInfos.find(name);
return it != uniformInfos.end() ? &(it->second) : nullptr;
}

const Shader::UniformInfo *Shader::getUniformInfo(BuiltinUniform builtin) const
Expand Down

0 comments on commit 2749209

Please sign in to comment.