Commit Graph

638 Commits

Author SHA1 Message Date
Stephen White 1184e46f87
Fix bind group binding ID validation. (#227)
* Fix bind group binding ID validation.

Use the binding, not the iterator index.
2018-07-19 09:52:31 -04:00
Corentin Wallez 846cfe3421 Remove prototype Blink codegen support 2018-07-18 22:54:06 +02:00
Corentin Wallez 6ed9cbf894 Rename last references of NXT to Dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez 9fc65344f4 Rename NXT -> Dawn in the comments 2018-07-18 22:54:06 +02:00
Corentin Wallez 923574eed5 Rename IsNXTBitMask and NxtReference/Release to dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez a5ee52d33e Rename NXT -> DAWN in header guards 2018-07-18 22:54:06 +02:00
Corentin Wallez 0927ea549c Rename // NXT API to // Dawn API 2018-07-18 22:54:06 +02:00
Corentin Wallez a4da03249c Rename NXTTest to DawnTest
Also formats the whole file for the first time.
2018-07-18 22:54:06 +02:00
Corentin Wallez ae187efc80 Rename NXT_INSTANTIATE_TEST to DAWN_INSTANTIATE_TEST 2018-07-18 22:54:06 +02:00
Corentin Wallez be5ca38351 Rename nxtProcTable and nxtSetProcs to dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez b1669e3fa4 Change the API prefix in generators from nxt to dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez ae79c03d45 Rename the nxt namespace to dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez 05c90ee4cb Rename nxt -> dawn for dawn_wsi.h declarations
Also does the initial complete formatting of files in src/include
2018-07-18 22:54:06 +02:00
Corentin Wallez 3e371b146d Rename files in src/include nxt -> dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez 046cb46bee Rename generated files nxt -> dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez 39039fa317 Rename CreateCppNXTDevice to CreateCppDawnDevice 2018-07-18 22:54:06 +02:00
Corentin Wallez fde3f2b5e0 Rename NXT -> Dawn in the rest of CMakeLists 2018-07-18 22:54:06 +02:00
Corentin Wallez f684040e0a Rename NXTHelpers to DawnHelpers 2018-07-18 22:54:06 +02:00
Corentin Wallez d148aebf3f Rename CMakeLists targets nxt -> dawn 2018-07-18 22:54:06 +02:00
Corentin Wallez f1ded9bea2 Rename CMakeLists variables NXT_* to DAWN_* 2018-07-18 22:54:06 +02:00
Corentin Wallez 4828d92df3 Rename nxt:: to dawn:: in examples 2018-07-18 22:54:06 +02:00
Corentin Wallez 54e58c20b2 Rename nxt:: to dawn:: in tests 2018-07-18 22:54:06 +02:00
Corentin Wallez 83a9c9d6d9 Rename src/common macros NXT_* to DAWN_* 2018-07-18 22:54:06 +02:00
Corentin Wallez 33ca49614d Rename Error.h macros 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 141c0be317 Add a temporary define to help rename nxt:: to dawn:: 2018-07-18 22:54:06 +02:00
Corentin Wallez a22335c2b7 Rename next.json to dawn.json 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 021c9504d0 Make CommandBufferValidation use Error.h 2018-07-17 22:34:10 +02:00
Corentin Wallez 52f2383bb8 DeviceBase: Add helper to consume errors
This adds DeviceBase::ConsumedError which is a helper method intended to
be the main place where Error.h errors are consumed.

To test this mechanism, object creation using descriptors is changed to
use ConsumedError, which finally gets their validation errors go
somewhere. This mechanism isn't final though because we have yet to
implement WebGPU error handling.
2018-07-17 22:34:10 +02:00
Corentin Wallez 629c11baad Add windows_with_undefs.h to fix conflicts with windows.h
windows.h adds macros such as `#define GetMessage GetMessageA` which
cause conflicts in naming when for example a class definition is before
windows.h and a use is after windows.h

Add a header that can be used both to include windows.h and remove
defines, and to only remove defines (when windows.h is included by)
external dependencies.
2018-07-17 22:34:10 +02:00
Kai Ninomiya 6aaa10fa60
Skip ComputeCopyStorageBufferTests.SizedArrayOfStruct on D3D12 (#225) 2018-07-17 11:14:47 -07:00
Kai Ninomiya cfa524b86b
Fix glTFViewer by using push constants (#224)
* Works on Metal
* Not working on OpenGL (black screen; not sure why)
* Not working on Vulkan or D3D12 (push constants not implemented)
2018-07-17 11:12:47 -07:00
Kai Ninomiya b7ecfaa347
Partially fix ComputeCopyStorageBufferTests.DISABLED_UnsizedArray (#220)
And update test names + comments on several ComputeCopyStorageBufferTests cases.
2018-07-16 13:44:59 -07:00
Kai Ninomiya e320182f40
Fix glTFViewer (bind group + y-flip) (#222)
Doesn't completely fix the viewer - there is still a TODO about uniform buffers being updated incorrectly.
2018-07-16 10:30:16 -07: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 d2312e8138 Fix D3D12 compute bindgroups 2018-07-16 14:44:20 +02:00
Corentin Wallez 27388434d6 D3D12: Fix SetDescriptorHeap when we only have a sampler heap 2018-07-13 13:31:14 +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 2beeae3ad3 CommandBufferD3D12: Iterate per pass 2018-07-13 13:31:14 +02:00
Corentin Wallez aa13be96e8 Make the Vulkan backend support implicit barriers.
With this commit the Vulkan backend completely ignores the explicit
barrier commands passed from the frontend, and generates its own
pipeline barriers.

Right now it encodes each barrier just before the resources are used,
which is quite bad but will be optimized later.

This commit also makes the frontend command buffer validation perform
the checks necessary for implicit barriers (although they are redundant
with checks for explicit barriers) because the tracking can pre-compute
pass usage information that's useful for the Vulkan backend.

Tests for usage validation inside passes will be added once the concept
of transition is removed from the API.
2018-07-11 17:17:21 +02:00
Corentin Wallez 117f2f0ad6 Make EnumClassBitmask operations constexpr
This allows declaring combinations of bits as constants in header.
kReadOnlyBufferUsages is added using this feature.

Also reformat the file.
2018-07-11 17:17:21 +02:00
Kai Ninomiya 23bec15f4c
ComputeCopyStorageBufferTests (#216)
These should hopefully subsume the ComputeBoids demo for testing purposes. Not all of these tests pass currently:

* ComputeCopyStorageBufferTests.StructTest/D3D12 fails due to "Reading structs from ByteAddressBuffer not yet supported."
* The disabled tests fail for various reasons on various backends.
2018-07-10 17:26:35 -07:00
Kai Ninomiya 0582bfdfda
Fix D3D12 descriptor renumbering (#218)
Previously, the renumbering loop would sometimes iterate in the wrong order. To fix this, instead use the binding info already correctly extracted by `ExtractSpirvInfo`.

Fixes ComputeCopyStorageBufferTests.BasicTest/D3D12.
2018-07-10 17:25:48 -07:00
Kai Ninomiya 21006bbe6f Assert HandleCommands succeeds 2018-07-10 14:00:52 -07:00
Corentin Wallez d5c1ecaf64 WireClient: MapReadCallback, unconditionnally consume the data
When a MapReadRequestCallback arrived late and hit one of the early out
of the handler (for example if the buffer was already unmapped), the
handler wouldn't consume the data payload of the command. This would
cause the command buffer pointer to not be advanced enough and point to
random data instead of the next command.
2018-07-10 14:00:52 -07:00
Kai Ninomiya 234becf175
Use a descriptor for BindGroupLayout (#211)
* Use a descriptor for BindGroupLayout
* Fix MatchesLambda
* Add WireTests.StructureOfStructureArrayArgument
* Add BindGroupValidationTests.BindGroupLayoutCache
2018-07-10 12:23:50 -07:00
Kai Ninomiya 7883e7e59c
Fix ComputeBoids (#214)
I know there was some churn on which version of this shader was correct - but right now, this goes from broken on all 4 backends to working on all 4 backends. So this seems better.

The old code (accidentally?) uses descriptor arrays (I think), which are not trivial to support on all backends, so we won't use them for now.
2018-07-10 11:01:28 -07:00
Kai Ninomiya 6c639c991e
Roll glslang to 1ea8f595 (#215)
Rolling this now to fix some memory leaks.
2018-07-10 10:55:46 -07:00
Corentin Wallez 976430c097 CommandBufferMTL: Iterate per-pass
This introduces a small amount of code duplication in the code that
handles push constants. On the plus side it removes the need for all the
asserts around which Metal encoder is active.
2018-07-10 10:59:44 +02:00