struct MeshSpec
Defined at line 85 of file ../../src/ui/lib/escher/shape/mesh_spec.h
Describes the format of a mesh with >= 1 attribute buffers (
<
= VulkanLimits::kNumVertexBuffers),
more specifically the layout of attributes within those buffers. Some or all of the attributes
may be interleaved, or not. For example, here are three different specs with the same 3
attributes:
- MeshSpec{{MeshAttribute::kPosition2D | MeshAttribute::kUV | MeshAttribute::kBlendWeight1}}
- MeshSpec{{MeshAttribute::kPosition2D, MeshAttribute::kUV | MeshAttribute::kBlendWeight1}}
- MeshSpec{{MeshAttribute::kPosition2D, MeshAttribute::kUV, MeshAttribute::kBlendWeight1}}
The first interleaves all three attributes.
The second interleaves the UV and blend weight attributes, but not the position attribute.
The third interleaves no attributes.
Public Members
array attributes
Public Methods
uint32_t attribute_count (uint32_t vertex_buffer_index)
Return the number of attributes in the specified vertex buffer.
Defined at line 42 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
uint32_t total_attribute_count ()
Return the total number of attributes in all vertex buffers.
Defined at line 48 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
uint32_t attribute_offset (uint32_t vertex_buffer_index, MeshAttribute attr)
Delegates to GetMeshAttributeOffset() after verifying that
|vertex_buffer_index| is sane.
Defined at line 53 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
bool has_attribute (uint32_t vertex_buffer_index, MeshAttribute attr)
Return true if the specified vertex buffer has the specifed attribute, and
false otherwise.
Defined at line 102 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
bool has_attributes (uint32_t vertex_buffer_index, MeshAttributes attrs)
Return true if the specified vertex buffer has the specifed attributes, and
false otherwise.
Defined at line 107 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
uint32_t stride (uint32_t vertex_buffer_index)
Defined at line 117 of file ../../src/ui/lib/escher/shape/mesh_spec.h
uint32_t vertex_buffer_count ()
Return the number of vertex buffers that have at least one attribute.
Defined at line 121 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
MeshAttributes all_attributes ()
Return the union of all attributes, from all vertex buffers.
Defined at line 112 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
bool IsValid ()
There must be exactly one position attribute (either 2D or 3D), and it must
appear in the first vertex buffer.
Defined at line 130 of file ../../src/ui/lib/escher/shape/mesh_spec.cc
bool IsValidOneBufferMesh ()
This is a hack that describes the "currently supported" mesh formats in
Escher, i.e. the ones that tessellators know how to tessellate, and that
renderers know how to render. Just because a MeshSpec describes a valid
one- or two-buffer mesh doesn't mean that all parts of Escher will be able
to deal with it, e.g. ModelDisplayListBuilder can only deal with one-buffer
meshes.
Defined at line 144 of file ../../src/ui/lib/escher/shape/mesh_spec.cc