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

@@ -18,21 +18,21 @@
namespace utils {
ComboInputStateDescriptor::ComboInputStateDescriptor() {
dawn::InputStateDescriptor* descriptor = this;
ComboVertexInputDescriptor::ComboVertexInputDescriptor() {
dawn::VertexInputDescriptor* descriptor = this;
descriptor->indexFormat = dawn::IndexFormat::Uint32;
// Fill the default values for vertexInput.
descriptor->numInputs = 0;
dawn::VertexInputDescriptor vertexInput;
vertexInput.inputSlot = 0;
vertexInput.stride = 0;
vertexInput.stepMode = dawn::InputStepMode::Vertex;
for (uint32_t i = 0; i < kMaxVertexInputs; ++i) {
cInputs[i] = vertexInput;
// Fill the default values for vertexBuffer.
descriptor->numBuffers = 0;
dawn::VertexBufferDescriptor vertexBuffer;
vertexBuffer.inputSlot = 0;
vertexBuffer.stride = 0;
vertexBuffer.stepMode = dawn::InputStepMode::Vertex;
for (uint32_t i = 0; i < kMaxVertexBuffers; ++i) {
cBuffers[i] = vertexBuffer;
}
descriptor->inputs = &cInputs[0];
descriptor->buffers = &cBuffers[0];
// Fill the default values for vertexAttribute.
descriptor->numAttributes = 0;
@@ -66,7 +66,7 @@ namespace utils {
}
// Set defaults for the input state descriptors.
descriptor->inputState = &cInputState;
descriptor->vertexInput = &cVertexInput;
// Set defaults for the rasterization state descriptor.
{

View File

@@ -23,11 +23,11 @@
namespace utils {
class ComboInputStateDescriptor : public dawn::InputStateDescriptor {
class ComboVertexInputDescriptor : public dawn::VertexInputDescriptor {
public:
ComboInputStateDescriptor();
ComboVertexInputDescriptor();
std::array<dawn::VertexInputDescriptor, kMaxVertexInputs> cInputs;
std::array<dawn::VertexBufferDescriptor, kMaxVertexBuffers> cBuffers;
std::array<dawn::VertexAttributeDescriptor, kMaxVertexAttributes> cAttributes;
};
@@ -38,7 +38,7 @@ namespace utils {
dawn::PipelineStageDescriptor cVertexStage;
dawn::PipelineStageDescriptor cFragmentStage;
ComboInputStateDescriptor cInputState;
ComboVertexInputDescriptor cVertexInput;
dawn::RasterizationStateDescriptor cRasterizationState;
std::array<dawn::ColorStateDescriptor*, kMaxColorAttachments> cColorStates;
dawn::DepthStencilStateDescriptor cDepthStencilState;