renderer: fix layered depth clears.

fixes: gl-3.2-layered-rendering-clear-depth
macos/master
Dave Airlie 10 years ago
parent e5b4d12cab
commit c6dc6acf27
  1. 8
      src/vrend_renderer.c

@ -1186,7 +1186,7 @@ void vrend_fb_bind_texture(struct vrend_resource *res,
static void vrend_hw_set_zsurf_texture(struct vrend_context *ctx)
{
struct vrend_resource *tex;
int first_layer, last_layer;
if (!ctx->sub->zsurf) {
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT,
GL_TEXTURE_2D, 0, 0);
@ -1197,7 +1197,11 @@ static void vrend_hw_set_zsurf_texture(struct vrend_context *ctx)
if (!tex)
return;
vrend_fb_bind_texture(tex, 0, ctx->sub->zsurf->val0, ctx->sub->zsurf->val1 & 0xffff);
first_layer = ctx->sub->zsurf->val1 & 0xffff;
last_layer = (ctx->sub->zsurf->val1 >> 16) & 0xffff;
vrend_fb_bind_texture(tex, 0, ctx->sub->zsurf->val0,
first_layer != last_layer ? 0xffffffff : first_layer);
}
static void vrend_hw_set_color_surface(struct vrend_context *ctx, int index)

Loading…
Cancel
Save