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-controller.h"
19 #include "test-graphics-buffer.h"
20 #include "test-graphics-command-buffer.h"
21 #include "test-graphics-reflection.h"
22 #include "test-graphics-sampler.h"
23 #include "test-graphics-texture.h"
25 #include <dali/integration-api/gl-defines.h>
33 T* Uncast(const Graphics::CommandBuffer* object)
35 return const_cast<T*>(static_cast<const T*>(object));
39 T* Uncast(const Graphics::Texture* object)
41 return const_cast<T*>(static_cast<const T*>(object));
45 T* Uncast(const Graphics::Sampler* object)
47 return const_cast<T*>(static_cast<const T*>(object));
51 T* Uncast(const Graphics::Buffer* object)
53 return const_cast<T*>(static_cast<const T*>(object));
56 std::ostream& operator<<(std::ostream& o, const Graphics::BufferCreateInfo& bufferCreateInfo)
58 return o << "usage:" << std::hex << bufferCreateInfo.usage << ", size:" << std::dec << bufferCreateInfo.size;
61 std::ostream& operator<<(std::ostream& o, const Graphics::CommandBufferCreateInfo& commandBufferCreateInfo)
63 return o << "level:" << (commandBufferCreateInfo.level == Graphics::CommandBufferLevel::PRIMARY ? "PRIMARY" : "SECONDARY")
64 << ", fixedCapacity:" << std::dec << commandBufferCreateInfo.fixedCapacity;
67 std::ostream& operator<<(std::ostream& o, const Graphics::TextureType& textureType)
71 case Graphics::TextureType::TEXTURE_2D:
74 case Graphics::TextureType::TEXTURE_3D:
77 case Graphics::TextureType::TEXTURE_CUBEMAP:
78 o << "TEXTURE_CUBEMAP";
84 std::ostream& operator<<(std::ostream& o, const Graphics::Extent2D extent)
86 o << "width:" << extent.width << ", height:" << extent.height;
90 std::ostream& operator<<(std::ostream& o, const Graphics::TextureCreateInfo& createInfo)
92 o << "textureType:" << createInfo.textureType
93 << " size:" << createInfo.size
94 << " format:" << static_cast<uint32_t>(createInfo.format)
95 << " mipMapFlag:" << createInfo.mipMapFlag
96 << " layout:" << (createInfo.layout == Graphics::TextureLayout::LINEAR ? "LINEAR" : "OPTIMAL")
97 << " usageFlags:" << std::hex << createInfo.usageFlags
98 << " data:" << std::hex << createInfo.data
99 << " dataSize:" << std::dec << createInfo.dataSize
100 << " nativeImagePtr:" << std::hex << createInfo.nativeImagePtr;
104 std::ostream& operator<<(std::ostream& o, Graphics::SamplerAddressMode addressMode)
108 case Graphics::SamplerAddressMode::REPEAT:
111 case Graphics::SamplerAddressMode::MIRRORED_REPEAT:
112 o << "MIRRORED_REPEAT";
114 case Graphics::SamplerAddressMode::CLAMP_TO_EDGE:
115 o << "CLAMP_TO_EDGE";
117 case Graphics::SamplerAddressMode::CLAMP_TO_BORDER:
118 o << "CLAMP_TO_BORDER";
120 case Graphics::SamplerAddressMode::MIRROR_CLAMP_TO_EDGE:
121 o << "MIRROR_CLAMP_TO_EDGE";
127 std::ostream& operator<<(std::ostream& o, Graphics::SamplerFilter filterMode)
131 case Graphics::SamplerFilter::LINEAR:
134 case Graphics::SamplerFilter::NEAREST:
141 std::ostream& operator<<(std::ostream& o, Graphics::SamplerMipmapMode mipmapMode)
145 case Graphics::SamplerMipmapMode::NONE:
148 case Graphics::SamplerMipmapMode::LINEAR:
151 case Graphics::SamplerMipmapMode::NEAREST:
158 std::ostream& operator<<(std::ostream& o, const Graphics::SamplerCreateInfo& createInfo)
160 o << "minFilter:" << createInfo.minFilter
161 << " magFilter:" << createInfo.magFilter
162 << " wrapModeU:" << createInfo.addressModeU
163 << " wrapModeV:" << createInfo.addressModeV
164 << " wrapModeW:" << createInfo.addressModeW
165 << " mipMapMode:" << createInfo.mipMapMode;
169 class TestGraphicsMemory : public Graphics::Memory
172 TestGraphicsMemory(TraceCallStack& callStack, TestGraphicsBuffer& buffer, uint32_t mappedOffset, uint32_t mappedSize)
173 : mCallStack(callStack),
175 mMappedOffset(mappedOffset),
176 mMappedSize(mappedSize)
180 void* LockRegion(uint32_t offset, uint32_t size) override
182 std::ostringstream o;
183 o << offset << ", " << size;
184 mCallStack.PushCall("Memory::LockRegion", o.str());
186 if(offset > mMappedOffset + mMappedSize ||
187 size + offset > mMappedOffset + mMappedSize)
189 fprintf(stderr, "TestGraphics.Memory::LockRegion() Out of bounds");
190 mBuffer.memory.resize(mMappedOffset + offset + size); // Grow to prevent memcpy from crashing
192 mLockedOffset = offset;
194 return &mBuffer.memory[mMappedOffset + offset];
197 void Unlock(bool flush) override
199 mCallStack.PushCall("Memory::Unlock", (flush ? "Flush" : "NoFlush"));
206 void Flush() override
208 mCallStack.PushCall("Memory::Flush", "");
210 mBuffer.Upload(mMappedOffset + mLockedOffset, mLockedSize);
214 TraceCallStack& mCallStack;
215 TestGraphicsBuffer& mBuffer;
216 uint32_t mMappedOffset;
217 uint32_t mMappedSize;
218 uint32_t mLockedOffset;
219 uint32_t mLockedSize;
222 TestGraphicsController::TestGraphicsController()
223 : mCallStack(true, "TestGraphicsController."),
224 mCommandBufferCallStack(true, "TestCommandBuffer.")
226 mCallStack.Enable(true);
227 mCommandBufferCallStack.Enable(true);
228 auto& trace = mGl.GetTextureTrace();
230 trace.EnableLogging(true);
233 int GetNumComponents(Graphics::VertexInputFormat vertexFormat)
237 case Graphics::VertexInputFormat::UNDEFINED:
238 case Graphics::VertexInputFormat::FLOAT:
239 case Graphics::VertexInputFormat::INTEGER:
241 case Graphics::VertexInputFormat::IVECTOR2:
242 case Graphics::VertexInputFormat::FVECTOR2:
244 case Graphics::VertexInputFormat::IVECTOR3:
245 case Graphics::VertexInputFormat::FVECTOR3:
247 case Graphics::VertexInputFormat::FVECTOR4:
248 case Graphics::VertexInputFormat::IVECTOR4:
254 GLint GetSize(Graphics::VertexInputFormat vertexFormat)
258 case Graphics::VertexInputFormat::UNDEFINED:
260 case Graphics::VertexInputFormat::INTEGER:
261 case Graphics::VertexInputFormat::IVECTOR2:
262 case Graphics::VertexInputFormat::IVECTOR3:
263 case Graphics::VertexInputFormat::IVECTOR4:
265 case Graphics::VertexInputFormat::FLOAT:
266 case Graphics::VertexInputFormat::FVECTOR2:
267 case Graphics::VertexInputFormat::FVECTOR3:
268 case Graphics::VertexInputFormat::FVECTOR4:
274 GLint GetGlType(Graphics::VertexInputFormat vertexFormat)
278 case Graphics::VertexInputFormat::UNDEFINED:
280 case Graphics::VertexInputFormat::INTEGER:
281 case Graphics::VertexInputFormat::IVECTOR2:
282 case Graphics::VertexInputFormat::IVECTOR3:
283 case Graphics::VertexInputFormat::IVECTOR4:
285 case Graphics::VertexInputFormat::FLOAT:
286 case Graphics::VertexInputFormat::FVECTOR2:
287 case Graphics::VertexInputFormat::FVECTOR3:
288 case Graphics::VertexInputFormat::FVECTOR4:
294 GLenum GetTopology(Graphics::PrimitiveTopology topology)
298 case Graphics::PrimitiveTopology::POINT_LIST:
301 case Graphics::PrimitiveTopology::LINE_LIST:
304 case Graphics::PrimitiveTopology::LINE_LOOP:
307 case Graphics::PrimitiveTopology::LINE_STRIP:
308 return GL_LINE_STRIP;
310 case Graphics::PrimitiveTopology::TRIANGLE_LIST:
313 case Graphics::PrimitiveTopology::TRIANGLE_STRIP:
314 return GL_TRIANGLE_STRIP;
316 case Graphics::PrimitiveTopology::TRIANGLE_FAN:
317 return GL_TRIANGLE_FAN;
322 GLenum GetCullFace(Graphics::CullMode cullMode)
326 case Graphics::CullMode::NONE:
328 case Graphics::CullMode::FRONT:
330 case Graphics::CullMode::BACK:
332 case Graphics::CullMode::FRONT_AND_BACK:
333 return GL_FRONT_AND_BACK;
338 GLenum GetFrontFace(Graphics::FrontFace frontFace)
340 if(frontFace == Graphics::FrontFace::CLOCKWISE)
347 GLenum GetBlendFactor(Graphics::BlendFactor blendFactor)
349 GLenum glFactor = GL_ZERO;
353 case Graphics::BlendFactor::ZERO:
356 case Graphics::BlendFactor::ONE:
359 case Graphics::BlendFactor::SRC_COLOR:
360 glFactor = GL_SRC_COLOR;
362 case Graphics::BlendFactor::ONE_MINUS_SRC_COLOR:
363 glFactor = GL_ONE_MINUS_SRC_COLOR;
365 case Graphics::BlendFactor::DST_COLOR:
366 glFactor = GL_DST_COLOR;
368 case Graphics::BlendFactor::ONE_MINUS_DST_COLOR:
369 glFactor = GL_ONE_MINUS_DST_COLOR;
371 case Graphics::BlendFactor::SRC_ALPHA:
372 glFactor = GL_SRC_ALPHA;
374 case Graphics::BlendFactor::ONE_MINUS_SRC_ALPHA:
375 glFactor = GL_ONE_MINUS_SRC_ALPHA;
377 case Graphics::BlendFactor::DST_ALPHA:
378 glFactor = GL_DST_ALPHA;
380 case Graphics::BlendFactor::ONE_MINUS_DST_ALPHA:
381 glFactor = GL_ONE_MINUS_DST_ALPHA;
383 case Graphics::BlendFactor::CONSTANT_COLOR:
384 glFactor = GL_CONSTANT_COLOR;
386 case Graphics::BlendFactor::ONE_MINUS_CONSTANT_COLOR:
387 glFactor = GL_ONE_MINUS_CONSTANT_COLOR;
389 case Graphics::BlendFactor::CONSTANT_ALPHA:
390 glFactor = GL_CONSTANT_ALPHA;
392 case Graphics::BlendFactor::ONE_MINUS_CONSTANT_ALPHA:
393 glFactor = GL_ONE_MINUS_CONSTANT_ALPHA;
395 case Graphics::BlendFactor::SRC_ALPHA_SATURATE:
396 glFactor = GL_SRC_ALPHA_SATURATE;
398 // GLES doesn't appear to have dual source blending.
399 case Graphics::BlendFactor::SRC1_COLOR:
400 glFactor = GL_SRC_COLOR;
402 case Graphics::BlendFactor::ONE_MINUS_SRC1_COLOR:
403 glFactor = GL_ONE_MINUS_SRC_COLOR;
405 case Graphics::BlendFactor::SRC1_ALPHA:
406 glFactor = GL_SRC_ALPHA;
408 case Graphics::BlendFactor::ONE_MINUS_SRC1_ALPHA:
409 glFactor = GL_ONE_MINUS_SRC_ALPHA;
415 GLenum GetBlendOp(Graphics::BlendOp blendOp)
417 GLenum op = GL_FUNC_ADD;
420 case Graphics::BlendOp::ADD:
423 case Graphics::BlendOp::SUBTRACT:
424 op = GL_FUNC_SUBTRACT;
426 case Graphics::BlendOp::REVERSE_SUBTRACT:
427 op = GL_FUNC_REVERSE_SUBTRACT;
429 case Graphics::BlendOp::MIN:
432 case Graphics::BlendOp::MAX:
436 // @todo Add advanced blend equations
441 void TestGraphicsController::SubmitCommandBuffers(const Graphics::SubmitInfo& submitInfo)
443 TraceCallStack::NamedParams namedParams;
444 namedParams["submitInfo"] << "cmdBuffer[" << submitInfo.cmdBuffer.size()
445 << "], flags:" << std::hex << submitInfo.flags;
447 mCallStack.PushCall("Controller::SubmitCommandBuffers", "", namedParams);
449 for(auto& graphicsCommandBuffer : submitInfo.cmdBuffer)
451 auto commandBuffer = Uncast<TestGraphicsCommandBuffer>(graphicsCommandBuffer);
452 for(auto& binding : commandBuffer->mTextureBindings)
456 auto texture = Uncast<TestGraphicsTexture>(binding.texture);
458 texture->Bind(binding.binding);
462 auto sampler = Uncast<TestGraphicsSampler>(binding.sampler);
465 sampler->Apply(texture->GetTarget());
469 texture->Prepare(); // Ensure native texture is ready
473 // IndexBuffer binding,
474 auto& indexBufferBinding = commandBuffer->mIndexBufferBinding;
475 if(indexBufferBinding.buffer)
477 auto buffer = Uncast<TestGraphicsBuffer>(indexBufferBinding.buffer);
481 // VertexBuffer binding,
482 for(auto graphicsBuffer : commandBuffer->mVertexBufferBindings.buffers)
484 auto vertexBuffer = Uncast<TestGraphicsBuffer>(graphicsBuffer);
485 vertexBuffer->Bind();
488 // Pipeline attribute setup
489 auto& vi = commandBuffer->mPipeline->vertexInputState;
490 for(auto& attribute : vi.attributes)
492 mGl.EnableVertexAttribArray(attribute.location);
493 uint32_t attributeOffset = attribute.offset;
494 GLsizei stride = vi.bufferBindings[attribute.binding].stride;
496 mGl.VertexAttribPointer(attribute.location,
497 GetNumComponents(attribute.format),
498 GetGlType(attribute.format),
499 GL_FALSE, // Not normalized
501 reinterpret_cast<void*>(attributeOffset));
505 auto& rasterizationState = commandBuffer->mPipeline->rasterizationState;
506 if(rasterizationState.cullMode == Graphics::CullMode::NONE)
508 mGl.Disable(GL_CULL_FACE);
512 mGl.Enable(GL_CULL_FACE);
513 mGl.CullFace(GetCullFace(rasterizationState.cullMode));
516 mGl.FrontFace(GetFrontFace(rasterizationState.frontFace));
517 // We don't modify glPolygonMode in our context/abstraction from GL_FILL (the GL default),
518 // so it isn't present in the API (and won't have any tests!)
521 auto& colorBlendState = commandBuffer->mPipeline->colorBlendState;
522 if(colorBlendState.blendEnable)
524 mGl.Enable(GL_BLEND);
526 mGl.BlendFuncSeparate(GetBlendFactor(colorBlendState.srcColorBlendFactor),
527 GetBlendFactor(colorBlendState.dstColorBlendFactor),
528 GetBlendFactor(colorBlendState.srcAlphaBlendFactor),
529 GetBlendFactor(colorBlendState.dstAlphaBlendFactor));
530 if(colorBlendState.colorBlendOp != colorBlendState.alphaBlendOp)
532 mGl.BlendEquationSeparate(GetBlendOp(colorBlendState.colorBlendOp), GetBlendOp(colorBlendState.alphaBlendOp));
536 mGl.BlendEquation(GetBlendOp(colorBlendState.colorBlendOp));
538 mGl.BlendColor(colorBlendState.blendConstants[0],
539 colorBlendState.blendConstants[1],
540 colorBlendState.blendConstants[2],
541 colorBlendState.blendConstants[3]);
545 mGl.Disable(GL_BLEND);
549 auto topology = commandBuffer->mPipeline->inputAssemblyState.topology;
551 if(commandBuffer->drawCommand.drawType == TestGraphicsCommandBuffer::Draw::DrawType::Indexed)
553 mGl.DrawElements(GetTopology(topology),
554 static_cast<GLsizei>(commandBuffer->drawCommand.u.indexedDraw.indexCount),
556 reinterpret_cast<void*>(commandBuffer->drawCommand.u.indexedDraw.firstIndex));
560 mGl.DrawArrays(GetTopology(topology), 0, commandBuffer->drawCommand.u.unindexedDraw.vertexCount);
564 for(auto& attribute : vi.attributes)
566 mGl.DisableVertexAttribArray(attribute.location);
572 * @brief Presents render target
573 * @param renderTarget render target to present
575 void TestGraphicsController::PresentRenderTarget(Graphics::RenderTarget* renderTarget)
577 TraceCallStack::NamedParams namedParams;
578 namedParams["renderTarget"] << std::hex << renderTarget;
579 mCallStack.PushCall("Controller::PresentRenderTarget", "", namedParams);
583 * @brief Waits until the GPU is idle
585 void TestGraphicsController::WaitIdle()
587 mCallStack.PushCall("Controller::WaitIdle", "");
591 * @brief Lifecycle pause event
593 void TestGraphicsController::Pause()
595 mCallStack.PushCall("Controller::Pause", "");
599 * @brief Lifecycle resume event
601 void TestGraphicsController::Resume()
603 mCallStack.PushCall("Controller::Resume", "");
606 void TestGraphicsController::UpdateTextures(const std::vector<Graphics::TextureUpdateInfo>& updateInfoList,
607 const std::vector<Graphics::TextureUpdateSourceInfo>& sourceList)
609 TraceCallStack::NamedParams namedParams;
610 namedParams["updateInfoList"] << "[" << updateInfoList.size() << "]:";
611 namedParams["sourceList"] << "[" << sourceList.size() << "]:";
613 mCallStack.PushCall("Controller::UpdateTextures", "", namedParams);
615 // Call either TexImage2D or TexSubImage2D
616 for(unsigned int i = 0; i < updateInfoList.size(); ++i)
618 auto& updateInfo = updateInfoList[i];
619 auto& source = sourceList[i];
621 auto texture = static_cast<TestGraphicsTexture*>(updateInfo.dstTexture);
622 texture->Bind(0); // Use first texture unit during resource update
623 texture->Update(updateInfo, source);
627 bool TestGraphicsController::EnableDepthStencilBuffer(bool enableDepth, bool enableStencil)
629 TraceCallStack::NamedParams namedParams;
630 namedParams["enableDepth"] << (enableDepth ? "T" : "F");
631 namedParams["enableStencil"] << (enableStencil ? "T" : "F");
632 mCallStack.PushCall("Controller::EnableDepthStencilBuffer", "", namedParams);
636 void TestGraphicsController::RunGarbageCollector(size_t numberOfDiscardedRenderers)
638 TraceCallStack::NamedParams namedParams;
639 namedParams["numberOfDiscardedRenderers"] << numberOfDiscardedRenderers;
640 mCallStack.PushCall("Controller::RunGarbageCollector", "", namedParams);
643 void TestGraphicsController::DiscardUnusedResources()
645 mCallStack.PushCall("Controller::DiscardUnusedResources", "");
648 bool TestGraphicsController::IsDiscardQueueEmpty()
650 mCallStack.PushCall("Controller::IsDiscardQueueEmpty", "");
651 return isDiscardQueueEmptyResult;
655 * @brief Test if the graphics subsystem has resumed & should force a draw
657 * @return true if the graphics subsystem requires a re-draw
659 bool TestGraphicsController::IsDrawOnResumeRequired()
661 mCallStack.PushCall("Controller::IsDrawOnResumeRequired", "");
662 return isDrawOnResumeRequiredResult;
665 Graphics::UniquePtr<Graphics::Buffer> TestGraphicsController::CreateBuffer(const Graphics::BufferCreateInfo& createInfo, Graphics::UniquePtr<Graphics::Buffer>&& oldBuffer)
667 std::ostringstream oss;
668 oss << "bufferCreateInfo:" << createInfo;
669 mCallStack.PushCall("Controller::CreateBuffer", oss.str());
670 return Graphics::MakeUnique<TestGraphicsBuffer>(mCallStack, mGl, createInfo.size, createInfo.usage);
673 Graphics::UniquePtr<Graphics::CommandBuffer> TestGraphicsController::CreateCommandBuffer(const Graphics::CommandBufferCreateInfo& commandBufferCreateInfo, Graphics::UniquePtr<Graphics::CommandBuffer>&& oldCommandBuffer)
675 std::ostringstream oss;
676 oss << "commandBufferCreateInfo:" << commandBufferCreateInfo;
677 mCallStack.PushCall("Controller::CreateCommandBuffer", oss.str());
678 return Graphics::MakeUnique<TestGraphicsCommandBuffer>(mCommandBufferCallStack, mGl);
681 Graphics::UniquePtr<Graphics::RenderPass> TestGraphicsController::CreateRenderPass(const Graphics::RenderPassCreateInfo& renderPassCreateInfo, Graphics::UniquePtr<Graphics::RenderPass>&& oldRenderPass)
683 mCallStack.PushCall("Controller::CreateRenderPass", "");
687 Graphics::UniquePtr<Graphics::Texture> TestGraphicsController::CreateTexture(const Graphics::TextureCreateInfo& textureCreateInfo, Graphics::UniquePtr<Graphics::Texture>&& oldTexture)
689 TraceCallStack::NamedParams namedParams;
690 namedParams["textureCreateInfo"] << textureCreateInfo;
691 mCallStack.PushCall("Controller::CreateTexture", namedParams.str(), namedParams);
693 return Graphics::MakeUnique<TestGraphicsTexture>(mGl, textureCreateInfo);
696 Graphics::UniquePtr<Graphics::Framebuffer> TestGraphicsController::CreateFramebuffer(const Graphics::FramebufferCreateInfo& framebufferCreateInfo, Graphics::UniquePtr<Graphics::Framebuffer>&& oldFramebuffer)
698 mCallStack.PushCall("Controller::CreateFramebuffer", "");
702 Graphics::UniquePtr<Graphics::Pipeline> TestGraphicsController::CreatePipeline(const Graphics::PipelineCreateInfo& pipelineCreateInfo, Graphics::UniquePtr<Graphics::Pipeline>&& oldPipeline)
704 mCallStack.PushCall("Controller::CreatePipeline", "");
705 return std::make_unique<TestGraphicsPipeline>(mGl, pipelineCreateInfo);
708 Graphics::UniquePtr<Graphics::Shader> TestGraphicsController::CreateShader(const Graphics::ShaderCreateInfo& shaderCreateInfo, Graphics::UniquePtr<Graphics::Shader>&& oldShader)
710 mCallStack.PushCall("Controller::CreateShader", "");
714 Graphics::UniquePtr<Graphics::Sampler> TestGraphicsController::CreateSampler(const Graphics::SamplerCreateInfo& samplerCreateInfo, Graphics::UniquePtr<Graphics::Sampler>&& oldSampler)
716 TraceCallStack::NamedParams namedParams;
717 namedParams["samplerCreateInfo"] << samplerCreateInfo;
718 mCallStack.PushCall("Controller::CreateSampler", namedParams.str(), namedParams);
720 return Graphics::MakeUnique<TestGraphicsSampler>(mGl, samplerCreateInfo);
723 Graphics::UniquePtr<Graphics::RenderTarget> TestGraphicsController::CreateRenderTarget(const Graphics::RenderTargetCreateInfo& renderTargetCreateInfo, Graphics::UniquePtr<Graphics::RenderTarget>&& oldRenderTarget)
725 mCallStack.PushCall("Controller::CreateRenderTarget", "");
729 Graphics::UniquePtr<Graphics::Memory> TestGraphicsController::MapBufferRange(const Graphics::MapBufferInfo& mapInfo)
731 mCallStack.PushCall("Controller::MapBufferRange", "");
733 auto buffer = static_cast<TestGraphicsBuffer*>(mapInfo.buffer);
734 buffer->memory.resize(mapInfo.offset + mapInfo.size); // For initial testing, allow writes past capacity
736 return std::make_unique<TestGraphicsMemory>(mCallStack, *buffer, mapInfo.offset, mapInfo.size);
739 Graphics::UniquePtr<Graphics::Memory> TestGraphicsController::MapTextureRange(const Graphics::MapTextureInfo& mapInfo)
741 mCallStack.PushCall("Controller::MapTextureRange", "");
745 void TestGraphicsController::UnmapMemory(Graphics::UniquePtr<Graphics::Memory> memory)
747 mCallStack.PushCall("Controller::UnmapMemory", "");
750 Graphics::MemoryRequirements TestGraphicsController::GetTextureMemoryRequirements(Graphics::Texture& texture) const
752 mCallStack.PushCall("Controller::GetTextureMemoryRequirements", "");
753 return Graphics::MemoryRequirements{};
756 Graphics::MemoryRequirements TestGraphicsController::GetBufferMemoryRequirements(Graphics::Buffer& buffer) const
758 mCallStack.PushCall("Controller::GetBufferMemoryRequirements", "");
759 return Graphics::MemoryRequirements{};
762 const Graphics::TextureProperties& TestGraphicsController::GetTextureProperties(const Graphics::Texture& texture)
764 static Graphics::TextureProperties textureProperties{};
765 mCallStack.PushCall("Controller::GetTextureProperties", "");
767 return textureProperties;
770 const Graphics::Reflection& TestGraphicsController::GetPipelineReflection(const Graphics::Pipeline& pipeline)
772 static TestGraphicsReflection reflection(mGl);
773 mCallStack.PushCall("Controller::GetPipelineReflection", "");
778 bool TestGraphicsController::PipelineEquals(const Graphics::Pipeline& pipeline0, const Graphics::Pipeline& pipeline1) const
780 mCallStack.PushCall("Controller::PipelineEquals", "");