Commit Graph

5017 Commits

Author SHA1 Message Date
Corentin Wallez 8308b1c1b3 Metal: Don't hardcode the texture usage or dimension 2017-07-06 11:34:31 -04:00
Corentin Wallez c6f9006b02 Metal: Use RGBA instead of BGRA and clear render targets by default
This makes rendering of the samples have the wrong colors on the Metal
backend, but using BGRA made end2end tests fail. The rendering color
will be fixed when the WSI is introduced.
2017-07-06 11:34:31 -04:00
Corentin Wallez 8859178703 Add nxt::VertexFormat::FloatR32 2017-07-06 11:34:31 -04:00
Corentin Wallez 4cd65f03b7 Add a readpixel test 2017-07-06 11:34:31 -04:00
Austin Eng cd13691783 Update SPRIV-Cross for HLSL SM5.1 register name support 2017-07-04 14:30:34 -04:00
Austin Eng 036f76f51f D3D12: Refactor bind group descriptor tracking and descriptor heap allocation
Extract descriptor offset computation and CPU descriptor recording to
BindGroupLayout and BindGroup. Refactor descriptor heap allocation to
copy from a large CPU heap to a GPU heap.
2017-07-04 14:30:34 -04:00
Austin Eng aecf0b130e Add D3D12 buffer, texture, and sampler binding 2017-07-04 14:30:34 -04:00
Austin Eng 29477375a6 fix bind group state tracking on pipeline switch 2017-07-04 14:30:34 -04:00
Austin Eng ed54ec0c71 update spirv-cross version for HLSL register declaration support 2017-07-04 14:30:34 -04:00
Corentin Wallez ac06ef34e4 Fix shaderc not finding python when inside VS
Visual Studio 2017 is able to build CMake-based projects directly be
opening the folder containing the CMakeLists.txt. However when doing
this shaderc is not able to find the Python executable (it uses
find_program instead of the special Python CMake module). Help shaderc
by setting the PYTHON_EXE variable before including its CMakeLists.txt
2017-07-04 12:54:39 -04:00
Corentin Wallez e9d347e89e Add T->B copies.
This implements T->B copies on the Metal backend only and while it adds
validation tests, end2end tests will be done in a follow-up commit.
2017-06-27 13:25:42 -04:00
Corentin Wallez 492cbe4a43 ValidationTests: add B->T copy tests 2017-06-27 13:25:42 -04:00
Corentin Wallez b6d52b4ad1 Refactor copy validation to add helper functions useful for T->B too.
Also fixes validation not taking the mip-level into account when
checking if the copy would fit in the texture.
2017-06-27 13:25:42 -04:00
Corentin Wallez 4b4922cdce Allow empty B->T copies
This adds a test that empty copies are valid for B->B copies too. Tests
for B->T will come in a follow up commit.
2017-06-27 13:25:42 -04:00
Corentin Wallez eaae746433 Introduce end2end tests.
This commit adds a test harness that handles instantiating tests on
multiple backends, and have deferred expectations on the content of
resources.
2017-06-22 09:56:30 -07:00
Corentin Wallez ef199c0310 Metal: Implement BufferMapRead 2017-06-22 09:56:30 -07:00
Corentin Wallez 6cb33ef24e Metal: Introduce a proper BufferUploader and PendingCommands
Previously the Metal backend used a manual mutex system to make sure the
BufferSetSubData didn't have data races with reads from the GPU. Replace
this with a non-hacky version
 - Make the Buffer objects allocated on the GPU
 - Make SetSubData use a ResourceUploader that allocates a CPU buffer
   and schedules a CPU->GPU copy.
 - Have a list of pending commands and a finished command serial to
   order operations and track when resource become unused.
2017-06-22 09:56:30 -07:00
Corentin Wallez 0ba5550874 Metal: split non-trivial objects in their own file.
No functional changes intended, but there are a couple additional
cleanups:
 - Use anonymous namespaces instead of static functions
 - Don't store an extra Device pointer in objects
2017-06-22 09:56:30 -07:00
Corentin Wallez 702186e169 Add restrictions on usages allowed with MapRead/Write 2017-06-22 09:56:30 -07:00
Corentin Wallez 769b00fc23 Fix MapRead and MapWrite being the same bit 2017-06-22 09:56:30 -07:00
Corentin Wallez 76707f9ac9 SerialQueue: add const version of the iterators.
Unfortunately you can't template on const-ness in C++ so we have to
duplicate all the iterator code for SerialQueue (that, or introduce very
heavy templating).
2017-06-22 09:56:30 -07:00
Corentin Wallez e64dec7a3d Move Serial declaration to Forward.h
This is a bit ugly but avoids having to include all of SerialQueue.h
just to get this typedef.
2017-06-22 09:56:30 -07:00
Corentin Wallez fbf53ac773 Remove SpirvTest 2017-06-20 07:40:17 -07:00
Corentin Wallez 9347e8fcd1 Rename example/Utils to example/SampleUtils 2017-06-20 07:40:17 -07:00
Corentin Wallez 5ee7afdfbe Split NXT helpers from example/Utils into src/utils
This will make it possible to use them in the test suites
2017-06-20 07:40:17 -07:00
Corentin Wallez 1bd219d8a8 Split BackendBinding from example/Utils into src/utils
This will make it possible to reuse the backend bindings for test suites
2017-06-20 07:40:17 -07:00
Corentin Wallez 931e6e82fd Make CHelloTriangle in C++ to simplify Utils
The point of CHelloTriangle is to use the C version of NXT, so having
the code C++ is still ok.
2017-06-20 07:40:17 -07:00
Austin Eng 6aef6833b7 assert vector is nonempty in SerialQueue::Enqueue 2017-06-19 17:32:26 -04:00
Austin Eng e480a0724c add test for SerialQueue::FirstSerial 2017-06-19 17:32:26 -04:00
Austin Eng e44179ae4d Move command list creation to the Device and indirectly reserve command allocators 2017-06-19 15:08:53 -04:00
Austin Eng a4dcde9cf3 forward declare allocator classes 2017-06-19 15:08:53 -04:00
Austin Eng f96ce23628 Add ResourceAllocationManager to create and track lifetimes of d3d12 resources 2017-06-19 15:08:53 -04:00
Austin Eng 78f1619446 Use CommandAllocatorManager to create and track lifetimes of ID3D12CommandAllocators 2017-06-19 15:08:53 -04:00
Austin Eng 2157002570 refactor ResourceUploader to use SerialQueue 2017-06-19 15:08:53 -04:00
Corentin Wallez 38246eb51c Introduce SerialQueue to track in flight resources 2017-06-15 15:37:48 -07:00
Corentin Wallez dbb5729e64 Add Device::Tick for periodic work 2017-06-15 13:27:50 -07:00
Austin Eng b947993e1a Add d3d12 resource uploader to create and manage uploading resource lifetimes 2017-06-14 13:53:52 -04:00
Austin Eng d251356783 D3D12 vertex and index buffers with resource transitions 2017-06-14 13:53:52 -04:00
Austin Eng 459537491b Refactor TransitionUsage to use abstract TransitionUsageImpl 2017-06-14 13:53:52 -04:00
Austin Eng 39c901d3dc Change usage requirements for Buffer::SetSubData to require TransferDst
instead of MapWrite bit
2017-06-14 13:53:52 -04:00
Corentin Wallez 5c92537418 Add validation tests for B2B commands 2017-06-13 13:15:30 -07:00
Corentin Wallez d84d107076 Add buffer to buffer copies 2017-06-13 13:15:30 -07:00
Corentin Wallez 367cb3515c Fix MapRead error callback being called with a valid pointer
This happened when a request resulted in an error while the buffer was
already mapped. Adds a test that catches the error.
2017-06-13 08:30:01 -07:00
Corentin Wallez 68358b5c23 Add Buffer::MapReadAsync validation tests.
This also expands the Buffer validation tests to cover more creation
code paths and SetSubData. It also introduces a mechanism for
ValidationTests to check for device errors.
2017-06-13 08:30:01 -07:00
Corentin Wallez 43bfaae340 Null: implement fake async BufferMapRead
We want to test BufferMapRead validation using the null backend. To get
closer to conditions on a real backend, we call the callback only on the
next Queue::Submit. This is because on real backends, we would have to
wait for the GPU to be finished with the buffer, to be sure the correct
data is read.
2017-06-13 08:30:01 -07:00
Corentin Wallez c863b1c26f ToBackend: Add support for Device 2017-06-13 08:30:01 -07:00
Corentin Wallez eca89c2989 WireTests for buffer read mapping 2017-06-13 08:30:01 -07:00
Corentin Wallez 9388b23212 Implement Buffer::MapReadAsync in the wire 2017-06-13 08:30:01 -07:00
Corentin Wallez b1c19eeb4f Add Buffer::MapReadAsync state-tracking 2017-06-13 08:30:01 -07:00
Corentin Wallez f45bdb89c6 Split Mapped usage in MapWrite and MapRead
Also make use of CreateFrozenBufferFromData where possible in the
example to make the renaming easier.
2017-06-09 15:26:26 -07:00