Struct ComputeShaderKernel
- Namespace
- Uralstech.UXR.QuestMeshing
A light wrapper for a compute shader kernel.
public readonly struct ComputeShaderKernel
Constructors
ComputeShaderKernel(ComputeShader, string)
public ComputeShaderKernel(ComputeShader shader, string name)
Parameters
shaderComputeShadernamestring
Fields
KernelIndex
The index of the kernel.
public readonly int KernelIndex
Field Value
- int
ThreadGroupSizes
The thread group sizes of the kernel as defined in its numthreads attribute.
public readonly (uint x, uint y, uint z) ThreadGroupSizes
Field Value
- (uint x, uint y, uint z)
Methods
Dispatch(int, int, int)
Dispatches the shader kernel.
public void Dispatch(int threadsX, int threadsY = 1, int threadsZ = 1)
Parameters
threadsXintThe total threads for computation in the X dimension.
threadsYintThe total threads for computation in the Y dimension.
threadsZintThe total threads for computation in the Z dimension.
Dispatch(Vector3Int)
Dispatches the shader kernel.
public void Dispatch(Vector3Int threads)
Parameters
threadsVector3IntThe total threads for computation in 3 dimensions.
SetBuffer(int, ComputeBuffer)
Sets a buffer for the kernel.
public void SetBuffer(int id, ComputeBuffer buffer)
Parameters
idintThe parameter ID of the buffer as defined in the shader.
bufferComputeBufferThe buffer to set.
SetBuffer(int, GraphicsBuffer)
Sets a buffer for the kernel.
public void SetBuffer(int id, GraphicsBuffer buffer)
Parameters
idintThe parameter ID of the buffer as defined in the shader.
bufferGraphicsBufferThe buffer to set.
SetTexture(int, Texture)
Sets a texture for the kernel.
public void SetTexture(int id, Texture texture)
Parameters
idintThe parameter ID of the texture as defined in the shader.
textureTextureThe texture to set.