Class GPUCopyAsset | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    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
    ScriptableObject
    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
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023