FNA-XNA / FNA3D

FNA3D - 3D Graphics Library for FNA
http://fna-xna.github.io/
Other
267 stars 44 forks source link

Vulkan: Restructure memory barriers to avoid breaking render pass #166

Closed thatcosmonaut closed 1 year ago

thatcosmonaut commented 1 year ago

Addresses https://github.com/FNA-XNA/FNA3D/issues/165

We should really only have been setting memory barriers in cases where a data race was actually possible, so this patch addresses that. Memory barriers are only created on data copies, and when a render pass ends.

To help facilitate this change, SetRenderTargets now configures the state for the next render pass. That state is then set when the new render pass is triggered, instead of immediately.

The validation layer might complain now if you bind a resource that hasn't had any data written to it, but that seems acceptable to me.

flibitijibibo commented 1 year ago

Haven't identified the issue but SpriteBatchTest is a black screen with this patch.