Migrate shaders to the registry (#964)

Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
This commit is contained in:
mwilsnd
2023-04-04 14:00:12 -05:00
committed by GitHub
parent daeae05181
commit f207aee091
97 changed files with 1924 additions and 3577 deletions

View File

@@ -134,14 +134,17 @@ void RenderTile::finishRender(PaintParameters& parameters) const {
static const style::Properties<>::PossiblyEvaluated properties {};
static const DebugProgram::Binders paintAttributeData(properties, 0);
auto& program = parameters.programs.debug;
auto program = parameters.shaders.get<DebugProgram>();
if (!program) {
return;
}
if (parameters.debugOptions & (MapDebugOptions::Timestamps | MapDebugOptions::ParseStatus)) {
assert(debugBucket);
const auto allAttributeBindings =
DebugProgram::computeAllAttributeBindings(*debugBucket->vertexBuffer, paintAttributeData, properties);
program.draw(parameters.context,
program->draw(parameters.context,
*parameters.renderPass,
gfx::Lines{4.0f * parameters.pixelRatio},
gfx::DepthMode::disabled(),
@@ -161,7 +164,7 @@ void RenderTile::finishRender(PaintParameters& parameters) const {
DebugProgram::TextureBindings{textures::image::Value{debugBucket->texture->getResource()}},
"text-outline");
program.draw(parameters.context,
program->draw(parameters.context,
*parameters.renderPass,
gfx::Lines{2.0f * parameters.pixelRatio},
gfx::DepthMode::disabled(),
@@ -187,7 +190,7 @@ void RenderTile::finishRender(PaintParameters& parameters) const {
if (debugBucket->tileBorderSegments.empty()) {
debugBucket->tileBorderSegments = RenderStaticData::tileBorderSegments();
}
parameters.programs.debug.draw(
program->draw(
parameters.context,
*parameters.renderPass,
gfx::LineStrip{4.0f * parameters.pixelRatio},