Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Low-level native rendering plugin API for D3D11

Discussion in 'General Graphics' started by goncalo09, Oct 26, 2017.

  1. goncalo09

    goncalo09

    Joined:
    Oct 26, 2017
    Posts:
    8
    Does anyone know what the methods exposed in IUnityGraphicsD3D11.h do? Are they documented anywhere?

    Specifically, what do these functions do, and how/when to use them:

    Code (csharp):
    1. ID3D11ShaderResourceView* (UNITY_INTERFACE_API * SRVFromNativeTexture)(UnityTextureID texture);
    2. ID3D11Resource* (UNITY_INTERFACE_API * TextureFromNativeTexture)(UnityTextureID texture)
    I tried calling the functions with texture IDs provided by Texture.GetNativeTexturePtr in the managed side, but they always returned NULL pointers.
     
  2. sebk99

    sebk99

    Joined:
    Apr 15, 2020
    Posts:
    9
    Example:

    Code (Cpp):
    1.  
    2. ID3D11Resource* src = interface_->TextureFromNativeTexture(iParams->source);
    3. ID3D11Resource* dst = interface_->TextureFromRenderBuffer(iParams->destination);
    4. context_->CopyResource(dst, src);
    5.