mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-08 21:17:45 +00:00
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:
committed by
Commit Bot service account
parent
54e4d47db4
commit
e105f962cf
@@ -118,13 +118,13 @@ void initRender() {
|
||||
attribute1.shaderLocation = 0;
|
||||
attribute1.inputSlot = 0;
|
||||
attribute1.offset = offsetof(Particle, pos);
|
||||
attribute1.format = dawn::VertexFormat::FloatR32G32;
|
||||
attribute1.format = dawn::VertexFormat::Float2;
|
||||
|
||||
dawn::VertexAttributeDescriptor attribute2;
|
||||
attribute2.shaderLocation = 1;
|
||||
attribute2.inputSlot = 0;
|
||||
attribute2.offset = offsetof(Particle, vel);
|
||||
attribute2.format = dawn::VertexFormat::FloatR32G32;
|
||||
attribute2.format = dawn::VertexFormat::Float2;
|
||||
|
||||
dawn::VertexInputDescriptor input1;
|
||||
input1.inputSlot = 0;
|
||||
@@ -135,7 +135,7 @@ void initRender() {
|
||||
attribute3.shaderLocation = 2;
|
||||
attribute3.inputSlot = 1;
|
||||
attribute3.offset = 0;
|
||||
attribute3.format = dawn::VertexFormat::FloatR32G32;
|
||||
attribute3.format = dawn::VertexFormat::Float2;
|
||||
|
||||
dawn::VertexInputDescriptor input2;
|
||||
input2.inputSlot = 1;
|
||||
|
||||
@@ -115,7 +115,7 @@ void init() {
|
||||
attribute.shaderLocation = 0;
|
||||
attribute.inputSlot = 0;
|
||||
attribute.offset = 0;
|
||||
attribute.format = dawn::VertexFormat::FloatR32G32B32A32;
|
||||
attribute.format = dawn::VertexFormat::Float4;
|
||||
|
||||
dawn::VertexInputDescriptor input;
|
||||
input.inputSlot = 0;
|
||||
|
||||
@@ -160,13 +160,13 @@ void init() {
|
||||
attribute1.shaderLocation = 0;
|
||||
attribute1.inputSlot = 0;
|
||||
attribute1.offset = 0;
|
||||
attribute1.format = dawn::VertexFormat::FloatR32G32B32;
|
||||
attribute1.format = dawn::VertexFormat::Float3;
|
||||
|
||||
dawn::VertexAttributeDescriptor attribute2;
|
||||
attribute2.shaderLocation = 1;
|
||||
attribute2.inputSlot = 0;
|
||||
attribute2.offset = 3 * sizeof(float);
|
||||
attribute2.format = dawn::VertexFormat::FloatR32G32B32;
|
||||
attribute2.format = dawn::VertexFormat::Float3;
|
||||
|
||||
dawn::VertexInputDescriptor input;
|
||||
input.inputSlot = 0;
|
||||
|
||||
@@ -107,13 +107,13 @@ namespace {
|
||||
bool techniqueParameterTypeToVertexFormat(int type, dawn::VertexFormat *format) {
|
||||
switch (type) {
|
||||
case gl::FloatVec2:
|
||||
*format = dawn::VertexFormat::FloatR32G32;
|
||||
*format = dawn::VertexFormat::Float2;
|
||||
return true;
|
||||
case gl::FloatVec3:
|
||||
*format = dawn::VertexFormat::FloatR32G32B32;
|
||||
*format = dawn::VertexFormat::Float3;
|
||||
return true;
|
||||
case gl::FloatVec4:
|
||||
*format = dawn::VertexFormat::FloatR32G32B32A32;
|
||||
*format = dawn::VertexFormat::Float4;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
@@ -290,7 +290,7 @@ namespace {
|
||||
attribute.offset = 0;
|
||||
attribute.shaderLocation = i;
|
||||
attribute.inputSlot = i;
|
||||
attribute.format = dawn::VertexFormat::FloatR32G32B32A32;
|
||||
attribute.format = dawn::VertexFormat::Float4;
|
||||
|
||||
dawn::VertexInputDescriptor input;
|
||||
input.inputSlot = i;
|
||||
|
||||
Reference in New Issue
Block a user