diff options
author | Dave Airlie <airlied@redhat.com> | 2016-02-29 16:23:00 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2016-02-29 06:56:03 +0000 |
commit | 5f9133d0dbce6d850fe7024eaf80e622ac4d2eba (patch) | |
tree | 78e0a04b723232c5105b86620e88e1dd555a91c4 | |
parent | d413cba1e9ee6702b491f0d077a29294c30b1a7c (diff) |
renderer: remove stencil attachments better
disconnect using the proper functions, the API in theory
works but mesa has bugs so lets avoid it for now.
This fixes 1d texture depth tests.
-rw-r--r-- | src/vrend_renderer.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 2072dfb..dd98cc7 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -1382,9 +1382,19 @@ void vrend_fb_bind_texture(struct vrend_resource *res, break; } - if (attachment == GL_DEPTH_ATTACHMENT) - glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT, - 0, 0, 0); + if (attachment == GL_DEPTH_ATTACHMENT) { + switch (res->target) { + case GL_TEXTURE_1D: + glFramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT, + GL_TEXTURE_1D, 0, 0); + break; + case GL_TEXTURE_2D: + default: + glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT, + GL_TEXTURE_2D, 0, 0); + break; + } + } } static void vrend_hw_set_zsurf_texture(struct vrend_context *ctx) |