SetComputeIntParams
Adds a command to set multiple consecutive integer parameters on a ComputeShader.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Method
- Namespace: UnityEngine.Rendering
- Assembly: UnityEngine.CoreModule
SetComputeIntParams(ComputeShader, string, int[])
Adds a command to set multiple consecutive integer parameters on a ComputeShader.
public void SetComputeIntParams(ComputeShader computeShader, string name, params int[] values)
Parameters
Remarks
This function can be used to set an integer vector, integer array or integer vector array values. For example, in the compute shader can be filled by passing 8 integers. See Compute Shaders for information on data layout rules.
int4 myArray[2]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.SetComputeIntParam, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam, CommandBuffer.SetComputeBufferParam.
SetComputeIntParams(ComputeShader, int, int[])
Adds a command to set multiple consecutive integer parameters on a ComputeShader.
public void SetComputeIntParams(ComputeShader computeShader, int nameID, params int[] values)
Parameters
ComputeShader to set parameter for.
Property name ID. Use Shader.PropertyToID to get this ID.
Values to set.
Remarks
This function can be used to set an integer vector, integer array or integer vector array values. For example, in the compute shader can be filled by passing 8 integers. See Compute Shaders for information on data layout rules.
int4 myArray[2]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.SetComputeIntParam, CommandBuffer.SetComputeMatrixParam, CommandBuffer.SetComputeMatrixArrayParam, CommandBuffer.SetComputeVectorParam, CommandBuffer.SetComputeVectorArrayParam, CommandBuffer.SetComputeTextureParam, CommandBuffer.SetComputeBufferParam.