Search Unity

Native Plugin documentation is lacking

Discussion in 'Documentation' started by michal_gjk, Jan 4, 2022.

  1. michal_gjk

    michal_gjk

    Joined:
    Aug 13, 2016
    Posts:
    69
    Here are just a few of great many questions not answered at:

    https://docs.unity3d.com/Manual/NativePluginInterface.html

    nor

    https://github.com/Unity-Technologies/NativeRenderingPlugin

    What kind of access is possible using native pointers obtained from:
    Mesh.GetNativeIndexBufferPtr()
    Mesh.GetNativeVertexBufferPtr()
    ComputeBuffer.GetNativeBufferPtr()

    Especially prior to Unity 2021.2

    What are the allowed operations both on CPU and GPU side, and how do they differ between APIs (DX11; DX12; Vulkan, Metal)

    What's is the RESOURCE_STATE of these buffers in DX12 and equivalent in Vulkan as well as to what extent it can be modified prior to 2021.2? Same for native Textures.

    How to obtain meaningful debug feedback. For example how to turn on DX12 Debug Layer without having to resort to forcing it on in helper apps like DXcpl? How to access debug info in IDEs like Visual Studio at runtime?

    Is it safe to create own Command Queues or should we only use the one exposed via the obtained interface?

    What barriers does unity insert into the commandqueue based on passed UnityGraphicsD3D12ResourceState * states? Anything else it's used for?

    These are just simple examples. There a much more complex ones like describing complete life cycle of the plugin. In case of Vulkan using various AccessModes. When each of them is allowed to be used and for what type of resources.

    I hope native plugins are not envisioned to be used solely for what's presented in the simple examples at github and nothing else.