Commit Graph

35 Commits

Author SHA1 Message Date
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
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 f53f98bf86
Use a descriptor for PipelineLayout (#206)
Adds support for structures inside descriptors.
2018-06-27 16:21:39 -07:00
Corentin Wallez b703def640 Add Device::CreateQueue() instead of the builder
We are changing all object creation to use descriptors but there is no
creation argument to pass for queue, so instead Device::CreateQueue
takes no argument.
2018-06-18 13:33:40 -04:00
Corentin Wallez b711b9b2c9 Add a GetDefaultSamplerDescriptor helper. 2018-05-23 14:03:51 -04:00
Corentin Wallez 1ae19e8276 Change Sampler creation to use a descriptor instead of a builder 2018-05-23 14:03:51 -04:00
Corentin Wallez 8d6b5d2337 Rename RenderPassInfo to RenderPassDescriptor 2018-05-16 11:18:14 -04:00
Corentin Wallez 6f7749cce9 Change render passes from multi to single pass.
This as an API change to get closer to the direction in which WebGPU is
headed. The API change in next.json caused a ton of files to be changed
in the same commit to keep things compiling.

API: the Framebuffer and RenderPass objects are now merged in a single
RenderPassInfo that contains the attachments, loadOps and clear values
for a BeginRenderPass command. The concept of subpass is removed.
The RenderPass creation argument to RenderPipelines is replaced by
explicitly setting the format of attachments for RenderPipeline.

Validation: SetPipeline checks are changed to check that the attachments
info set on a RenderPipeline matches the attachments of the render pass.

Backends: Most changes are simplifications of the backends that no
longer require and indirection to query the current subpass out of the
render pass in BeginSubpass, and don't need to get the attachment info
from a RenderPass when creating RenderPipelines. In the Vulkan backend,
a VkRenderPass cache is added to reuse VkRenderPasses between
RenderPassInfos and RenderPipelines.

Tests and examples: they are updated with the simplified API. Tests
specific to the Framebuffer and RenderPass objects were removed and
validation tests for RenderPassInfo were added.

Tested by running CppHelloTriangle on all backends, end2end tests on all
platforms and all examples on the GL backend.
2018-05-16 11:18:14 -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 d0d6e5cd20 Fix glTFViewer after shaderc update
Fragment shader outputs now require a location qualifier, that
glTFViewer was missing in its shaderc.
2018-01-15 19:13:01 -05:00
Corentin Wallez 2e31e8f0bf Make binding expose the preferred format 2017-11-20 09:59:03 -05:00
Corentin Wallez 405dcd636a Make the index format part of the pipeline state. 2017-11-20 09:59:03 -05:00
Corentin Wallez 715ac712c6 Document a bug in glTFViewer 2017-11-20 09:59:03 -05:00
Kai Ninomiya 921fb5e1ce remove initialUsage from SwapChain::Configure 2017-09-15 14:02:02 -07:00
Kai Ninomiya ee7b6b1b62 Update SwapChain to configure texture usage
Explicitly configure swap chain usage in bindings and examples

Fix missing case in switch

Make swap chain Present usage implicit

Author: Austin Eng <enga@google.com>
2017-09-15 14:02:02 -07:00
Kai Ninomiya b985431c82 Load operations (#105)
* load ops: design + implementation (all backends)

* Animometer/glTFViewer: use just one subpass per frame
2017-08-11 14:36:20 -07:00
Kai Ninomiya 3d1154786f glTFViewer: replace default texture with an untextured shader (#106)
This fixes the issue where the default texture wasn't uploading
correctly (due to 3f47729, changes in row pitch validation) by just
removing the broken texture entirely.
2017-08-09 11:44:48 -07:00
Kai Ninomiya c16a67ae52 Swap chains, part 2 (#94) 2017-07-27 18:30:57 -07:00
Corentin Wallez 134e08005a Move USleep to utils/ 2017-07-18 11:06:54 -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 c5f8e7ae77 Update usage of CopyBufferToTexture and CopyTextureToBuffer to include row pitch 2017-07-17 17:16:45 -04:00
Corentin Wallez 66ff447216 Split Pipeline in Render and Compute, examples 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
Corentin Wallez 83e779d8f2 Fix all Windows warnings 2017-07-11 13:59:15 -04:00
Corentin Wallez 98c90d4faa Fix clang/GCC warnings 2017-07-10 19:35:21 -04:00
Kai Ninomiya fa37f2239c replace AdvanceSubpass with Begin/EndRenderSubpass
and replace subpassActive with VALIDATION_ASPECT_RENDER_SUBPASS
2017-07-07 11:19:42 -04:00
Corentin Wallez 9347e8fcd1 Rename example/Utils to example/SampleUtils 2017-06-20 07:40:17 -07:00
Corentin Wallez 5ee7afdfbe Split NXT helpers from example/Utils into src/utils
This will make it possible to use them in the test suites
2017-06-20 07:40:17 -07:00
Austin Eng 39c901d3dc Change usage requirements for Buffer::SetSubData to require TransferDst
instead of MapWrite bit
2017-06-14 13:53:52 -04:00
Corentin Wallez f45bdb89c6 Split Mapped usage in MapWrite and MapRead
Also make use of CreateFrozenBufferFromData where possible in the
example to make the renaming easier.
2017-06-09 15:26:26 -07:00
Kai Ninomiya 39c1bce62d Update glTFViewer for render passes and depth stencil state (#39) 2017-06-08 19:03:59 -07:00
Corentin Wallez a0ad53b618 Enable format macros in glTFViewer
Without this compilation can fail in picojson.h because the PRId64 macro
isn't defined (it is used to print 64bit ints).
2017-05-30 15:55:34 -07:00
Corentin Wallez 583e9a8f3c Avoid name conflicts between Util and Windows function
GetWindow and SwapBuffers are function of Windows.h and using the same
name causes a compile error.

This commit also changes Util's GetProcTableAndDevice to CreateNXTDevice
because we might need to call NXT procs when creating the C++ device.
2017-05-30 10:48:32 -07:00
Corentin Wallez 7f433a5b52 Add bufferOffset to CopyBufferToTexture. 2017-05-10 19:49:52 +02:00
Corentin Wallez f07e3bd4c9 Initial commit of all the NXT integration.
More like squashed history, contributors were:
 - Kai Ninomiya
 - Corentin Wallez
2017-04-20 14:38:20 -04:00