diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:21 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:21 +0100 |
commit | 939fde5ca405342ab4c52ee3da81fb2daa192e3e (patch) | |
tree | 0920ca9e70760b2cad50707020a9808ddaa0eca4 /stockton-render/src/draw/context.rs | |
parent | 48ebe87925c4aca8fb9ab8f120b327b677f6812c (diff) |
refactor(draw): use macro for buffer attribute descriptions
Diffstat (limited to 'stockton-render/src/draw/context.rs')
-rw-r--r-- | stockton-render/src/draw/context.rs | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/stockton-render/src/draw/context.rs b/stockton-render/src/draw/context.rs index 86c2270..789b4ce 100644 --- a/stockton-render/src/draw/context.rs +++ b/stockton-render/src/draw/context.rs @@ -538,28 +538,11 @@ impl<'a> RenderingContext<'a> { rate: VertexInputRate::Vertex, }]; - let attributes: Vec<AttributeDesc> = vec![AttributeDesc { // XYZ Attribute - location: 0, - binding: 0, - element: Element { - format: Format::Rgb32Sfloat, - offset: 0, - }, - }, AttributeDesc { // UV Attribute - location: 1, - binding: 0, - element: Element { - format: Format::Rg32Sfloat, - offset: (size_of::<f32>() * 3) as ElemOffset, - } - }, AttributeDesc { // Tex Attribute - location: 2, - binding: 0, - element: Element { - format: Format::R32Sint, - offset: (size_of::<f32>() * 5) as ElemOffset - } - }]; + let attributes: Vec<AttributeDesc> = pipeline_vb_attributes!(0, + size_of::<f32>() * 3; Rgb32Sfloat, + size_of::<f32>() * 2; Rg32Sfloat, + size_of::<u32>(); R32Sint + ); // Rasterizer let rasterizer = Rasterizer { |