Files
sbox-public/engine/Sandbox.Engine/Systems/Render/CommandList/RenderTargetHandle.cs
Lorenz Junglas 2e366c48f6 Added DepthTextureRef to RenderTargetHandle (#4034)
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.
2026-02-27 09:56:20 +01:00

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; }
}
}