floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.63k stars 472 forks source link

sokol_gfx.h add missing error paths when backend resource creation calls fail #894

Closed floooh closed 10 months ago

floooh commented 10 months ago

This adds the missing error code paths (_SG_ERROR log + put object into SG_RESOURCESTATE_FAILED mode) when Metal object creation fails for the following object types:

NOTE: For (Web)GL this isn't possible without involving a full pipeline flush (caused by calling glGetError()), and WebGPU's asynchronous error reporting also doesn't allow to react to out-of-memory-situations at object creation time.