[virglrenderer-devel] [PATCH] vrend: specify correct offset in resource copy fallback path
Gurchetan Singh
gurchetansingh at chromium.org
Thu Mar 15 23:49:38 UTC 2018
glGetTexImage returns the entire texture, and 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
v2: Cubemap textures seem to suffer from the same issue:
Fixes:
dEQP-GLES3.functional.texture.shadow.cube.nearest.*
Example test cases:
dEQP-GLES3.functional.texture.shadow.cube.nearest.less_or_equal_depth_component16
dEQP-GLES3.functional.texture.shadow.cube.nearest.less_or_equal_depth24_stencil8
---
src/vrend_renderer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 68bc932..49eee9f 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -5737,8 +5737,8 @@ static void vrend_resource_copy_fallback(struct vrend_context *ctx,
}
glBindTexture(dst_res->target, dst_res->id);
- slice_offset = 0;
- for (i = 0; i < cube_slice; i++) {
+ slice_offset = dstz * slice_size;
+ for (i = dstz; i < dstz + src_box->depth; i++) {
GLenum ctarget = dst_res->target == GL_TEXTURE_CUBE_MAP ? GL_TEXTURE_CUBE_MAP_POSITIVE_X + i : dst_res->target;
if (compressed) {
if (ctarget == GL_TEXTURE_1D) {
--
2.16.2.804.g6dcf76e118-goog
More information about the virglrenderer-devel
mailing list