mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
Update Slang, Vulkan, Gltf and ImGui. Offload natives to sub-packages.
Public-PR: https://github.com/ahwootech/BRUTAL/pull/9 Public-PR: https://github.com/ahwootech/BRUTAL/pull/15 Public-PR: https://github.com/ahwootech/BRUTAL/pull/21 Fixes: ahwootech/BRUTAL#8 Fixes: ahwootech/BRUTAL#22 Co-authored-by: Laurens de Voogd <laurens@devoogd.be> Co-authored-by: sGo7-Dev <goulax16@gmail.com> Co-authored-by: Capsup <capsup@live.dk>
This commit is contained in:
parent
a25cdf80b2
commit
4ac91e105e
1 changed files with 2034 additions and 318 deletions
20
Brutal.Slang/EntryPointLayoutExtensions.cs
Normal file
20
Brutal.Slang/EntryPointLayoutExtensions.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
namespace Brutal.SlangApi;
|
||||
|
||||
/// <summary>
|
||||
/// Hand-written helpers on entry-point reflection handles for flat-C getters that fill
|
||||
/// output arrays, which the generated signatures expose as raw pointers.
|
||||
/// </summary>
|
||||
public static unsafe class EntryPointLayoutExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a compute entry point's thread-group size, its <c>[numthreads]</c>, along
|
||||
/// X, Y and Z. The handle borrows from its program layout, so call this only while the
|
||||
/// component that produced the layout is alive.
|
||||
/// </summary>
|
||||
public static (ulong X, ulong Y, ulong Z) GetComputeThreadGroupSize(this EntryPointLayout entryPoint)
|
||||
{
|
||||
var sizes = stackalloc ulong[3];
|
||||
Slang.PInvoke.spReflectionEntryPoint_getComputeThreadGroupSize(entryPoint, 3, sizes);
|
||||
return (sizes[0], sizes[1], sizes[2]);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue