History

static pipelines + misc render cleanup

HifiExperiments committed 2 years ago

Commit 68767421 parent a22087233 files · +169 −142Browse files

Showing the changes to libraries/render/src/render/DrawSceneOctree.cpp (1 of 33 files). Show all

Unified · Split

libraries/render/src/render/DrawSceneOctree.cpp+11−4
@@ -24,6 +24,15 @@ · 23 unmodified lines
2424
2525 using namespace render;
2626
27+gpu::PipelinePointer DrawSceneOctree::_drawCellBoundsPipeline;
28+gpu::PipelinePointer DrawSceneOctree::_drawLODReticlePipeline;
29+gpu::PipelinePointer DrawSceneOctree::_drawItemBoundPipeline;
30+gpu::Stream::FormatPointer DrawSceneOctree::_cellBoundsFormat = std::make_shared<gpu::Stream::Format>();
31+
32+DrawSceneOctree::DrawSceneOctree() {
33+ _cellBoundsFormat->setAttribute(0, 0, gpu::Element(gpu::VEC4, gpu::INT32, gpu::XYZW), 0, gpu::Stream::PER_INSTANCE);
34+}
35+
2736 const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
2837 if (!_drawCellBoundsPipeline) {
2938 gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);
@@ -36,9 +45,6 @@ const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() { · 6 unmodified lines
3645
3746 // Good to go add the brand new pipeline
3847 _drawCellBoundsPipeline = gpu::Pipeline::create(program, state);
39− _cellBoundsFormat = std::make_shared<gpu::Stream::Format>();
40− _cellBoundsFormat->setAttribute(0, 0, gpu::Element(gpu::VEC4, gpu::INT32, gpu::XYZW), 0, gpu::Stream::PER_INSTANCE);
41− _cellBoundsBuffer = std::make_shared<gpu::Buffer>();
4248 }
4349 return _drawCellBoundsPipeline;
4450 }
@@ -62,7 +68,6 @@ void DrawSceneOctree::configure(const Config& config) { · 17 unmodified lines
6268 _showEmptyCells = config.showEmptyCells;
6369 }
6470
65−
6671 void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {
6772 assert(renderContext->args);
6873 assert(renderContext->args->hasViewFrustum());
@@ -132,6 +137,8 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS · 63 unmodified lines
132137 });
133138 }
134139
140+gpu::PipelinePointer DrawItemSelection::_drawItemBoundPipeline;
141+
135142 const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {
136143 if (!_drawItemBoundPipeline) {
137144 gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemBounds);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t