Repository navigation
Commit 587a346
committed
shell/gpu: call Context virtuals instead of downcasting to ContextVK
impeller_context_ is a shared_ptr<impeller::Context> handed in by the caller, and
it is often a SurfaceContextVK, which derives from Context rather than ContextVK.
ContextVK::Cast on it is an unchecked downcast: DisposeThreadLocalCachedResources
then locks desc_pool_mutex_ at the wrong offset, pthread_mutex_lock returns
EINVAL, and the process aborts. The same member is cast to SurfaceContextVK a few
lines below, so the two casts could not both be right.
DisposeThreadLocalCachedResources, CreateCommandBuffer and GetCommandQueue are
all virtual on Context and SurfaceContextVK overrides or delegates them, so call
through the base and drop the casts.1 parent 4ec652a commit 587a346
1 file changed
Lines changed: 3 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
| 97 | + | |
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
| |||
260 | 259 | | |
261 | 260 | | |
262 | 261 | | |
263 | | - | |
264 | | - | |
265 | 262 | | |
266 | 263 | | |
267 | 264 | | |
268 | | - | |
| 265 | + | |
269 | 266 | | |
270 | 267 | | |
271 | 268 | | |
| |||
286 | 283 | | |
287 | 284 | | |
288 | 285 | | |
289 | | - | |
| 286 | + | |
290 | 287 | | |
291 | 288 | | |
292 | 289 | | |
| |||
0 commit comments