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