293 Commits

Author SHA1 Message Date
Austin Eng
476e5cbe30 Metal: Apply BlendState to RenderPipeline 2017-08-07 18:51:48 -04:00
Austin Eng
4820dbd7ee D3D12: Apply blend state to render pipeline 2017-08-07 18:51:48 -04:00
Austin Eng
31fc0d234c D3D12 & Metal: Blend state conversions 2017-08-07 18:51:48 -04:00
Austin Eng
94bebe517d Add BlendState to NXT API 2017-08-07 18:51:48 -04:00
Ben Constable
2c05f4d8fc Remove comment per code review feedback 2017-08-01 18:45:33 -04:00
Ben Constable
ea507ddf77 Code review feedback 2017-08-01 18:45:33 -04:00
Ben Constable
d54a5239a6 Fix missing depth stencil format and reference value setting 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
4526368263 Remove outdated backbuffer hack + reduce GL version to 4.4 (#100) 2017-07-31 11:25:06 -07:00
Corentin Wallez
4122b2e3f9 Metal: Implement push constants 2017-07-28 17:11:07 -04:00
Corentin Wallez
30beb65a7b Metal: Make the MSL indices match the ones of PipelineLayout
Previously didn't tell SPIRV-Cross at which MSL resource indices the
different SPIRV binding should be, and were lucky that it's giving
indices in increasing order matched the PipelineLayout in all our
samples.

Fix this by making SPIRV->MSL compilation depend on the PipelineLayout
so we can tell SPIRV-Cross which binding goes where.

We should do the same for vertex attributes eventually as they are
hardcoded to start at kMaxBindingsPerGroup currently.

Also a couple unrelated cleanups (unused function, usage of
IterateBitSet).
2017-07-28 17:11:07 -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
Austin Eng
ba6a36c974 D3D12: Enable better live object reporting and cleanup resources on device destruction 2017-07-27 15:15:28 -04:00
Austin Eng
439d963ccd Point,Line,Triangle -> PointList,LineList,TriangleList 2017-07-27 10:19:30 -04:00
Austin Eng
c2def461a1 Add input primitive topology to D3D12 and Metal pipeline states 2017-07-27 10:19:30 -04:00
Austin Eng
d81fd82bde Implement primitive topology in OpenGL, Metal, and D3D12 backends 2017-07-27 10:19:30 -04:00
Austin Eng
3e9e315636 Add primitive topology to NXT API 2017-07-27 10:19:30 -04:00
Austin Eng
ccf1fa2330 Remove DepthTestEnabled() and fix depth writes for depth function Always 2017-07-25 10:16:08 -04:00
Austin Eng
0506138567 D3D12: Add copy splitting for texture copies not 512-byte aligned 2017-07-25 09:40:54 -04:00
Kai Ninomiya
78c8b837ea clang/gcc: enable a bunch more warnings (#91)
* clang/gcc: enable -pedantic warnings

* suppress a GCC-specific warning in stb_image

* And some clang-specific warnings

* -Wconversion (clang) -Wold-style-cast (clang+gcc)

and fix a few warnings that show up with these (and a few more with
-Wconversion on gcc, even though that's not enabled by default)

* bunch more warnings

* fixes

* remove merge error
2017-07-21 17:00:22 -07:00
Corentin Wallez
86b2894103 ShaderModule: Validate the push_constant block size 2017-07-20 16:33:02 -04:00
Corentin Wallez
c8377da79b Validate SetPushConstants is done inside subpass and compute passes 2017-07-20 16:33:02 -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
Austin Eng
3835edde10 Add validation for buffer offset 2017-07-18 16:03:51 -04:00
Corentin Wallez
ea1241af80 D3D12: Handle MapReadAsync offset 2017-07-18 11:06:54 -04:00
Corentin Wallez
d8e1a25cbc Metal: Wait for GPU on device destruction 2017-07-18 11:06:54 -04:00
Austin Eng
33560ef015 Implement backend texture->buffer and buffer->texture copies with row pitch 2017-07-17 17:16:45 -04:00
Austin Eng
3f47729df6 Add row pitch validation and default computation 2017-07-17 17:16:45 -04:00
Austin Eng
359acd6e95 Add row pitch to Texture->Buffer and Buffer->Texture copy commands 2017-07-17 17:16:45 -04:00
Austin Eng
c100ca7b3f Update BufferD3D12 to use Align helper 2017-07-17 17:16:45 -04:00
Austin Eng
8867e5d8df Rename Align to AlignPtr 2017-07-17 17:16:45 -04:00
Corentin Wallez
0bcf0e8e74 Factor computation of inherited bindgroups in PipelineLayoutBase 2017-07-17 15:25:16 -04:00
Corentin Wallez
136cae5ee2 Split Pipeline in Render and Compute, D3D12 part 2017-07-17 15:25:16 -04:00
Corentin Wallez
b085eecb31 Split Pipeline in Render and Compute, OpenGL part 2017-07-17 15:25:16 -04:00
Corentin Wallez
494a157f66 Split Pipeline in Render and Compute, Metal part 2017-07-17 15:25:16 -04:00
Corentin Wallez
29ced285d4 Split Pipeline in Render and Compute, common part 2017-07-17 15:25:16 -04:00
Kai Ninomiya
00349e6e36 Default-initialize descriptor heaps to null (#82) 2017-07-17 15:14:01 -04:00
Corentin Wallez
23620b0dc7 OpenGL: Implement T->B copies
Also enable the basic end2end tests that are now passing.
InputStateTests isn't passing yet, for some reason the ReadPixels
returns pure black.
2017-07-17 13:48:17 -04:00
Corentin Wallez
0f9f747c8a OpenGL: implement a synchronous MapReadAsync
Mapping OpenGL buffers persistently and unsynchronized isn't supported
on OSX's OpenGL version where we want to run tests.
2017-07-17 13:48:17 -04:00
Corentin Wallez
dab0638177 Fix using NXT_PLATFORM without including Platform.h 2017-07-17 13:48:17 -04:00
Corentin Wallez
9d4b9ab313 OpenGL: move buffer to its own file 2017-07-17 13:48:17 -04:00
Kai Ninomiya
fec8c58a97 Add depth-stencil textures and attachments (#77)
Related: #29
2017-07-17 12:03:16 -04:00
Corentin Wallez
11ce310de3 D3D12: make texture transition barrier on all subresources
This doesn't fix anything in particular and is just a drive-by
change.
2017-07-13 15:41:43 -04:00
Corentin Wallez
de4a3c4c3b Fix framebuffer dimensions in InputStateTest
Also add validation that the framebuffer size matches its attachement
size and make a test for it.
2017-07-13 15:41:43 -04:00
Corentin Wallez
0b186b1fda Use feature detection macros everywhere 2017-07-13 14:55:23 -04:00
Corentin Wallez
275817a93a Add proper defines for backend enablement 2017-07-13 14:55:23 -04:00
Corentin Wallez
a7bfc9d2ac Metal: Fix Device::pendingCommands being freed under us 2017-07-13 14:55:23 -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
Kai Ninomiya
e66fcd8b0e OpenGL backend: implement render passes (#73)
Probably not the most efficient implementation, but works.

Issues:

* Doesn't seem to render until the second frame. No clue why, yet.
* Hardcoded 640x480 in more places.
* Creates new FBOs for every subpass every frame. Should be done at Framebuffer build or CommandBuffer build time.
2017-07-11 17:49:20 -07:00