Descriptorize SwapChain.

This also makes SwapChain support WebGPU-style error handling.

BUG=dawn:8

Change-Id: I5a142ae58600445f0f44f6dbe419cb7c3cdc9464
Reviewed-on: https://dawn-review.googlesource.com/c/4660
Reviewed-by: Yunchao He <yunchao.he@intel.com>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2019-02-15 11:15:58 +00:00
committed by Commit Bot service account
parent c8b067d2df
commit 7be2a71f2b
27 changed files with 212 additions and 111 deletions

View File

@@ -29,11 +29,10 @@ void init() {
queue = dawnDeviceCreateQueue(device);
{
dawnSwapChainBuilder builder = dawnDeviceCreateSwapChainBuilder(device);
uint64_t swapchainImpl = GetSwapChainImplementation();
dawnSwapChainBuilderSetImplementation(builder, swapchainImpl);
swapchain = dawnSwapChainBuilderGetResult(builder);
dawnSwapChainBuilderRelease(builder);
dawnSwapChainDescriptor descriptor;
descriptor.nextInChain = nullptr;
descriptor.implementation = GetSwapChainImplementation();
swapchain = dawnDeviceCreateSwapChain(device, &descriptor);
}
swapChainFormat = static_cast<dawnTextureFormat>(GetPreferredSwapChainTextureFormat());
dawnSwapChainConfigure(swapchain, swapChainFormat, DAWN_TEXTURE_USAGE_BIT_OUTPUT_ATTACHMENT, 640,