namespace Brutal.ShaderCApi; /// /// A function-pointer wrapper for the shaderc include-resolve callback. /// /// /// /// Wraps the native shaderc_include_resolve_fn callback, whose C signature is: /// /// /// typedef shaderc_include_result* (*shaderc_include_resolve_fn)( /// void* user_data, /// const char* requested_source, /// int type, /// const char* requesting_source, /// size_t include_depth); /// /// The parameters, in order, are: /// /// user_data: opaque client context pointer passed through from the options. /// requested_source: NUL-terminated UTF-8 C string; the path being included. /// type: an value indicating relative vs. standard inclusion. /// requesting_source: NUL-terminated UTF-8 C string; the source file containing the #include. /// include_depth: nesting depth (1 = top-level include). /// /// /// Ownership. The callee allocates the returned and its /// buffers; shaderc calls the matching when it is done with the /// result. The result and its contents must remain valid until that release call. /// /// /// The full consumer-visible contract is documented on /// and . /// /// public readonly unsafe struct IncludeResolveFn( delegate* unmanaged[Cdecl] handle ) { /// The underlying unmanaged function pointer. public readonly delegate* unmanaged[Cdecl] Invoke = handle; } /// /// A function-pointer wrapper for the shaderc include-result release callback. /// /// /// /// Wraps the native shaderc_include_result_release_fn callback, whose C signature is: /// /// /// typedef void (*shaderc_include_result_release_fn)( /// void* user_data, /// shaderc_include_result* include_result); /// /// /// This callback is the matching deallocator for : it must free the /// and all buffers allocated by the resolver. Use the same /// allocator/deallocator pair; do not mix allocators between the resolve and release callbacks. /// /// /// The full consumer-visible contract is documented on /// and . /// /// public readonly unsafe struct IncludeResultReleaseFn(delegate* unmanaged[Cdecl] handle) { /// The underlying unmanaged function pointer. public readonly delegate* unmanaged[Cdecl] Invoke = handle; }