| 1 |
/* |
| 2 |
* Copyright 2025 Google LLC |
| 3 |
* |
| 4 |
* Use of this source code is governed by a BSD-style license that can be |
| 5 |
* found in the LICENSE file. |
| 6 |
*/ |
| 7 |
|
| 8 |
#ifndef SKSL_NATIVESHADER |
| 9 |
#define SKSL_NATIVESHADER |
| 10 |
|
| 11 |
#include <cstdint> |
| 12 |
#include <string> |
| 13 |
#include <vector> |
| 14 |
|
| 15 |
namespace SkSL { |
| 16 |
|
| 17 |
// After compiling SkSL to native, the result is either in text or binary form. Currently, only |
| 18 |
// SPIR-V is in binary form. |
| 19 |
struct NativeShader { |
| 20 |
std::string fText; |
| 21 |
std::vector<uint32_t> fBinary; |
| 22 |
|
| 23 |
bool isBinary() const { return !fBinary.empty(); } |
| 24 |
}; |
| 25 |
|
| 26 |
} // namespace SkSL |
| 27 |
|
| 28 |
#endif // SKSL_NATIVESHADER |