Commit Graph

4748 Commits

Author SHA1 Message Date
Austin Eng 1b8c64d3e2 Print small buffers on test expectation failure 2017-07-20 13:07:36 -04:00
Austin Eng 4234c39a09 Add output string streams to NXT test expectation helpers 2017-07-20 13:07:36 -04:00
Kai Ninomiya 59dc03f101 Correctly configure NXT_ENABLE_ASSERTS on multiconfiguration generators (#88)
And also set a default build type for single-configuration generators
2017-07-20 07:28:00 -07: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 1e66ab93fe end2end: Add BufferSetSubData tests
The test doing many small SetSubData freezes the Metal driver on a
MTLBuffer allocation. This is because we don't use a ringbuffer for
SetSubData and instead create one small upload buffer per call.

The same test is skipped on D3D12 as it is bound to have the same issue.

Also adds comments that were forgotten before every MapReadAsync test.
2017-07-18 17:24:54 -04:00
Corentin Wallez e1f16a25bf NXTTest: add other Is<Backend> methods 2017-07-18 17:24:54 -04:00
Austin Eng 3835edde10 Add validation for buffer offset 2017-07-18 16:03:51 -04:00
Corentin Wallez 8668fbacdd end2end: Add BufferMapReadAsync tests 2017-07-18 11:06:54 -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
Corentin Wallez 134e08005a Move USleep to utils/ 2017-07-18 11:06:54 -04:00
Austin Eng 2fbda87caf D3D12: Enable PureInstance test 2017-07-17 17:16:45 -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 51ff013ee2 Add automatic readback alignment and packing for texture expectations
Texture expectations copy into a buffer with a 256-byte aligned row
pitch. Then, the rows are packed into an array to check expectations
against.
2017-07-17 17:16:45 -04:00
Austin Eng 36d82645c3 Add row pitch validation tests 2017-07-17 17:16:45 -04:00
Austin Eng 5ed02ee648 update existing unit tests with proper row pitch 2017-07-17 17:16:45 -04:00
Austin Eng 972a1e59a7 Update tests and examples to follow copy row pitch alignment constraints 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 c5f8e7ae77 Update usage of CopyBufferToTexture and CopyTextureToBuffer to include row pitch 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 deba8a4ea6 Add value type Align tests 2017-07-17 17:16:45 -04:00
Austin Eng 98b781527f Add kTextureRowPitchAlignment and 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 66ff447216 Split Pipeline in Render and Compute, examples 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 e20c5ee9ff Split Pipeline in Render and Compute, test 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 55ebc25c0f NXTTest: Make GTest print the name of the backend 2017-07-17 13:48:17 -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 28684d93ed Fix CMake OS dependent default options.
The defaults were setting local variables, while the "option" command
uses the values from the CMake cache. This made the CI not build the
D3D12 or Metal backend on their platforms.
2017-07-14 14:06:12 -04:00
Corentin Wallez bcee1e5981 NXTTest: expose SwapBuffers to test to make it easy to RenderDoc
RenderDoc uses presents as the points to start and end a capture, so to
debug test we have to do the following:

TEST_F(...)
    while(true) {
    	// All the test code
    	SwapBuffers();
    }
}
2017-07-13 15:41:43 -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 4db6327f78 Use WIN32_LEAN_AND_MEAN on Windows
This makes Windows.h includes less headers that we don't want and will
help with compilation.
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
Corentin Wallez 3df6441a8c Group the target sources for the VS solution explorer 2017-07-11 13:59:15 -04:00
Corentin Wallez 0f833f30ed Enable warnings on Windows 2017-07-11 13:59:15 -04:00