319 Commits

Author SHA1 Message Date
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
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
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
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
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
b8387a62a6 RefCounted: make copy constructor arg const 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
33f7bfe322 OpenGL: Apply vertex/index buffers just before draw.
Previously we would modify the GL state as soon as we saw
SetIndex/VertexBuffers. This GL state is owned by the VAOs in the
InputState and was disappearing on a Pipeline change. Fix this by
applying the index / vertex buffers lazily.
2017-11-21 17:34:16 -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
2eb113d690 Noop d3d12_platform.h cleanup 2017-11-21 16:09:15 -05:00
Corentin Wallez
e862a33dac Add TextureFormat::B8G8R8A8Unorm 2017-11-20 09:59:03 -05:00
Corentin Wallez
405dcd636a Make the index format part of the pipeline state. 2017-11-20 09:59:03 -05:00
Corentin Wallez
ff57ccbcf1 OpenGL: Fix rendered textures being flipped.
This was because the clip space of OpenGL has an inverted Y compared to
other APIs. This commit:
 - Updates SPIRV-Cross to the latest version
 - Uses the new vertex.flip_vert_y option in ShaderModuleGL
 - Enables tests that are now passing in GL.
2017-11-16 11:42:38 -05:00
Kai Ninomiya
921fb5e1ce remove initialUsage from SwapChain::Configure 2017-09-15 14:02:02 -07:00
Kai Ninomiya
169809c458 use TransitionUsageImpl 2017-09-15 14:02:02 -07:00
Kai Ninomiya
720a5d9366 d3d12: add implicit transition for subpass attachments 2017-09-15 14:02:02 -07:00
Kai Ninomiya
ee7b6b1b62 Update SwapChain to configure texture usage
Explicitly configure swap chain usage in bindings and examples

Fix missing case in switch

Make swap chain Present usage implicit

Author: Austin Eng <enga@google.com>
2017-09-15 14:02:02 -07:00
Kai Ninomiya
08a0081c13 Change SetPipelineCommon to return void (#124)
This is to avoid a potential future problem if SetPipelineCommon were to
ever return false (which is currently not possible), some state might
have been modified incorrectly.
2017-08-31 10:56:15 -07:00
Kai Ninomiya
da42198478 Remove the last few null=backbuffer hacks (#125)
I missed these in #94.
2017-08-31 10:47:54 -07:00