181 Commits

Author SHA1 Message Date
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
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
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
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
1c24abc672 Implement SamplerTests AddressModeTest.
Exercise both U and V, but not W.
2018-04-09 13:42:24 -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
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
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
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
eba7c027f9 Enable DepthStencilStateTests on Vulkan 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
7648217f15 NXTTest: destroy the swapchain before the device 2018-01-29 14:35:58 -05:00
Corentin Wallez
395bf15599 Enable the InputState tests on Vulkan 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
348fb1b223 Enable T<->B CopyTests on Vulkan 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
b6fb5f3149 Roll shaderc 2017-12-12 01:02:35 -05:00
Corentin Wallez
d5d77af5b6 Member rename: src/tests 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
f40d8c545c Fix warnings in IndexFormatTests 2017-11-21 17:34:16 -05:00
Corentin Wallez
6225a72fb7 Add index format tests. 2017-11-20 09:59:03 -05:00
Corentin Wallez
2e31e8f0bf Make binding expose the preferred format 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
720a5d9366 d3d12: add implicit transition for subpass attachments 2017-09-15 14:02:02 -07:00
Corentin Wallez
7218ed19a1 end2end: Add push constant tests 2017-08-23 09:49:35 -04:00
Corentin Wallez
ab4aa2af3e NXTTest: Configure the swapchain
Otherwise when trying to use SwapBuffersForCapture a device error is
generated.
2017-08-23 09:49:35 -04:00
Corentin Wallez
8846433ae7 end2end: Clear attachments in tests 2017-08-23 09:49:35 -04:00
Austin Eng
4086effec0 Validate buffer view offset on bind groups 2017-08-17 15:36:02 -04:00
Austin Eng
ae48c95306 Add IsAligned helper for values 2017-08-17 15:36:02 -04:00
Austin Eng
d37ec9af92 unittests: Test inheritance of vertex inputs between pipelines and no inheritance between subpasses 2017-08-15 19:40:10 -04:00
Kai Ninomiya
b476abd915 RenderPassLoadOpTests.ClearsOnlyOnFirstUsePerRenderPass (#117)
Tests that an attachment is cleared only on the first subpass that uses
it in a renderpass
2017-08-15 13:58:48 -07:00
Kai Ninomiya
afa45a9176 Add tests for clears, render passes, framebuffers (#107)
* Add tests for clears, render passes, framebuffers

* Test load with a draw in it
2017-08-14 16:32:26 -07:00
Austin Eng
e69a2893b3 Add BlendState validation tests 2017-08-07 18:51:48 -04:00
Austin Eng
12a00ba3d1 Reset blend color to (0,0,0,0) at the start of render subpass 2017-08-07 18:51:48 -04:00
Austin Eng
cce6b01b6d Remove dual source blending
It is not supported on many mobile GPUS on Vulkan
http://vulkan.gpuinfo.org/listreports.php?feature=dualSrcBlend&option=not
and is optional on Metal
2017-08-07 18:51:48 -04:00
Austin Eng
18163f1223 end2end: Add blend state tests 2017-08-07 18:51:48 -04:00
Ben Constable
ea507ddf77 Code review feedback 2017-08-01 18:45:33 -04:00
Ben Constable
a015ad3399 Initial changes for depth stencil, some tests not passing 2017-08-01 18:45:33 -04:00
Kai Ninomiya
c16a67ae52 Swap chains, part 2 (#94) 2017-07-27 18:30:57 -07:00
Corentin Wallez
3818e18c5c Forward unhandled builder errors to the device 2017-07-27 21:08:12 -04:00