PRoviding a fix for the macOS build

This commit is contained in:
samcake 2016-08-19 11:09:12 -07:00
parent a4945fe45c
commit 6a076bcee4
3 changed files with 11 additions and 23 deletions

View file

@ -180,10 +180,10 @@ public:
using Index = int;
BufferPointer _buffer;
Size _offset;
Size _size;
Element _element;
uint16 _stride;
Size _offset { 0 };
Size _size { 0 };
Element _element { DEFAULT_ELEMENT };
uint16 _stride { 0 };
BufferView(const BufferView& view) = default;
BufferView& operator=(const BufferView& view) = default;

View file

@ -340,7 +340,6 @@ void AmbientOcclusionEffect::run(const render::SceneContextPointer& sceneContext
RenderArgs* args = renderContext->args;
const auto& frameTransform = inputs.get0();
const auto& deferredFramebuffer = inputs.get1();
const auto& linearDepthFramebuffer = inputs.get2();
auto linearDepthTexture = linearDepthFramebuffer->getLinearDepthTexture();
@ -372,13 +371,9 @@ void AmbientOcclusionEffect::run(const render::SceneContextPointer& sceneContext
float tMin = occlusionViewport.y / (float)framebufferSize.y;
float tHeight = occlusionViewport.w / (float)framebufferSize.y;
auto resolutionLevel = _parametersBuffer->getResolutionLevel();
//_parametersBuffer->ditheringInfo.y += 0.25f;
// Running in stero ?
bool isStereo = args->_context->isStereo();
auto occlusionPipeline = getOcclusionPipeline();
auto firstHBlurPipeline = getHBlurPipeline();
@ -486,13 +481,7 @@ void DebugAmbientOcclusion::run(const render::SceneContextPointer& sceneContext,
RenderArgs* args = renderContext->args;
// FIXME: Different render modes should have different tasks
// if (args->_renderMode != RenderArgs::DEFAULT_RENDER_MODE) {
// return;
// }
const auto& frameTransform = inputs.get0();
const auto& deferredFramebuffer = inputs.get1();
const auto& linearDepthFramebuffer = inputs.get2();
const auto& ambientOcclusionUniforms = inputs.get3();
@ -519,11 +508,7 @@ void DebugAmbientOcclusion::run(const render::SceneContextPointer& sceneContext,
float sWidth = occlusionViewport.z / (float)framebufferSize.x;
float tMin = occlusionViewport.y / (float)framebufferSize.y;
float tHeight = occlusionViewport.w / (float)framebufferSize.y;
// Running in stero ?
bool isStereo = args->_context->isStereo();
auto debugPipeline = getDebugPipeline();
gpu::doInBatch(args->_context, [=](gpu::Batch& batch) {

View file

@ -109,15 +109,18 @@ signals:
namespace gpu {
template <class T> class UniformBuffer : public gpu::BufferView {
public:
static BufferPointer makeBuffer() {
T t;
return std::make_shared<gpu::Buffer>(sizeof(T), (const gpu::Byte*) &t);
}
~UniformBuffer<T>() {};
UniformBuffer<T>() : gpu::BufferView(std::make_shared<gpu::Buffer>(sizeof(T), (const gpu::Byte*) &T())) {}
UniformBuffer<T>() : gpu::BufferView(makeBuffer()) {}
const T* operator ->() const { return &get<T>(); }
T* operator ->() { return &edit<T>(); }
};
}
class AmbientOcclusionEffect {