Add shader registry (#924)

This commit is contained in:
mwilsnd
2023-03-27 12:41:38 -05:00
committed by GitHub
parent 7c96e517c3
commit 1d8c4b527f
23 changed files with 416 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
#include <mbgl/programs/program_parameters.hpp>
#include <mbgl/util/string.hpp>
#include <string_view>
namespace mbgl {
@@ -15,11 +16,28 @@ ProgramParameters::ProgramParameters(const float pixelRatio,
result += "#define OVERDRAW_INSPECTOR\n";
}
return result;
}()) {
}())
{}
ProgramParameters ProgramParameters::withShaderSource(std::string_view vertexSource,
std::string_view fragmentSource) const noexcept
{
ProgramParameters params = *this;
params.vertexSource_ = vertexSource;
params.fragmentSource_ = fragmentSource;
return params;
}
const std::string& ProgramParameters::getDefines() const {
return defines;
}
const std::string& ProgramParameters::vertexSource() const noexcept {
return vertexSource_;
}
const std::string& ProgramParameters::fragmentSource() const noexcept {
return fragmentSource_;
}
} // namespace mbgl