[virglrenderer-devel] [PATCH] vrend: bind correct face during blitter fallback

Gurchetan Singh gurchetansingh at chromium.org
Fri Mar 2 02:19:31 UTC 2018


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

v2: Set layer to dst_z for cases other than GL_CUBE_MAP
---
 src/vrend_blitter.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/vrend_blitter.c b/src/vrend_blitter.c
index ebd76ac..edbc9ea 100644
--- a/src/vrend_blitter.c
+++ b/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) -
                           (info->dst.box.depth - 1) * dst2src_scale) * 0.5;
       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);
-      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;
       glDrawBuffers(1, &buffers);
-- 
2.16.2.395.g2e18187dfd-goog



More information about the virglrenderer-devel mailing list