


In OpenGL ES 2.0, the process for creating and binding any kind of buffer generally follows this pattern Swap chain with "back buffer" surface See IDXGISwapChain1 with attached IDXGISurface1. Render target(s) See ID3D11RenderTargetView with ID3D11Texture2D. Vertex buffer element field, designated by an input layout and marked with a specific HLSL semantic.īuffer See D3D11_SUBRESOURCE_DATA and D3D11_BUFFER_DESC and for a general-use buffer definitions. Despite the superficial commonality, they are handled quite different in usage. In Direct3D 11, these roughly map to constant buffers, vertex buffers, and subresources. In OpenGL ES 2.0, data is passed to and from shader programs in four ways: as uniforms for constant data, as attributes for vertex data, as buffer objects for other resource data (such as textures). I know the thread is old, but it was one of my first results when googeling my issue, so I want to keep it as consistent as possible.During the process of porting to Direct3D 11 from OpenGL ES 2.0, you must change the syntax and API behavior for passing data between the app and the shader programs. GlEnable(GL_DEPTH_TEST) //has to be enabled for some reason GlColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE) The C++ code for copying looks like this: glDepthMask(GL_TRUE)

Gl_FragDepth = texture(depthTexture, texCoords).r In vec2 texCoords //texture coordinates from vertex-shader The Fragment-Program (aka Pixel-Shader) #version 150 What works best (in my experience) is copying via shader: The first attempt worked fine on NVIDIA cards, so I'm pretty sure I did not mess things up. When using GL_DEPTH24_STENCIL8 for my framebuffer's depth-texture the Blitting worked as expected, but I had other issues with this format. Using GL_DEPTH_COMPONENT24 as my internal depth-texture-format just didn't work on my AMD Radeon 6950 (latest driver) because Windows (or the driver) decided to use the equivalent to GL_DEPTH24_STENCIL8 as the depth-format for my front/backbuffer, although i did not request any stencil precision (stencil-bits set to 0 in the pixel format descriptor). Just because you cannot guarantee the format does match. I just experienced that copying a depth buffer from a renderbuffer to the main (context-provided) depth buffer is highly unreliable when using glBlitFramebuffer.
