Construct VertexAttributeDescriptor, in order to match web idl

The parameters about vertex attribute were encapsulated in
VertexAttributeDescriptor in web idl. This change construct
this descriptor accordingly.

BUG=dawn:107

Change-Id: Ia1c6e53af951d8f2a0c0b69bdca09291c2661e50
Reviewed-on: https://dawn-review.googlesource.com/c/4620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
This commit is contained in:
Yunchao He
2019-02-14 00:35:39 +00:00
committed by Commit Bot service account
parent 445869d2b0
commit b2207737ab
18 changed files with 207 additions and 73 deletions

View File

@@ -111,10 +111,15 @@ void init() {
fragColor = texture(sampler2D(myTexture, mySampler), gl_FragCoord.xy / vec2(640.0, 480.0));
})");
dawn::VertexAttributeDescriptor attribute;
attribute.shaderLocation = 0;
attribute.inputSlot = 0;
attribute.offset = 0;
attribute.format = dawn::VertexFormat::FloatR32G32B32A32;
auto inputState = device.CreateInputStateBuilder()
.SetAttribute(0, 0, dawn::VertexFormat::FloatR32G32B32A32, 0)
.SetInput(0, 4 * sizeof(float), dawn::InputStepMode::Vertex)
.GetResult();
.SetAttribute(&attribute)
.SetInput(0, 4 * sizeof(float), dawn::InputStepMode::Vertex)
.GetResult();
auto bgl = utils::MakeBindGroupLayout(
device, {