diff options
| author | Andre Weissflog <floooh@gmail.com> | 2026-01-20 19:28:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-20 19:28:15 +0100 |
| commit | 5a6100f6b8d94e308aa3023aac0a8635ca5fe185 (patch) | |
| tree | 4a261bbcee181cfa06762e93508612d2747c3863 | |
| parent | 3c5b8f662a7e229caaa5774b4e0b6e991d8eec03 (diff) | |
| parent | 30db1b58b92a32ff414c0d57e1bc4dfd753a6303 (diff) | |
Merge pull request #1418 from luigi-rosso/expose_command_queue
feature: expose Metal CommandQueue
| -rw-r--r-- | sokol_gfx.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h index 1bb40043..76ebc01e 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -5337,6 +5337,8 @@ SOKOL_GFX_API_DECL const void* sg_mtl_device(void); SOKOL_GFX_API_DECL const void* sg_mtl_render_command_encoder(void); // Metal: return __bridge-casted MTLComputeCommandEncoder when inside compute pass (otherwise zero) SOKOL_GFX_API_DECL const void* sg_mtl_compute_command_encoder(void); +// Metal: return __bridge-casted MTLCommandQueue +SOKOL_GFX_API_DECL const void* sg_mtl_command_queue(void); // Metal: get internal __bridge-casted buffer resource objects SOKOL_GFX_API_DECL sg_mtl_buffer_info sg_mtl_query_buffer_info(sg_buffer buf); // Metal: get internal __bridge-casted image resource objects @@ -26230,6 +26232,18 @@ SOKOL_API_IMPL const void* sg_mtl_compute_command_encoder(void) { #endif } +SOKOL_API_IMPL const void* sg_mtl_command_queue(void) { + #if defined(SOKOL_METAL) + if (nil != _sg.mtl.cmd_queue) { + return (__bridge const void*) _sg.mtl.cmd_queue; + } else { + return 0; + } + #else + return 0; + #endif +} + SOKOL_API_IMPL sg_mtl_buffer_info sg_mtl_query_buffer_info(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); _SG_STRUCT(sg_mtl_buffer_info, res); |