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