From 32d9c82fd183da60e3c54584d888388e73b92d34 Mon Sep 17 00:00:00 2001 From: Adeel Kazmi Date: Thu, 27 May 2021 10:43:24 +0100 Subject: [PATCH] Fixed SVACE errors in Test Graphics Change-Id: I67fb0f6d7eddbde198a2d68519afd35f8a9eb667 --- .../test-graphics-controller.cpp | 43 ++++++++++++++-------- .../test-graphics-framebuffer.h | 4 +- 2 files changed, 30 insertions(+), 17 deletions(-) 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 cbdd5dd..0886719 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 @@ -600,11 +600,14 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com } case CommandType::BIND_UNIFORM_BUFFER: { - auto& bindings = cmd.data.bindUniformBuffers; - auto buffer = bindings.standaloneUniformsBufferBinding; + if(currentPipeline) + { + auto& bindings = cmd.data.bindUniformBuffers; + auto buffer = bindings.standaloneUniformsBufferBinding; - // based on reflection, issue gl calls - buffer.buffer->BindAsUniformBuffer(static_cast(currentPipeline->programState.program), bindings.standaloneUniformsBufferBinding); + // based on reflection, issue gl calls + buffer.buffer->BindAsUniformBuffer(static_cast(currentPipeline->programState.program), bindings.standaloneUniformsBufferBinding); + } break; } case CommandType::BIND_SAMPLERS: @@ -619,25 +622,34 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com } case CommandType::DRAW: { - mGl.DrawArrays(GetTopology(currentPipeline->inputAssemblyState.topology), - 0, - cmd.data.draw.draw.vertexCount); + if(currentPipeline) + { + mGl.DrawArrays(GetTopology(currentPipeline->inputAssemblyState.topology), + 0, + cmd.data.draw.draw.vertexCount); + } break; } case CommandType::DRAW_INDEXED: { - mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), - static_cast(cmd.data.draw.drawIndexed.indexCount), - GL_UNSIGNED_SHORT, - reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + if(currentPipeline) + { + mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), + static_cast(cmd.data.draw.drawIndexed.indexCount), + GL_UNSIGNED_SHORT, + reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + } break; } case CommandType::DRAW_INDEXED_INDIRECT: { - mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), - static_cast(cmd.data.draw.drawIndexed.indexCount), - GL_UNSIGNED_SHORT, - reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + if(currentPipeline) + { + mGl.DrawElements(GetTopology(currentPipeline->inputAssemblyState.topology), + static_cast(cmd.data.draw.drawIndexed.indexCount), + GL_UNSIGNED_SHORT, + reinterpret_cast(cmd.data.draw.drawIndexed.firstIndex)); + } break; } case CommandType::SET_SCISSOR: @@ -838,6 +850,7 @@ void TestGraphicsController::ProcessCommandBuffer(TestGraphicsCommandBuffer& com const auto& area = cmd.data.beginRenderPass.renderArea; if(area.x == 0 && area.y == 0 && + renderTarget && area.width == renderTarget->mCreateInfo.extent.width && area.height == renderTarget->mCreateInfo.extent.height) { diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-framebuffer.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-framebuffer.h index 664c28b..97efe39 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-framebuffer.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-graphics-framebuffer.h @@ -40,8 +40,8 @@ public: TraceCallStack& mCallStack; GLuint mId{0}; - GLuint mDepthBuffer; - GLuint mStencilBuffer; + GLuint mDepthBuffer{0}; + GLuint mStencilBuffer{0}; }; } // namespace Dali -- 2.7.4