Class BufferedRTHandleSystem
Implement a multiple buffering for RenderTextures.
Implements
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public class BufferedRTHandleSystem : IDisposable
Properties
maxHeight
Maximum allocated height of the Buffered RTHandle System
Declaration
public int maxHeight { get; }
Property Value
Type | Description |
---|---|
int |
maxWidth
Maximum allocated width of the Buffered RTHandle System
Declaration
public int maxWidth { get; }
Property Value
Type | Description |
---|---|
int |
rtHandleProperties
Current properties of the Buffered RTHandle System
Declaration
public RTHandleProperties rtHandleProperties { get; }
Property Value
Type | Description |
---|---|
RTHandleProperties |
Methods
AllocBuffer(int, Func<RTHandleSystem, int, RTHandle>, int)
Allocate RT handles for a buffer.
Declaration
public void AllocBuffer(int bufferId, Func<RTHandleSystem, int, RTHandle> allocator, int bufferCount)
Parameters
Type | Name | Description |
---|---|---|
int | bufferId | The buffer to allocate. |
Func<RTHandleSystem, int, RTHandle> | allocator | The functor to use for allocation. |
int | bufferCount | The number of RT handles for this buffer. |
CalculateRatioAgainstMaxSize(int, int)
Returns the ratio against the current target's max resolution
Declaration
public Vector2 CalculateRatioAgainstMaxSize(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
int | width | width to utilize |
int | height | height to utilize |
Returns
Type | Description |
---|---|
Vector2 | retruns the width,height / maxTargetSize.xy ratio. |
ClearBuffers(CommandBuffer)
Clears all the previously created history buffers
Declaration
public void ClearBuffers(CommandBuffer cmd)
Parameters
Type | Name | Description |
---|---|---|
CommandBuffer | cmd | Defines the command buffer used for clearing. |
Dispose()
Dispose implementation
Declaration
public void Dispose()
GetFrameRT(int, int)
Return the frame RT or null.
Declaration
public RTHandle GetFrameRT(int bufferId, int frameIndex)
Parameters
Type | Name | Description |
---|---|---|
int | bufferId | Defines the buffer to use. |
int | frameIndex |
Returns
Type | Description |
---|---|
RTHandle | The frame RT or null when the |
GetNumFramesAllocated(int)
Queries the number of RT handle buffers allocated for a buffer ID.
Declaration
public int GetNumFramesAllocated(int bufferId)
Parameters
Type | Name | Description |
---|---|---|
int | bufferId | The buffer ID to query. |
Returns
Type | Description |
---|---|
int | The num of frames allocated |
ReleaseAll()
Deallocate and clear all buffers.
Declaration
public void ReleaseAll()
ReleaseBuffer(int)
Release a buffer
Declaration
public void ReleaseBuffer(int bufferId)
Parameters
Type | Name | Description |
---|---|---|
int | bufferId | Id of the buffer that needs to be released. |
ResetReferenceSize(int, int)
Reset the reference size of the system and reallocate all textures.
Declaration
public void ResetReferenceSize(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
int | width | New width. |
int | height | New height. |
SwapAndSetReferenceSize(int, int)
Swap buffers Set the reference size for this RT Handle System (SetReferenceSize(int, int, bool))
Declaration
public void SwapAndSetReferenceSize(int width, int height)
Parameters
Type | Name | Description |
---|---|---|
int | width | The width of the RTs of this buffer. |
int | height | The height of the RTs of this buffer. |