PDA

View Full Version : WGL_NV_DX_interop



yehiyam
01-16-2011, 12:40 PM
Hi all
Has anyone tried the WGL_NV_DX_interop extension from NVIDIA?
I'm working on this on and off for a few days now. I've managed to get the extensions loaded, and set up a shared texture I created in DX9.
My problem is when I try to attach this texture to a framebuffer object, I get FrameBufferUnsupported error.
Did anyone have any success using this extension to render from OpenGL on a DirectX texture?

Alfonse Reinheart
01-16-2011, 01:09 PM
What's the format of the texture?

glfreak
01-16-2011, 02:27 PM
What's the real benefit of this extension?

Does it mean that Direct3D and GL context can co-exist in the same application window?

Aleksandar
01-16-2011, 03:04 PM
This extension allows OpenGL to directly access DirectX buffers and surfaces. A DirectX vertex buffer may be shared as an OpenGL buffer object and a DirectX surface may be shared as an OpenGL texture or renderbuffer object.

The main purpose currently is probably using DX video decoders inside OpenGL. I tried to reuse VBOs created in D3D inside OpenGL half year ago, and it worked...

yehiyam
01-17-2011, 02:12 PM
Hi
The purpose is to allow integration of openGL graphics with WPF.
The main flow is:
1. Create a d3d surface as the render target (ARGB32, no multisample).
2. setup the interop with OpenGL as Texture2D. (this works OK).
3. lock the interop texture
4. try to bind to my FBO (this is the step that fails).
5. render
6. unlock
7. use the d3d surface with WPF.

I'm running this on Windows XP. Is it possible that this will only work with WDDM drivers and Windows 7?

Thanks
Yehiyam

Alfonse Reinheart
01-17-2011, 03:24 PM
The purpose is to allow integration of openGL graphics with WPF.

If you want to integrate OpenGL and WPF, there are easier ways to do it. There are techniques for creating a Win32 HWND within a WPF-controlled system. Once you've got that working, just use the HWND to create an OpenGL context and use it as normal.

yehiyam
01-18-2011, 12:24 AM
That's true, but it will not allow complete integration. Rendering to the window will create "air-space" problems, where native WPF controls can't be placed over the OpenGL window.

Alfonse Reinheart
01-18-2011, 12:55 AM
That's true, but it will not allow complete integration.

No, but:

1: It'll be more likely to work. The OpenGL implementation has the right to refuse textures for FBOs for any reason. And if NVIDIA's implementation doesn't want to allow DX interop textures in FBOs, there's not much you can do about it.

2: It'll be more likely to work outside of NVIDIA's hardware. It is an NVIDIA extension, after all.

Also, how are you creating an OpenGL context if you don't have a window?

You never answered my question about the texture's format. That wasn't idle or rhetorical.

And have you tried creating a renderbuffer instead of a texture?

Also, you may want to look at the issues section of the extension spec. Particularly Issue 4.

fc.opengl
02-23-2011, 06:15 AM
Hi yehiyam,

I am having the same problem: something happened during texture attachment (dx render targets -> FBO) :

glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D_MULTISAMPLE, gl_names[0],0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D_MULTISAMPLE, gl_names[1],0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_TEXTURE_2D_MULTISAMPLE, gl_names[1],0);

because after it, i checked the FBO status using glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) and the result was always GL_FRAMEBUFFER_UNSUPPORTED_EXT!


did you find any solution??

thanks!