Match vertex format in dawn with webgpu

BUG=dawn:41

Change-Id: If16e615ccf6b9c7e85d41adcdb6d66baa07179da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/5280
Commit-Queue: Shaobo Yan <shaobo.yan@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Yan, Shaobo
2019-03-21 11:18:31 +00:00
committed by Commit Bot service account
parent 54e4d47db4
commit e105f962cf
18 changed files with 382 additions and 191 deletions

View File

@@ -68,13 +68,13 @@ TEST_F(InputStateTest, PipelineCompatibility) {
attribute1.shaderLocation = 0;
attribute1.inputSlot = 0;
attribute1.offset = 0;
attribute1.format = dawn::VertexFormat::FloatR32;
attribute1.format = dawn::VertexFormat::Float;
dawn::VertexAttributeDescriptor attribute2;
attribute2.shaderLocation = 1;
attribute2.inputSlot = 0;
attribute2.offset = sizeof(float);
attribute2.format = dawn::VertexFormat::FloatR32;
attribute2.format = dawn::VertexFormat::Float;
dawn::VertexInputDescriptor input;
input.inputSlot = 0;
@@ -126,7 +126,7 @@ TEST_F(InputStateTest, StrideZero) {
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = 128;
attribute.format = dawn::VertexFormat::FloatR32;
attribute.format = dawn::VertexFormat::Float;
AssertWillBeSuccess(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)
@@ -182,7 +182,7 @@ TEST_F(InputStateTest, AlreadySetAttribute) {
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = 0;
attribute.format = dawn::VertexFormat::FloatR32;
attribute.format = dawn::VertexFormat::Float;
AssertWillBeSuccess(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)
@@ -204,7 +204,7 @@ TEST_F(InputStateTest, SetAttributeLocationOutOfBounds) {
attribute.shaderLocation = kMaxVertexAttributes - 1;
attribute.inputSlot = 0;
attribute.offset = 0;
attribute.format = dawn::VertexFormat::FloatR32;
attribute.format = dawn::VertexFormat::Float;
AssertWillBeSuccess(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)
@@ -225,8 +225,8 @@ TEST_F(InputStateTest, SetAttributeOffsetOutOfBounds) {
dawn::VertexAttributeDescriptor attribute;
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = kMaxVertexAttributeEnd - sizeof(dawn::VertexFormat::FloatR32);
attribute.format = dawn::VertexFormat::FloatR32;
attribute.offset = kMaxVertexAttributeEnd - sizeof(dawn::VertexFormat::Float);
attribute.format = dawn::VertexFormat::Float;
AssertWillBeSuccess(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)
.SetAttribute(&attribute)
@@ -246,7 +246,7 @@ TEST_F(InputStateTest, SetAttributeOffsetOverflow) {
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = std::numeric_limits<uint32_t>::max();
attribute.format = dawn::VertexFormat::FloatR32;
attribute.format = dawn::VertexFormat::Float;
AssertWillBeError(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)
.SetAttribute(&attribute)
@@ -260,7 +260,7 @@ TEST_F(InputStateTest, RequireInputForAttribute) {
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = 0;
attribute.format = dawn::VertexFormat::FloatR32;
attribute.format = dawn::VertexFormat::Float;
AssertWillBeSuccess(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)
@@ -282,7 +282,7 @@ TEST_F(InputStateTest, SetAttributeOOBCheckForInputs) {
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = 0;
attribute.format = dawn::VertexFormat::FloatR32;
attribute.format = dawn::VertexFormat::Float;
AssertWillBeSuccess(device.CreateInputStateBuilder())
.SetInput(&kBaseInput)

View File

@@ -71,7 +71,7 @@ class VertexBufferValidationTest : public ValidationTest {
auto builder = device.CreateInputStateBuilder();
dawn::VertexAttributeDescriptor attribute;
attribute.offset = 0;
attribute.format = dawn::VertexFormat::FloatR32G32B32;
attribute.format = dawn::VertexFormat::Float3;
dawn::VertexInputDescriptor input;
input.stride = 0;