| 1 |
/* |
| 2 |
* Copyright 2024 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_CODEGENTYPES |
| 9 |
#define SKSL_CODEGENTYPES |
| 10 |
|
| 11 |
namespace SkSL { |
| 12 |
|
| 13 |
enum class PrettyPrint : bool { |
| 14 |
kNo = false, |
| 15 |
kYes = true, |
| 16 |
}; |
| 17 |
|
| 18 |
namespace spirv { |
| 19 |
|
| 20 |
enum ReservedId { |
| 21 |
// Zero is not a valid ID in SPIR-V. |
| 22 |
kIdInvalid = 0, |
| 23 |
|
| 24 |
// The following are IDs that are fixed in every SPIR-V, if present. If the backend needs to |
| 25 |
// transform the SPIR-V, it doesn't have to figure them out. See the transformations in |
| 26 |
// VulkanSpirvTransforms.cpp for where and why each of these IDs might be used. |
| 27 |
|
| 28 |
// %kIdTypeInt = OpTypeInt 32 1 |
| 29 |
kIdTypeInt, |
| 30 |
// %kIdTypePointerInputInt = OpTypePointer Input %kIdTypeInt |
| 31 |
kIdTypePointerInputInt, |
| 32 |
|
| 33 |
// Input-attachment-related IDs. There can only be one input attachment, so these are unique. |
| 34 |
// %kIdTypeImageSubpassData = OpTypeImage %type SubpassData 0 0 0 2 Unknown |
| 35 |
kIdTypeImageSubpassData, |
| 36 |
// %kIdVariableImageSubpassData = OpVariable %pointer_to_kIdTypeImageSubpassData UniformConstant |
| 37 |
kIdVariableImageSubpassData, |
| 38 |
|
| 39 |
// All other SPIR-V IDs start from this. |
| 40 |
kIdFirstUnreserved, |
| 41 |
}; |
| 42 |
|
| 43 |
} // namespace spirv |
| 44 |
|
| 45 |
} // namespace SkSL |
| 46 |
|
| 47 |
#endif |