Skip to content

Commit

Permalink
Metal backend fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilsnd committed Aug 28, 2024
1 parent d6cdab3 commit b188487
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mbgl/mtl/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ UniqueShaderProgram Context::createProgram(shaders::BuiltIn shaderID,
std::string defineStr;
std::vector<const NS::Object*> rawDefines;
rawDefines.reserve(2 * numDefines);
const auto addDefine = [&rawDefines](const auto& pair) {
const auto addDefine = [&rawDefines, &defineStr](const auto& pair) {
const auto* nsKey = NS::String::string(pair.first.data(), NS::UTF8StringEncoding);
const auto* nsVal = NS::String::string(pair.second.data(), NS::UTF8StringEncoding);
rawDefines.insert(std::next(rawDefines.begin(), rawDefines.size() / 2), nsKey);
Expand Down Expand Up @@ -168,7 +168,7 @@ UniqueShaderProgram Context::createProgram(shaders::BuiltIn shaderID,
fragmentFunction = NS::TransferPtr(library->newFunction(nsFragName));
if (!fragmentFunction) {
Log::Error(Event::Shader, name + " missing fragment function " + fragmentName.data());
observer->onShaderCompileFailed(shaderID, gfx::Backend::Type::Metal, additionalDefines);
observer->onShaderCompileFailed(shaderID, gfx::Backend::Type::Metal, defineStr);
assert(false);
return nullptr;
}
Expand Down

0 comments on commit b188487

Please sign in to comment.