Make the Vulkan backend support implicit barriers.

With this commit the Vulkan backend completely ignores the explicit
barrier commands passed from the frontend, and generates its own
pipeline barriers.

Right now it encodes each barrier just before the resources are used,
which is quite bad but will be optimized later.

This commit also makes the frontend command buffer validation perform
the checks necessary for implicit barriers (although they are redundant
with checks for explicit barriers) because the tracking can pre-compute
pass usage information that's useful for the Vulkan backend.

Tests for usage validation inside passes will be added once the concept
of transition is removed from the API.
This commit is contained in:
Corentin Wallez
2018-07-10 18:03:22 +02:00
committed by Corentin Wallez
parent 117f2f0ad6
commit aa13be96e8
29 changed files with 409 additions and 77 deletions

View File

@@ -48,7 +48,10 @@ typedef struct {
nxtSwapChainError (*Present)(void* userData);
/// Each function is called with userData as its first argument.
void* userData = nullptr;
void* userData;
/// For use by the D3D12 and Vulkan backends: how the swapchain will use the texture.
nxtTextureUsageBit textureUsage;
} nxtSwapChainImplementation;
#if defined(NXT_ENABLE_BACKEND_D3D12) && defined(__cplusplus)