MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Clear

Method Clear

Source/Engine/GraphicsDevice/Vulkan/GPUContextVulkan.cpp:843–861  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

841}
842
843void GPUContextVulkan::Clear(GPUTextureView* rt, const Color& color)
844{
845 auto rtVulkan = static_cast<GPUTextureViewVulkan*>(rt);
846
847 if (rtVulkan)
848 {
849 // TODO: detect if inside render pass and use ClearAttachments
850 // TODO: delay clear for attachments before render pass to use render pass clear values for faster clearing
851
852 const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
853 if (cmdBuffer->IsInsideRenderPass())
854 EndRenderPass();
855
856 AddImageBarrier(rtVulkan, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
857 FlushBarriers();
858
859 vkCmdClearColorImage(cmdBuffer->GetHandle(), rtVulkan->Image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, (const VkClearColorValue*)color.Raw, 1, &rtVulkan->Info.subresourceRange);
860 }
861}
862
863void GPUContextVulkan::ClearDepth(GPUTextureView* depthBuffer, float depthValue, uint8 stencilValue)
864{

Callers 15

ExecuteMethod · 0.45
~GPUContextVulkanMethod · 0.45
FrameBeginMethod · 0.45
SubmitMethod · 0.45
RefreshFenceStatusMethod · 0.45
OnReleaseGPUMethod · 0.45
ReleaseBackBufferMethod · 0.45
TryGetResultMethod · 0.45
OnReleaseGPUMethod · 0.45
ResetMethod · 0.45

Calls 3

GetCmdBufferMethod · 0.80
IsInsideRenderPassMethod · 0.80
GetHandleMethod · 0.45

Tested by

no test coverage detected