Updated test files to match dali-core
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-graphics-command-buffer.h
1 #ifndef DALI_TEST_GRAPHICS_COMMAND_BUFFER_H
2 #define DALI_TEST_GRAPHICS_COMMAND_BUFFER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 #include <dali/graphics-api/graphics-command-buffer-create-info.h>
21 #include <dali/graphics-api/graphics-command-buffer.h>
22 #include <dali/graphics-api/graphics-types.h>
23 #include <cstdint>
24 #include <vector>
25 #include "test-gl-abstraction.h"
26 #include "test-trace-call-stack.h"
27
28 namespace Dali
29 {
30 class TestGraphicsCommandBuffer : public Graphics::CommandBuffer
31 {
32 public:
33   TestGraphicsCommandBuffer(TraceCallStack& callstack, TestGlAbstraction& glAbstraction);
34
35   void BindVertexBuffers(uint32_t                             firstBinding,
36                          std::vector<const Graphics::Buffer*> buffers,
37                          std::vector<uint32_t>                offsets);
38
39   void BindUniformBuffers(const std::vector<Graphics::UniformBufferBinding>& bindings);
40
41   void BindPipeline(const Graphics::Pipeline& pipeline);
42
43   void BindTextures(std::vector<Graphics::TextureBinding>& textureBindings);
44
45   void BindSamplers(std::vector<Graphics::SamplerBinding>& samplerBindings);
46
47   void BindPushConstants(void*    data,
48                          uint32_t size,
49                          uint32_t binding);
50
51   void BindIndexBuffer(const Graphics::Buffer& buffer,
52                        uint32_t                offset,
53                        Graphics::Format        format);
54
55   void BeginRenderPass(Graphics::RenderPass&             renderPass,
56                        Graphics::RenderTarget&           renderTarget,
57                        Graphics::Extent2D                renderArea,
58                        std::vector<Graphics::ClearValue> clearValues);
59
60   void EndRenderPass();
61
62   void Draw(
63     uint32_t vertexCount,
64     uint32_t instanceCount,
65     uint32_t firstVertex,
66     uint32_t firstInstance);
67
68   void DrawIndexed(
69     uint32_t indexCount,
70     uint32_t instanceCount,
71     uint32_t firstIndex,
72     int32_t  vertexOffset,
73     uint32_t firstInstance);
74
75   void DrawIndexedIndirect(
76     Graphics::Buffer& buffer,
77     uint32_t          offset,
78     uint32_t          drawCount,
79     uint32_t          stride);
80
81   void Reset(Graphics::CommandBuffer& commandBuffer);
82
83   void SetScissor(Graphics::Extent2D value);
84
85   void SetScissorTestEnable(bool value);
86
87   void SetViewport(Graphics::Viewport value);
88
89   void SetViewportEnable(bool value);
90
91 public:
92   TraceCallStack     mCallStack;
93   TestGlAbstraction& mGlAbstraction;
94
95   std::vector<Graphics::TextureBinding> mTextureBindings;
96 };
97
98 } // namespace Dali
99
100 #endif //DALI_TEST_GRAPHICS_COMMAND_BUFFER_H