mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-13 23:26:24 +00:00
Construct ComboInputStateDescriptor to simplify tests and examples
Bug=dawn:107 Change-Id: I900de454cacf9f62ae97213161a98ce6d4254eab Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6020 Commit-Queue: Yunchao He <yunchao.he@intel.com> Reviewed-by: Kai Ninomiya <kainino@chromium.org>
This commit is contained in:
committed by
Commit Bot service account
parent
5f4bcbb946
commit
1ba2cb8589
@@ -156,27 +156,15 @@ void init() {
|
||||
fragColor = vec4(mix(f_col, vec3(0.5, 0.5, 0.5), 0.5), 1.0);
|
||||
})");
|
||||
|
||||
dawn::VertexAttributeDescriptor attribute[2];
|
||||
attribute[0].shaderLocation = 0;
|
||||
attribute[0].inputSlot = 0;
|
||||
attribute[0].offset = 0;
|
||||
attribute[0].format = dawn::VertexFormat::Float3;
|
||||
|
||||
attribute[1].shaderLocation = 1;
|
||||
attribute[1].inputSlot = 0;
|
||||
attribute[1].offset = 3 * sizeof(float);
|
||||
attribute[1].format = dawn::VertexFormat::Float3;
|
||||
|
||||
dawn::VertexInputDescriptor input;
|
||||
input.inputSlot = 0;
|
||||
input.stride = 6 * sizeof(float);
|
||||
input.stepMode = dawn::InputStepMode::Vertex;
|
||||
|
||||
dawn::InputStateDescriptor inputState;
|
||||
utils::ComboInputStateDescriptor inputState;
|
||||
inputState.numAttributes = 2;
|
||||
inputState.attributes = attribute;
|
||||
inputState.cAttributes[0].format = dawn::VertexFormat::Float3;
|
||||
inputState.cAttributes[1].shaderLocation = 1;
|
||||
inputState.cAttributes[1].offset = 3 * sizeof(float);
|
||||
inputState.cAttributes[1].format = dawn::VertexFormat::Float3;
|
||||
|
||||
inputState.numInputs = 1;
|
||||
inputState.inputs = &input;
|
||||
inputState.cInputs[0].stride = 6 * sizeof(float);
|
||||
|
||||
auto bgl = utils::MakeBindGroupLayout(
|
||||
device, {
|
||||
|
||||
Reference in New Issue
Block a user