24 : type_(type), compiler_(
std::move(compiler)){};
34 spirv_cross::ID
id)
const {
35 if (
auto compiler = GetMSLCompiler()) {
38 return compiler->get_automatic_msl_resource_binding(
id);
40 return compiler->get_automatic_msl_resource_binding_secondary(
id);
44 if (
auto compiler = GetGLSLCompiler()) {
45 return compiler->get_decoration(
id, spv::Decoration::DecorationBinding);
47 const auto kOOBIndex =
static_cast<uint32_t
>(-1);
52 if (
auto compiler = GetGLSLCompiler()) {
56 if (
auto compiler = GetMSLCompiler()) {
60 if (
auto compiler = GetSkSLCompiler()) {
68 if (
auto* msl = std::get_if<MSLCompiler>(&compiler_)) {
71 if (
auto* glsl = std::get_if<GLSLCompiler>(&compiler_)) {
74 if (
auto* sksl = std::get_if<SkSLCompiler>(&compiler_)) {
80 const spirv_cross::CompilerMSL* CompilerBackend::GetMSLCompiler()
const {
81 if (
auto* msl = std::get_if<MSLCompiler>(&compiler_)) {
87 const spirv_cross::CompilerGLSL* CompilerBackend::GetGLSLCompiler()
const {
88 if (
auto* glsl = std::get_if<GLSLCompiler>(&compiler_)) {
94 const CompilerSkSL* CompilerBackend::GetSkSLCompiler()
const {
95 if (
auto* sksl = std::get_if<SkSLCompiler>(&compiler_)) {
101 CompilerBackend::operator bool()
const {
102 return !!GetCompiler();