Update VertexInput (InputState) to match spec - Part 1

This is only a renaming: change VertexInput to VertexBuffer, and
change InputState to VertexInput.

The next two patches will do as follows:
1) change the structure of vertex input descriptor related stuff.
2) change num to count.

BUG=dawn:80, dawn:107

Change-Id: Ie76aa653a527759a9c3b4a4792e3254689f053b8
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/7420
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-05-22 22:46:32 +00:00
committed by Commit Bot service account
parent 820a04b9ce
commit eea2091068
35 changed files with 758 additions and 757 deletions

View File

@@ -120,20 +120,20 @@ void initRender() {
descriptor.cVertexStage.module = vsModule;
descriptor.cFragmentStage.module = fsModule;
descriptor.cInputState.numAttributes = 3;
descriptor.cInputState.cAttributes[0].offset = offsetof(Particle, pos);
descriptor.cInputState.cAttributes[0].format = dawn::VertexFormat::Float2;
descriptor.cInputState.cAttributes[1].shaderLocation = 1;
descriptor.cInputState.cAttributes[1].offset = offsetof(Particle, vel);
descriptor.cInputState.cAttributes[1].format = dawn::VertexFormat::Float2;
descriptor.cInputState.cAttributes[2].shaderLocation = 2;
descriptor.cInputState.cAttributes[2].inputSlot = 1;
descriptor.cInputState.cAttributes[2].format = dawn::VertexFormat::Float2;
descriptor.cInputState.numInputs = 2;
descriptor.cInputState.cInputs[0].stride = sizeof(Particle);
descriptor.cInputState.cInputs[0].stepMode = dawn::InputStepMode::Instance;
descriptor.cInputState.cInputs[1].inputSlot = 1;
descriptor.cInputState.cInputs[1].stride = sizeof(glm::vec2);
descriptor.cVertexInput.numAttributes = 3;
descriptor.cVertexInput.cAttributes[0].offset = offsetof(Particle, pos);
descriptor.cVertexInput.cAttributes[0].format = dawn::VertexFormat::Float2;
descriptor.cVertexInput.cAttributes[1].shaderLocation = 1;
descriptor.cVertexInput.cAttributes[1].offset = offsetof(Particle, vel);
descriptor.cVertexInput.cAttributes[1].format = dawn::VertexFormat::Float2;
descriptor.cVertexInput.cAttributes[2].shaderLocation = 2;
descriptor.cVertexInput.cAttributes[2].inputSlot = 1;
descriptor.cVertexInput.cAttributes[2].format = dawn::VertexFormat::Float2;
descriptor.cVertexInput.numBuffers = 2;
descriptor.cVertexInput.cBuffers[0].stride = sizeof(Particle);
descriptor.cVertexInput.cBuffers[0].stepMode = dawn::InputStepMode::Instance;
descriptor.cVertexInput.cBuffers[1].inputSlot = 1;
descriptor.cVertexInput.cBuffers[1].stride = sizeof(glm::vec2);
descriptor.depthStencilState = &descriptor.cDepthStencilState;
descriptor.cDepthStencilState.format = dawn::TextureFormat::D32FloatS8Uint;
descriptor.cColorStates[0]->format = GetPreferredSwapChainTextureFormat();