From 5cf8a1a1a83ae490ca79fff224a1e4de2c42816c Mon Sep 17 00:00:00 2001 From: Adam Bialogonski Date: Mon, 17 May 2021 17:45:05 +0100 Subject: [PATCH] Managed Unified Uniform Buffer Test harness update Change-Id: Ie65fb2564dc7d7be8c946b14c870062211af745c --- .../dali-toolkit-test-utils/test-graphics-buffer.cpp | 5 +++-- .../dali-toolkit-test-utils/test-graphics-buffer.h | 3 ++- .../dali-toolkit-test-utils/test-graphics-controller.cpp | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.cpp index d8a1b1a668..fb06c3dc91 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.cpp @@ -80,14 +80,15 @@ GLenum TestGraphicsBuffer::GetTarget() return target; } -void TestGraphicsBuffer::BindAsUniformBuffer(const TestGraphicsProgram* program) const +void TestGraphicsBuffer::BindAsUniformBuffer(const TestGraphicsProgram* program, const Dali::UniformBufferBindingDescriptor& uboBinding) const { auto* reflection = static_cast(&program->GetReflection()); Graphics::UniformBlockInfo uboInfo{}; reflection->GetUniformBlock(0, uboInfo); - auto* data = memory.data(); + auto offset = uboBinding.offset; + auto* data = memory.data() + offset; for(const auto& member : uboInfo.members) { diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.h index 87c9f87837..1dc2715a3d 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-buffer.h @@ -26,6 +26,7 @@ namespace Dali { class TestGraphicsProgram; +class UniformBufferBindingDescriptor; class TestGraphicsBuffer : public Graphics::Buffer { public: @@ -40,7 +41,7 @@ public: return true; } - void BindAsUniformBuffer(const TestGraphicsProgram* program) const; + void BindAsUniformBuffer(const TestGraphicsProgram* program, const Dali::UniformBufferBindingDescriptor& uboBinding) const; TraceCallStack& mCallStack; TestGlAbstraction& mGl; diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp index 517463fa31..cbdd5dd8ff 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-controller.cpp @@ -604,7 +604,7 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com auto buffer = bindings.standaloneUniformsBufferBinding; // based on reflection, issue gl calls - buffer.buffer->BindAsUniformBuffer(static_cast(currentPipeline->programState.program)); + buffer.buffer->BindAsUniformBuffer(static_cast(currentPipeline->programState.program), bindings.standaloneUniformsBufferBinding); break; } case CommandType::BIND_SAMPLERS: -- 2.34.1