Showing the changes to libraries/render-utils/src/ToneMapAndResampleTask.cpp (1 of 81 files). Show all
Unified · Split
| @@ -25,9 +25,10 @@ using namespace shader::render_utils::program; · 24 unmodified lines | ||
| 25 | 25 | gpu::PipelinePointer ToneMapAndResample::_pipeline; |
| 26 | 26 | gpu::PipelinePointer ToneMapAndResample::_mirrorPipeline; |
| 27 | 27 | |
| 28 | −ToneMapAndResample::ToneMapAndResample() { | |
| 28 | +ToneMapAndResample::ToneMapAndResample(size_t depth) { | |
| 29 | 29 | Parameters parameters; |
| 30 | 30 | _parametersBuffer = gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(Parameters), (const gpu::Byte*) ¶meters)); |
| 31 | + _depth = depth; | |
| 31 | 32 | } |
| 32 | 33 | |
| 33 | 34 | void ToneMapAndResample::init() { |
| @@ -95,7 +96,8 @@ void ToneMapAndResample::run(const RenderContextPointer& renderContext, const In · 61 unmodified lines | ||
| 95 | 96 | batch.setViewportTransform(destViewport); |
| 96 | 97 | batch.setProjectionTransform(glm::mat4()); |
| 97 | 98 | batch.resetViewTransform(); |
| 98 | − batch.setPipeline(args->_renderMode == RenderArgs::MIRROR_RENDER_MODE ? _mirrorPipeline : _pipeline); | |
| 99 | + bool shouldMirror = args->_numMirrorFlips >= (args->_renderMode != RenderArgs::MIRROR_RENDER_MODE); | |
| 100 | + batch.setPipeline(shouldMirror ? _mirrorPipeline : _pipeline); | |
| 99 | 101 | |
| 100 | 102 | batch.setModelTransform(gpu::Framebuffer::evalSubregionTexcoordTransform(srcBufferSize, args->_viewport)); |
| 101 | 103 | batch.setUniformBuffer(render_utils::slot::buffer::ToneMappingParams, _parametersBuffer); |