| Flutter Impeller |

vertex_buffer.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_CORE_VERTEX_BUFFER_H_
6 #define FLUTTER_IMPELLER_CORE_VERTEX_BUFFER_H_
7
8 #include "impeller/core/buffer_view.h"
9 #include "impeller/core/formats.h"
10
11 namespace impeller {
12
13 constexpr size_t kMaxVertexBuffers = 16;
14
15 struct VertexBuffer {
16 BufferView vertex_buffer;
17
18 //----------------------------------------------------------------------------
19 /// The index buffer binding used by the vertex shader stage.
20 BufferView index_buffer;
21
22 //----------------------------------------------------------------------------
23 /// The total count of vertices, either in the vertex_buffer if the
24 /// index_type is IndexType::kNone or in the index_buffer otherwise.
25 size_t vertex_count = 0u;
26
27 //----------------------------------------------------------------------------
28 /// The type of indices in the index buffer. The indices must be tightly
29 /// packed in the index buffer.
30 ///
31 IndexType index_type = IndexType::kUnknown;
32
33 explicit inline operator bool() const {
34 return static_cast<bool>(vertex_buffer) &&
35 (index_type == IndexType::kNone || static_cast<bool>(index_buffer));
36 }
37 };
38
39 } // namespace impeller
40
41 #endif // FLUTTER_IMPELLER_CORE_VERTEX_BUFFER_H_
buffer_view.h
formats.h
impeller
Definition: allocation.cc:12
impeller::IndexType
IndexType
Definition: formats.h:343
impeller::IndexType::kUnknown
@ kUnknown
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::kMaxVertexBuffers
constexpr size_t kMaxVertexBuffers
Definition: vertex_buffer.h:13
impeller::BufferView
Definition: buffer_view.h:19
impeller::VertexBuffer
Definition: vertex_buffer.h:15
impeller::VertexBuffer::index_type
IndexType index_type
Definition: vertex_buffer.h:31
impeller::VertexBuffer::vertex_count
size_t vertex_count
Definition: vertex_buffer.h:25
impeller::VertexBuffer::index_buffer
BufferView index_buffer
The index buffer binding used by the vertex shader stage.
Definition: vertex_buffer.h:20
impeller::VertexBuffer::vertex_buffer
BufferView vertex_buffer
Definition: vertex_buffer.h:16