CommandBuffer.SetComputeTextureParam

Switch to Manual
public void SetComputeTextureParam (ComputeShader computeShader, int kernelIndex, string name, Rendering.RenderTargetIdentifier rt);
public void SetComputeTextureParam (ComputeShader computeShader, int kernelIndex, int nameID, Rendering.RenderTargetIdentifier rt);
public void SetComputeTextureParam (ComputeShader computeShader, int kernelIndex, string name, Rendering.RenderTargetIdentifier rt, int mipLevel);
public void SetComputeTextureParam (ComputeShader computeShader, int kernelIndex, int nameID, Rendering.RenderTargetIdentifier rt, int mipLevel);

Parameters

computeShader要为其设置参数的 ComputeShader
kernelIndex当前为其设置纹理的内核。请参阅 ComputeShader.FindKernel
name着色器代码中的纹理变量的名称。
nameID属性名称 ID。使用 Shader.PropertyToID 可获取此 ID。
rt有关要设置的纹理值或标识符,请参阅 RenderTargetIdentifier
mipLevelOptional mipmap level of the read-write texture.

Description

添加用于在 ComputeShader 中设置纹理参数的命令。

Textures and buffers are set per-kernel. Use ComputeShader.FindKernel to find kernel index by function name. Please note that the mipLevel parameter is ignored unless the shader specifies a read-write (unordered access) texture.

另请参阅:DispatchComputeSetComputeFloatParamSetComputeFloatParamsSetComputeIntParamSetComputeIntParamsSetComputeMatrixParamSetComputeMatrixArrayParamSetComputeVectorParamSetComputeVectorArrayParamSetComputeBufferParam