Remove InputStepMode (it was deprecated in favor of VertexStepMode)
Bug: dawn:1023 Change-Id: Ie5bb84f34f62143f92b59a816c7976f358b5c102 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/59665 Auto-Submit: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
fd35aa8e47
commit
c6cbe3fda6
|
@ -63,8 +63,8 @@ transform::VertexBufferLayoutDescriptor ExtractVertexBufferLayoutDescriptor(
|
||||||
Reader* r) {
|
Reader* r) {
|
||||||
transform::VertexBufferLayoutDescriptor desc;
|
transform::VertexBufferLayoutDescriptor desc;
|
||||||
desc.array_stride = r->read<uint32_t>();
|
desc.array_stride = r->read<uint32_t>();
|
||||||
desc.step_mode = r->enum_class<transform::InputStepMode>(
|
desc.step_mode = r->enum_class<transform::VertexStepMode>(
|
||||||
static_cast<uint8_t>(transform::InputStepMode::kLastEntry) + 1);
|
static_cast<uint8_t>(transform::VertexStepMode::kLastEntry) + 1);
|
||||||
desc.attributes = r->vector(ExtractVertexAttributeDescriptor);
|
desc.attributes = r->vector(ExtractVertexAttributeDescriptor);
|
||||||
return desc;
|
return desc;
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,7 +298,7 @@ struct State {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto* index_expr = buffer_layout.step_mode == InputStepMode::kVertex
|
auto* index_expr = buffer_layout.step_mode == VertexStepMode::kVertex
|
||||||
? vertex_index_expr()
|
? vertex_index_expr()
|
||||||
: instance_index_expr();
|
: instance_index_expr();
|
||||||
|
|
||||||
|
@ -860,7 +860,7 @@ struct State {
|
||||||
// Insert new parameters for vertex_index and instance_index if needed.
|
// Insert new parameters for vertex_index and instance_index if needed.
|
||||||
if (!vertex_index_expr) {
|
if (!vertex_index_expr) {
|
||||||
for (const VertexBufferLayoutDescriptor& layout : cfg.vertex_state) {
|
for (const VertexBufferLayoutDescriptor& layout : cfg.vertex_state) {
|
||||||
if (layout.step_mode == InputStepMode::kVertex) {
|
if (layout.step_mode == VertexStepMode::kVertex) {
|
||||||
auto name = ctx.dst->Symbols().New("tint_pulling_vertex_index");
|
auto name = ctx.dst->Symbols().New("tint_pulling_vertex_index");
|
||||||
new_function_parameters.push_back(
|
new_function_parameters.push_back(
|
||||||
ctx.dst->Param(name, ctx.dst->ty.u32(),
|
ctx.dst->Param(name, ctx.dst->ty.u32(),
|
||||||
|
@ -872,7 +872,7 @@ struct State {
|
||||||
}
|
}
|
||||||
if (!instance_index_expr) {
|
if (!instance_index_expr) {
|
||||||
for (const VertexBufferLayoutDescriptor& layout : cfg.vertex_state) {
|
for (const VertexBufferLayoutDescriptor& layout : cfg.vertex_state) {
|
||||||
if (layout.step_mode == InputStepMode::kInstance) {
|
if (layout.step_mode == VertexStepMode::kInstance) {
|
||||||
auto name = ctx.dst->Symbols().New("tint_pulling_instance_index");
|
auto name = ctx.dst->Symbols().New("tint_pulling_instance_index");
|
||||||
new_function_parameters.push_back(
|
new_function_parameters.push_back(
|
||||||
ctx.dst->Param(name, ctx.dst->ty.u32(),
|
ctx.dst->Param(name, ctx.dst->ty.u32(),
|
||||||
|
@ -945,7 +945,7 @@ VertexBufferLayoutDescriptor::VertexBufferLayoutDescriptor() = default;
|
||||||
|
|
||||||
VertexBufferLayoutDescriptor::VertexBufferLayoutDescriptor(
|
VertexBufferLayoutDescriptor::VertexBufferLayoutDescriptor(
|
||||||
uint32_t in_array_stride,
|
uint32_t in_array_stride,
|
||||||
InputStepMode in_step_mode,
|
VertexStepMode in_step_mode,
|
||||||
std::vector<VertexAttributeDescriptor> in_attributes)
|
std::vector<VertexAttributeDescriptor> in_attributes)
|
||||||
: array_stride(in_array_stride),
|
: array_stride(in_array_stride),
|
||||||
step_mode(in_step_mode),
|
step_mode(in_step_mode),
|
||||||
|
|
|
@ -65,9 +65,6 @@ enum class VertexFormat {
|
||||||
/// index
|
/// index
|
||||||
enum class VertexStepMode { kVertex, kInstance, kLastEntry = kInstance };
|
enum class VertexStepMode { kVertex, kInstance, kLastEntry = kInstance };
|
||||||
|
|
||||||
/// Deprecated
|
|
||||||
using InputStepMode = VertexStepMode;
|
|
||||||
|
|
||||||
/// Describes a vertex attribute within a buffer
|
/// Describes a vertex attribute within a buffer
|
||||||
struct VertexAttributeDescriptor {
|
struct VertexAttributeDescriptor {
|
||||||
/// The format of the attribute
|
/// The format of the attribute
|
||||||
|
@ -88,7 +85,7 @@ struct VertexBufferLayoutDescriptor {
|
||||||
/// @param in_attributes the in attributes
|
/// @param in_attributes the in attributes
|
||||||
VertexBufferLayoutDescriptor(
|
VertexBufferLayoutDescriptor(
|
||||||
uint32_t in_array_stride,
|
uint32_t in_array_stride,
|
||||||
InputStepMode in_step_mode,
|
VertexStepMode in_step_mode,
|
||||||
std::vector<VertexAttributeDescriptor> in_attributes);
|
std::vector<VertexAttributeDescriptor> in_attributes);
|
||||||
/// Copy constructor
|
/// Copy constructor
|
||||||
/// @param other the struct to copy
|
/// @param other the struct to copy
|
||||||
|
@ -105,7 +102,7 @@ struct VertexBufferLayoutDescriptor {
|
||||||
/// The array stride used in the in buffer
|
/// The array stride used in the in buffer
|
||||||
uint32_t array_stride = 0u;
|
uint32_t array_stride = 0u;
|
||||||
/// The input step mode used
|
/// The input step mode used
|
||||||
InputStepMode step_mode = InputStepMode::kVertex;
|
VertexStepMode step_mode = VertexStepMode::kVertex;
|
||||||
/// The vertex attributes
|
/// The vertex attributes
|
||||||
std::vector<VertexAttributeDescriptor> attributes;
|
std::vector<VertexAttributeDescriptor> attributes;
|
||||||
};
|
};
|
||||||
|
|
|
@ -88,7 +88,7 @@ fn main([[location(0)]] var_a : f32) -> [[builtin(position)]] vec4<f32> {
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{15, InputStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
{{15, VertexStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
DataMap data;
|
DataMap data;
|
||||||
|
@ -157,7 +157,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{4, InputStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
{{4, VertexStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
DataMap data;
|
DataMap data;
|
||||||
|
@ -196,7 +196,7 @@ fn main([[builtin(instance_index)]] tint_pulling_instance_index : u32) -> [[buil
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{4, InputStepMode::kInstance, {{VertexFormat::kFloat32, 0, 0}}}}};
|
{{4, VertexStepMode::kInstance, {{VertexFormat::kFloat32, 0, 0}}}}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
DataMap data;
|
DataMap data;
|
||||||
|
@ -235,7 +235,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{4, InputStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
{{4, VertexStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
||||||
cfg.pulling_group = 5;
|
cfg.pulling_group = 5;
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{4, InputStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
{{4, VertexStepMode::kVertex, {{VertexFormat::kFloat32, 0, 0}}}}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
DataMap data;
|
DataMap data;
|
||||||
|
@ -335,12 +335,12 @@ fn main([[builtin(vertex_index)]] custom_vertex_index : u32, [[builtin(instance_
|
||||||
cfg.vertex_state = {{
|
cfg.vertex_state = {{
|
||||||
{
|
{
|
||||||
4,
|
4,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{{VertexFormat::kFloat32, 0, 0}},
|
{{VertexFormat::kFloat32, 0, 0}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
4,
|
4,
|
||||||
InputStepMode::kInstance,
|
VertexStepMode::kInstance,
|
||||||
{{VertexFormat::kFloat32, 0, 1}},
|
{{VertexFormat::kFloat32, 0, 1}},
|
||||||
},
|
},
|
||||||
}};
|
}};
|
||||||
|
@ -415,12 +415,12 @@ fn main(tint_symbol_1 : tint_symbol) -> [[builtin(position)]] vec4<f32> {
|
||||||
cfg.vertex_state = {{
|
cfg.vertex_state = {{
|
||||||
{
|
{
|
||||||
4,
|
4,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{{VertexFormat::kFloat32, 0, 0}},
|
{{VertexFormat::kFloat32, 0, 0}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
4,
|
4,
|
||||||
InputStepMode::kInstance,
|
VertexStepMode::kInstance,
|
||||||
{{VertexFormat::kFloat32, 0, 1}},
|
{{VertexFormat::kFloat32, 0, 1}},
|
||||||
},
|
},
|
||||||
}};
|
}};
|
||||||
|
@ -492,12 +492,12 @@ fn main(indices : Indices) -> [[builtin(position)]] vec4<f32> {
|
||||||
cfg.vertex_state = {{
|
cfg.vertex_state = {{
|
||||||
{
|
{
|
||||||
4,
|
4,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{{VertexFormat::kFloat32, 0, 0}},
|
{{VertexFormat::kFloat32, 0, 0}},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
4,
|
4,
|
||||||
InputStepMode::kInstance,
|
VertexStepMode::kInstance,
|
||||||
{{VertexFormat::kFloat32, 0, 1}},
|
{{VertexFormat::kFloat32, 0, 1}},
|
||||||
},
|
},
|
||||||
}};
|
}};
|
||||||
|
@ -543,7 +543,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{16,
|
{{16,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{{VertexFormat::kFloat32, 0, 0}, {VertexFormat::kFloat32x4, 0, 1}}}}};
|
{{VertexFormat::kFloat32, 0, 0}, {VertexFormat::kFloat32x4, 0, 1}}}}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
|
@ -596,9 +596,9 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {{
|
cfg.vertex_state = {{
|
||||||
{8, InputStepMode::kVertex, {{VertexFormat::kFloat32x2, 0, 0}}},
|
{8, VertexStepMode::kVertex, {{VertexFormat::kFloat32x2, 0, 0}}},
|
||||||
{12, InputStepMode::kVertex, {{VertexFormat::kFloat32x3, 0, 1}}},
|
{12, VertexStepMode::kVertex, {{VertexFormat::kFloat32x3, 0, 1}}},
|
||||||
{16, InputStepMode::kVertex, {{VertexFormat::kFloat32x4, 0, 2}}},
|
{16, VertexStepMode::kVertex, {{VertexFormat::kFloat32x4, 0, 2}}},
|
||||||
}};
|
}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
|
@ -650,7 +650,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index_1 : u32) -> [[builti
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {
|
cfg.vertex_state = {
|
||||||
{{16,
|
{{16,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{{VertexFormat::kFloat32, 0, 0}, {VertexFormat::kFloat32x4, 0, 1}}}}};
|
{{VertexFormat::kFloat32, 0, 0}, {VertexFormat::kFloat32x4, 0, 1}}}}};
|
||||||
cfg.entry_point_name = "main";
|
cfg.entry_point_name = "main";
|
||||||
|
|
||||||
|
@ -779,7 +779,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {{{256,
|
cfg.vertex_state = {{{256,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{
|
{
|
||||||
{VertexFormat::kUint8x2, 64, 0},
|
{VertexFormat::kUint8x2, 64, 0},
|
||||||
{VertexFormat::kUint8x4, 64, 1},
|
{VertexFormat::kUint8x4, 64, 1},
|
||||||
|
@ -940,7 +940,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {{{256,
|
cfg.vertex_state = {{{256,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{
|
{
|
||||||
{VertexFormat::kUint8x2, 63, 0},
|
{VertexFormat::kUint8x2, 63, 0},
|
||||||
{VertexFormat::kUint8x4, 63, 1},
|
{VertexFormat::kUint8x4, 63, 1},
|
||||||
|
@ -1100,7 +1100,7 @@ fn main([[builtin(vertex_index)]] tint_pulling_vertex_index : u32) -> [[builtin(
|
||||||
|
|
||||||
VertexPulling::Config cfg;
|
VertexPulling::Config cfg;
|
||||||
cfg.vertex_state = {{{256,
|
cfg.vertex_state = {{{256,
|
||||||
InputStepMode::kVertex,
|
VertexStepMode::kVertex,
|
||||||
{
|
{
|
||||||
{VertexFormat::kUint8x2, 64, 0},
|
{VertexFormat::kUint8x2, 64, 0},
|
||||||
{VertexFormat::kUint8x4, 64, 1},
|
{VertexFormat::kUint8x4, 64, 1},
|
||||||
|
|
Loading…
Reference in New Issue