Struct ComputeFunc
Syntax
public struct ComputeFunc
Constructors
ComputeFunc(ComputeShader, String)
Declaration
public ComputeFunc(ComputeShader cs, string kn)
Parameters
Type |
Name |
Description |
ComputeShader |
cs |
|
String |
kn |
|
ComputeFunc(ComputeShader, String[], Int32, Int32, Int32)
Declaration
public ComputeFunc(ComputeShader cs, string[] kns, int x, int y = 1, int z = 1)
Parameters
ComputeFunc(ComputeShader[], String)
Declaration
public ComputeFunc(ComputeShader[] cs, string kn)
Parameters
Type |
Name |
Description |
ComputeShader[] |
cs |
|
String |
kn |
|
ComputeFunc(ComputeShader[], String[], Int32, Int32, Int32)
Declaration
public ComputeFunc(ComputeShader[] cs, string[] kns, int x, int y = 1, int z = 1)
Parameters
Fields
kernelIndex
Declaration
public readonly int kernelIndex
Field Value
kernelName
Declaration
public readonly string kernelName
Field Value
shader
Declaration
public readonly ComputeShader shader
Field Value
Type |
Description |
ComputeShader |
|
threadGroupSizeX
Declaration
public readonly uint threadGroupSizeX
Field Value
threadGroupSizeY
Declaration
public readonly uint threadGroupSizeY
Field Value
threadGroupSizeZ
Declaration
public readonly uint threadGroupSizeZ
Field Value
Properties
depth
Declaration
public int depth { get; }
Property Value
height
Declaration
public int height { get; }
Property Value
threadGroupSize
Declaration
public uint threadGroupSize { get; }
Property Value
width
Declaration
public int width { get; }
Property Value
Methods
Dispatch(Int32, Int32, Int32)
Declaration
public void Dispatch(int workItemsX, int workItemsY, int workItemsZ)
Parameters
Dispatch((Int32, Int32, Int32))
Declaration
public void Dispatch((int, int, int)workItems)
Parameters
FindBestKernelMatchingDimensions(ComputeShader[], String[], Int32, Int32, Int32)
Declaration
public static string FindBestKernelMatchingDimensions(ComputeShader[] cs, string[] kns, int x, int y = 1, int z = 1)
Parameters
Returns
GetTensorData(String)
Declaration
public static int GetTensorData(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
GetTensorDecl(String)
Declaration
public static ComputeFunc.TensorDecl GetTensorDecl(string name)
Parameters
Type |
Name |
Description |
String |
name |
|
Returns
IntDivCeil(Int32, Int32)
Declaration
public static int IntDivCeil(int v, int div)
Parameters
Returns
SetTensor(String, TensorShape, ComputeBuffer, Int64)
Declaration
public void SetTensor(string name, TensorShape shape, ComputeBuffer buffer, long dataOffset = 0L)
Parameters
SetTensor(String, TensorShape, Texture, Int64)
Declaration
public void SetTensor(string name, TensorShape shape, Texture texture, long dataOffset = 0L)
Parameters
SetTensor(ComputeFunc.TensorDecl, Int32, TensorShape, ComputeBuffer, Int64)
Declaration
public void SetTensor(ComputeFunc.TensorDecl tensorDecl, int dataPropId, TensorShape shape, ComputeBuffer buffer, long dataOffset = 0L)
Parameters
SetTensorBuffer(Int32, ComputeBuffer)
Declaration
public void SetTensorBuffer(int propId, ComputeBuffer buffer)
Parameters
Type |
Name |
Description |
Int32 |
propId |
|
ComputeBuffer |
buffer |
|
SetTensorBuffer(String, ComputeBuffer)
Declaration
public void SetTensorBuffer(string name, ComputeBuffer buffer)
Parameters
Type |
Name |
Description |
String |
name |
|
ComputeBuffer |
buffer |
|
SetTensorDecl(String, TensorShape, Int64)
Declaration
public void SetTensorDecl(string name, TensorShape shape, long dataOffset)
Parameters
SetTensorDecl(ComputeFunc.TensorDecl, TensorShape, Int64)
Declaration
public void SetTensorDecl(ComputeFunc.TensorDecl tensorDecl, TensorShape shape, long dataOffset)
Parameters
SetTexture(String, Texture)
Declaration
public void SetTexture(string name, Texture tex)
Parameters
Type |
Name |
Description |
String |
name |
|
Texture |
tex |
|
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.