SetComputeIntParam
Adds a command to set an integer parameter on a ComputeShader.
Read time 1 minuteLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
SetComputeIntParam(ComputeShader, int, int)
Adds a command to set an integer parameter on a ComputeShader.
public void SetComputeIntParam(ComputeShader computeShader, int nameID, int val)
Parameters
ComputeShader to set parameter for.
Property name ID. Use Shader.PropertyToID to get this ID.
Value to set.
Remarks
Constant buffers are shared between all kernels in a single compute shader asset. Therefore this function affects all kernels in the passed ComputeShader.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam, CommandBuffer.SetComputeBufferParam.
SetComputeIntParam(ComputeShader, string, int)
Adds a command to set an integer parameter on a ComputeShader.
public void SetComputeIntParam(ComputeShader computeShader, string name, int val)
Parameters
Remarks
Constant buffers are shared between all kernels in a single compute shader asset. Therefore this function affects all kernels in the passed ComputeShader.
Additional Resources: CommandBuffer.DispatchCompute, CommandBuffer.SetComputeFloatParam, CommandBuffer.SetComputeFloatParams, CommandBuffer.SetComputeIntParams, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam, CommandBuffer.SetComputeBufferParam.