diff options
author | Charmaine Lee <[email protected]> | 2017-04-04 13:14:54 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-04-07 13:46:44 -0600 |
commit | 35a748e79c2fef090ea02404247f1061b8db34cc (patch) | |
tree | 08152d841b9ab24f8bbd99c928aa76faefc12b4b /src/gallium/drivers/svga/svga_surface.c | |
parent | 5637a497a3d86ff0bff793a1ecc706239cfe6a6f (diff) |
svga: Fix zslice index to svga_texture_copy_handle_resource()
The zslice index to svga_texture_copy_handle_resource() is not adjusted
and should be a signed integer.
This patch fixes piglit tests for non-vgpu10 including
spec@arb_framebuffer_object@fbo-generatemipmap-3d
[email protected]@execution@tex-miplevel-selection gl2:texture* 3d
Tested with MTT piglit and glretrace
Diffstat (limited to 'src/gallium/drivers/svga/svga_surface.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_surface.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/gallium/drivers/svga/svga_surface.c b/src/gallium/drivers/svga/svga_surface.c index 18bce3467fd..bbd31c63c8c 100644 --- a/src/gallium/drivers/svga/svga_surface.c +++ b/src/gallium/drivers/svga/svga_surface.c @@ -111,18 +111,25 @@ svga_texture_copy_handle_resource(struct svga_context *svga, struct svga_winsys_surface *dst, unsigned int numMipLevels, unsigned int numLayers, - unsigned int zoffset, + int zslice_pick, unsigned int mipoffset, unsigned int layeroffset) { unsigned int i, j; + unsigned int zoffset = 0; + + /* A negative zslice_pick implies zoffset at 0, and depth to copy is + * from the depth of the texture at the particular mipmap level. + */ + if (zslice_pick >= 0) + zoffset = zslice_pick; for (i = 0; i < numMipLevels; i++) { unsigned int miplevel = i + mipoffset; for (j = 0; j < numLayers; j++) { if (svga_is_texture_level_defined(src_tex, j+layeroffset, miplevel)) { - unsigned depth = (zoffset < 0 ? + unsigned depth = (zslice_pick < 0 ? u_minify(src_tex->b.b.depth0, miplevel) : 1); svga_texture_copy_handle(svga, @@ -155,7 +162,6 @@ svga_texture_view_surface(struct svga_context *svga, { struct svga_screen *ss = svga_screen(svga->pipe.screen); struct svga_winsys_surface *handle; - unsigned z_offset = 0; boolean validated; SVGA_DBG(DEBUG_PERF, @@ -205,13 +211,10 @@ svga_texture_view_surface(struct svga_context *svga, if (layer_pick < 0) layer_pick = 0; - if (zslice_pick >= 0) - z_offset = zslice_pick; - svga_texture_copy_handle_resource(svga, tex, handle, key->numMipLevels, key->numFaces * key->arraySize, - z_offset, start_mip, layer_pick); + zslice_pick, start_mip, layer_pick); return handle; } |