Rename the _pipeline into _shapePipeline in the render::Args

This commit is contained in:
Sam Gateau 2017-07-10 12:16:53 +02:00
parent a8086764da
commit 4edea433ce
9 changed files with 31 additions and 31 deletions

View file

@ -80,8 +80,8 @@ void Circle3DOverlay::render(RenderArgs* args) {
Q_ASSERT(args->_batch); Q_ASSERT(args->_batch);
auto& batch = *args->_batch; auto& batch = *args->_batch;
if (args->_pipeline) { if (args->_shapePipeline) {
batch.setPipeline(args->_pipeline->pipeline); batch.setPipeline(args->_shapePipeline->pipeline);
} }
// FIXME: THe line width of _lineWidth is not supported anymore, we ll need a workaround // FIXME: THe line width of _lineWidth is not supported anymore, we ll need a workaround

View file

@ -65,15 +65,15 @@ void Cube3DOverlay::render(RenderArgs* args) {
transform.setTranslation(position); transform.setTranslation(position);
transform.setRotation(rotation); transform.setRotation(rotation);
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
auto pipeline = args->_pipeline; auto shapePipeline = args->_shapePipeline;
if (!pipeline) { if (!shapePipeline) {
pipeline = _isSolid ? geometryCache->getOpaqueShapePipeline() : geometryCache->getWireShapePipeline(); shapePipeline = _isSolid ? geometryCache->getOpaqueShapePipeline() : geometryCache->getWireShapePipeline();
} }
if (_isSolid) { if (_isSolid) {
transform.setScale(dimensions); transform.setScale(dimensions);
batch->setModelTransform(transform); batch->setModelTransform(transform);
geometryCache->renderSolidCubeInstance(args, *batch, cubeColor, pipeline); geometryCache->renderSolidCubeInstance(args, *batch, cubeColor, shapePipeline);
} else { } else {
geometryCache->bindSimpleProgram(*batch, false, false, false, true, true); geometryCache->bindSimpleProgram(*batch, false, false, false, true, true);
if (getIsDashedLine()) { if (getIsDashedLine()) {
@ -109,7 +109,7 @@ void Cube3DOverlay::render(RenderArgs* args) {
} else { } else {
transform.setScale(dimensions); transform.setScale(dimensions);
batch->setModelTransform(transform); batch->setModelTransform(transform);
geometryCache->renderWireCubeInstance(args, *batch, cubeColor, pipeline); geometryCache->renderWireCubeInstance(args, *batch, cubeColor, shapePipeline);
} }
} }
} }

View file

@ -45,17 +45,17 @@ void Shape3DOverlay::render(RenderArgs* args) {
transform.setTranslation(position); transform.setTranslation(position);
transform.setRotation(rotation); transform.setRotation(rotation);
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
auto pipeline = args->_pipeline; auto shapePipeline = args->_shapePipeline;
if (!pipeline) { if (!shapePipeline) {
pipeline = _isSolid ? geometryCache->getOpaqueShapePipeline() : geometryCache->getWireShapePipeline(); shapePipeline = _isSolid ? geometryCache->getOpaqueShapePipeline() : geometryCache->getWireShapePipeline();
} }
transform.setScale(dimensions); transform.setScale(dimensions);
batch->setModelTransform(transform); batch->setModelTransform(transform);
if (_isSolid) { if (_isSolid) {
geometryCache->renderSolidShapeInstance(args, *batch, _shape, cubeColor, pipeline); geometryCache->renderSolidShapeInstance(args, *batch, _shape, cubeColor, shapePipeline);
} else { } else {
geometryCache->renderWireShapeInstance(args, *batch, _shape, cubeColor, pipeline); geometryCache->renderWireShapeInstance(args, *batch, _shape, cubeColor, shapePipeline);
} }
} }
} }

View file

@ -44,15 +44,15 @@ void Sphere3DOverlay::render(RenderArgs* args) {
batch->setModelTransform(transform); batch->setModelTransform(transform);
auto geometryCache = DependencyManager::get<GeometryCache>(); auto geometryCache = DependencyManager::get<GeometryCache>();
auto pipeline = args->_pipeline; auto shapePipeline = args->_shapePipeline;
if (!pipeline) { if (!shapePipeline) {
pipeline = _isSolid ? geometryCache->getOpaqueShapePipeline() : geometryCache->getWireShapePipeline(); shapePipeline = _isSolid ? geometryCache->getOpaqueShapePipeline() : geometryCache->getWireShapePipeline();
} }
if (_isSolid) { if (_isSolid) {
geometryCache->renderSolidSphereInstance(args, *batch, sphereColor, pipeline); geometryCache->renderSolidSphereInstance(args, *batch, sphereColor, shapePipeline);
} else { } else {
geometryCache->renderWireSphereInstance(args, *batch, sphereColor, pipeline); geometryCache->renderWireSphereInstance(args, *batch, sphereColor, shapePipeline);
} }
} }
} }

View file

@ -137,8 +137,8 @@ void Text3DOverlay::render(RenderArgs* args) {
// Text renderer sets its own pipeline, // Text renderer sets its own pipeline,
_textRenderer->draw(batch, 0, 0, getText(), textColor, glm::vec2(-1.0f), getDrawInFront()); _textRenderer->draw(batch, 0, 0, getText(), textColor, glm::vec2(-1.0f), getDrawInFront());
// so before we continue, we must reset the pipeline // so before we continue, we must reset the pipeline
batch.setPipeline(args->_pipeline->pipeline); batch.setPipeline(args->_shapePipeline->pipeline);
args->_pipeline->prepare(batch, args); args->_shapePipeline->prepare(batch, args);
} }
const render::ShapeKey Text3DOverlay::getShapeKey() { const render::ShapeKey Text3DOverlay::getShapeKey() {

View file

@ -259,7 +259,7 @@ void MeshPartPayload::render(RenderArgs* args) {
gpu::Batch& batch = *(args->_batch); gpu::Batch& batch = *(args->_batch);
auto locations = args->_pipeline->locations; auto locations = args->_shapePipeline->locations;
assert(locations); assert(locations);
// Bind the model transform and the skinCLusterMatrices if needed // Bind the model transform and the skinCLusterMatrices if needed
@ -583,7 +583,7 @@ void ModelMeshPartPayload::render(RenderArgs* args) {
} }
gpu::Batch& batch = *(args->_batch); gpu::Batch& batch = *(args->_batch);
auto locations = args->_pipeline->locations; auto locations = args->_shapePipeline->locations;
assert(locations); assert(locations);
bindTransform(batch, locations, args->_renderMode); bindTransform(batch, locations, args->_renderMode);

View file

@ -68,7 +68,7 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext,
std::vector<ShapeKey> skinnedShapeKeys{}; std::vector<ShapeKey> skinnedShapeKeys{};
// Iterate through all inShapes and render the unskinned // Iterate through all inShapes and render the unskinned
args->_pipeline = shadowPipeline; args->_shapePipeline = shadowPipeline;
batch.setPipeline(shadowPipeline->pipeline); batch.setPipeline(shadowPipeline->pipeline);
for (auto items : inShapes) { for (auto items : inShapes) {
if (items.first.isSkinned()) { if (items.first.isSkinned()) {
@ -79,13 +79,13 @@ void RenderShadowMap::run(const render::RenderContextPointer& renderContext,
} }
// Reiterate to render the skinned // Reiterate to render the skinned
args->_pipeline = shadowSkinnedPipeline; args->_shapePipeline = shadowSkinnedPipeline;
batch.setPipeline(shadowSkinnedPipeline->pipeline); batch.setPipeline(shadowSkinnedPipeline->pipeline);
for (const auto& key : skinnedShapeKeys) { for (const auto& key : skinnedShapeKeys) {
renderItems(renderContext, inShapes.at(key)); renderItems(renderContext, inShapes.at(key));
} }
args->_pipeline = nullptr; args->_shapePipeline = nullptr;
args->_batch = nullptr; args->_batch = nullptr;
}); });
} }

View file

@ -103,7 +103,7 @@ namespace render {
std::shared_ptr<gpu::Context> _context; std::shared_ptr<gpu::Context> _context;
std::shared_ptr<gpu::Framebuffer> _blitFramebuffer; std::shared_ptr<gpu::Framebuffer> _blitFramebuffer;
std::shared_ptr<render::ShapePipeline> _pipeline; std::shared_ptr<render::ShapePipeline> _shapePipeline;
QSharedPointer<QObject> _renderData; QSharedPointer<QObject> _renderData;
std::stack<ViewFrustum> _viewFrustums; std::stack<ViewFrustum> _viewFrustums;
glm::ivec4 _viewport { 0.0f, 0.0f, 1.0f, 1.0f }; glm::ivec4 _viewport { 0.0f, 0.0f, 1.0f, 1.0f };

View file

@ -43,11 +43,11 @@ void renderShape(RenderArgs* args, const ShapePlumberPointer& shapeContext, cons
assert(item.getKey().isShape()); assert(item.getKey().isShape());
auto key = item.getShapeKey() | globalKey; auto key = item.getShapeKey() | globalKey;
if (key.isValid() && !key.hasOwnPipeline()) { if (key.isValid() && !key.hasOwnPipeline()) {
args->_pipeline = shapeContext->pickPipeline(args, key); args->_shapePipeline = shapeContext->pickPipeline(args, key);
if (args->_pipeline) { if (args->_shapePipeline) {
item.render(args); item.render(args);
} }
args->_pipeline = nullptr; args->_shapePipeline = nullptr;
} else if (key.hasOwnPipeline()) { } else if (key.hasOwnPipeline()) {
item.render(args); item.render(args);
} else { } else {
@ -109,15 +109,15 @@ void render::renderStateSortShapes(const RenderContextPointer& renderContext,
// Then render // Then render
for (auto& pipelineKey : sortedPipelines) { for (auto& pipelineKey : sortedPipelines) {
auto& bucket = sortedShapes[pipelineKey]; auto& bucket = sortedShapes[pipelineKey];
args->_pipeline = shapeContext->pickPipeline(args, pipelineKey); args->_shapePipeline = shapeContext->pickPipeline(args, pipelineKey);
if (!args->_pipeline) { if (!args->_shapePipeline) {
continue; continue;
} }
for (auto& item : bucket) { for (auto& item : bucket) {
item.render(args); item.render(args);
} }
} }
args->_pipeline = nullptr; args->_shapePipeline = nullptr;
for (auto& item : ownPipelineBucket) { for (auto& item : ownPipelineBucket) {
item.render(args); item.render(args);
} }