36 Commits

Author SHA1 Message Date
Corentin Wallez
79d9e16d3c Make Device::CreateSamplerImpl to return a ResultOrError
This will allow backends to do error-handling internally for things like
allocation failures though non of them take advantage of it yet.
2018-05-31 15:00:28 -04:00
Corentin Wallez
1ae19e8276 Change Sampler creation to use a descriptor instead of a builder 2018-05-23 14:03:51 -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
20aa6b9759 Vulkan: Implement ComputePipeline 2018-04-19 13:22:56 -04:00
Corentin Wallez
e44b900861 Vulkan: Implement samplers 2018-04-18 15:31:24 -04:00
Corentin Wallez
4977fa66a3 VulkanDevice: Request indenpendentBlend.
This is a core NXT feature but wasn't enabled, causing the Vulkan
validation layers to produce an error.
2018-04-17 18:10:57 -04:00
Corentin Wallez
cc0a54dbdb Implement MapWrite except in the wire.
Also this MapWrite doesn't zero out memory yet.
2018-04-06 16:03:57 -04:00
Corentin Wallez
08b3cbf5bf Vulkan: Implement DepthStencilState 2018-02-06 09:15:01 -05:00
Corentin Wallez
14e0687f94 Vulkan: Implement BindGroups
For now only StorageBuffer and UniformBuffer bindings are supported as
we don't have samplers yet.
2018-02-05 13:27:47 -05:00
Corentin Wallez
e7362d0b1b Vulkan: Implement BindGroupLayout 2018-02-05 13:27:47 -05:00
Corentin Wallez
5842c71e17 Vulkan: Implement BlendState 2018-02-05 13:27:47 -05:00
Corentin Wallez
92baafc7a0 Vulkan: Initial implementation of a swapchain.
This is currently hardcoded to work on one specific HW/OS/driver
version. It also assumes that the graphics queue is the same as the
present queue.
2018-01-29 19:50:28 -05:00
Corentin Wallez
407233390b Vulkan: support vktrace and renderdoc 2018-01-29 14:35:58 -05:00
Corentin Wallez
04d8567d31 VulkanInfo: Implement gathering of VkSurfaceKHR related info 2018-01-29 14:35:58 -05:00
Corentin Wallez
49588b0b8d Vulkan: Split off and implement SwapChain 2018-01-18 16:17:28 -05:00
Corentin Wallez
2b391dac74 Vulkan: Implement RenderPipeline 2018-01-15 19:13:01 -05:00
Corentin Wallez
35fcfc737b Vulkan: Implement TextureView and Framebuffer 2018-01-15 19:13:01 -05:00
Corentin Wallez
2bd6143061 Vulkan: Implement InputState 2018-01-15 19:13:01 -05:00
Corentin Wallez
3a11684e05 Vulkan: Implement 1-subpass renderpasses
Also adds some missing asserts for empty serial queues in the fenced
deleter service.
2018-01-15 19:13:01 -05:00
Corentin Wallez
aeaffcf8fc Vulkan: Create dummy pipeline layouts 2018-01-15 19:13:01 -05: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
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
Corentin Wallez
a9b98af710 Vulkan: Centralized deferred deletion, use it for BufferVk's handle
This introduce a new FencedDeleter service as part of the Device
objects that tracks when resources are no longer used and deletes them.
BufferVk takes advantage of this to defer the deletion of its handle
that was previously incorrectly delete directly in ~BufferVk.
2017-12-12 12:31:20 -05:00
Corentin Wallez
b36b501f5e Build the Vulkan backend on CI 2017-12-04 21:39:16 -05:00
Corentin Wallez
23b27a27e2 Format: src/backend/vulkan 2017-11-28 16:18:39 -05:00
Corentin Wallez
8d75e5b4ae Member rename: src/backend/vulkan 2017-11-23 17:04:10 -05:00
Corentin Wallez
b325f4d0af Fix compilation of Vulkan backend on Windows 2017-11-23 17:04:10 -05:00
Corentin Wallez
eee5171c39 Vulkan: Add uploader for BufferSetSubData 2017-11-23 09:26:26 -05:00
Corentin Wallez
a8ec80ba57 Vulkan: Add some simple command pool / buffer management 2017-11-23 09:26:26 -05:00
Corentin Wallez
9018236b38 Vulkan: Keep track of finished operations with fences 2017-11-23 09:26:26 -05:00
Corentin Wallez
315e9268bb Vulkan: Start buffers, hack SetSubData and MapRead 2017-11-22 18:25:20 -05:00
Corentin Wallez
0216233a83 Vulkan: Create device and load all entry points 2017-11-22 18:25:20 -05:00
Corentin Wallez
6d9a3b82c6 Vulkan: Create VkInstance and register debug report 2017-11-21 16:09:15 -05:00
Corentin Wallez
f2adf6d5bd Vulkan: Load Vulkan library and gather global info 2017-11-21 16:09:15 -05:00
Corentin Wallez
916046c956 Add stub Vulkan backend 2017-08-29 13:37:24 -07:00