From f32948d78207f5b7b57eee3d8d8f23616806adf1 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Wed, 1 Aug 2018 10:37:25 -0700 Subject: [PATCH] vrend_renderer: Zero out tex parameters for TBOs In certain cases, specifying level and layer for TBOs causes tests to fail. Don't do this. Fixes: dEQP-GLES31.functional.image_load_store.buffer.image_size.writeonly_12 dEQP-GLES31.functional.image_load_store.buffer.image_size.writeonly_1 dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_writeonly_12 dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_writeonly_1 dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_12 dEQP-GLES31.functional.image_load_store.buffer.image_size.readonly_1 Signed-off-by: Dave Airlie --- src/vrend_renderer.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 0d7b5b8..ddf7f3a 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3608,10 +3608,10 @@ static void vrend_draw_bind_ssbo_shader(struct vrend_context *ctx, int shader_ty static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_type) { - struct vrend_image_view *iview; - uint32_t mask; - uint32_t tex_id; GLenum access; + GLboolean layered; + struct vrend_image_view *iview; + uint32_t mask, tex_id, level, first_layer; if (!has_feature(feat_images)) return; @@ -3638,11 +3638,16 @@ static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_ glBindTexture(GL_TEXTURE_BUFFER, iview->texture->tbo_tex_id); glTexBuffer(GL_TEXTURE_BUFFER, iview->format, iview->texture->id); tex_id = iview->texture->tbo_tex_id; + level = first_layer = 0; + layered = GL_TRUE; + } else { + level = iview->u.tex.level; + first_layer = iview->u.tex.first_layer; + layered = !((iview->texture->base.array_size > 1 || + iview->texture->base.depth0 > 1) && (iview->u.tex.first_layer == iview->u.tex.last_layer)); } glUniform1i(ctx->sub->prog->img_locs[shader_type][i], i); - GLboolean layered = !((iview->texture->base.array_size > 1 || - iview->texture->base.depth0 > 1) && (iview->u.tex.first_layer == iview->u.tex.last_layer)); switch (iview->access) { case PIPE_IMAGE_ACCESS_READ: @@ -3659,12 +3664,7 @@ static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_ return; } - glBindImageTexture(i, tex_id, - iview->u.tex.level, - layered, - iview->u.tex.first_layer, - access, - iview->format); + glBindImageTexture(i, tex_id, level, layered, first_layer, access, iview->format); } }