diff options
author | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-06-10 14:44:32 -0700 |
---|---|---|
committer | Jason Ekstrand <jason.ekstrand@intel.com> | 2016-06-22 12:26:43 -0700 |
commit | 320de71858cc1ec73e2735923ac30ef45cbc1957 (patch) | |
tree | 39f6d99c99e78330102af563ee08e85efaf93691 /src/mesa | |
parent | 664dc89a1baede86da193a24d27d6314fa0f662e (diff) | |
download | external_mesa3d-320de71858cc1ec73e2735923ac30ef45cbc1957.zip external_mesa3d-320de71858cc1ec73e2735923ac30ef45cbc1957.tar.gz external_mesa3d-320de71858cc1ec73e2735923ac30ef45cbc1957.tar.bz2 |
i965/blorp: Only set src_z for gen8+ 3D textures
Otherwise, we end up with a bogus value in the third component. On gen6-7
where we always use 2D textures, this can cause problems if the
SurfaceArray bit is set in the SURFACE_STATE.
Acked-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp index 782d285..cdb6b33 100644 --- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp +++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp @@ -1846,8 +1846,15 @@ brw_blorp_blit_miptrees(struct brw_context *brw, brw_blorp_setup_coord_transform(¶ms.wm_push_consts.y_transform, src_y0, src_y1, dst_y0, dst_y1, mirror_y); - params.wm_push_consts.src_z = - params.src.mt->target == GL_TEXTURE_3D ? params.src.layer : 0; + if (brw->gen >= 8 && params.src.mt->target == GL_TEXTURE_3D) { + /* On gen8+ we use actual 3-D textures so we need to pass the layer + * through to the sampler. + */ + params.wm_push_consts.src_z = params.src.layer; + } else { + /* On gen7 and earlier, we fake everything with 2-D textures */ + params.wm_push_consts.src_z = 0; + } if (params.dst.num_samples <= 1 && dst_mt->num_samples > 1) { /* We must expand the rectangle we send through the rendering pipeline, |