mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-27 21:48:25 +01:00
first
This commit is contained in:
parent
bd62d51ec9
commit
b578433e37
1 changed files with 784842 additions and 0 deletions
29
Brutal.ShaderC/Types/CompileOptions.cs
Normal file
29
Brutal.ShaderC/Types/CompileOptions.cs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
namespace Brutal.ShaderCApi;
|
||||
|
||||
/// <summary>
|
||||
/// An object that contains options for compiling shaders.
|
||||
/// </summary>
|
||||
public partial struct CompileOptions
|
||||
{
|
||||
/// <summary>Installs the built-in disk-based include resolver on this options instance.</summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Overwrites any include callbacks previously set on this instance (destructive replacement).
|
||||
/// The resolver reads the requested file from disk relative to the directory of the requesting
|
||||
/// source, so the source name passed to the compiler must be a real, accessible file path.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// This options instance must outlive any compilation that uses it; the native shaderc API
|
||||
/// holds a raw pointer to the callbacks for the duration of the compile.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public unsafe void SetDefaultIncludeCallbacks()
|
||||
{
|
||||
ShaderC.PInvoke.shaderc_compile_options_set_include_callbacks(
|
||||
this,
|
||||
new IncludeResolveFn(&ShaderC.Callbacks.Resolve),
|
||||
new IncludeResultReleaseFn(&ShaderC.Callbacks.Release),
|
||||
null
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue