#include <vector>
#include "dawn/tests/DawnTest.h"
#include "dawn/utils/ComboRenderPipelineDescriptor.h"
#include "dawn/utils/WGPUHelpers.h"
namespace dawn {
namespace {
wgpu::Texture Create2DTexture(wgpu::Device device,
uint32_t width,
uint32_t height,
wgpu::TextureFormat format,
wgpu::TextureUsage usage) { … }
static constexpr uint32_t kWidth = …;
static constexpr uint32_t kHeight = …;
std::array<std::array<utils::RGBA8, 4>, 4> kDefaultExpectedRGBA = …;
std::array<std::array<utils::RGBA8, 2>, 2> kDownScaledExpectedRGBA = …;
std::array<std::array<utils::RGBA8, 8>, 8> kUpScaledExpectedRGBA = …;
template <typename Parent>
class CopyExternalTextureForBrowserTests : public Parent { … };
enum class CopyRect { … };
enum class ScaleType { … };
FlipY;
CopySrcRect;
CopyDstRect;
std::ostream& operator<<(std::ostream& o, ScaleType scaleType) { … }
std::ostream& operator<<(std::ostream& o, CopyRect copyRect) { … }
DAWN_TEST_PARAM_STRUCT(CopyTestParams, CopySrcRect, CopyDstRect, ScaleType, FlipY);
template <typename... Params>
class CopyExternalTextureForBrowserTestsBase
: public CopyExternalTextureForBrowserTests<DawnTestWithParams<Params...>> { … };
class CopyExternalTextureForBrowserTests_Basic
: public CopyExternalTextureForBrowserTestsBase<CopyTestParams> { … };
TEST_P(CopyExternalTextureForBrowserTests_Basic, Copy) { … }
DAWN_INSTANTIATE_TEST_P(…);
class CopyExternalTextureForBrowserTests_Aspect : public CopyExternalTextureForBrowserTestsBase<> { … };
TEST_P(CopyExternalTextureForBrowserTests_Aspect, Copy) { … }
DAWN_INSTANTIATE_TEST(CopyExternalTextureForBrowserTests_Aspect,
D3D11Backend(),
D3D12Backend(),
MetalBackend(),
OpenGLBackend(),
OpenGLESBackend(),
VulkanBackend());
}
}