| 747 | } |
| 748 | |
| 749 | void 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 | |
| 791 | void GPUContextVulkan::FrameEnd() |
| 792 | { |
no test coverage detected