1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "ExternalTexture.h"
9 # include "mozilla/webgpu/ExternalTextureD3D11.h"
12 namespace mozilla::webgpu
{
15 UniquePtr
<ExternalTexture
> ExternalTexture::Create(
16 const uint32_t aWidth
, const uint32_t aHeight
,
17 const struct ffi::WGPUTextureFormat aFormat
,
18 const ffi::WGPUTextureUsages aUsage
) {
19 UniquePtr
<ExternalTexture
> texture
;
21 texture
= ExternalTextureD3D11::Create(aWidth
, aHeight
, aFormat
, aUsage
);
26 ExternalTexture::ExternalTexture(const uint32_t aWidth
, const uint32_t aHeight
,
27 const struct ffi::WGPUTextureFormat aFormat
,
28 const ffi::WGPUTextureUsages aUsage
)
29 : mWidth(aWidth
), mHeight(aHeight
), mFormat(aFormat
), mUsage(aUsage
) {}
31 ExternalTexture::~ExternalTexture() {}
33 void ExternalTexture::SetSubmissionIndex(uint64_t aSubmissionIndex
) {
34 MOZ_ASSERT(aSubmissionIndex
!= 0);
36 mSubmissionIndex
= aSubmissionIndex
;
39 } // namespace mozilla::webgpu