Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


FindKernel(string)

Find ComputeShader kernel index.
Read time 1 minuteLast updated 7 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public int FindKernel(string name)

Parameters

name

Name of kernel function.

Returns

Type

Description

intThe Kernel index. If the kernel is not found, Unity logs a "FindKernel failed" error message and raises an ArgumentException.

Remarks

A single compute shader can contain many "kernels" (functions that do the computation); FindKernel returns kernel index given the name.
Additional Resources: ComputeShader.Dispatch.