vrend: bind correct face during blitter fallback

In the case of PIPE_TEXTURE_CUBE, util_gen_mipmap (in Mesa)
encodes the target face in blit.{src,dst}.box.z. We need to
bind to the correct texture target before we draw.

Also removed extraneous whitespace.

Fixes:

dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_fastest
dEQP-GLES2.functional.texture.mipmap.cube.generate.a8_nicest
dEQP-GLES2.functional.texture.specification.basic_copyteximage2d.cube_alpha
dEQP-GLES2.functional.texture.specification.basic_copytexsubimage2d.cube_alpha

[airlied: also fixes piglit:
spec@arb_texture_cube_map@copyteximage cube]
v2: Set layer to dst_z for cases other than GL_CUBE_MAP
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Gurchetan Singh 7 years ago committed by Dave Airlie
parent f38d701226
commit 167b314d1a
  1. 5
      src/vrend_blitter.c

@ -645,11 +645,10 @@ void vrend_renderer_blit_gl(struct vrend_context *ctx,
float dst_offset = ((info->src.box.depth - 1) - float dst_offset = ((info->src.box.depth - 1) -
(info->dst.box.depth - 1) * dst2src_scale) * 0.5; (info->dst.box.depth - 1) * dst2src_scale) * 0.5;
float src_z = (dst_z + dst_offset) * dst2src_scale; float src_z = (dst_z + dst_offset) * dst2src_scale;
uint32_t layer = (dst_res->target == GL_TEXTURE_CUBE_MAP) ? info->dst.box.z : dst_z;
glBindFramebuffer(GL_FRAMEBUFFER_EXT, blit_ctx->fb_id); glBindFramebuffer(GL_FRAMEBUFFER_EXT, blit_ctx->fb_id);
vrend_fb_bind_texture(dst_res, 0, info->dst.level, dst_z); vrend_fb_bind_texture(dst_res, 0, info->dst.level, layer);
buffers = GL_COLOR_ATTACHMENT0_EXT; buffers = GL_COLOR_ATTACHMENT0_EXT;
glDrawBuffers(1, &buffers); glDrawBuffers(1, &buffers);

Loading…
Cancel
Save