[virglrenderer-devel] [PATCH] vrend: specify correct offset in resource copy fallback path

Gurchetan Singh gurchetansingh at chromium.org
Thu Mar 15 23:15:05 UTC 2018


glGetTexImage returns the entire texture, and for non-cubemap
cases we always copy from the beginning of the texture. Instead,
we should start copying from the offset specified by the bounding
box.

Fixes:
    dEQP-GLES3.functional.texture.shadow.2d_array.*.*depth*

Example test cases:
    dEQP-GLES3.functional.texture.shadow.2d_array.linear.not_equal_depth_component32f
    dEQP-GLES3.functional.texture.shadow.2d_array.nearest_mipmap_nearest.less_or_equal_depth_component16
    dEQP-GLES3.functional.texture.shadow.2d_array.nearest_mipmap_nearest.greater_or_equal_depth_component16
---
 src/vrend_renderer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 68bc932..2f635c0 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5737,7 +5737,7 @@ static void vrend_resource_copy_fallback(struct vrend_context *ctx,
    }
 
    glBindTexture(dst_res->target, dst_res->id);
-   slice_offset = 0;
+   slice_offset = (dst_res->target == GL_TEXTURE_CUBE_MAP) ? 0 : dstz * slice_size;
    for (i = 0; i < cube_slice; i++) {
       GLenum ctarget = dst_res->target == GL_TEXTURE_CUBE_MAP ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + i : dst_res->target;
       if (compressed) {
-- 
2.16.2.804.g6dcf76e118-goog



More information about the virglrenderer-devel mailing list