Commit Graph

505 Commits

Author SHA1 Message Date
Corentin Wallez a714f5b459 OpenGL: Split off QueueGL 2018-06-19 13:51:26 -04:00
Corentin Wallez 77d1f10493 OpenGL: Split OpenGLBackend in Forward.h and DeviceGL 2018-06-19 13:51:26 -04:00
Corentin Wallez 30f7ddbb6b Vulkan: Split VulkanBackend in Forward.h and DeviceVk 2018-06-19 13:51:26 -04:00
Corentin Wallez a4cb35cdbc Vulkan: Split off QueueVk 2018-06-19 13:51:26 -04:00
Corentin Wallez b703def640 Add Device::CreateQueue() instead of the builder
We are changing all object creation to use descriptors but there is no
creation argument to pass for queue, so instead Device::CreateQueue
takes no argument.
2018-06-18 13:33:40 -04:00
Corentin Wallez 82565b340f Add NXT_UNUSED to silence unused warnings 2018-06-12 14:26:32 -04:00
Corentin Wallez 5ab96e0d40 Wire: Implement MapWriteAsync
The flow of commands is a bit more involved than for MapReadAsync and
goes like this:
 - C->S MapAsync isWrite = true
 - S: Call MapWriteAsync
 - S: MapWriteAsync callback fired
 - S->C: MapWriteAsyncCallback (no data compared to the read case)
 - C: Call the MapWriteAsync callback with a zeroed out buffer
 - C: Application calls unmap.
 - C->S: UpdateMappedData with the content of the mapped pointer
 - S: Copy the data in the mapped pointer
 - C->S: Regular unmap command
 - S: Call unmap

Makes nxt_end2end_tests -w pass all tests.

Also duplicates the MapRead wire tests for the write cases
2018-06-09 13:52:45 +02:00
Corentin Wallez 88fb8fa353 Wire: Move the logic of [de]serialization in WireCmd.
This will help with follow-up changes that add support for a more
complete grammer of types, including structures containing pointers
to objects or other structures.

Instead of having the wire::Client and wire::Server directly act on
buffer memory, a couple interfaces are introduced so that WireCmd can do
things like get the object<->id mapping and temporary allocations.

While the serialization and deserialization of most commands was moved
into WireCmd, the commands that don't directly correspond to NXT methods
have their logic moved inside Client and Server and will be made to
expose the new interface in a follow-up commit.
2018-06-08 13:58:55 +02:00
Corentin Wallez 419e9841a8 NXTTest: add -w to run the end2end tests through the wire
This will be useful to provide additional coverage of the wire in
addition to the very focused WireTests unittests. All tests pass except
the MapWriteAsync ones that aren't implemented in the wire yet. They can
be skipped with --gtest_filter=-*MapWrite*
2018-06-08 13:58:55 +02:00
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 50e0986e0e Use Error in Sampler and autogenerated validation functions 2018-05-31 15:00:28 -04:00
Corentin Wallez 1fda980fa6 Add an Error and ResultOrError<T> type and tests
These types are meant to be used for computations that might but are not
expected to fail in backend/, such that the error case can be much
slower than the success case.

The NXT_TRY and NXT_TRY_RESULT macros are added to help write more
concise code that uses Error and ResultOrError.
2018-05-31 15:00:28 -04:00
Corentin Wallez 44b5ca4aa1 Add a functional-y Result<T, E> class and tests for it.
Implements two optimized versions of Result, one for Result<void, E*> as
a nullable pointer, and one for Result<T*, E*> as a tagged pointer.
2018-05-31 15:00:28 -04:00
Corentin Wallez 2141e960b7 Add NXT_(UN)?LIKELY macros to help with branch prediction 2018-05-31 15:00:28 -04:00
Corentin Wallez b1341db700 Add a NXT_NO_DISCARD that is C++17 [[nodiscard]] where available 2018-05-31 15:00:28 -04:00
Corentin Wallez b711b9b2c9 Add a GetDefaultSamplerDescriptor helper. 2018-05-23 14:03:51 -04:00
Corentin Wallez 5101d57972 WireTests: Add a test for sending structs of non-object values 2018-05-23 14:03:51 -04:00
Corentin Wallez 99c6fa2f55 WireTests: introduce a MatchesLambda GMock helper 2018-05-23 14:03:51 -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 2ee315ca64 Make WireTests not rely on SamplerBuilder
The sampler builder will be removed as the first builder being converted
to a descriptor. Use CommandBufferBuilder instead as it is not expected
to change soon.
2018-05-23 14:03:51 -04:00
Corentin Wallez e8c8f020fb Factor autogen validation utilities out of ProcTable 2018-05-23 14:03:51 -04:00
Corentin Wallez 7d95c40163 Factor CMakeLists backend ProcTable generation 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 87ec361cc2 Use the binding mask for BGL hashing and comparison 2018-05-16 11:18:14 -04:00
Stephen White f77e3cc648 Don't release things which will be autoreleased. 2018-05-09 11:37:09 -04:00
Corentin Wallez ae27c7a4bc Move HashCombine to HashUtils and make it work better on 64bits
HashCombine will be used in more than just BindGroupLayout caching so we
extract it to a separate header. Add a better mixing constant for 64bit
systems.
2018-05-08 16:51:06 -04:00
Corentin Wallez 60ffbfc071 Add word size detection to Platform.h 2018-05-08 16:51:06 -04:00
Stephen White 8f2050540d Fix a memory leak in metal ShaderModule.
Make the MetalFunctionData object returned by GetFunction() own a
reference to the MTLFunction and release it on destruction.
2018-04-28 00:06:20 -04:00
Stephen White c71cbf7721 Fix leak in Metal's Device::GetPendingCommandBuffer().
GetPendingCommandBuffer() doesn't need to retain the metal
command buffer; it's created with a ref.
2018-04-28 00:03:53 -04:00
Stephen White cce393e0d4 Fix some more memory leaks in the Metal backend. 2018-04-27 11:37:45 -04:00
Stephen White 22b862e052 Fix some leaking builder objects in common backend.
Delete the TextureBuilder created in SwapChainBase::GetNextTexture().
Delete the InputStateBuilder and DepthStencilStateBuilder created in
RenderPipelineBuilder::GetResultImpl().
2018-04-26 13:50: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 20aa6b9759 Vulkan: Implement ComputePipeline 2018-04-19 13:22:56 -04:00
Corentin Wallez 857a1cdb0e Enable IndexFormatTests on D3D12 2018-04-18 15:31:24 -04:00
Corentin Wallez 5ec9683800 Vulkan: Implement textures in bindgroups
Also enable the sampler tests on the Vulkan backend
2018-04-18 15:31:24 -04:00
Corentin Wallez e44b900861 Vulkan: Implement samplers 2018-04-18 15:31:24 -04:00
Corentin Wallez 32cb6fbca0 RenderPassVk: Set the correct number of color attachments 2018-04-17 18:10:57 -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 bfeb285dcf Fix BindGroupLayout leak in PipelineLayout default.
PipelineLayout was re-entering in NXT to create the default empty BGLs,
but forgot to remove the initial external refcount for them.

Fixing this showed an issue where it was impossible to externally
reference a RefCounted that had only internal references, fix this as
well and add a test.
2018-04-17 18:10:57 -04:00
Corentin Wallez df5a18d883 Fix BindGroupLayout caused by caching.
When a BGL was first created in the cache, it started with an external
refcount of 1 and we then referenced again in
BindGroupLayoutBuilder::GetResultImpl, causing a leak.

Fix this by referencing in the cache lookup only if the BGL already
exists.
2018-04-17 18:10:57 -04:00
Stephen White 51f9987298 Update CommandBufferGL.cpp 2018-04-16 15:31:02 -04:00
Corentin Wallez 9ce29d1104 Fixup comment 2018-04-16 15:31:02 -04:00
Stephen White ac49ed0779 Use a memcpy to avoid strict-aliasing warnings. 2018-04-16 15:31:02 -04:00
Stephen White 6d90e01858 Expand allowable formats for color attachments.
Don't assert on color formats which can be cleared with a
floating-point clear value.
So far, these are { unorm } x { r, rg, rgba, bgra }.
Fix linter error when no files to check.
2018-04-13 11:53:12 -04:00
Stephen White d0771f8dd5 Metal backend: do a Tick() on queue submit. 2018-04-12 13:14:19 -04:00
Stephen White 8c231b6990 Fix a DrawElements bug in the Metal backend.
The indexOffset of the draw was not being used. It must be
included in the indexBufferOffset.
Renamed indexBufferOffset -> indexBufferBaseOffset.
Add a DrawElements test which exercises zero and non-zero index offsets.
2018-04-12 10:32:33 -04:00
Stephen White a5aacc9cad Fix color write mask on GL backend.
Set the color mask even if blending is disabled.
2018-04-10 14:37:06 -04:00
Stephen White 10a659ad91 Implement support for all Int32 vertex formats. (#179) 2018-04-10 14:35:17 -04:00
Stephen White e5ae3274a3 Make SetSubData take size in uint8_t not uint32_t.
Also change data pointer to uint8_t*.
Add a test for a non-aligned SetSubData().
Implemented on all backends.
2018-04-10 14:34:24 -04:00
Stephen White ee66f25c4f Add support for R16G16B16A16 ushort.
Also implement both new formats in Vulkan.
2018-04-10 11:37:35 -04:00
Stephen White 0b1fbd9322 Add support for ushort2 vertex format.
Also fix some vertex format computations.
2018-04-10 11:37:35 -04:00
Stephen White ceec97978e Implement recent vertex and texture formats on Vk.
Implement unorm_rgba8 and unorm_rg8 vertex formats and
{uint8, unorm8} x {r, rg} texture formats on Vulkan backend.
2018-04-09 16:15:59 -04:00
Stephen White 1c24abc672 Implement SamplerTests AddressModeTest.
Exercise both U and V, but not W.
2018-04-09 13:42:24 -04:00
Stephen White a9e3d7fd00 Implement sampler address modes (API, D3D, MTL, GL). 2018-04-09 13:42:24 -04:00
Stephen White cd4f8a2e2f Add 1- and 2-component texture formats.
Implemented {uint8, unorm8} x {r, rg} texture formats.
Backend support added for Metal, D3D12 and OpenGL.
2018-04-09 11:26:17 -04:00
Stephen White 8d742d1375 Implement unorm_rgba8 and unorm_rg8 vertex formats.
Backend support implemented in GL, Metal and D3D12.
Support for unorm values in the GL backend requires a
utility function to indicate if the format's components
are normalized.

Note that unorm_r8 is only supported on more recent MacOS SDKs (10.13),
so it's omitted for now.
2018-04-09 11:25:31 -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 8565e0056a Rename "buffer map read status" to "buffer map async status"
This is in preparation of MapWriteAsync that will use the same status
enum.
2018-04-06 16:03:57 -04:00
Corentin Wallez 2da19d5d6b Fix double MapReadCallback trigger when Unmapping in it.
When calling unmap on a mapped buffer for which the callback hasn't
fired yet, the callback should be called with UNKNOWN. The code marked
the callback as called only after calling it, causing problems with
re-entrancy where the callback would be called twice.

This could also get triggered by destroying the buffer inside the
callback.

Fix this in backend::Buffer and the WireClient and add test for both.
2018-04-06 16:03:57 -04:00
Stephen White c25d376ac3 Use GL_RGBA8 as the internal format for GL_BGRA. 2018-04-06 15:05:05 -04:00
Corentin Wallez 32c0caab61 Enable BasicTests on the Vulkan backend 2018-03-02 15:26:19 -05:00
Corentin Wallez 8d541f3de9 Enable PrimitiveTopologyTests on Vulkan 2018-03-02 15:26:19 -05: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 cf0ac7570d D3D12: Keep a reference to pipelines until unused
Previously we would remove the reference to pipelines in the destructor
of the d3d12::*Pipeline objects which could cause the D3D12 pipeline
state to be destroyed while still used by in-flight commands. Add a
global queue of ComPtrs to keep alive in the d3d12::Device to fix this.
2018-03-02 14:25:30 -05:00
Corentin Wallez 57f7bc750a Add an end2end test for SetScissorRect 2018-03-02 14:22:50 -05:00
Corentin Wallez 3a2d9b9a13 Add validation test for dynamic state
This includes:
 - SetScissorRect
 - SetBlendColor
 - SetStencilReference
2018-03-02 14:22:50 -05:00
Corentin Wallez a3c89cc27a Add and Implement CommandBuffer::SetScissorRect 2018-03-02 14:22:50 -05:00
Corentin Wallez 1090a10d4f Invert final blit in the OpenGL bindings
We want all of NXT to have the origin in the top left. OpenGL's origin
is the bottom left instead. We are doing a blit already to decouple
the NXT render targets from the OpenGL default framebuffer. Take
advantage of this and invert the blit to make the OpenGL's backend
origin be top left.
2018-02-12 15:19:11 -05:00
Corentin Wallez 54ab71b5ce Add ViewportOrientation test 2018-02-12 15:19:11 -05:00
Corentin Wallez a88ec74e60 Factor simple framebuffer creation in end2end tests 2018-02-12 15:19:11 -05:00
msiglreith adb152bff1 dx12: Handle present texture in a specially
PRESENT is an exclusive flag in NXT and can't be combined with other flags. The existing implementation treats the D3D12_RESOURCE_STATE_PRESENT as flag which is confusing due to being 0.
2018-02-08 16:12:06 -05:00
Corentin Wallez 6569f9f0a4 D3D12: Move initialization of the device in the backend 2018-02-07 14:37:51 -05:00
Corentin Wallez 9b491437b1 D3D12: Move the NativeSwapChainImpl in the backend 2018-02-07 00:31:17 -05:00
Corentin Wallez 02d24d3c5e D3D12: Add back flip_vert_y.
This fixes the InputStateTests and PrimitiveTopologyTests
2018-02-07 00:31:17 -05:00
Corentin Wallez 099656dc7a D3D12: Fix swapchains after 921fb5e1ce
The Swapchain::Configure was changed to not require an initial usage
anymore. Previously the code was doing a transition to this usage
causing the code to now transition to <uninitialized data> usage.
Fix this by deleting code. Also make TextureD3D12 responsible for the
transition to PRESENT.
2018-02-07 00:31:17 -05:00
Corentin Wallez eba7c027f9 Enable DepthStencilStateTests on Vulkan 2018-02-06 09:15:01 -05:00
Corentin Wallez 53604a11a5 Vulkan: Implement SetStencilReference 2018-02-06 09:15:01 -05:00
Corentin Wallez 08b3cbf5bf Vulkan: Implement DepthStencilState 2018-02-06 09:15:01 -05:00
Corentin Wallez 6e01758dcd TextureVk: Don't release swapchain-owned images 2018-02-06 09:15:01 -05:00
Corentin Wallez 27570bd5b4 Vulkan: Implement RenderPass LoadOp 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 5000ee68d2 Enable BlendStateTest on the Vulkan backend 2018-02-05 13:27:47 -05:00
Corentin Wallez 54c11a8a55 Vulkan: Implement SetBindGroup 2018-02-05 13:27:47 -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 8df4142870 Vulkan: Implement SetBlendColor 2018-02-05 13:27:47 -05:00
Corentin Wallez 5842c71e17 Vulkan: Implement BlendState 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 9e59b4ddf1 Fixup some include guards to match the filename 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 672d7f26e1 TextureVk: Fix not transitioning between queues 2018-01-29 19:50:28 -05:00
Corentin Wallez 75f5b8039b Vulkan: Fix texture synchronization for present 2018-01-29 19:50:28 -05:00
Corentin Wallez dd5ff104ec Vulkan: support fenced deletion of swapchain objects 2018-01-29 19:50:28 -05:00
Corentin Wallez eb45309722 vulkan_platform: Add a method to get the uint64_t handle 2018-01-29 19:50:28 -05:00
Corentin Wallez 37bead6fa5 Vulkan: transition attachments implicitly 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 7648217f15 NXTTest: destroy the swapchain before the device 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 0887236c81 nxtSwapChainNextTexture: make texture a union of ptr, u32, u64
Making all textures represented by pointers is a problem for Vulkan
where VkImage is a 64bit type and wouldn't fit in a pointer on 32bit
builds. Make texture contain on of each useful type so that each backend
can choose which one it wants to receive.
2018-01-18 16:17:28 -05:00
Corentin Wallez c0f5ca1f5a Move vulkan_platform.h to common/
This file changes the non-dispatchable Vulkan handle types. We want to
use some of these handles in utils/VulkanSwapChain.cpp so it needs to
have access to it. The file could include
backend/vulkan/vulkan_platform.h but it seems a bit cleaner to move the
header in common/ instead with a warning if the Vulkan backend isn't
enabled.
2018-01-18 16:17:28 -05:00
Corentin Wallez cc407ae787 Make SwapChainImpl a function and move it to common/
For the Vulkan backend it will make sense to have the SwapChain be
implemented inside the backend as it will need to interact with a lot of
things there. It will need SwapChainImpl and cannot see utils/ so
SwapChainImpl has to be moved in common/

Also makes SwapChainImpl a function called CreateSwapChainImplementation
as the inheritance was only used to share a static method.
2018-01-18 16:17:28 -05:00
Corentin Wallez 395bf15599 Enable the InputState tests on Vulkan 2018-01-15 19:13:01 -05:00
Corentin Wallez a00a5d3d8b TextureVk: Transition to the first usage if needed
In Vulkan images are created in no particular layout and must be
transitioned before they can be used. This didn't appear before because
the test were creating the textures with not initial usage and then
transitioned them. This isn't the case with InputStateTest, which is
what uncovered this issue.
2018-01-15 19:13:01 -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 35fcfc737b Vulkan: Implement TextureView and Framebuffer 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 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 47155a3555 Make gl_Position(-1, -1) map to texel (0, 0) of the render target
There was a lot of missing around with viewports and flip the Y
coordinate in vertex shaders before. Turns out things are simpler than
we thought: *all* APIs have gl_Position(-1, -1) map to texel (0, 0). It
is just the present coordinate system that changes.

Remove some of the hacks we had to work around non-existent viewport
issues and fix tests.
2018-01-15 19:13:01 -05:00
Corentin Wallez d15177d84e Don't leak default created objects
Sometimes NXT provides default objects for parts of the pipelines, for
example a default pipeline layout. This objects were create with code
like: device->CreateFooBuilder()->GetResult(); and stored in a Ref<>.
This caused the object to have on external reference and two internal
references and not get destroyed when the Ref<> goes out. Call Release
on these objects to remove the external reference and fix the leak.

Was found via the Vulkan validation layers that were complaining that a
VkPipelineLayout was leaked.
2018-01-15 19:13:01 -05:00
Corentin Wallez 348fb1b223 Enable T<->B CopyTests on Vulkan 2018-01-08 04:07:41 -08: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 f11396767f Make nxt::TextureBase::GetDevice const
Because it is.
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
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 c34aa3abe7 Vulkan: Make non-dispatchable handles always opaque
On 32 bit Vulkan typedefs these handles to uint64_t which breaks
function overload resolution. Replace the
VK_DEFINE_NON_DISPATCHABLE_HANDLE and VK_NULL_HANDLE defines to be
opaque C++ types with the same capabilities.
2017-12-12 12:31:20 -05:00
Corentin Wallez 00935daffc Use shaderc_shared and don't build unnecessary targets
This should speed up compilation on Travis a little bit.
2017-12-12 01:02:35 -05:00
Corentin Wallez b6fb5f3149 Roll shaderc 2017-12-12 01:02:35 -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 c7807abf04 Format: src/backend/opengl 2017-11-28 16:18:39 -05:00
Corentin Wallez 1aa4d5604f Format: src/backend/null 2017-11-28 16:18:39 -05:00
Corentin Wallez f58d84d488 Format: src/backend/metal 2017-11-28 16:18:39 -05:00
Corentin Wallez 2d62a371ee Format: src/backend/d3d12 2017-11-28 16:18:39 -05:00
Corentin Wallez c1400f0d14 Format: src/backend 2017-11-28 16:18:39 -05:00
Corentin Wallez 9d01c6c26d Format: src/{common, utils, wire} 2017-11-28 16:18:39 -05:00
Corentin Wallez d5d77af5b6 Member rename: src/tests 2017-11-23 17:04:10 -05:00
Corentin Wallez ad6470466c Member rename: src/{common/utils/wire} 2017-11-23 17:04:10 -05:00
Corentin Wallez 8d75e5b4ae Member rename: src/backend/vulkan 2017-11-23 17:04:10 -05:00
Corentin Wallez 7ee1610f38 Member rename: src/backend/opengl 2017-11-23 17:04:10 -05:00
Corentin Wallez b0c75a5b68 Member rename: src/backend/metal 2017-11-23 17:04:10 -05:00
Corentin Wallez e00385af73 Member rename: src/backend/d3d12 2017-11-23 17:04:10 -05:00
Corentin Wallez 903c563b43 Member rename: src/backend/null 2017-11-23 17:04:10 -05:00
Corentin Wallez fbecc28ac4 Member rename: src/backend 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 98013d7866 Enable first tests on Vulkan! 2017-11-23 09:26:26 -05:00
Corentin Wallez bdde209ed9 VulkanBinding: make a dummy Vulkan swapchain impl 2017-11-23 09:26:26 -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