SetComputeBufferParam
Adds a command to set an input or output buffer parameter on a ComputeShader.
Read time 5 minutesLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
SetComputeBufferParam(ComputeShader, int, int, ComputeBuffer)
Adds a command to set an input or output buffer parameter on a ComputeShader.
public void SetComputeBufferParam(ComputeShader computeShader, int kernelIndex, int nameID, ComputeBuffer buffer)
Parameters
ComputeShader to set parameter for.
Which kernel the buffer is being set for. See ComputeShader.FindKernel.
Property name ID. Use Shader.PropertyToID to get this ID.
Buffer to set.
Remarks
Buffers and textures are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name.
Setting a compute buffer to a kernel will leave the append/consume counter value unchanged. To set or reset the value, use ComputeBuffer.SetCounterValue or GraphicsBuffer.SetCounterValue.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParam, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam.
SetComputeBufferParam(ComputeShader, int, string, ComputeBuffer)
Adds a command to set an input or output buffer parameter on a ComputeShader.
public void SetComputeBufferParam(ComputeShader computeShader, int kernelIndex, string name, ComputeBuffer buffer)
Parameters
ComputeShader to set parameter for.
Which kernel the buffer is being set for. See ComputeShader.FindKernel.
Name of the buffer variable in shader code.
Buffer to set.
Remarks
Buffers and textures are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name.
Setting a compute buffer to a kernel will leave the append/consume counter value unchanged. To set or reset the value, use ComputeBuffer.SetCounterValue or GraphicsBuffer.SetCounterValue.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParam, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam.
SetComputeBufferParam(ComputeShader, int, int, GraphicsBufferHandle)
Adds a command to set an input or output buffer parameter on a ComputeShader.
public void SetComputeBufferParam(ComputeShader computeShader, int kernelIndex, int nameID, GraphicsBufferHandle bufferHandle)
Parameters
ComputeShader to set parameter for.
Which kernel the buffer is being set for. See ComputeShader.FindKernel.
Property name ID. Use Shader.PropertyToID to get this ID.
The handle of the buffer to set.
Remarks
Buffers and textures are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name.
Setting a compute buffer to a kernel will leave the append/consume counter value unchanged. To set or reset the value, use ComputeBuffer.SetCounterValue or GraphicsBuffer.SetCounterValue.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParam, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam.
SetComputeBufferParam(ComputeShader, int, string, GraphicsBufferHandle)
Adds a command to set an input or output buffer parameter on a ComputeShader.
public void SetComputeBufferParam(ComputeShader computeShader, int kernelIndex, string name, GraphicsBufferHandle bufferHandle)
Parameters
ComputeShader to set parameter for.
Which kernel the buffer is being set for. See ComputeShader.FindKernel.
Name of the buffer variable in shader code.
The handle of the buffer to set.
Remarks
Buffers and textures are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name.
Setting a compute buffer to a kernel will leave the append/consume counter value unchanged. To set or reset the value, use ComputeBuffer.SetCounterValue or GraphicsBuffer.SetCounterValue.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParam, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam.
SetComputeBufferParam(ComputeShader, int, int, GraphicsBuffer)
Adds a command to set an input or output buffer parameter on a ComputeShader.
public void SetComputeBufferParam(ComputeShader computeShader, int kernelIndex, int nameID, GraphicsBuffer buffer)
Parameters
ComputeShader to set parameter for.
Which kernel the buffer is being set for. See ComputeShader.FindKernel.
Property name ID. Use Shader.PropertyToID to get this ID.
Buffer to set.
Remarks
Buffers and textures are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name.
Setting a compute buffer to a kernel will leave the append/consume counter value unchanged. To set or reset the value, use ComputeBuffer.SetCounterValue or GraphicsBuffer.SetCounterValue.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParam, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam.
SetComputeBufferParam(ComputeShader, int, string, GraphicsBuffer)
Adds a command to set an input or output buffer parameter on a ComputeShader.
public void SetComputeBufferParam(ComputeShader computeShader, int kernelIndex, string name, GraphicsBuffer buffer)
Parameters
ComputeShader to set parameter for.
Which kernel the buffer is being set for. See ComputeShader.FindKernel.
Name of the buffer variable in shader code.
Buffer to set.
Remarks
Buffers and textures are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name.
Setting a compute buffer to a kernel will leave the append/consume counter value unchanged. To set or reset the value, use ComputeBuffer.SetCounterValue or GraphicsBuffer.SetCounterValue.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParam, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam.