NVIDIA
nvEncRegisterResource parameter (void * resourceToRegister)
Hi all, I have a question that I can't find any documentation on. What exactly is the resource type expected to be? I know in the Direct X examples it is usually a D3D surface, what happens if I try to register a D3D Texture instead? I'm asking this because I'm trying to encode a Unity Engine render texture which gives a IDirect3DTexture9 ptr. If i could pass this directly in and not have to actually get a D3D9Surface that would safe me some time. If not I probably need to write a native plugin to get at the D3D surface. Thanks
Hi all, I have a question that I can't find any documentation on.

What exactly is the resource type expected to be? I know in the Direct X examples it is usually a D3D surface,
what happens if I try to register a D3D Texture instead? I'm asking this because I'm trying to encode a Unity Engine render texture which gives a IDirect3DTexture9 ptr. If i could pass this directly in and not have to actually get a D3D9Surface that would safe me some time. If not I probably need to write a native plugin to get at the D3D surface.

Thanks

#1
Posted 01/04/2017 10:16 AM   
Hi vincentnagi, If you want to register a D3D texture, even nvEncRegisterResource() succeeds, the following nvEncMapInputResource() will fail. So D3D9 texture can't be used as the input resource type. In your use case, please call IDirect3DTexture9::GetSurfaceLevel to get a surface pointer from the texture. Gary
Hi vincentnagi,

If you want to register a D3D texture, even nvEncRegisterResource() succeeds, the following nvEncMapInputResource() will fail. So D3D9 texture can't be used as the input resource type.

In your use case, please call IDirect3DTexture9::GetSurfaceLevel to get a surface pointer from the texture.

Gary

#2
Posted 01/05/2017 04:38 AM   
Thanks for the response Gary, would you have any inkling what this would be for D3D11, a ID3DView or ID3D11Resource? Where does one go about finding these details? I skimmed the nvEnc guide and references and they don't have these details. Regards, Vince Edit: Upon more googling it would seem that NvEncoder does not support interop with D3D11 directly, and I could either a) bridge the D3D9/D3D11 gap by doing a manual buffer copy, or b) use IFR do return the encoded texture. [quote="Gary"]Hi vincentnagi, If you want to register a D3D texture, even nvEncRegisterResource() succeeds, the following nvEncMapInputResource() will fail. So D3D9 texture can't be used as the input resource type. In your use case, please call IDirect3DTexture9::GetSurfaceLevel to get a surface pointer from the texture. Gary[/quote]
Thanks for the response Gary, would you have any inkling what this would be for D3D11, a ID3DView or ID3D11Resource? Where does one go about finding these details? I skimmed the nvEnc guide and references and they don't have these details.

Regards,
Vince

Edit: Upon more googling it would seem that NvEncoder does not support interop with D3D11 directly, and I could either a) bridge the D3D9/D3D11 gap by doing a manual buffer copy, or b) use IFR do return the encoded texture.

Gary said:Hi vincentnagi,

If you want to register a D3D texture, even nvEncRegisterResource() succeeds, the following nvEncMapInputResource() will fail. So D3D9 texture can't be used as the input resource type.

In your use case, please call IDirect3DTexture9::GetSurfaceLevel to get a surface pointer from the texture.

Gary

#3
Posted 01/25/2017 07:26 AM   
Scroll To Top

Add Reply