forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblob.h
43 lines (33 loc) · 882 Bytes
/
blob.h
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
37
38
39
40
41
42
43
// 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 <cstddef>
#include <cstdint>
#include <memory>
#include <string>
#include "flutter/fml/macros.h"
#include "flutter/fml/mapping.h"
namespace impeller {
constexpr const uint32_t kBlobCatMagic = 0x0B10BCA7;
struct BlobHeader {
uint32_t magic = kBlobCatMagic;
uint32_t blob_count = 0u;
};
struct Blob {
enum class ShaderType : uint8_t {
kVertex,
kFragment,
};
static constexpr size_t kMaxNameLength = 32u;
ShaderType type = ShaderType::kVertex;
uint64_t offset = 0;
uint64_t length = 0;
uint8_t name[kMaxNameLength] = {};
};
struct BlobDescription {
Blob::ShaderType type;
std::string name;
std::shared_ptr<fml::Mapping> mapping;
};
} // namespace impeller