KhronosGroup / SPIRV-Cross

SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
Apache License 2.0
2.03k stars 559 forks source link

MSL: how to query bind-point of `[image]_atomic` buffer? #2315

Closed Try closed 5 months ago

Try commented 5 months ago

Asking in context of image-atomics emulation.

In CompilerMSL class function both memebers atomic_image_vars_emulated and get_metal_resource_index are protected. For application it's required to have public api to check storage image for complementary _atomic binding.

HansKristian-Work commented 5 months ago
    // Same as get_automatic_msl_resource_binding, but should only be used for combined image samplers, in which case the
    // sampler's binding is returned instead. For any other resource type, -1 is returned.
    // Secondary bindings are also used for the auxillary image atomic buffer.
    uint32_t get_automatic_msl_resource_binding_secondary(uint32_t id) const;