75 {
76
77
78
79 if (!resolver) {
80 return;
81 }
82
84
85 auto error_fn = reinterpret_cast<PFNGLGETERRORPROC>(resolver("glGetError"));
86 if (!error_fn) {
88 return;
89 }
90
91#define IMPELLER_PROC(proc_ivar) \
92 if (auto fn_ptr = resolver(proc_ivar.name)) { \
93 proc_ivar.function = \
94 reinterpret_cast<decltype(proc_ivar.function)>(fn_ptr); \
95 proc_ivar.error_fn = error_fn; \
96 } else { \
97 VALIDATION_LOG << "Could not resolve " << proc_ivar.name; \
98 return; \
99 }
100
102
103 description_ = std::make_unique<DescriptionGLES>(*this);
104
105 if (!description_->IsValid()) {
106 return;
107 }
108
109 if (description_->IsES()) {
111 } else {
113 }
114
115#undef IMPELLER_PROC
116
117#define IMPELLER_PROC(proc_ivar) \
118 if (auto fn_ptr = resolver(proc_ivar.name)) { \
119 proc_ivar.function = \
120 reinterpret_cast<decltype(proc_ivar.function)>(fn_ptr); \
121 proc_ivar.error_fn = error_fn; \
122 }
125
126#undef IMPELLER_PROC
127
128 if (!description_->HasDebugExtension()) {
129 PushDebugGroupKHR.Reset();
130 PopDebugGroupKHR.Reset();
131 ObjectLabelKHR.Reset();
132 } else {
133 GetIntegerv(GL_MAX_LABEL_LENGTH_KHR, &debug_label_max_length_);
134 }
135
136 if (!description_->HasExtension("GL_EXT_discard_framebuffer")) {
137 DiscardFramebufferEXT.Reset();
138 }
139
140 capabilities_ = std::make_shared<CapabilitiesGLES>(*this);
141
142 is_valid_ = true;
143}
FOR_EACH_IMPELLER_ES_ONLY_PROC(IMPELLER_PROC)
FOR_EACH_IMPELLER_GLES3_PROC(IMPELLER_PROC)
FOR_EACH_IMPELLER_DESKTOP_ONLY_PROC(IMPELLER_PROC)
FOR_EACH_IMPELLER_PROC(IMPELLER_PROC)
FOR_EACH_IMPELLER_EXT_PROC(IMPELLER_PROC)
ProcTableGLES::Resolver WrappedResolver(const ProcTableGLES::Resolver &resolver)
#define IMPELLER_PROC(proc_ivar)