# glResolveMultisampleFramebufferAPPLE copying depth buffer

**URL:** <https://forums.imgtec.com/t/glresolvemultisampleframebufferapple-copying-depth-buffer/1686>\
**Category:** PowerVR Insider\
**Created:** [February 27, 2013, 3:58pm UTC](https://forums.imgtec.com/t/glresolvemultisampleframebufferapple-copying-depth-buffer/1686 "2013-02-27T15:58:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickb](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nickb](https://forums.imgtec.com/u/nickb)\
**Post date:** [February 27, 2013, 3:58pm UTC](https://forums.imgtec.com/t/glresolvemultisampleframebufferapple-copying-depth-buffer/1686/1 "2013-02-27T15:58:36Z")

</div>

Hiya,  
  
I’m trying to use glResolveMultisampleFramebufferAPPLE on iOS to copy a one framebuffer object to another. I also want to copy the depth buffer into a texture. Is this possible?  
  
I’m copying from a multisampled FBO, in my read FBO I have a texture attached for both the colour attachment and the depth buffer, it doesn’t flag any errors after the resolve and I get the color copied but not the depth.  
  
I’m trying to do a depth of field affect, I managed it on windows with a glBlitFramebuffer. Any ideas how I could achieve that on iOS?  
  
Cheers,  
  
Nick

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [March 6, 2013, 10:54am UTC](https://forums.imgtec.com/t/glresolvemultisampleframebufferapple-copying-depth-buffer/1686/2 "2013-03-06T10:54:52Z")

</div>

Hi Nick,  
  
  
  
As far as I can tell from the specification, this isn’t possible, at least not easily, as the resolve operation only affects colour data. Unfortunately you also can’t attach a non-multisampled depth texture to a multi-sampled framebuffer, and nor can you create a multisampled depth texture, which rules both of these options for working around the limitations.  
  
  
  
So unless you have a spare channel in your colour texture, you’re likely to have to do a second render with the same data, and write the value of “glFragCoord.z” to your colour output, then do a resolve on that. If you do have a spare channel, you can just do this as part of your main render - typically this can be written into the alpha channel if you are doing an opaque render, for example.  
  
  
  
If you do have to do a second render, it’s going to be a fairly expensive operation unfortunately, so you may want to look at alternative methods of achieving your effects; but this should work for most cases.  
  
  
  
Thanks,  
  
Tobias
