From 633b1a7463ca43f0fd4820bf2f62db1e40b63fe6 Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Wed, 12 Aug 2020 19:28:59 +0000 Subject: [PATCH] Minor updates to fix compilation. This CL adds the needed `memory` include for clang on windows and fixes up some issues to make doxygen happy again. Change-Id: I2c3f21aa086b079d3b861786834bcf4370123a7d Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/26703 Reviewed-by: Idan Raiter Reviewed-by: dan sinclair Commit-Queue: dan sinclair --- src/ast/transform/vertex_pulling_transform.h | 26 +++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/ast/transform/vertex_pulling_transform.h b/src/ast/transform/vertex_pulling_transform.h index d81b1cde81..030c517820 100644 --- a/src/ast/transform/vertex_pulling_transform.h +++ b/src/ast/transform/vertex_pulling_transform.h @@ -15,6 +15,7 @@ #ifndef SRC_AST_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_ #define SRC_AST_TRANSFORM_VERTEX_PULLING_TRANSFORM_H_ +#include #include #include #include @@ -78,35 +79,54 @@ enum class InputStepMode { kVertex, kInstance }; /// Describes a vertex attribute within a buffer struct VertexAttributeDescriptor { + /// The format of the attribute VertexFormat format; + /// The byte offset of the attribute in the buffer uint64_t offset; + /// The shader location used for the attribute uint32_t shader_location; }; /// Describes a buffer containing multiple vertex attributes struct VertexBufferLayoutDescriptor { + /// Constructor VertexBufferLayoutDescriptor(); - ~VertexBufferLayoutDescriptor(); + /// Constructor + /// @param in_array_stride the array stride of the in buffer + /// @param in_step_mode the step mode of the in buffer + /// @param in_attributes the in attributes VertexBufferLayoutDescriptor( uint64_t in_array_stride, InputStepMode in_step_mode, std::vector in_attributes); + /// Copy constructor + /// @param other the struct to copy VertexBufferLayoutDescriptor(const VertexBufferLayoutDescriptor& other); + ~VertexBufferLayoutDescriptor(); + /// The array stride used in the in buffer uint64_t array_stride = 0u; + /// The input step mode used InputStepMode step_mode = InputStepMode::kVertex; + /// The vertex attributes std::vector attributes; }; /// Describes vertex state, which consists of many buffers containing vertex /// attributes struct VertexStateDescriptor { + /// Constructor VertexStateDescriptor(); - ~VertexStateDescriptor(); + /// Constructor + /// @param in_vertex_buffers the vertex buffers VertexStateDescriptor( std::vector in_vertex_buffers); + /// Copy constructor + /// @param other the struct to copy VertexStateDescriptor(const VertexStateDescriptor& other); + ~VertexStateDescriptor(); + /// The vertex buffers std::vector vertex_buffers; }; @@ -121,7 +141,7 @@ struct VertexStateDescriptor { /// /// |VertexFormat| represents the input type of the attribute. This isn't /// related to the type of the variable in the shader. For example, -/// |VertexFormat::vec2_f16| tells us that the buffer will contain f16 elements, +/// `VertexFormat::kVec2F16` tells us that the buffer will contain f16 elements, /// to be read as vec2. In the shader, a user would make a vec2 to be able /// to use them. The conversion between f16 and f32 will need to be handled by /// us (using unpack functions).