Commit Graph

9919 Commits

Author SHA1 Message Date
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 b91022dc23 SampleUtils: Flush the wire before getting preferred format
This makes sure that the swapchain has been created on the server side
and that the preferred swapchain format is correctly computed.
2018-01-29 14:35:58 -05:00
Corentin Wallez 52cbcb4e47 SampleUtils: print GLFW errors for debugging 2018-01-29 14:35:58 -05:00
Corentin Wallez e98678f886 CHelloTriangle: Make the framebuffer use the preferred swapchain format 2018-01-29 14:35:58 -05:00
Corentin Wallez 32fbde25ec Fix Travis after LLVM APT repo change
After LLVM 6.0 was branched, the LLVM APT repositories changed so that
clang-format-7 is in the "latest" repo instead of 6.0. We cannot use
the LLVM-6.0 repo in Travis yet because it isn't in the repo whitelist.
Update travis.yml to use clang-format-7
2018-01-29 13:20:07 -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 d0d6e5cd20 Fix glTFViewer after shaderc update
Fragment shader outputs now require a location qualifier, that
glTFViewer was missing in its shaderc.
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 ae7f113fe8 Only compile the used SPIRV-Cross backends 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 3cf6c9df0c Travis: install pip manually on OSX 2017-12-04 14:14:38 -05:00
Corentin Wallez e3b1f51c04 Add travis hook to check formatting 2017-11-28 16:18:39 -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