25 Commits

Author SHA1 Message Date
Corentin Wallez
d8c068fb4f Remove explicit usage transition from the API and validation
This removes the following for both Buffer and Texture:
 - The builder's SetInitialUsage
 - The object's FreezeUsage and TransitionUsage methods
 - The CommandBuffer Transition<Object>Usage methods

All samples and tests are simplified as a result. This also obsoletes
the UsageValidationTest which is removed.

Some validation was dependent on "current usage" and hasn't been
reintroduced for implicit transitions yet:
 - Buffers can be used while mapped
 - Swapchain textures can be used after they have been presented.

Validation for these will involve collecting all the resources used by a
command buffer and will be done in a follow-up patch.
2018-07-16 14:44:20 +02:00
Corentin Wallez
aa13be96e8 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.
2018-07-11 17:17:21 +02:00
Corentin Wallez
c9f0348bfe CommandBufferVk: Iterate per-pass 2018-07-10 10:59:44 +02:00
Corentin Wallez
30f7ddbb6b Vulkan: Split VulkanBackend in Forward.h and DeviceVk 2018-06-19 13:51:26 -04:00
Corentin Wallez
8d6b5d2337 Rename RenderPassInfo to RenderPassDescriptor 2018-05-16 11:18:14 -04:00
Corentin Wallez
6f7749cce9 Change render passes from multi to single pass.
This as an API change to get closer to the direction in which WebGPU is
headed. The API change in next.json caused a ton of files to be changed
in the same commit to keep things compiling.

API: the Framebuffer and RenderPass objects are now merged in a single
RenderPassInfo that contains the attachments, loadOps and clear values
for a BeginRenderPass command. The concept of subpass is removed.
The RenderPass creation argument to RenderPipelines is replaced by
explicitly setting the format of attachments for RenderPipeline.

Validation: SetPipeline checks are changed to check that the attachments
info set on a RenderPipeline matches the attachments of the render pass.

Backends: Most changes are simplifications of the backends that no
longer require and indirection to query the current subpass out of the
render pass in BeginSubpass, and don't need to get the attachment info
from a RenderPass when creating RenderPipelines. In the Vulkan backend,
a VkRenderPass cache is added to reuse VkRenderPasses between
RenderPassInfos and RenderPipelines.

Tests and examples: they are updated with the simplified API. Tests
specific to the Framebuffer and RenderPass objects were removed and
validation tests for RenderPassInfo were added.

Tested by running CppHelloTriangle on all backends, end2end tests on all
platforms and all examples on the GL backend.
2018-05-16 11:18:14 -04:00
Corentin Wallez
46d5441557 Vulkan: Implement compute CommandBuffer operations 2018-04-19 13:22:56 -04:00
Corentin Wallez
186a5cba87 CommandBufferVk: Lazily set bindgroups in preparation for compute
Also fix PipelineLayoutBase::InheritedGroupsMask
2018-04-19 13:22:56 -04:00
Corentin Wallez
abcf982e09 Enable IndexFormatTests on Vulkan
This adds translation of the index format in the Vulkan backend. A test
is also added for an issue currently present in the Vulkan backend.
2018-03-02 15:26:19 -05:00
Corentin Wallez
a3c89cc27a Add and Implement CommandBuffer::SetScissorRect 2018-03-02 14:22:50 -05:00
Corentin Wallez
53604a11a5 Vulkan: Implement SetStencilReference 2018-02-06 09:15:01 -05:00
Corentin Wallez
8b7564fb54 Vulkan: Remove stencil masks from dynamic state
In NXT the stencil read and write masks are part of the pipeline state
so they should be set by the pipeline and not dynamically.
2018-02-06 09:15:01 -05:00
Corentin Wallez
54c11a8a55 Vulkan: Implement SetBindGroup 2018-02-05 13:27:47 -05:00
Corentin Wallez
8df4142870 Vulkan: Implement SetBlendColor 2018-02-05 13:27:47 -05:00
Corentin Wallez
b0ae792954 Vulkan: Don't implicitly transition texture already in output attachment 2018-02-05 13:27:47 -05:00
Corentin Wallez
37bead6fa5 Vulkan: transition attachments implicitly 2018-01-29 19:50:28 -05:00
Corentin Wallez
2b391dac74 Vulkan: Implement RenderPipeline 2018-01-15 19:13:01 -05:00
Corentin Wallez
eb135f6fc0 Vulkan: Implement render pass commands 2018-01-15 19:13:01 -05:00
Corentin Wallez
49450b5644 Vulkan: Implement Draw* commands 2018-01-15 19:13:01 -05:00
Corentin Wallez
88d85fbaac Vulkan: Implement Set[Index|Vertex]Buffers 2018-01-15 19:13:01 -05:00
Corentin Wallez
6b986732d5 Vulkan: implement T<->B copies 2018-01-08 04:07:41 -08:00
Corentin Wallez
f1d56f3094 Vulkan: Implement texture transitions 2018-01-08 04:07:41 -08:00
Corentin Wallez
aa43d162ec Vulkan: Implement texture creation.
This commit only implements the creation and destruction of VkImage as
well as the allocation and freeing of its memory.
2018-01-08 04:07:41 -08:00
Corentin Wallez
160abad592 Vulkan: Implement buffer transitions 2017-12-12 12:31:20 -05:00
Corentin Wallez
77a1d908b6 Vulkan: Handle CopyBufferToBuffer commands
This as this is the first command handled by the Vulkan backend, this
commit also introduces the b:✌️:CommandBUffer class and implements
b:✌️:Queue::Submit.

Also enables the BufferSetSubData tests that are now passing on Vulkan
even though the buffer transitions are unimplemented.
2017-12-12 12:31:20 -05:00