2 * Copyright (c) 2021 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "test-graphics-command-buffer.h"
21 TestGraphicsCommandBuffer::TestGraphicsCommandBuffer(TraceCallStack& callstack, TestGlAbstraction& glAbstraction)
22 : mCallStack(callstack),
23 mGlAbstraction(glAbstraction)
27 void TestGraphicsCommandBuffer::BindVertexBuffers(uint32_t firstBinding,
28 std::vector<const Graphics::Buffer*> buffers,
29 std::vector<uint32_t> offsets)
31 mCallStack.PushCall("BindVertexBuffers", "");
34 void TestGraphicsCommandBuffer::BindUniformBuffers(const std::vector<Graphics::UniformBufferBinding>& bindings)
36 mCallStack.PushCall("BindUniformBuffers", "");
39 void TestGraphicsCommandBuffer::BindPipeline(const Graphics::Pipeline& pipeline)
41 mCallStack.PushCall("BindPipeline", "");
44 void TestGraphicsCommandBuffer::BindTextures(std::vector<Graphics::TextureBinding>& textureBindings)
46 mCallStack.PushCall("BindTextures", "");
47 for(auto& binding : textureBindings)
49 mTextureBindings.push_back(binding);
53 void TestGraphicsCommandBuffer::BindSamplers(std::vector<Graphics::SamplerBinding>& samplerBindings)
55 mCallStack.PushCall("BindSamplers", "");
58 void TestGraphicsCommandBuffer::BindPushConstants(void* data,
62 mCallStack.PushCall("BindPushConstants", "");
65 void TestGraphicsCommandBuffer::BindIndexBuffer(const Graphics::Buffer& buffer,
67 Graphics::Format format)
69 mCallStack.PushCall("BindIndexBuffer", "");
72 void TestGraphicsCommandBuffer::BeginRenderPass(
73 Graphics::RenderPass& renderPass,
74 Graphics::RenderTarget& renderTarget,
75 Graphics::Extent2D renderArea,
76 std::vector<Graphics::ClearValue> clearValues)
78 mCallStack.PushCall("BeginRenderPass", "");
81 void TestGraphicsCommandBuffer::EndRenderPass()
83 mCallStack.PushCall("EndRenderPass", "");
86 void TestGraphicsCommandBuffer::Draw(
88 uint32_t instanceCount,
90 uint32_t firstInstance)
92 mCallStack.PushCall("Draw", "");
95 void TestGraphicsCommandBuffer::DrawIndexed(
97 uint32_t instanceCount,
100 uint32_t firstInstance)
102 mCallStack.PushCall("DrawIndexed", "");
105 void TestGraphicsCommandBuffer::DrawIndexedIndirect(
106 Graphics::Buffer& buffer,
111 mCallStack.PushCall("DrawIndexedIndirect", "");
114 void TestGraphicsCommandBuffer::Reset(Graphics::CommandBuffer& commandBuffer)
116 mCallStack.PushCall("Reset", "");
119 void TestGraphicsCommandBuffer::SetScissor(Graphics::Extent2D value)
121 mCallStack.PushCall("SetScissor", "");
124 void TestGraphicsCommandBuffer::SetScissorTestEnable(bool value)
126 mCallStack.PushCall("SetScissorTestEnable", "");
129 void TestGraphicsCommandBuffer::SetViewport(Graphics::Viewport value)
131 mCallStack.PushCall("SetViewport", "");
134 void TestGraphicsCommandBuffer::SetViewportEnable(bool value)
136 mCallStack.PushCall("SetViewportEnable", "");