forked from flutter-team-archive/engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvertex_buffer.h
More file actions
36 lines (27 loc) · 1.17 KB
/
Copy pathvertex_buffer.h
File metadata and controls
36 lines (27 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include "impeller/core/buffer_view.h"
#include "impeller/core/formats.h"
namespace impeller {
struct VertexBuffer {
BufferView vertex_buffer;
//----------------------------------------------------------------------------
/// The index buffer binding used by the vertex shader stage.
BufferView index_buffer;
//----------------------------------------------------------------------------
/// The total count of vertices, either in the vertex_buffer if the
/// index_type is IndexType::kNone or in the index_buffer otherwise.
size_t vertex_count = 0u;
//----------------------------------------------------------------------------
/// The type of indices in the index buffer. The indices must be tightly
/// packed in the index buffer.
///
IndexType index_type = IndexType::kUnknown;
constexpr explicit operator bool() const {
return static_cast<bool>(vertex_buffer) &&
(index_type == IndexType::kNone || static_cast<bool>(index_buffer));
}
};
} // namespace impeller