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

Method FrameBegin

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

Source from the content-addressed store, hash-verified

747}
748
749void GPUContextVulkan::FrameBegin()
750{
751 // Base
752 GPUContext::FrameBegin();
753
754 // Setup
755 _psDirtyFlag = 0;
756 _rtDirtyFlag = 0;
757 _cbDirtyFlag = 0;
758 _rtCount = 0;
759 _vbCount = 0;
760 _stencilRef = 0;
761 _renderPass = nullptr;
762 _currentState = nullptr;
763 _currentCompute = nullptr;
764 _vertexLayout = nullptr;
765 _rtDepth = nullptr;
766 Platform::MemoryClear(_rtHandles, sizeof(_rtHandles));
767 Platform::MemoryClear(_cbHandles, sizeof(_cbHandles));
768 Platform::MemoryClear(_srHandles, sizeof(_srHandles));
769 Platform::MemoryClear(_uaHandles, sizeof(_uaHandles));
770 Platform::MemoryCopy(_samplerHandles, _device->HelperResources.GetStaticSamplers(), sizeof(VkSampler) * GPU_STATIC_SAMPLERS_COUNT);
771 Platform::MemoryClear(_samplerHandles + GPU_STATIC_SAMPLERS_COUNT, sizeof(_samplerHandles) - sizeof(VkSampler) * GPU_STATIC_SAMPLERS_COUNT);
772
773 // Init command buffer
774 const auto cmdBuffer = _cmdBufferManager->GetCmdBuffer();
775 vkCmdSetStencilReference(cmdBuffer->GetHandle(), VK_STENCIL_FRONT_AND_BACK, _stencilRef);
776 VkBuffer buffers[1] = { _device->HelperResources.GetDummyVertexBuffer()->GetHandle() };
777 VkDeviceSize offsets[1] = {};
778 vkCmdBindVertexBuffers(cmdBuffer->GetHandle(), GPU_MAX_VB_BINDED, 1, buffers, offsets);
779
780#if VULKAN_RESET_QUERY_POOLS
781 // Reset pending queries
782 if (_device->QueriesToReset.HasItems())
783 {
784 for (auto query : _device->QueriesToReset)
785 query->Reset(cmdBuffer);
786 _device->QueriesToReset.Clear();
787 }
788#endif
789}
790
791void GPUContextVulkan::FrameEnd()
792{

Callers 1

DrawMethod · 0.45

Calls 8

MemoryClearFunction · 0.85
GetStaticSamplersMethod · 0.80
GetCmdBufferMethod · 0.80
GetDummyVertexBufferMethod · 0.80
GetHandleMethod · 0.45
HasItemsMethod · 0.45
ResetMethod · 0.45
ClearMethod · 0.45

Tested by

no test coverage detected