dawn.json: Make textureDescriptor use Extent3D

This matches WebGPU and is a good test of having structures include
other structures by value.

BUG=dawn:13

Change-Id: Ibd5ea1340338e5aa16069499c498ac5a455fc2cd
Reviewed-on: https://dawn-review.googlesource.com/1500
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez
2018-09-18 12:49:22 +00:00
committed by Commit Bot service account
parent 1e68479cd6
commit 29353d6ee3
16 changed files with 101 additions and 56 deletions

View File

@@ -61,9 +61,9 @@ namespace dawn_native {
TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = mWidth;
descriptor.height = mHeight;
descriptor.depth = 1;
descriptor.size.width = mWidth;
descriptor.size.height = mHeight;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = mFormat;
descriptor.mipLevel = 1;

View File

@@ -29,8 +29,9 @@ namespace dawn_native {
DAWN_TRY(ValidateTextureFormat(descriptor->format));
// TODO(jiawei.shao@intel.com): check stuff based on the dimension
if (descriptor->width == 0 || descriptor->height == 0 || descriptor->depth == 0 ||
descriptor->arrayLayer == 0 || descriptor->mipLevel == 0) {
if (descriptor->size.width == 0 || descriptor->size.height == 0 ||
descriptor->size.depth == 0 || descriptor->arrayLayer == 0 ||
descriptor->mipLevel == 0) {
return DAWN_VALIDATION_ERROR("Cannot create an empty texture");
}
@@ -89,9 +90,9 @@ namespace dawn_native {
: mDevice(device),
mDimension(descriptor->dimension),
mFormat(descriptor->format),
mWidth(descriptor->width),
mHeight(descriptor->height),
mDepth(descriptor->depth),
mWidth(descriptor->size.width),
mHeight(descriptor->size.height),
mDepth(descriptor->size.depth),
mArrayLayers(descriptor->arrayLayer),
mNumMipLevels(descriptor->mipLevel),
mUsage(descriptor->usage) {

View File

@@ -692,9 +692,9 @@ TEST_P(BlendStateTest, IndependentBlendState) {
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = kRTSize;
descriptor.height = kRTSize;
descriptor.depth = 1;
descriptor.size.width = kRTSize;
descriptor.size.height = kRTSize;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
descriptor.mipLevel = 1;

View File

@@ -75,9 +75,9 @@ class CopyTests_T2B : public CopyTests {
// Create a texture that is `width` x `height` with (`level` + 1) mip levels.
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = textureSpec.width;
descriptor.height = textureSpec.height;
descriptor.depth = 1;
descriptor.size.width = textureSpec.width;
descriptor.size.height = textureSpec.height;
descriptor.size.depth = 1;
descriptor.arrayLayer = textureSpec.arrayLayer;
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
descriptor.mipLevel = textureSpec.level + 1;
@@ -175,9 +175,9 @@ protected:
// Create a texture that is `width` x `height` with (`level` + 1) mip levels.
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = textureSpec.width;
descriptor.height = textureSpec.height;
descriptor.depth = 1;
descriptor.size.width = textureSpec.width;
descriptor.size.height = textureSpec.height;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
descriptor.mipLevel = textureSpec.level + 1;

View File

@@ -26,9 +26,9 @@ class DepthStencilStateTest : public DawnTest {
dawn::TextureDescriptor renderTargetDescriptor;
renderTargetDescriptor.dimension = dawn::TextureDimension::e2D;
renderTargetDescriptor.width = kRTSize;
renderTargetDescriptor.height = kRTSize;
renderTargetDescriptor.depth = 1;
renderTargetDescriptor.size.width = kRTSize;
renderTargetDescriptor.size.height = kRTSize;
renderTargetDescriptor.size.depth = 1;
renderTargetDescriptor.arrayLayer = 1;
renderTargetDescriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
renderTargetDescriptor.mipLevel = 1;
@@ -39,9 +39,9 @@ class DepthStencilStateTest : public DawnTest {
dawn::TextureDescriptor depthDescriptor;
depthDescriptor.dimension = dawn::TextureDimension::e2D;
depthDescriptor.width = kRTSize;
depthDescriptor.height = kRTSize;
depthDescriptor.depth = 1;
depthDescriptor.size.width = kRTSize;
depthDescriptor.size.height = kRTSize;
depthDescriptor.size.depth = 1;
depthDescriptor.arrayLayer = 1;
depthDescriptor.format = dawn::TextureFormat::D32FloatS8Uint;
depthDescriptor.mipLevel = 1;

View File

@@ -57,9 +57,9 @@ class RenderPassLoadOpTests : public DawnTest {
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = kRTSize;
descriptor.height = kRTSize;
descriptor.depth = 1;
descriptor.size.width = kRTSize;
descriptor.size.height = kRTSize;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
descriptor.mipLevel = 1;

View File

@@ -82,9 +82,9 @@ protected:
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = 2;
descriptor.height = 2;
descriptor.depth = 1;
descriptor.size.width = 2;
descriptor.size.height = 2;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
descriptor.mipLevel = 1;

View File

@@ -30,9 +30,9 @@ class CopyCommandTest : public ValidationTest {
dawn::TextureFormat format, dawn::TextureUsageBit usage) {
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = width;
descriptor.height = height;
descriptor.depth = 1;
descriptor.size.width = width;
descriptor.size.height = height;
descriptor.size.depth = 1;
descriptor.arrayLayer = arrayLayer;
descriptor.format = format;
descriptor.mipLevel = levels;

View File

@@ -24,9 +24,9 @@ class RenderPassDescriptorValidationTest : public ValidationTest {
dawn::TextureView Create2DAttachment(dawn::Device& device, uint32_t width, uint32_t height, dawn::TextureFormat format) {
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = width;
descriptor.height = height;
descriptor.depth = 1;
descriptor.size.width = width;
descriptor.size.height = height;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = format;
descriptor.mipLevel = 1;

View File

@@ -76,9 +76,9 @@ std::string ValidationTest::GetLastDeviceErrorMessage() const {
dawn::RenderPassDescriptor ValidationTest::CreateSimpleRenderPass() {
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = 640;
descriptor.height = 480;
descriptor.depth = 1;
descriptor.size.width = 640;
descriptor.size.height = 480;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = dawn::TextureFormat::R8G8B8A8Unorm;
descriptor.mipLevel = 1;
@@ -129,9 +129,9 @@ ValidationTest::DummyRenderPass ValidationTest::CreateDummyRenderPass() {
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = dummy.width;
descriptor.height = dummy.height;
descriptor.depth = 1;
descriptor.size.width = dummy.width;
descriptor.size.height = dummy.height;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = dummy.attachmentFormat;
descriptor.mipLevel = 1;

View File

@@ -135,9 +135,9 @@ namespace utils {
result.colorFormat = dawn::TextureFormat::R8G8B8A8Unorm;
dawn::TextureDescriptor descriptor;
descriptor.dimension = dawn::TextureDimension::e2D;
descriptor.width = width;
descriptor.height = height;
descriptor.depth = 1;
descriptor.size.width = width;
descriptor.size.height = height;
descriptor.size.depth = 1;
descriptor.arrayLayer = 1;
descriptor.format = result.colorFormat;
descriptor.mipLevel = 1;