25 Commits

Author SHA1 Message Date
Corentin Wallez
b1669e3fa4 Change the API prefix in generators from nxt to dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez
226110f958 Rename nxt:: to dawn:: in the backends 2018-07-18 22:54:06 +02:00
Corentin Wallez
4a9ef4ee21 Rename the copyright authors from NXT to Dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez
d8c068fb4f Remove explicit usage transition from the API and validation
This removes the following for both Buffer and Texture:
 - The builder's SetInitialUsage
 - The object's FreezeUsage and TransitionUsage methods
 - The CommandBuffer Transition<Object>Usage methods

All samples and tests are simplified as a result. This also obsoletes
the UsageValidationTest which is removed.

Some validation was dependent on "current usage" and hasn't been
reintroduced for implicit transitions yet:
 - Buffers can be used while mapped
 - Swapchain textures can be used after they have been presented.

Validation for these will involve collecting all the resources used by a
command buffer and will be done in a follow-up patch.
2018-07-16 14:44:20 +02:00
Corentin Wallez
a430a9a0aa Make the D3D12 backend support implicit barriers
With this the backend ignores explicit usage transition hints from the
frontent and generates all the barriers automatically based on resource
usage.

The current implementation is very naive and encodes a barrier
immediately just before a resource is used in a new state.
2018-07-13 13:31:14 +02:00
Corentin Wallez
a2f9277dac D3D12: Split D3D12Backend in Forward.h and DeviceD3D12 2018-06-19 13:51:26 -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
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
2d62a371ee Format: src/backend/d3d12 2017-11-28 16:18:39 -05:00
Corentin Wallez
e00385af73 Member rename: src/backend/d3d12 2017-11-23 17:04:10 -05:00
Corentin Wallez
315e9268bb Vulkan: Start buffers, hack SetSubData and MapRead 2017-11-22 18:25:20 -05:00
Austin Eng
37d11539a4 Add compute to D3D12 backend 2017-08-14 17:39:36 -04:00
Corentin Wallez
ea1241af80 D3D12: Handle MapReadAsync offset 2017-07-18 11:06:54 -04:00
Austin Eng
c100ca7b3f Update BufferD3D12 to use Align helper 2017-07-17 17:16:45 -04:00
Corentin Wallez
fd589f3919 Add an internal ASSERT macro
This macro has some advantages over the standard library one:
 - It prints the place where the macro was triggered
 - It "references" the condition even in Release to avoid warnings
 - In release, if possible, it gives compiler hints

It is basically is stripped down version of the ASSERT macros I wrote
for the Daemon engine in src/common/Assert.h

This commit also removes the stray "backend" namespaces for common/
code.
2017-07-10 19:35:21 -04:00
Corentin Wallez
fffe6dfa16 Split backend/common in backend/ and common/
This directory used to contain both the state tracking code for the
backends, and the common utilities that could be used both by the
backends and the rest of the code. Things are now:

 - src/common is utility code for the whole repo
 - src/backend contains libNXT's code
 - src/utils is utility code that we don't want in libNXT

This commit also changes all includes to use global paths from src/
bacause it had to touch a bunch of #include statements anyway.
2017-07-06 17:54:52 -04:00
Austin Eng
47261d4ecb Implement MapReadAsync on D3D12 backend
Buffers with MapRead allowed are created on the READBACK heap and always
add the D3D12_RESOURCE_STATE_COPY_DEST state (required by D3D12).
Likewise MapWrite adds the D3D12_RESOURCE_STATE_GENERIC_READ state and
places resources on the UPLOAD heap. Because these states are
required, transitions for mapped buffers do nothing.
2017-07-06 16:57:54 -04:00
Austin Eng
6774bce06e Remove unused Device member in D3D12 TextureView and BufferView 2017-07-06 16:57:54 -04:00
Austin Eng
6103c62489 Rename backend::d3d12::ResourceUploader::UploadToBuffer to BufferSubData 2017-07-06 16:57:54 -04:00
Austin Eng
aecf0b130e Add D3D12 buffer, texture, and sampler binding 2017-07-04 14:30:34 -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
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