diff options
| author | Andre Weissflog <floooh@gmail.com> | 2025-05-29 16:23:32 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2025-05-29 16:23:32 +0200 |
| commit | 760ce19c7fdc685e91cbd063bf7757032ed71a69 (patch) | |
| tree | b35453d4dd178711ca8934a62e8d0511b92da759 | |
| parent | d2fea79e4b9c620e0caa8c06c928c135546838ae (diff) | |
sokol_gfx.h: simplify the _sg_lookup function signatures
| -rw-r--r-- | sokol_gfx.h | 269 |
1 files changed, 133 insertions, 136 deletions
diff --git a/sokol_gfx.h b/sokol_gfx.h index be999f2f..44d8fbd1 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -5613,7 +5613,7 @@ struct _sg_sampler_s; struct _sg_shader_s; struct _sg_pipeline_s; struct _sg_attachments_s; -_SOKOL_PRIVATE struct _sg_buffer_s* _sg_lookup_buffer(const struct _sg_pools_s* p, uint32_t buf_id); +_SOKOL_PRIVATE struct _sg_buffer_s* _sg_lookup_buffer(uint32_t buf_id); // safe references to resource objects typedef struct _sg_buffer_ref_s { @@ -14951,7 +14951,7 @@ _SOKOL_PRIVATE void _sg_mtl_end_pass(void) { if (needs_sync) { id<MTLBlitCommandEncoder> blit_cmd_encoder = [_sg.mtl.cmd_buffer blitCommandEncoder]; for (uint32_t i = 0; i < _sg.compute.readwrite_sbufs.cur; i++) { - _sg_buffer_t* sbuf = _sg_lookup_buffer(&_sg.pools, _sg.compute.readwrite_sbufs.items[i]); + _sg_buffer_t* sbuf = _sg_lookup_buffer(_sg.compute.readwrite_sbufs.items[i]); if (sbuf) { [blit_cmd_encoder synchronizeResource:_sg_mtl_id(sbuf->mtl.buf[sbuf->cmn.active_slot])]; } @@ -18457,9 +18457,9 @@ _SOKOL_PRIVATE _sg_attachments_t* _sg_attachments_at(const _sg_pools_t* p, uint3 } // returns pointer to resource with matching id check, may return 0 -_SOKOL_PRIVATE _sg_buffer_t* _sg_lookup_buffer(const _sg_pools_t* p, uint32_t buf_id) { +_SOKOL_PRIVATE _sg_buffer_t* _sg_lookup_buffer(uint32_t buf_id) { if (SG_INVALID_ID != buf_id) { - _sg_buffer_t* buf = _sg_buffer_at(p, buf_id); + _sg_buffer_t* buf = _sg_buffer_at(&_sg.pools, buf_id); if (buf->slot.id == buf_id) { return buf; } @@ -18467,9 +18467,9 @@ _SOKOL_PRIVATE _sg_buffer_t* _sg_lookup_buffer(const _sg_pools_t* p, uint32_t bu return 0; } -_SOKOL_PRIVATE _sg_image_t* _sg_lookup_image(const _sg_pools_t* p, uint32_t img_id) { +_SOKOL_PRIVATE _sg_image_t* _sg_lookup_image(uint32_t img_id) { if (SG_INVALID_ID != img_id) { - _sg_image_t* img = _sg_image_at(p, img_id); + _sg_image_t* img = _sg_image_at(&_sg.pools, img_id); if (img->slot.id == img_id) { return img; } @@ -18477,9 +18477,9 @@ _SOKOL_PRIVATE _sg_image_t* _sg_lookup_image(const _sg_pools_t* p, uint32_t img_ return 0; } -_SOKOL_PRIVATE _sg_sampler_t* _sg_lookup_sampler(const _sg_pools_t* p, uint32_t smp_id) { +_SOKOL_PRIVATE _sg_sampler_t* _sg_lookup_sampler(uint32_t smp_id) { if (SG_INVALID_ID != smp_id) { - _sg_sampler_t* smp = _sg_sampler_at(p, smp_id); + _sg_sampler_t* smp = _sg_sampler_at(&_sg.pools, smp_id); if (smp->slot.id == smp_id) { return smp; } @@ -18487,10 +18487,9 @@ _SOKOL_PRIVATE _sg_sampler_t* _sg_lookup_sampler(const _sg_pools_t* p, uint32_t return 0; } -_SOKOL_PRIVATE _sg_shader_t* _sg_lookup_shader(const _sg_pools_t* p, uint32_t shd_id) { - SOKOL_ASSERT(p); +_SOKOL_PRIVATE _sg_shader_t* _sg_lookup_shader(uint32_t shd_id) { if (SG_INVALID_ID != shd_id) { - _sg_shader_t* shd = _sg_shader_at(p, shd_id); + _sg_shader_t* shd = _sg_shader_at(&_sg.pools, shd_id); if (shd->slot.id == shd_id) { return shd; } @@ -18498,10 +18497,9 @@ _SOKOL_PRIVATE _sg_shader_t* _sg_lookup_shader(const _sg_pools_t* p, uint32_t sh return 0; } -_SOKOL_PRIVATE _sg_pipeline_t* _sg_lookup_pipeline(const _sg_pools_t* p, uint32_t pip_id) { - SOKOL_ASSERT(p); +_SOKOL_PRIVATE _sg_pipeline_t* _sg_lookup_pipeline(uint32_t pip_id) { if (SG_INVALID_ID != pip_id) { - _sg_pipeline_t* pip = _sg_pipeline_at(p, pip_id); + _sg_pipeline_t* pip = _sg_pipeline_at(&_sg.pools, pip_id); if (pip->slot.id == pip_id) { return pip; } @@ -18509,10 +18507,9 @@ _SOKOL_PRIVATE _sg_pipeline_t* _sg_lookup_pipeline(const _sg_pools_t* p, uint32_ return 0; } -_SOKOL_PRIVATE _sg_attachments_t* _sg_lookup_attachments(const _sg_pools_t* p, uint32_t atts_id) { - SOKOL_ASSERT(p); +_SOKOL_PRIVATE _sg_attachments_t* _sg_lookup_attachments(uint32_t atts_id) { if (SG_INVALID_ID != atts_id) { - _sg_attachments_t* atts = _sg_attachments_at(p, atts_id); + _sg_attachments_t* atts = _sg_attachments_at(&_sg.pools, atts_id); if (atts->slot.id == atts_id) { return atts; } @@ -18658,31 +18655,31 @@ _SOKOL_PRIVATE bool _sg_pipeline_ref_eql(const _sg_pipeline_ref_t* ref, const _s _SOKOL_PRIVATE _sg_buffer_t* _sg_buffer_ref_ptr(const _sg_buffer_ref_t* ref) { SOKOL_ASSERT(ref); - _sg_buffer_t* ptr = _sg_lookup_buffer(&_sg.pools, ref->id); + _sg_buffer_t* ptr = _sg_lookup_buffer(ref->id); return (ptr && ptr->slot.uninit_count == ref->uninit_count) ? ptr : 0; } _SOKOL_PRIVATE _sg_image_t* _sg_image_ref_ptr(const _sg_image_ref_t* ref) { SOKOL_ASSERT(ref); - _sg_image_t* ptr = _sg_lookup_image(&_sg.pools, ref->id); + _sg_image_t* ptr = _sg_lookup_image(ref->id); return (ptr && ptr->slot.uninit_count == ref->uninit_count) ? ptr : 0; } _SOKOL_PRIVATE _sg_sampler_t* _sg_sampler_ref_ptr(const _sg_sampler_ref_t* ref) { SOKOL_ASSERT(ref); - _sg_sampler_t* ptr = _sg_lookup_sampler(&_sg.pools, ref->id); + _sg_sampler_t* ptr = _sg_lookup_sampler(ref->id); return (ptr && ptr->slot.uninit_count == ref->uninit_count) ? ptr : 0; } _SOKOL_PRIVATE _sg_shader_t* _sg_shader_ref_ptr(const _sg_shader_ref_t* ref) { SOKOL_ASSERT(ref); - _sg_shader_t* ptr = _sg_lookup_shader(&_sg.pools, ref->id); + _sg_shader_t* ptr = _sg_lookup_shader(ref->id); return (ptr && ptr->slot.uninit_count == ref->uninit_count) ? ptr : 0; } _SOKOL_PRIVATE _sg_pipeline_t* _sg_pipeline_ref_ptr(const _sg_pipeline_ref_t* ref) { SOKOL_ASSERT(ref); - _sg_pipeline_t* ptr = _sg_lookup_pipeline(&_sg.pools, ref->id); + _sg_pipeline_t* ptr = _sg_lookup_pipeline(ref->id); return (ptr && ptr->slot.uninit_count == ref->uninit_count) ? ptr : 0; } @@ -19284,7 +19281,7 @@ _SOKOL_PRIVATE bool _sg_validate_pipeline_desc(const sg_pipeline_desc* desc) { _SG_VALIDATE(desc->_start_canary == 0, VALIDATE_PIPELINEDESC_CANARY); _SG_VALIDATE(desc->_end_canary == 0, VALIDATE_PIPELINEDESC_CANARY); _SG_VALIDATE(desc->shader.id != SG_INVALID_ID, VALIDATE_PIPELINEDESC_SHADER); - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, desc->shader.id); + const _sg_shader_t* shd = _sg_lookup_shader(desc->shader.id); _SG_VALIDATE(0 != shd, VALIDATE_PIPELINEDESC_SHADER); if (shd) { _SG_VALIDATE(shd->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_PIPELINEDESC_SHADER); @@ -19371,7 +19368,7 @@ _SOKOL_PRIVATE bool _sg_validate_attachments_desc(const sg_attachments_desc* des } has_color_atts = true; _SG_VALIDATE(atts_cont, VALIDATE_ATTACHMENTSDESC_NO_CONT_COLOR_ATTS); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, att->image.id); + const _sg_image_t* img = _sg_lookup_image(att->image.id); _SG_VALIDATE(img, VALIDATE_ATTACHMENTSDESC_COLOR_IMAGE); if (0 != img) { _SG_VALIDATE(img->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_ATTACHMENTSDESC_COLOR_IMAGE); @@ -19400,7 +19397,7 @@ _SOKOL_PRIVATE bool _sg_validate_attachments_desc(const sg_attachments_desc* des if (res_att->image.id != SG_INVALID_ID) { // associated color attachment must be MSAA _SG_VALIDATE(img->cmn.sample_count > 1, VALIDATE_ATTACHMENTSDESC_RESOLVE_COLOR_IMAGE_MSAA); - const _sg_image_t* res_img = _sg_lookup_image(&_sg.pools, res_att->image.id); + const _sg_image_t* res_img = _sg_lookup_image(res_att->image.id); _SG_VALIDATE(res_img, VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE); if (res_img != 0) { _SG_VALIDATE(res_img->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_ATTACHMENTSDESC_RESOLVE_IMAGE); @@ -19425,7 +19422,7 @@ _SOKOL_PRIVATE bool _sg_validate_attachments_desc(const sg_attachments_desc* des if (desc->depth_stencil.image.id != SG_INVALID_ID) { has_depth_stencil_att = true; const sg_attachment_desc* att = &desc->depth_stencil; - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, att->image.id); + const _sg_image_t* img = _sg_lookup_image(att->image.id); _SG_VALIDATE(img, VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE); if (img) { _SG_VALIDATE(img->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_ATTACHMENTSDESC_DEPTH_IMAGE); @@ -19456,7 +19453,7 @@ _SOKOL_PRIVATE bool _sg_validate_attachments_desc(const sg_attachments_desc* des continue; } has_storage_atts = true; - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, att->image.id); + const _sg_image_t* img = _sg_lookup_image(att->image.id); _SG_VALIDATE(img, VALIDATE_ATTACHMENTSDESC_STORAGE_IMAGE); if (0 != img) { _SG_VALIDATE(img->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_ATTACHMENTSDESC_STORAGE_IMAGE); @@ -19501,7 +19498,7 @@ _SOKOL_PRIVATE bool _sg_validate_begin_pass(const sg_pass* pass) { if (is_compute_pass) { // this is a compute pass with optional storage attachments if (pass->attachments.id) { - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, pass->attachments.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(pass->attachments.id); if (atts) { _SG_VALIDATE(atts->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_BEGINPASS_ATTACHMENTS_VALID); _SG_VALIDATE(!atts->cmn.has_render_attachments, VALIDATE_BEGINPASS_COMPUTEPASS_STORAGE_ATTACHMENTS_ONLY); @@ -19564,7 +19561,7 @@ _SOKOL_PRIVATE bool _sg_validate_begin_pass(const sg_pass* pass) { #endif } else { // this is an 'offscreen pass' - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, pass->attachments.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(pass->attachments.id); if (atts) { _SG_VALIDATE(atts->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_BEGINPASS_ATTACHMENTS_VALID); _SG_VALIDATE(!atts->cmn.has_storage_attachments, VALIDATE_BEGINPASS_RENDERPASS_RENDER_ATTACHMENTS_ONLY); @@ -19665,7 +19662,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_pipeline(sg_pipeline pip_id) { _sg_validate_begin(); // the pipeline object must be alive and valid _SG_VALIDATE(pip_id.id != SG_INVALID_ID, VALIDATE_APIP_PIPELINE_VALID_ID); - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); _SG_VALIDATE(pip != 0, VALIDATE_APIP_PIPELINE_EXISTS); if (!pip) { return _sg_validate_end(); @@ -19695,7 +19692,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_pipeline(sg_pipeline pip_id) { if (shd->cmn.storage_images[i].stage != SG_SHADERSTAGE_NONE) { _SG_VALIDATE(atts->cmn.storages[i].image_id.id != SG_INVALID_ID, VALIDATE_APIP_EXPECTED_STORAGE_ATTACHMENT_IMAGE); if (atts->cmn.storages[i].image_id.id != SG_INVALID_ID) { - const _sg_image_t* att_simg = _sg_lookup_image(&_sg.pools, atts->cmn.storages[i].image_id.id); + const _sg_image_t* att_simg = _sg_lookup_image(atts->cmn.storages[i].image_id.id); _SG_VALIDATE(att_simg && att_simg == _sg_attachments_storage_image(atts, i), VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_EXISTS); if (att_simg) { _SG_VALIDATE(att_simg->slot.state == SG_RESOURCESTATE_VALID, VALIDATE_APIP_STORAGE_ATTACHMENT_IMAGE_VALID); @@ -19768,7 +19765,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { // a pipeline object must have been applied _SG_VALIDATE(_sg.cur_pipeline.id != SG_INVALID_ID, VALIDATE_ABND_PIPELINE); - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, _sg.cur_pipeline.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(_sg.cur_pipeline.id); _SG_VALIDATE(pip != 0, VALIDATE_ABND_PIPELINE_EXISTS); if (!pip) { return _sg_validate_end(); @@ -19788,7 +19785,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { _SG_VALIDATE(bindings->vertex_buffers[i].id != SG_INVALID_ID, VALIDATE_ABND_EXPECTED_VB); // buffers in vertex-buffer-slots must have vertex buffer usage if (bindings->vertex_buffers[i].id != SG_INVALID_ID) { - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, bindings->vertex_buffers[i].id); + const _sg_buffer_t* buf = _sg_lookup_buffer(bindings->vertex_buffers[i].id); _SG_VALIDATE(buf != 0, VALIDATE_ABND_VB_EXISTS); if (buf && buf->slot.state == SG_RESOURCESTATE_VALID) { _SG_VALIDATE(buf->cmn.usage.vertex_buffer, VALIDATE_ABND_VB_TYPE); @@ -19812,7 +19809,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { } if (bindings->index_buffer.id != SG_INVALID_ID) { // buffer in index-buffer-slot must have index buffer usage - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, bindings->index_buffer.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(bindings->index_buffer.id); _SG_VALIDATE(buf != 0, VALIDATE_ABND_IB_EXISTS); if (buf && buf->slot.state == SG_RESOURCESTATE_VALID) { _SG_VALIDATE(buf->cmn.usage.index_buffer, VALIDATE_ABND_IB_TYPE); @@ -19826,7 +19823,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { if (shd->cmn.images[i].stage != SG_SHADERSTAGE_NONE) { _SG_VALIDATE(bindings->images[i].id != SG_INVALID_ID, VALIDATE_ABND_EXPECTED_IMAGE_BINDING); if (bindings->images[i].id != SG_INVALID_ID) { - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, bindings->images[i].id); + const _sg_image_t* img = _sg_lookup_image(bindings->images[i].id); _SG_VALIDATE(img != 0, VALIDATE_ABND_IMG_EXISTS); if (img && img->slot.state == SG_RESOURCESTATE_VALID) { _SG_VALIDATE(img->cmn.type == shd->cmn.images[i].image_type, VALIDATE_ABND_IMAGE_TYPE_MISMATCH); @@ -19857,7 +19854,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { if (shd->cmn.samplers[i].stage != SG_SHADERSTAGE_NONE) { _SG_VALIDATE(bindings->samplers[i].id != SG_INVALID_ID, VALIDATE_ABND_EXPECTED_SAMPLER_BINDING); if (bindings->samplers[i].id != SG_INVALID_ID) { - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, bindings->samplers[i].id); + const _sg_sampler_t* smp = _sg_lookup_sampler(bindings->samplers[i].id); _SG_VALIDATE(smp != 0, VALIDATE_ABND_SMP_EXISTS); if (smp) { if (shd->cmn.samplers[i].sampler_type == SG_SAMPLERTYPE_COMPARISON) { @@ -19881,7 +19878,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_bindings(const sg_bindings* bindings) { if (shd->cmn.storage_buffers[i].stage != SG_SHADERSTAGE_NONE) { _SG_VALIDATE(bindings->storage_buffers[i].id != SG_INVALID_ID, VALIDATE_ABND_EXPECTED_STORAGEBUFFER_BINDING); if (bindings->storage_buffers[i].id != SG_INVALID_ID) { - const _sg_buffer_t* sbuf = _sg_lookup_buffer(&_sg.pools, bindings->storage_buffers[i].id); + const _sg_buffer_t* sbuf = _sg_lookup_buffer(bindings->storage_buffers[i].id); _SG_VALIDATE(sbuf != 0, VALIDATE_ABND_STORAGEBUFFER_EXISTS); if (sbuf) { _SG_VALIDATE(sbuf->cmn.usage.storage_buffer, VALIDATE_ABND_STORAGEBUFFER_BINDING_BUFFERTYPE); @@ -19931,7 +19928,7 @@ _SOKOL_PRIVATE bool _sg_validate_apply_uniforms(int ub_slot, const sg_range* dat _sg_validate_begin(); _SG_VALIDATE(_sg.cur_pass.in_pass, VALIDATE_AU_PASS_EXPECTED); _SG_VALIDATE(_sg.cur_pipeline.id != SG_INVALID_ID, VALIDATE_AU_NO_PIPELINE); - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, _sg.cur_pipeline.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(_sg.cur_pipeline.id); SOKOL_ASSERT(pip && (pip->slot.id == _sg.cur_pipeline.id)); SOKOL_ASSERT(pip->shader && (pip->shader->slot.id == pip->cmn.shader_id.id)); @@ -20424,7 +20421,7 @@ _SOKOL_PRIVATE void _sg_init_pipeline(_sg_pipeline_t* pip, const sg_pipeline_des SOKOL_ASSERT(pip && (pip->slot.state == SG_RESOURCESTATE_ALLOC)); SOKOL_ASSERT(desc); if (_sg_validate_pipeline_desc(desc)) { - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, desc->shader.id); + _sg_shader_t* shd = _sg_lookup_shader(desc->shader.id); if (shd && (shd->slot.state == SG_RESOURCESTATE_VALID)) { _sg_pipeline_common_init(&pip->cmn, desc); pip->slot.state = _sg_create_pipeline(pip, shd, desc); @@ -20450,7 +20447,7 @@ _SOKOL_PRIVATE void _sg_init_attachments(_sg_attachments_t* atts, const sg_attac int height = 0; for (size_t i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { if (desc->colors[i].image.id) { - _sg_image_t* img = _sg_lookup_image(&_sg.pools, desc->colors[i].image.id); + _sg_image_t* img = _sg_lookup_image(desc->colors[i].image.id); if (!(img && img->slot.state == SG_RESOURCESTATE_VALID)) { atts->slot.state = SG_RESOURCESTATE_FAILED; return; @@ -20461,7 +20458,7 @@ _SOKOL_PRIVATE void _sg_init_attachments(_sg_attachments_t* atts, const sg_attac atts_ptrs.color_images[i] = img; } if (desc->resolves[i].image.id) { - _sg_image_t* img = _sg_lookup_image(&_sg.pools, desc->resolves[i].image.id); + _sg_image_t* img = _sg_lookup_image(desc->resolves[i].image.id); if (!(img && img->slot.state == SG_RESOURCESTATE_VALID)) { atts->slot.state = SG_RESOURCESTATE_FAILED; return; @@ -20470,7 +20467,7 @@ _SOKOL_PRIVATE void _sg_init_attachments(_sg_attachments_t* atts, const sg_attac } } if (desc->depth_stencil.image.id) { - _sg_image_t* img = _sg_lookup_image(&_sg.pools, desc->depth_stencil.image.id); + _sg_image_t* img = _sg_lookup_image(desc->depth_stencil.image.id); if (!(img && img->slot.state == SG_RESOURCESTATE_VALID)) { atts->slot.state = SG_RESOURCESTATE_FAILED; return; @@ -20482,7 +20479,7 @@ _SOKOL_PRIVATE void _sg_init_attachments(_sg_attachments_t* atts, const sg_attac } for (size_t i = 0; i < SG_MAX_STORAGE_ATTACHMENTS; i++) { if (desc->storages[i].image.id) { - _sg_image_t* img = _sg_lookup_image(&_sg.pools, desc->storages[i].image.id); + _sg_image_t* img = _sg_lookup_image(desc->storages[i].image.id); if (!(img && img->slot.state == SG_RESOURCESTATE_VALID)) { atts->slot.state = SG_RESOURCESTATE_FAILED; return; @@ -20831,7 +20828,7 @@ SOKOL_API_IMPL sg_attachments sg_alloc_attachments(void) { SOKOL_API_IMPL void sg_dealloc_buffer(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { if (buf->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_dealloc_buffer(buf); @@ -20844,7 +20841,7 @@ SOKOL_API_IMPL void sg_dealloc_buffer(sg_buffer buf_id) { SOKOL_API_IMPL void sg_dealloc_image(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { if (img->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_dealloc_image(img); @@ -20857,7 +20854,7 @@ SOKOL_API_IMPL void sg_dealloc_image(sg_image img_id) { SOKOL_API_IMPL void sg_dealloc_sampler(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); - _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { if (smp->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_dealloc_sampler(smp); @@ -20870,7 +20867,7 @@ SOKOL_API_IMPL void sg_dealloc_sampler(sg_sampler smp_id) { SOKOL_API_IMPL void sg_dealloc_shader(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { if (shd->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_dealloc_shader(shd); @@ -20883,7 +20880,7 @@ SOKOL_API_IMPL void sg_dealloc_shader(sg_shader shd_id) { SOKOL_API_IMPL void sg_dealloc_pipeline(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { if (pip->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_dealloc_pipeline(pip); @@ -20896,7 +20893,7 @@ SOKOL_API_IMPL void sg_dealloc_pipeline(sg_pipeline pip_id) { SOKOL_API_IMPL void sg_dealloc_attachments(sg_attachments atts_id) { SOKOL_ASSERT(_sg.valid); - _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { if (atts->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_dealloc_attachments(atts); @@ -20910,7 +20907,7 @@ SOKOL_API_IMPL void sg_dealloc_attachments(sg_attachments atts_id) { SOKOL_API_IMPL void sg_init_buffer(sg_buffer buf_id, const sg_buffer_desc* desc) { SOKOL_ASSERT(_sg.valid); sg_buffer_desc desc_def = _sg_buffer_desc_defaults(desc); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { if (buf->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_init_buffer(buf, &desc_def); @@ -20925,7 +20922,7 @@ SOKOL_API_IMPL void sg_init_buffer(sg_buffer buf_id, const sg_buffer_desc* desc) SOKOL_API_IMPL void sg_init_image(sg_image img_id, const sg_image_desc* desc) { SOKOL_ASSERT(_sg.valid); sg_image_desc desc_def = _sg_image_desc_defaults(desc); - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { if (img->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_init_image(img, &desc_def); @@ -20940,7 +20937,7 @@ SOKOL_API_IMPL void sg_init_image(sg_image img_id, const sg_image_desc* desc) { SOKOL_API_IMPL void sg_init_sampler(sg_sampler smp_id, const sg_sampler_desc* desc) { SOKOL_ASSERT(_sg.valid); sg_sampler_desc desc_def = _sg_sampler_desc_defaults(desc); - _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { if (smp->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_init_sampler(smp, &desc_def); @@ -20955,7 +20952,7 @@ SOKOL_API_IMPL void sg_init_sampler(sg_sampler smp_id, const sg_sampler_desc* de SOKOL_API_IMPL void sg_init_shader(sg_shader shd_id, const sg_shader_desc* desc) { SOKOL_ASSERT(_sg.valid); sg_shader_desc desc_def = _sg_shader_desc_defaults(desc); - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { if (shd->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_init_shader(shd, &desc_def); @@ -20970,7 +20967,7 @@ SOKOL_API_IMPL void sg_init_shader(sg_shader shd_id, const sg_shader_desc* desc) SOKOL_API_IMPL void sg_init_pipeline(sg_pipeline pip_id, const sg_pipeline_desc* desc) { SOKOL_ASSERT(_sg.valid); sg_pipeline_desc desc_def = _sg_pipeline_desc_defaults(desc); - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { if (pip->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_init_pipeline(pip, &desc_def); @@ -20985,7 +20982,7 @@ SOKOL_API_IMPL void sg_init_pipeline(sg_pipeline pip_id, const sg_pipeline_desc* SOKOL_API_IMPL void sg_init_attachments(sg_attachments atts_id, const sg_attachments_desc* desc) { SOKOL_ASSERT(_sg.valid); sg_attachments_desc desc_def = _sg_attachments_desc_defaults(desc); - _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { if (atts->slot.state == SG_RESOURCESTATE_ALLOC) { _sg_init_attachments(atts, &desc_def); @@ -20999,7 +20996,7 @@ SOKOL_API_IMPL void sg_init_attachments(sg_attachments atts_id, const sg_attachm SOKOL_API_IMPL void sg_uninit_buffer(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { if ((buf->slot.state == SG_RESOURCESTATE_VALID) || (buf->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_buffer(buf); @@ -21013,7 +21010,7 @@ SOKOL_API_IMPL void sg_uninit_buffer(sg_buffer buf_id) { SOKOL_API_IMPL void sg_uninit_image(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { if ((img->slot.state == SG_RESOURCESTATE_VALID) || (img->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_image(img); @@ -21027,7 +21024,7 @@ SOKOL_API_IMPL void sg_uninit_image(sg_image img_id) { SOKOL_API_IMPL void sg_uninit_sampler(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); - _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { if ((smp->slot.state == SG_RESOURCESTATE_VALID) || (smp->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_sampler(smp); @@ -21041,7 +21038,7 @@ SOKOL_API_IMPL void sg_uninit_sampler(sg_sampler smp_id) { SOKOL_API_IMPL void sg_uninit_shader(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { if ((shd->slot.state == SG_RESOURCESTATE_VALID) || (shd->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_shader(shd); @@ -21055,7 +21052,7 @@ SOKOL_API_IMPL void sg_uninit_shader(sg_shader shd_id) { SOKOL_API_IMPL void sg_uninit_pipeline(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { if ((pip->slot.state == SG_RESOURCESTATE_VALID) || (pip->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_pipeline(pip); @@ -21069,7 +21066,7 @@ SOKOL_API_IMPL void sg_uninit_pipeline(sg_pipeline pip_id) { SOKOL_API_IMPL void sg_uninit_attachments(sg_attachments atts_id) { SOKOL_ASSERT(_sg.valid); - _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { if ((atts->slot.state == SG_RESOURCESTATE_VALID) || (atts->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_attachments(atts); @@ -21083,7 +21080,7 @@ SOKOL_API_IMPL void sg_uninit_attachments(sg_attachments atts_id) { SOKOL_API_IMPL void sg_fail_buffer(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { if (buf->slot.state == SG_RESOURCESTATE_ALLOC) { buf->slot.state = SG_RESOURCESTATE_FAILED; @@ -21096,7 +21093,7 @@ SOKOL_API_IMPL void sg_fail_buffer(sg_buffer buf_id) { SOKOL_API_IMPL void sg_fail_image(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { if (img->slot.state == SG_RESOURCESTATE_ALLOC) { img->slot.state = SG_RESOURCESTATE_FAILED; @@ -21109,7 +21106,7 @@ SOKOL_API_IMPL void sg_fail_image(sg_image img_id) { SOKOL_API_IMPL void sg_fail_sampler(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); - _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { if (smp->slot.state == SG_RESOURCESTATE_ALLOC) { smp->slot.state = SG_RESOURCESTATE_FAILED; @@ -21122,7 +21119,7 @@ SOKOL_API_IMPL void sg_fail_sampler(sg_sampler smp_id) { SOKOL_API_IMPL void sg_fail_shader(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { if (shd->slot.state == SG_RESOURCESTATE_ALLOC) { shd->slot.state = SG_RESOURCESTATE_FAILED; @@ -21135,7 +21132,7 @@ SOKOL_API_IMPL void sg_fail_shader(sg_shader shd_id) { SOKOL_API_IMPL void sg_fail_pipeline(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { if (pip->slot.state == SG_RESOURCESTATE_ALLOC) { pip->slot.state = SG_RESOURCESTATE_FAILED; @@ -21148,7 +21145,7 @@ SOKOL_API_IMPL void sg_fail_pipeline(sg_pipeline pip_id) { SOKOL_API_IMPL void sg_fail_attachments(sg_attachments atts_id) { SOKOL_ASSERT(_sg.valid); - _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { if (atts->slot.state == SG_RESOURCESTATE_ALLOC) { atts->slot.state = SG_RESOURCESTATE_FAILED; @@ -21161,42 +21158,42 @@ SOKOL_API_IMPL void sg_fail_attachments(sg_attachments atts_id) { SOKOL_API_IMPL sg_resource_state sg_query_buffer_state(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); sg_resource_state res = buf ? buf->slot.state : SG_RESOURCESTATE_INVALID; return res; } SOKOL_API_IMPL sg_resource_state sg_query_image_state(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); sg_resource_state res = img ? img->slot.state : SG_RESOURCESTATE_INVALID; return res; } SOKOL_API_IMPL sg_resource_state sg_query_sampler_state(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); - _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); sg_resource_state res = smp ? smp->slot.state : SG_RESOURCESTATE_INVALID; return res; } SOKOL_API_IMPL sg_resource_state sg_query_shader_state(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); sg_resource_state res = shd ? shd->slot.state : SG_RESOURCESTATE_INVALID; return res; } SOKOL_API_IMPL sg_resource_state sg_query_pipeline_state(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); sg_resource_state res = pip ? pip->slot.state : SG_RESOURCESTATE_INVALID; return res; } SOKOL_API_IMPL sg_resource_state sg_query_attachments_state(sg_attachments atts_id) { SOKOL_ASSERT(_sg.valid); - _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); sg_resource_state res = atts ? atts->slot.state : SG_RESOURCESTATE_INVALID; return res; } @@ -21294,7 +21291,7 @@ SOKOL_API_IMPL sg_attachments sg_make_attachments(const sg_attachments_desc* des SOKOL_API_IMPL void sg_destroy_buffer(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); _SG_TRACE_ARGS(destroy_buffer, buf_id); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { if ((buf->slot.state == SG_RESOURCESTATE_VALID) || (buf->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_buffer(buf); @@ -21310,7 +21307,7 @@ SOKOL_API_IMPL void sg_destroy_buffer(sg_buffer buf_id) { SOKOL_API_IMPL void sg_destroy_image(sg_image img_id) { SOKOL_ASSERT(_sg.valid); _SG_TRACE_ARGS(destroy_image, img_id); - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { if ((img->slot.state == SG_RESOURCESTATE_VALID) || (img->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_image(img); @@ -21326,7 +21323,7 @@ SOKOL_API_IMPL void sg_destroy_image(sg_image img_id) { SOKOL_API_IMPL void sg_destroy_sampler(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); _SG_TRACE_ARGS(destroy_sampler, smp_id); - _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { if ((smp->slot.state == SG_RESOURCESTATE_VALID) || (smp->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_sampler(smp); @@ -21342,7 +21339,7 @@ SOKOL_API_IMPL void sg_destroy_sampler(sg_sampler smp_id) { SOKOL_API_IMPL void sg_destroy_shader(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); _SG_TRACE_ARGS(destroy_shader, shd_id); - _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { if ((shd->slot.state == SG_RESOURCESTATE_VALID) || (shd->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_shader(shd); @@ -21358,7 +21355,7 @@ SOKOL_API_IMPL void sg_destroy_shader(sg_shader shd_id) { SOKOL_API_IMPL void sg_destroy_pipeline(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); _SG_TRACE_ARGS(destroy_pipeline, pip_id); - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { if ((pip->slot.state == SG_RESOURCESTATE_VALID) || (pip->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_pipeline(pip); @@ -21374,7 +21371,7 @@ SOKOL_API_IMPL void sg_destroy_pipeline(sg_pipeline pip_id) { SOKOL_API_IMPL void sg_destroy_attachments(sg_attachments atts_id) { SOKOL_ASSERT(_sg.valid); _SG_TRACE_ARGS(destroy_attachments, atts_id); - _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { if ((atts->slot.state == SG_RESOURCESTATE_VALID) || (atts->slot.state == SG_RESOURCESTATE_FAILED)) { _sg_uninit_attachments(atts); @@ -21399,7 +21396,7 @@ SOKOL_API_IMPL void sg_begin_pass(const sg_pass* pass) { return; } if (pass_def.attachments.id != SG_INVALID_ID) { - _sg.cur_pass.atts = _sg_lookup_attachments(&_sg.pools, pass_def.attachments.id); + _sg.cur_pass.atts = _sg_lookup_attachments(pass_def.attachments.id); if (0 == _sg.cur_pass.atts) { _SG_ERROR(BEGINPASS_ATTACHMENT_INVALID); return; @@ -21475,7 +21472,7 @@ SOKOL_API_IMPL void sg_apply_pipeline(sg_pipeline pip_id) { return; } _sg.cur_pipeline = pip_id; - _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); SOKOL_ASSERT(pip); _sg.next_draw_valid = (SG_RESOURCESTATE_VALID == pip->slot.state); @@ -21512,7 +21509,7 @@ SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { _sg_bindings_ptrs_t bnd; _sg_clear(&bnd, sizeof(bnd)); - bnd.pip = _sg_lookup_pipeline(&_sg.pools, _sg.cur_pipeline.id); + bnd.pip = _sg_lookup_pipeline(_sg.cur_pipeline.id); if (0 == bnd.pip) { _sg.next_draw_valid = false; } @@ -21523,7 +21520,7 @@ SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { for (size_t i = 0; i < SG_MAX_VERTEXBUFFER_BINDSLOTS; i++) { if (bnd.pip->cmn.vertex_buffer_layout_active[i]) { SOKOL_ASSERT(bindings->vertex_buffers[i].id != SG_INVALID_ID); - bnd.vbs[i] = _sg_lookup_buffer(&_sg.pools, bindings->vertex_buffers[i].id); + bnd.vbs[i] = _sg_lookup_buffer(bindings->vertex_buffers[i].id); bnd.vb_offsets[i] = bindings->vertex_buffer_offsets[i]; if (bnd.vbs[i]) { _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == bnd.vbs[i]->slot.state); @@ -21534,7 +21531,7 @@ SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { } } if (bindings->index_buffer.id) { - bnd.ib = _sg_lookup_buffer(&_sg.pools, bindings->index_buffer.id); + bnd.ib = _sg_lookup_buffer(bindings->index_buffer.id); bnd.ib_offset = bindings->index_buffer_offset; if (bnd.ib) { _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == bnd.ib->slot.state); @@ -21548,7 +21545,7 @@ SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { for (int i = 0; i < SG_MAX_IMAGE_BINDSLOTS; i++) { if (shd->cmn.images[i].stage != SG_SHADERSTAGE_NONE) { SOKOL_ASSERT(bindings->images[i].id != SG_INVALID_ID); - bnd.imgs[i] = _sg_lookup_image(&_sg.pools, bindings->images[i].id); + bnd.imgs[i] = _sg_lookup_image(bindings->images[i].id); if (bnd.imgs[i]) { _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == bnd.imgs[i]->slot.state); } else { @@ -21560,7 +21557,7 @@ SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { for (size_t i = 0; i < SG_MAX_SAMPLER_BINDSLOTS; i++) { if (shd->cmn.samplers[i].stage != SG_SHADERSTAGE_NONE) { SOKOL_ASSERT(bindings->samplers[i].id != SG_INVALID_ID); - bnd.smps[i] = _sg_lookup_sampler(&_sg.pools, bindings->samplers[i].id); + bnd.smps[i] = _sg_lookup_sampler(bindings->samplers[i].id); if (bnd.smps[i]) { _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == bnd.smps[i]->slot.state); } else { @@ -21572,7 +21569,7 @@ SOKOL_API_IMPL void sg_apply_bindings(const sg_bindings* bindings) { for (size_t i = 0; i < SG_MAX_STORAGEBUFFER_BINDSLOTS; i++) { if (shd->cmn.storage_buffers[i].stage != SG_SHADERSTAGE_NONE) { SOKOL_ASSERT(bindings->storage_buffers[i].id != SG_INVALID_ID); - bnd.sbufs[i] = _sg_lookup_buffer(&_sg.pools, bindings->storage_buffers[i].id); + bnd.sbufs[i] = _sg_lookup_buffer(bindings->storage_buffers[i].id); if (bnd.sbufs[i]) { _sg.next_draw_valid &= (SG_RESOURCESTATE_VALID == bnd.sbufs[i]->slot.state); if (_sg.cur_pass.is_compute) { @@ -21693,7 +21690,7 @@ SOKOL_API_IMPL void sg_update_buffer(sg_buffer buf_id, const sg_range* data) { SOKOL_ASSERT(data && data->ptr && (data->size > 0)); _sg_stats_add(num_update_buffer, 1); _sg_stats_add(size_update_buffer, (uint32_t)data->size); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if ((data->size > 0) && buf && (buf->slot.state == SG_RESOURCESTATE_VALID)) { if (_sg_validate_update_buffer(buf, data)) { SOKOL_ASSERT(data->size <= (size_t)buf->cmn.size); @@ -21713,7 +21710,7 @@ SOKOL_API_IMPL int sg_append_buffer(sg_buffer buf_id, const sg_range* data) { SOKOL_ASSERT(data && data->ptr); _sg_stats_add(num_append_buffer, 1); _sg_stats_add(size_append_buffer, (uint32_t)data->size); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); int result; if (buf) { // rewind append cursor in a new frame @@ -21750,14 +21747,14 @@ SOKOL_API_IMPL int sg_append_buffer(sg_buffer buf_id, const sg_range* data) { SOKOL_API_IMPL bool sg_query_buffer_overflow(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); bool result = buf ? buf->cmn.append_overflow : false; return result; } SOKOL_API_IMPL bool sg_query_buffer_will_overflow(sg_buffer buf_id, size_t size) { SOKOL_ASSERT(_sg.valid); - _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); bool result = false; if (buf) { int append_pos = buf->cmn.append_pos; @@ -21783,7 +21780,7 @@ SOKOL_API_IMPL void sg_update_image(sg_image img_id, const sg_image_data* data) _sg_stats_add(size_update_image, (uint32_t)data->subimage[face_index][mip_index].size); } } - _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + _sg_image_t* img = _sg_lookup_image(img_id.id); if (img && img->slot.state == SG_RESOURCESTATE_VALID) { if (_sg_validate_update_image(img, data)) { SOKOL_ASSERT(img->cmn.upd_frame_index != _sg.frame_index); @@ -21835,7 +21832,7 @@ SOKOL_API_IMPL sg_buffer_info sg_query_buffer_info(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); sg_buffer_info info; _sg_clear(&info, sizeof(info)); - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { info.slot.state = buf->slot.state; info.slot.res_id = buf->slot.id; @@ -21859,7 +21856,7 @@ SOKOL_API_IMPL sg_image_info sg_query_image_info(sg_image img_id) { SOKOL_ASSERT(_sg.valid); sg_image_info info; _sg_clear(&info, sizeof(info)); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { info.slot.state = img->slot.state; info.slot.res_id = img->slot.id; @@ -21880,7 +21877,7 @@ SOKOL_API_IMPL sg_sampler_info sg_query_sampler_info(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); sg_sampler_info info; _sg_clear(&info, sizeof(info)); - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + const _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { info.slot.state = smp->slot.state; info.slot.res_id = smp->slot.id; @@ -21893,7 +21890,7 @@ SOKOL_API_IMPL sg_shader_info sg_query_shader_info(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); sg_shader_info info; _sg_clear(&info, sizeof(info)); - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + const _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { info.slot.state = shd->slot.state; info.slot.res_id = shd->slot.id; @@ -21906,7 +21903,7 @@ SOKOL_API_IMPL sg_pipeline_info sg_query_pipeline_info(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); sg_pipeline_info info; _sg_clear(&info, sizeof(info)); - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { info.slot.state = pip->slot.state; info.slot.res_id = pip->slot.id; @@ -21919,7 +21916,7 @@ SOKOL_API_IMPL sg_attachments_info sg_query_attachments_info(sg_attachments atts SOKOL_ASSERT(_sg.valid); sg_attachments_info info; _sg_clear(&info, sizeof(info)); - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { info.slot.state = atts->slot.state; info.slot.res_id = atts->slot.id; @@ -21932,7 +21929,7 @@ SOKOL_API_IMPL sg_buffer_desc sg_query_buffer_desc(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); sg_buffer_desc desc; _sg_clear(&desc, sizeof(desc)); - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { desc.size = (size_t)buf->cmn.size; desc.usage = buf->cmn.usage; @@ -21942,7 +21939,7 @@ SOKOL_API_IMPL sg_buffer_desc sg_query_buffer_desc(sg_buffer buf_id) { SOKOL_API_IMPL size_t sg_query_buffer_size(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { return (size_t)buf->cmn.size; } @@ -21953,7 +21950,7 @@ SOKOL_API_IMPL sg_buffer_usage sg_query_buffer_usage(sg_buffer buf_id) { SOKOL_ASSERT(_sg.valid); sg_buffer_usage usg; _sg_clear(&usg, sizeof(usg)); - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { usg = buf->cmn.usage; } @@ -21964,7 +21961,7 @@ SOKOL_API_IMPL sg_image_desc sg_query_image_desc(sg_image img_id) { SOKOL_ASSERT(_sg.valid); sg_image_desc desc; _sg_clear(&desc, sizeof(desc)); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { desc.type = img->cmn.type; desc.width = img->cmn.width; @@ -21980,7 +21977,7 @@ SOKOL_API_IMPL sg_image_desc sg_query_image_desc(sg_image img_id) { SOKOL_API_IMPL sg_image_type sg_query_image_type(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.type; } @@ -21989,7 +21986,7 @@ SOKOL_API_IMPL sg_image_type sg_query_image_type(sg_image img_id) { SOKOL_API_IMPL int sg_query_image_width(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.width; } @@ -21998,7 +21995,7 @@ SOKOL_API_IMPL int sg_query_image_width(sg_image img_id) { SOKOL_API_IMPL int sg_query_image_height(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.height; } @@ -22007,7 +22004,7 @@ SOKOL_API_IMPL int sg_query_image_height(sg_image img_id) { SOKOL_API_IMPL int sg_query_image_num_slices(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.num_slices; } @@ -22016,7 +22013,7 @@ SOKOL_API_IMPL int sg_query_image_num_slices(sg_image img_id) { SOKOL_API_IMPL int sg_query_image_num_mipmaps(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.num_mipmaps; } @@ -22025,7 +22022,7 @@ SOKOL_API_IMPL int sg_query_image_num_mipmaps(sg_image img_id) { SOKOL_API_IMPL sg_pixel_format sg_query_image_pixelformat(sg_image img_id) { SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.pixel_format; } @@ -22036,7 +22033,7 @@ SOKOL_API_IMPL sg_image_usage sg_query_image_usage(sg_image img_id) { SOKOL_ASSERT(_sg.valid); sg_image_usage usg; _sg_clear(&usg, sizeof(usg)); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { usg = img->cmn.usage; } @@ -22046,7 +22043,7 @@ SOKOL_API_IMPL sg_image_usage sg_query_image_usage(sg_image img_id) { SOKOL_API_IMPL int sg_query_image_sample_count(sg_image img_id) { SOKOL_ASSERT(_sg.valid); SOKOL_ASSERT(_sg.valid); - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { return img->cmn.sample_count; } @@ -22057,7 +22054,7 @@ SOKOL_API_IMPL sg_sampler_desc sg_query_sampler_desc(sg_sampler smp_id) { SOKOL_ASSERT(_sg.valid); sg_sampler_desc desc; _sg_clear(&desc, sizeof(desc)); - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + const _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { desc.min_filter = smp->cmn.min_filter; desc.mag_filter = smp->cmn.mag_filter; @@ -22078,7 +22075,7 @@ SOKOL_API_IMPL sg_shader_desc sg_query_shader_desc(sg_shader shd_id) { SOKOL_ASSERT(_sg.valid); sg_shader_desc desc; _sg_clear(&desc, sizeof(desc)); - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + const _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { for (size_t ub_idx = 0; ub_idx < SG_MAX_UNIFORMBLOCK_BINDSLOTS; ub_idx++) { sg_shader_uniform_block* ub_desc = &desc.uniform_blocks[ub_idx]; @@ -22129,7 +22126,7 @@ SOKOL_API_IMPL sg_pipeline_desc sg_query_pipeline_desc(sg_pipeline pip_id) { SOKOL_ASSERT(_sg.valid); sg_pipeline_desc desc; _sg_clear(&desc, sizeof(desc)); - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { desc.compute = pip->cmn.is_compute; desc.shader = pip->cmn.shader_id; @@ -22155,7 +22152,7 @@ SOKOL_API_IMPL sg_attachments_desc sg_query_attachments_desc(sg_attachments atts SOKOL_ASSERT(_sg.valid); sg_attachments_desc desc; _sg_clear(&desc, sizeof(desc)); - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { for (int i = 0; i < atts->cmn.num_colors; i++) { desc.colors[i].image = atts->cmn.colors[i].image_id; @@ -22220,7 +22217,7 @@ SOKOL_API_IMPL sg_d3d11_buffer_info sg_d3d11_query_buffer_info(sg_buffer buf_id) sg_d3d11_buffer_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_D3D11) - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { res.buf = (const void*) buf->d3d11.buf; } @@ -22235,7 +22232,7 @@ SOKOL_API_IMPL sg_d3d11_image_info sg_d3d11_query_image_info(sg_image img_id) { sg_d3d11_image_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_D3D11) - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { res.tex2d = (const void*) img->d3d11.tex2d; res.tex3d = (const void*) img->d3d11.tex3d; @@ -22253,7 +22250,7 @@ SOKOL_API_IMPL sg_d3d11_sampler_info sg_d3d11_query_sampler_info(sg_sampler smp_ sg_d3d11_sampler_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_D3D11) - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + const _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { res.smp = (const void*) smp->d3d11.smp; } @@ -22268,7 +22265,7 @@ SOKOL_API_IMPL sg_d3d11_shader_info sg_d3d11_query_shader_info(sg_shader shd_id) sg_d3d11_shader_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_D3D11) - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + const _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { for (size_t i = 0; i < SG_MAX_UNIFORMBLOCK_BINDSLOTS; i++) { res.cbufs[i] = (const void*) shd->d3d11.all_cbufs[i]; @@ -22287,7 +22284,7 @@ SOKOL_API_IMPL sg_d3d11_pipeline_info sg_d3d11_query_pipeline_info(sg_pipeline p sg_d3d11_pipeline_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_D3D11) - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { res.il = (const void*) pip->d3d11.il; res.rs = (const void*) pip->d3d11.rs; @@ -22305,7 +22302,7 @@ SOKOL_API_IMPL sg_d3d11_attachments_info sg_d3d11_query_attachments_info(sg_atta sg_d3d11_attachments_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_D3D11) - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { res.color_rtv[i] = (const void*) atts->d3d11.colors[i].view.rtv; @@ -22360,7 +22357,7 @@ SOKOL_API_IMPL sg_mtl_buffer_info sg_mtl_query_buffer_info(sg_buffer buf_id) { sg_mtl_buffer_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_METAL) - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { if (buf->mtl.buf[i] != 0) { @@ -22380,7 +22377,7 @@ SOKOL_API_IMPL sg_mtl_image_info sg_mtl_query_image_info(sg_image img_id) { sg_mtl_image_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_METAL) - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { if (img->mtl.tex[i] != 0) { @@ -22400,7 +22397,7 @@ SOKOL_API_IMPL sg_mtl_sampler_info sg_mtl_query_sampler_info(sg_sampler smp_id) sg_mtl_sampler_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_METAL) - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + const _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { if (smp->mtl.sampler_state != 0) { res.smp = (__bridge void*) _sg_mtl_id(smp->mtl.sampler_state); @@ -22417,7 +22414,7 @@ SOKOL_API_IMPL sg_mtl_shader_info sg_mtl_query_shader_info(sg_shader shd_id) { sg_mtl_shader_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_METAL) - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + const _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { const int vertex_lib = shd->mtl.vertex_func.mtl_lib; const int vertex_func = shd->mtl.vertex_func.mtl_func; @@ -22447,7 +22444,7 @@ SOKOL_API_IMPL sg_mtl_pipeline_info sg_mtl_query_pipeline_info(sg_pipeline pip_i sg_mtl_pipeline_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_METAL) - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { if (pip->mtl.rps != 0) { res.rps = (__bridge void*) _sg_mtl_id(pip->mtl.rps); @@ -22507,7 +22504,7 @@ SOKOL_API_IMPL sg_wgpu_buffer_info sg_wgpu_query_buffer_info(sg_buffer buf_id) { sg_wgpu_buffer_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_WGPU) - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { res.buf = (const void*) buf->wgpu.buf; } @@ -22522,7 +22519,7 @@ SOKOL_API_IMPL sg_wgpu_image_info sg_wgpu_query_image_info(sg_image img_id) { sg_wgpu_image_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_WGPU) - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { res.tex = (const void*) img->wgpu.tex; res.view = (const void*) img->wgpu.view; @@ -22538,7 +22535,7 @@ SOKOL_API_IMPL sg_wgpu_sampler_info sg_wgpu_query_sampler_info(sg_sampler smp_id sg_wgpu_sampler_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_WGPU) - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + const _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { res.smp = (const void*) smp->wgpu.smp; } @@ -22553,7 +22550,7 @@ SOKOL_API_IMPL sg_wgpu_shader_info sg_wgpu_query_shader_info(sg_shader shd_id) { sg_wgpu_shader_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_WGPU) - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + const _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { res.vs_mod = (const void*) shd->wgpu.vertex_func.module; res.fs_mod = (const void*) shd->wgpu.fragment_func.module; @@ -22570,7 +22567,7 @@ SOKOL_API_IMPL sg_wgpu_pipeline_info sg_wgpu_query_pipeline_info(sg_pipeline pip sg_wgpu_pipeline_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_WGPU) - const _sg_pipeline_t* pip = _sg_lookup_pipeline(&_sg.pools, pip_id.id); + const _sg_pipeline_t* pip = _sg_lookup_pipeline(pip_id.id); if (pip) { res.render_pipeline = (const void*) pip->wgpu.rpip; res.compute_pipeline = (const void*) pip->wgpu.cpip; @@ -22586,7 +22583,7 @@ SOKOL_API_IMPL sg_wgpu_attachments_info sg_wgpu_query_attachments_info(sg_attach sg_wgpu_attachments_info res; _sg_clear(&res, sizeof(res)); #if defined(SOKOL_WGPU) - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { res.color_view[i] = (const void*) atts->wgpu.colors[i].view; @@ -22605,7 +22602,7 @@ SOKOL_API_IMPL sg_gl_buffer_info sg_gl_query_buffer_info(sg_buffer buf_id) { sg_gl_buffer_info res; _sg_clear(&res, sizeof(res)); #if defined(_SOKOL_ANY_GL) - const _sg_buffer_t* buf = _sg_lookup_buffer(&_sg.pools, buf_id.id); + const _sg_buffer_t* buf = _sg_lookup_buffer(buf_id.id); if (buf) { for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { res.buf[i] = buf->gl.buf[i]; @@ -22623,7 +22620,7 @@ SOKOL_API_IMPL sg_gl_image_info sg_gl_query_image_info(sg_image img_id) { sg_gl_image_info res; _sg_clear(&res, sizeof(res)); #if defined(_SOKOL_ANY_GL) - const _sg_image_t* img = _sg_lookup_image(&_sg.pools, img_id.id); + const _sg_image_t* img = _sg_lookup_image(img_id.id); if (img) { for (int i = 0; i < SG_NUM_INFLIGHT_FRAMES; i++) { res.tex[i] = img->gl.tex[i]; @@ -22643,7 +22640,7 @@ SOKOL_API_IMPL sg_gl_sampler_info sg_gl_query_sampler_info(sg_sampler smp_id) { sg_gl_sampler_info res; _sg_clear(&res, sizeof(res)); #if defined(_SOKOL_ANY_GL) - const _sg_sampler_t* smp = _sg_lookup_sampler(&_sg.pools, smp_id.id); + const _sg_sampler_t* smp = _sg_lookup_sampler(smp_id.id); if (smp) { res.smp = smp->gl.smp; } @@ -22658,7 +22655,7 @@ SOKOL_API_IMPL sg_gl_shader_info sg_gl_query_shader_info(sg_shader shd_id) { sg_gl_shader_info res; _sg_clear(&res, sizeof(res)); #if defined(_SOKOL_ANY_GL) - const _sg_shader_t* shd = _sg_lookup_shader(&_sg.pools, shd_id.id); + const _sg_shader_t* shd = _sg_lookup_shader(shd_id.id); if (shd) { res.prog = shd->gl.prog; } @@ -22673,7 +22670,7 @@ SOKOL_API_IMPL sg_gl_attachments_info sg_gl_query_attachments_info(sg_attachment sg_gl_attachments_info res; _sg_clear(&res, sizeof(res)); #if defined(_SOKOL_ANY_GL) - const _sg_attachments_t* atts = _sg_lookup_attachments(&_sg.pools, atts_id.id); + const _sg_attachments_t* atts = _sg_lookup_attachments(atts_id.id); if (atts) { res.framebuffer = atts->gl.fb; for (int i = 0; i < SG_MAX_COLOR_ATTACHMENTS; i++) { |