History

TransitionStage + FadeJob compiling but not linked to entity events

Olivier Prat committed 9 years ago

Commit 06d69d02 parents 4256a1f d15c4ea87 files · +1613 −729Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 87 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+18−17
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include "gpu/StandardShaderLib.h"
3030
3131 #include "model/TextureMap.h"
32+#include "render/Args.h"
3233
3334 #include "standardTransformPNTC_vert.h"
3435 #include "standardDrawTexture_frag.h"
@@ -513,7 +514,7 @@ void GeometryCache::initializeShapePipelines() { · 478 unmodified lines
513514 render::ShapePipelinePointer GeometryCache::getShapePipeline(bool textured, bool transparent, bool culled,
514515 bool unlit, bool depthBias, bool fading) {
515516 return std::make_shared<render::ShapePipeline>(getSimplePipeline(textured, transparent, culled, unlit, depthBias, fading), nullptr,
516− [](const render::ShapePipeline&, gpu::Batch& batch) {
517+ [](const render::ShapePipeline&, gpu::Batch& batch, render::Args*) {
517518 // Set the defaults needed for a simple program
518519 batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO,
519520 DependencyManager::get<TextureCache>()->getWhiteTexture());
@@ -1971,7 +1972,7 @@ uint32_t toCompactColor(const glm::vec4& color) { · 1451 unmodified lines
19711972
19721973 static const size_t INSTANCE_COLOR_BUFFER = 0;
19731974
1974−void renderInstances(gpu::Batch& batch, const glm::vec4& color, bool isWire,
1975+void renderInstances(RenderArgs* args, gpu::Batch& batch, const glm::vec4& color, bool isWire,
19751976 const render::ShapePipelinePointer& pipeline, GeometryCache::Shape shape) {
19761977 // Add pipeline to name
19771978 std::string instanceName = (isWire ? "wire_shapes_" : "solid_shapes_") + std::to_string(shape) + "_" + std::to_string(std::hash<render::ShapePipelinePointer>()(pipeline));
@@ -1984,9 +1985,9 @@ void renderInstances(gpu::Batch& batch, const glm::vec4& color, bool isWire, · 6 unmodified lines
19841985 }
19851986
19861987 // Add call to named buffer
1987− batch.setupNamedCalls(instanceName, [isWire, pipeline, shape](gpu::Batch& batch, gpu::Batch::NamedBatchData& data) {
1988+ batch.setupNamedCalls(instanceName, [args, isWire, pipeline, shape](gpu::Batch& batch, gpu::Batch::NamedBatchData& data) {
19881989 batch.setPipeline(pipeline->pipeline);
1989− pipeline->prepare(batch);
1990+ pipeline->prepare(batch, args);
19901991
19911992 if (isWire) {
19921993 DependencyManager::get<GeometryCache>()->renderWireShapeInstances(batch, shape, data.count(), data.buffers[INSTANCE_COLOR_BUFFER]);
@@ -1996,32 +1997,32 @@ void renderInstances(gpu::Batch& batch, const glm::vec4& color, bool isWire, · 3 unmodified lines
19961997 });
19971998 }
19981999
1999−void GeometryCache::renderSolidShapeInstance(gpu::Batch& batch, GeometryCache::Shape shape, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
2000+void GeometryCache::renderSolidShapeInstance(RenderArgs* args, gpu::Batch& batch, GeometryCache::Shape shape, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
20002001 assert(pipeline != nullptr);
2001− renderInstances(batch, color, false, pipeline, shape);
2002+ renderInstances(args, batch, color, false, pipeline, shape);
20022003 }
20032004
2004−void GeometryCache::renderWireShapeInstance(gpu::Batch& batch, GeometryCache::Shape shape, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
2005+void GeometryCache::renderWireShapeInstance(RenderArgs* args, gpu::Batch& batch, GeometryCache::Shape shape, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
20052006 assert(pipeline != nullptr);
2006− renderInstances(batch, color, true, pipeline, shape);
2007+ renderInstances(args, batch, color, true, pipeline, shape);
20072008 }
20082009
2009−
2010−void GeometryCache::renderSolidSphereInstance(gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
2010+void GeometryCache::renderSolidSphereInstance(RenderArgs* args, gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
20112011 assert(pipeline != nullptr);
2012− renderInstances(batch, color, false, pipeline, GeometryCache::Sphere);
2012+ renderInstances(args, batch, color, false, pipeline, GeometryCache::Sphere);
20132013 }
20142014
2015−void GeometryCache::renderWireSphereInstance(gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
2015+void GeometryCache::renderWireSphereInstance(RenderArgs* args, gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
20162016 assert(pipeline != nullptr);
2017− renderInstances(batch, color, true, pipeline, GeometryCache::Sphere);
2017+ renderInstances(args, batch, color, true, pipeline, GeometryCache::Sphere);
20182018 }
20192019
20202020 // Enable this in a debug build to cause 'box' entities to iterate through all the
20212021 // available shape types, both solid and wireframes
20222022 //#define DEBUG_SHAPES
20232023
2024−void GeometryCache::renderSolidCubeInstance(gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
2024+
2025+void GeometryCache::renderSolidCubeInstance(RenderArgs* args, gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
20252026 assert(pipeline != nullptr);
20262027 #ifdef DEBUG_SHAPES
20272028 static auto startTime = usecTimestampNow();
@@ -2056,12 +2057,12 @@ void GeometryCache::renderSolidCubeInstance(gpu::Batch& batch, const glm::vec4& · 28 unmodified lines
20562057 }
20572058 });
20582059 #else
2059− renderInstances(batch, color, false, pipeline, GeometryCache::Cube);
2060+ renderInstances(args, batch, color, false, pipeline, GeometryCache::Cube);
20602061 #endif
20612062 }
20622063
2063−void GeometryCache::renderWireCubeInstance(gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
2064+void GeometryCache::renderWireCubeInstance(RenderArgs* args, gpu::Batch& batch, const glm::vec4& color, const render::ShapePipelinePointer& pipeline) {
20642065 static const std::string INSTANCE_NAME = __FUNCTION__;
20652066 assert(pipeline != nullptr);
2066− renderInstances(batch, color, true, pipeline, GeometryCache::Cube);
2067+ renderInstances(args, batch, color, true, pipeline, GeometryCache::Cube);
20672068 }