33 Commits

Author SHA1 Message Date
Austin Eng
94bebe517d Add BlendState to NXT API 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
Austin Eng
ba6a36c974 D3D12: Enable better live object reporting and cleanup resources on device destruction 2017-07-27 15:15:28 -04:00
Kai Ninomiya
35bf424035 Swap chains, part 1 (#87)
Adds the swap chain interfaces to the API without changing the behavior
of anything else. This includes the C APIs for applications to provide
swap chain implementations. Also adds stub implementations on every
backend.
2017-07-19 15:41:17 -07:00
Corentin Wallez
136cae5ee2 Split Pipeline in Render and Compute, D3D12 part 2017-07-17 15:25:16 -04:00
Kai Ninomiya
fec8c58a97 Add depth-stencil textures and attachments (#77)
Related: #29
2017-07-17 12:03:16 -04:00
Austin Eng
77a29986b0 D3D12 Render Targets (#72)
Implements BeginRenderSubpass on the D3D12 backend. Descriptors for render target and depth stencil views are recorded in a descriptor heap for each framebuffer. For now, we still have the hack where no attachment renders to the backbuffer, so the CommandBuffer records those when necessary when it is submitted.

This PR also enables input states for D3D12 which are mostly working. One failure seems to be happening because our texture copies are not yet correct.
2017-07-12 17:36:36 -07:00
Corentin Wallez
83e779d8f2 Fix all Windows warnings 2017-07-11 13:59:15 -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
Austin Eng
afdcf7d828 D3D12: Wait for GPU on device destruction 2017-07-10 16:45:28 -04:00
Austin Eng
f9c39d021e Add device reference counting 2017-07-10 16:45:28 -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
beb76d06db Rename d3d12 Device tick functions to Tick 2017-07-06 16:57:54 -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
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
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
Corentin Wallez
b1c19eeb4f Add Buffer::MapReadAsync state-tracking 2017-06-13 08:30:01 -07:00
Austin Eng
81bc3ad23b move frame resource transitions to D3D12Binding 2017-06-09 07:26:31 -07:00
Austin Eng
cfeda4d9f2 CHelloTriangle working 2017-06-07 16:23:10 -04:00
Austin Eng
eb6d22242a add D3D12Binding with swap chain 2017-06-07 16:23:10 -04:00
Austin Eng
fc2bac7e45 add null D3D12 backend 2017-06-07 16:23:10 -04:00