C# Class UnityEngine.ComputeShader

Inheritance: UnityEngine.Object
ファイルを表示 Open project: CarlosHBC/UnityDecompiled Class Usage Examples

Public Methods

Method Description
DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer, [ argsOffset ) : void

Execute a compute shader.

SetBool ( int nameID, bool val ) : void

Set a bool parameter.

SetBool ( string name, bool val ) : void

Set a bool parameter.

SetBuffer ( int kernelIndex, string name, ComputeBuffer buffer ) : void

Sets an input or output compute buffer.

SetFloat ( string name, float val ) : void

Set a float parameter.

SetFloats ( int nameID ) : void

Set multiple consecutive float parameters at once.

SetFloats ( string name ) : void

Set multiple consecutive float parameters at once.

SetInt ( string name, int val ) : void

Set an integer parameter.

SetInts ( int nameID ) : void

Set multiple consecutive integer parameters at once.

SetInts ( string name ) : void

Set multiple consecutive integer parameters at once.

SetTexture ( int kernelIndex, string name, Texture texture ) : void

Set a texture parameter.

SetTextureFromGlobal ( int kernelIndex, string name, string globalTextureName ) : void

Set a texture parameter from a global texture property.

SetVector ( int nameID, Vector4 val ) : void

Set a vector parameter.

SetVector ( string name, Vector4 val ) : void

Set a vector parameter.

Private Methods

Method Description
Dispatch ( int kernelIndex, int threadGroupsX, int threadGroupsY, int threadGroupsZ ) : void
DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer ) : void
FindKernel ( string name ) : int
GetKernelThreadGroupSizes ( int kernelIndex, uint &x, uint &y, uint &z ) : void
HasKernel ( string name ) : bool
INTERNAL_CALL_SetVector ( ComputeShader self, int nameID, Vector4 &val ) : void
Internal_DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer, uint argsOffset ) : void
Internal_SetFloats ( int nameID, float values ) : void
Internal_SetInts ( int nameID, int values ) : void
SetBuffer ( int kernelIndex, int nameID, ComputeBuffer buffer ) : void
SetFloat ( int nameID, float val ) : void
SetInt ( int nameID, int val ) : void
SetTexture ( int kernelIndex, int nameID, Texture texture ) : void
SetTextureFromGlobal ( int kernelIndex, int nameID, int globalTextureNameID ) : void

Method Details

DispatchIndirect() public method

Execute a compute shader.

public DispatchIndirect ( int kernelIndex, ComputeBuffer argsBuffer, [ argsOffset ) : void
kernelIndex int Which kernel to execute. A single compute shader asset can have multiple kernel entry points.
argsBuffer ComputeBuffer Buffer with dispatch arguments.
argsOffset [ Byte offset where in the buffer the dispatch arguments are.
return void

SetBool() public method

Set a bool parameter.

public SetBool ( int nameID, bool val ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
val bool Value to set.
return void

SetBool() public method

Set a bool parameter.

public SetBool ( string name, bool val ) : void
name string Variable name in shader code.
val bool Value to set.
return void

SetBuffer() public method

Sets an input or output compute buffer.

public SetBuffer ( int kernelIndex, string name, ComputeBuffer buffer ) : void
kernelIndex int For which kernel the buffer is being set. See FindKernel.
name string Name of the buffer variable in shader code.
buffer ComputeBuffer Buffer to set.
return void

SetFloat() public method

Set a float parameter.

public SetFloat ( string name, float val ) : void
name string Variable name in shader code.
val float Value to set.
return void

SetFloats() public method

Set multiple consecutive float parameters at once.

public SetFloats ( int nameID ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
return void

SetFloats() public method

Set multiple consecutive float parameters at once.

public SetFloats ( string name ) : void
name string Array variable name in the shader code.
return void

SetInt() public method

Set an integer parameter.

public SetInt ( string name, int val ) : void
name string Variable name in shader code.
val int Value to set.
return void

SetInts() public method

Set multiple consecutive integer parameters at once.

public SetInts ( int nameID ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
return void

SetInts() public method

Set multiple consecutive integer parameters at once.

public SetInts ( string name ) : void
name string Array variable name in the shader code.
return void

SetTexture() public method

Set a texture parameter.

public SetTexture ( int kernelIndex, string name, Texture texture ) : void
kernelIndex int For which kernel the texture is being set. See FindKernel.
name string Name of the buffer variable in shader code.
texture Texture Texture to set.
return void

SetTextureFromGlobal() public method

Set a texture parameter from a global texture property.

public SetTextureFromGlobal ( int kernelIndex, string name, string globalTextureName ) : void
kernelIndex int For which kernel the texture is being set. See FindKernel.
name string Name of the buffer variable in shader code.
globalTextureName string Global texture property to assign to shader.
return void

SetVector() public method

Set a vector parameter.

public SetVector ( int nameID, Vector4 val ) : void
nameID int Property name ID, use Shader.PropertyToID to get it.
val Vector4 Value to set.
return void

SetVector() public method

Set a vector parameter.

public SetVector ( string name, Vector4 val ) : void
name string Variable name in shader code.
val Vector4 Value to set.
return void