mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-04-22 15:28:46 -04:00
So far we only had a way to get the Color buffer of a render target, this lets us use the depth target as well in commandlists.
53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
namespace Sandbox.Rendering;
|
|
|
|
/// <summary>
|
|
/// A render target handle used with CommandLists
|
|
/// </summary>
|
|
public ref struct RenderTargetHandle
|
|
{
|
|
public string Name { get; internal set; }
|
|
|
|
/// <summary>
|
|
/// Reference to the color texture of this target
|
|
/// </summary>
|
|
public readonly ColorTextureRef ColorTexture => new ColorTextureRef { Name = Name };
|
|
|
|
/// <summary>
|
|
/// Reference to the depth texture of this target
|
|
/// </summary>
|
|
public readonly DepthTextureRef DepthTexture => new DepthTextureRef { Name = Name };
|
|
|
|
/// <summary>
|
|
/// Reference to the index of the color texture of this target
|
|
/// </summary>
|
|
public readonly ColorIndexRef ColorIndex => new ColorIndexRef { Name = Name };
|
|
|
|
/// <summary>
|
|
/// Reference to the size of the texture
|
|
/// </summary>
|
|
public readonly SizeHandle Size => new SizeHandle { Name = Name };
|
|
|
|
public ref struct ColorTextureRef
|
|
{
|
|
public string Name { get; internal set; }
|
|
}
|
|
|
|
public ref struct DepthTextureRef
|
|
{
|
|
public string Name { get; internal set; }
|
|
}
|
|
|
|
public ref struct ColorIndexRef
|
|
{
|
|
public string Name { get; internal set; }
|
|
}
|
|
|
|
public ref struct SizeHandle
|
|
{
|
|
public string Name { get; internal set; }
|
|
|
|
public int Divisor { get; internal set; }
|
|
}
|
|
|
|
}
|