Class GPUCopyAsset
Declares what should be generated in utility code. It will generate a compute shader and a C# class to use the compute shader with a ComputeBuffer
Exemple:
- I add a CopyOperation { sourceChannel = 4, targetChannel = 2, subscript = "zx" } => a Kernel will be generated to copy from a TextureRGBA the AR channels into a TextureRG => A method will be added to call the kernel in the C# class GPUCopy (SampleCopy_xyzw2zx)
C# Exemple: // Initialize the gpucopy var gpuCopy = new CPUCopy(generatedComputeShaderAsset);
CommandBuffer cmb = ... gpuCopy.SampleCopyChannel_xyzw2x(cmb, _SourceTexture, _TargetTexture, new Vector2(targetWidth, targetHeight));
Initialization:
- You must set the generated ComputeShader as argument of the constructor of the generated GPUCopy C# class
Inheritance
System.Object
GPUCopyAsset
Namespace: UnityEngine.Experimental.Rendering
Syntax
public class GPUCopyAsset : ScriptableObject
Methods
Generate(out String, out String)
Declaration
public void Generate(out string computeShader, out string csharp)
Parameters
Type | Name | Description |
---|---|---|
System.String | computeShader | |
System.String | csharp |