mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-02 19:25:56 +00:00
This commit changes wgpu::Device::CreateSwapChain to take an additional wgpu::Surface argument. Passing nullptr is enough to stay on the previous swapchain implementation, until the new one is ready. In order to support both the "old" implementation-based swapchains and the "new" surface-based swapchains. SwapChainBase is now split into three abstract classes: - SwapChainBase that has a virtual method for each of the wgpu::SwapChain methods. - OldSwapChainBase that corresponds to the implementation-based swapchains. - NewSwapChainBase that will contain the surface-based swapchain implementation and will eventually just be renamed to SwapChainBase. The interaction of the surface-based swapchains with the Surface objects aren't implemented yet, neither are the swapchain methods. Only creation works. Validation tests for surface-based swapchain creation are added in the end2end test target because they need to create OS windows. Bug: dawn:269 Change-Id: I7e07d6c666479867b9a16d7b1b8c181d5dbd69a0 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/15281 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// Copyright 2017 The Dawn Authors
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef DAWNNATIVE_D3D12_SWAPCHAIND3D12_H_
|
|
#define DAWNNATIVE_D3D12_SWAPCHAIND3D12_H_
|
|
|
|
#include "dawn_native/SwapChain.h"
|
|
|
|
namespace dawn_native { namespace d3d12 {
|
|
|
|
class Device;
|
|
|
|
class SwapChain : public OldSwapChainBase {
|
|
public:
|
|
SwapChain(Device* device, const SwapChainDescriptor* descriptor);
|
|
~SwapChain();
|
|
|
|
protected:
|
|
TextureBase* GetNextTextureImpl(const TextureDescriptor* descriptor) override;
|
|
MaybeError OnBeforePresent(TextureBase* texture) override;
|
|
|
|
wgpu::TextureUsage mTextureUsage;
|
|
};
|
|
|
|
}} // namespace dawn_native::d3d12
|
|
|
|
#endif // DAWNNATIVE_D3D12_SWAPCHAIN_D3D12_H_
|