mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 22:35:45 +00:00
{maxwell_3d,buffer_cache}: Implement memory barriers using 3D registers
Drop MemoryBarrier from the buffer cache and use Maxwell3D's register WaitForIdle. To implement this on OpenGL we just call glMemoryBarrier with the necessary bits. Vulkan lacks this synchronization primitive, so we set an event and immediately wait for it. This is not a pretty solution, but it's what Vulkan can do without submitting the current command buffer to the queue (which ends up being more expensive on the CPU).
This commit is contained in:
parent
fe8ea9e0c9
commit
8835d40024
13 changed files with 57 additions and 16 deletions
|
@ -205,6 +205,7 @@ struct DeviceDispatch : public InstanceDispatch {
|
|||
PFN_vkCmdSetStencilReference vkCmdSetStencilReference;
|
||||
PFN_vkCmdSetStencilWriteMask vkCmdSetStencilWriteMask;
|
||||
PFN_vkCmdSetViewport vkCmdSetViewport;
|
||||
PFN_vkCmdWaitEvents vkCmdWaitEvents;
|
||||
PFN_vkCreateBuffer vkCreateBuffer;
|
||||
PFN_vkCreateBufferView vkCreateBufferView;
|
||||
PFN_vkCreateCommandPool vkCreateCommandPool;
|
||||
|
@ -958,6 +959,15 @@ public:
|
|||
dld->vkCmdSetEvent(handle, event, stage_flags);
|
||||
}
|
||||
|
||||
void WaitEvents(Span<VkEvent> events, VkPipelineStageFlags src_stage_mask,
|
||||
VkPipelineStageFlags dst_stage_mask, Span<VkMemoryBarrier> memory_barriers,
|
||||
Span<VkBufferMemoryBarrier> buffer_barriers,
|
||||
Span<VkImageMemoryBarrier> image_barriers) const noexcept {
|
||||
dld->vkCmdWaitEvents(handle, events.size(), events.data(), src_stage_mask, dst_stage_mask,
|
||||
memory_barriers.size(), memory_barriers.data(), buffer_barriers.size(),
|
||||
buffer_barriers.data(), image_barriers.size(), image_barriers.data());
|
||||
}
|
||||
|
||||
void BindTransformFeedbackBuffersEXT(u32 first, u32 count, const VkBuffer* buffers,
|
||||
const VkDeviceSize* offsets,
|
||||
const VkDeviceSize* sizes) const noexcept {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue