Add action journal (#3409)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bart Louwers <bart@emeel.net>
This commit is contained in:
@@ -220,6 +220,7 @@ const root = path.dirname(import.meta.dirname);
|
||||
const outLocation = args.out ? args.out : root;
|
||||
const shaderRoot = path.join(root, "shaders");
|
||||
const outputRoot = path.join(outLocation, "include/mbgl/shaders");
|
||||
const cppOutputRoot = path.join(outLocation, "src/mbgl/shaders");
|
||||
let generatedHeaders = [];
|
||||
let shaderNames = [];
|
||||
|
||||
@@ -317,4 +318,21 @@ struct ShaderSource<BuiltIn::None, gfx::Backend::Type::OpenGL> {
|
||||
} // namespace mbgl
|
||||
`);
|
||||
|
||||
// Generate shader_source.cpp
|
||||
fs.writeFileSync(path.join(cppOutputRoot, "shader_source.cpp"),
|
||||
`${generatedHeader}
|
||||
#include <mbgl/shaders/shader_source.hpp>
|
||||
#include <mbgl/util/enum.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
using namespace shaders;
|
||||
|
||||
MBGL_DEFINE_ENUM(BuiltIn, {
|
||||
{BuiltIn::None, "None"},${shaderNames.map(name => `\n{BuiltIn::` + name + `, "` + name + `"}`)}
|
||||
});
|
||||
|
||||
} // namespace mbgl
|
||||
`);
|
||||
|
||||
console.log("Shaders generated!");
|
||||
|
||||
Reference in New Issue
Block a user