Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

ComputeShader.FindKernel

FindKernel(name: string): int;
int FindKernel(string name);
def FindKernel(name as string) as int

Description

Find ComputeShader kernel index.

A single compute shader can contain many "kernels" (functions that do the computation); FindKernel returns kernel index given the name. If name is not found, -1 is returned.