Commit Graph

9176 Commits

Author SHA1 Message Date
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 33dfd0a78f Use Travis OSX's default pip
easy_install failing to download pip was a major source of flakiness for
OSX builds.
2018-04-09 10:48:52 -04:00
Corentin Wallez 8828f2ad82 Don't check formatting on generator/ 2018-04-06 16:03: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 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 bc360f7a79 Travis.yml: Fix pip and cache it on OSX 2018-04-04 16:57:25 -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 234111c379 Give up on formatting tests and examples
clang-format really doesn't like the builder pattern. We can re-enable
it when we get rid of it.
2018-02-12 15:19:11 -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
Corentin Wallez 0dbf74b068 Reduce the verbosity of MSBuild in AppVeyor 2018-02-08 15:04:42 -08: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