mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-15 16:16:08 +00:00
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:
committed by
Commit Bot service account
parent
c8b067d2df
commit
7be2a71f2b
@@ -90,8 +90,9 @@ namespace dawn_native { namespace opengl {
|
||||
const ShaderModuleDescriptor* descriptor) {
|
||||
return new ShaderModule(this, descriptor);
|
||||
}
|
||||
SwapChainBase* Device::CreateSwapChain(SwapChainBuilder* builder) {
|
||||
return new SwapChain(builder);
|
||||
ResultOrError<SwapChainBase*> Device::CreateSwapChainImpl(
|
||||
const SwapChainDescriptor* descriptor) {
|
||||
return new SwapChain(this, descriptor);
|
||||
}
|
||||
ResultOrError<TextureBase*> Device::CreateTextureImpl(const TextureDescriptor* descriptor) {
|
||||
return new Texture(this, descriptor);
|
||||
|
||||
@@ -44,7 +44,6 @@ namespace dawn_native { namespace opengl {
|
||||
InputStateBase* CreateInputState(InputStateBuilder* builder) override;
|
||||
RenderPassDescriptorBase* CreateRenderPassDescriptor(
|
||||
RenderPassDescriptorBuilder* builder) override;
|
||||
SwapChainBase* CreateSwapChain(SwapChainBuilder* builder) override;
|
||||
|
||||
Serial GetCompletedCommandSerial() const final override;
|
||||
Serial GetLastSubmittedCommandSerial() const final override;
|
||||
@@ -74,6 +73,8 @@ namespace dawn_native { namespace opengl {
|
||||
ResultOrError<SamplerBase*> CreateSamplerImpl(const SamplerDescriptor* descriptor) override;
|
||||
ResultOrError<ShaderModuleBase*> CreateShaderModuleImpl(
|
||||
const ShaderModuleDescriptor* descriptor) override;
|
||||
ResultOrError<SwapChainBase*> CreateSwapChainImpl(
|
||||
const SwapChainDescriptor* descriptor) override;
|
||||
ResultOrError<TextureBase*> CreateTextureImpl(const TextureDescriptor* descriptor) override;
|
||||
ResultOrError<TextureViewBase*> CreateTextureViewImpl(
|
||||
TextureBase* texture,
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
#include "dawn_native/opengl/SwapChainGL.h"
|
||||
|
||||
#include "dawn_native/Device.h"
|
||||
#include "dawn_native/opengl/DeviceGL.h"
|
||||
#include "dawn_native/opengl/Forward.h"
|
||||
#include "dawn_native/opengl/TextureGL.h"
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
|
||||
namespace dawn_native { namespace opengl {
|
||||
|
||||
SwapChain::SwapChain(SwapChainBuilder* builder) : SwapChainBase(builder) {
|
||||
SwapChain::SwapChain(Device* device, const SwapChainDescriptor* descriptor)
|
||||
: SwapChainBase(device, descriptor) {
|
||||
const auto& im = GetImplementation();
|
||||
im.Init(im.userData, nullptr);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace dawn_native { namespace opengl {
|
||||
|
||||
class SwapChain : public SwapChainBase {
|
||||
public:
|
||||
SwapChain(SwapChainBuilder* builder);
|
||||
SwapChain(Device* device, const SwapChainDescriptor* descriptor);
|
||||
~SwapChain();
|
||||
|
||||
protected:
|
||||
|
||||
Reference in New Issue
Block a user