SetBuffer
Binds an input or output compute buffer.
Read time 3 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
SetBuffer(int, ComputeBuffer)
Binds an input or output compute buffer.
public void SetBuffer(int nameID, ComputeBuffer buffer)
Parameters
The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID.
The buffer to bind.
Remarks
Only shaders defined in the .raytrace file can access the buffer you designate as the argument for this method. To make this buffer accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalBuffer method instead.
SetBuffer(int, GraphicsBuffer)
Binds an input or output compute buffer.
public void SetBuffer(int nameID, GraphicsBuffer buffer)
Parameters
The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID.
The buffer to bind.
Remarks
Only shaders defined in the .raytrace file can access the buffer you designate as the argument for this method. To make this buffer accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalBuffer method instead.
SetBuffer(int, GraphicsBufferHandle)
Binds an input or output compute buffer.
public void SetBuffer(int nameID, GraphicsBufferHandle bufferHandle)
Parameters
The ID of the buffer name in shader code. Use Shader.PropertyToID to get this ID.
The handle of the buffer to bind.
Remarks
Only shaders defined in the .raytrace file can access the buffer you designate as the argument for this method. To make this buffer accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalBuffer method instead.
SetBuffer(string, ComputeBuffer)
Binds an input or output compute buffer.
public void SetBuffer(string name, ComputeBuffer buffer)
Parameters
Remarks
Only shaders defined in the .raytrace file can access the buffer you designate as the argument for this method. To make this buffer accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalBuffer method instead.
SetBuffer(string, GraphicsBuffer)
Binds an input or output compute buffer.
public void SetBuffer(string name, GraphicsBuffer buffer)
Parameters
Remarks
Only shaders defined in the .raytrace file can access the buffer you designate as the argument for this method. To make this buffer accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalBuffer method instead.
SetBuffer(string, GraphicsBufferHandle)
Binds an input or output compute buffer.
public void SetBuffer(string name, GraphicsBufferHandle bufferHandle)
Parameters
The name of the buffer in shader code.
The handle of the buffer to bind.
Remarks
Only shaders defined in the .raytrace file can access the buffer you designate as the argument for this method. To make this buffer accessible to all ray tracing shader types (closest hit, any hit, miss, etc.), call the Shader.SetGlobalBuffer method instead.