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
24 24
25using namespace render;25using namespace render;
26 26
27gpu::PipelinePointer DrawSceneOctree::_drawCellBoundsPipeline;
28gpu::PipelinePointer DrawSceneOctree::_drawLODReticlePipeline;
29gpu::PipelinePointer DrawSceneOctree::_drawItemBoundPipeline;
30gpu::Stream::FormatPointer DrawSceneOctree::_cellBoundsFormat = std::make_shared<gpu::Stream::Format>();
31
32DrawSceneOctree::DrawSceneOctree() {
33 _cellBoundsFormat->setAttribute(0, 0, gpu::Element(gpu::VEC4, gpu::INT32, gpu::XYZW), 0, gpu::Stream::PER_INSTANCE);
34}
35
27const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {36const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() {
28 if (!_drawCellBoundsPipeline) {37 if (!_drawCellBoundsPipeline) {
29 gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);38 gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawCellBounds);
@@ -36,9 +45,6 @@ const gpu::PipelinePointer DrawSceneOctree::getDrawCellBoundsPipeline() { · 6 unmodified lines
36 45
37 // Good to go add the brand new pipeline46 // Good to go add the brand new pipeline
38 _drawCellBoundsPipeline = gpu::Pipeline::create(program, state);47 _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>();
42 }48 }
43 return _drawCellBoundsPipeline;49 return _drawCellBoundsPipeline;
44}50}
@@ -62,7 +68,6 @@ void DrawSceneOctree::configure(const Config& config) { · 17 unmodified lines
62 _showEmptyCells = config.showEmptyCells;68 _showEmptyCells = config.showEmptyCells;
63}69}
64 70
65
66void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {71void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) {
67 assert(renderContext->args);72 assert(renderContext->args);
68 assert(renderContext->args->hasViewFrustum());73 assert(renderContext->args->hasViewFrustum());
@@ -132,6 +137,8 @@ void DrawSceneOctree::run(const RenderContextPointer& renderContext, const ItemS · 63 unmodified lines
132 });137 });
133}138}
134 139
140gpu::PipelinePointer DrawItemSelection::_drawItemBoundPipeline;
141
135const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {142const gpu::PipelinePointer DrawItemSelection::getDrawItemBoundPipeline() {
136 if (!_drawItemBoundPipeline) {143 if (!_drawItemBoundPipeline) {
137 gpu::ShaderPointer program = gpu::Shader::createProgram(shader::render::program::drawItemBounds);144 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