Module: Mesa Branch: 10.1 Commit: 151e7ac3cf045ed24c1990a42c040599311086c6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=151e7ac3cf045ed24c1990a42c040599311086c6
Author: Neil Roberts <[email protected]> Date: Mon Jun 9 17:43:37 2014 +0100 i965: Set the fast clear color value for texture surfaces When a multisampled texture is used for sampling the fast clear color value needs to be programmed into the surface state. This was being left as all zeroes so if the surface was cleared to a value other than black then it wouldn't work properly. This doesn't matter for single-sample textures because in that case the MCS buffer is resolved before it is used as a texture source. https://bugs.freedesktop.org/show_bug.cgi?id=79729 Reviewed-by: Chris Forbes <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Cc: "10.1 10.2" <[email protected]> (cherry picked from commit 765efeef883cdbb86e052acd887e0c3c0e39b732) --- src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 4 +++- src/mesa/drivers/dri/i965/gen8_surface_state.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c index dad3b0c..a25ec57 100644 --- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c @@ -330,6 +330,8 @@ gen7_update_texture_surface(struct gl_context *ctx, /* mip count */ (intelObj->_MaxLevel - tObj->BaseLevel)); + surf[7] = mt->fast_clear_color_value; + if (brw->is_haswell) { /* Handling GL_ALPHA as a surface format override breaks 1.30+ style * texturing functions that return a float, as our code generation always @@ -344,7 +346,7 @@ gen7_update_texture_surface(struct gl_context *ctx, const bool need_scs_green_to_blue = for_gather && tex_format == BRW_SURFACEFORMAT_R32G32_FLOAT_LD; - surf[7] = + surf[7] |= SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 0), need_scs_green_to_blue), GEN7_SURFACE_SCS_R) | SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 1), need_scs_green_to_blue), GEN7_SURFACE_SCS_G) | SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 2), need_scs_green_to_blue), GEN7_SURFACE_SCS_B) | diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c index efadb0d..7df9f9a 100644 --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c @@ -195,9 +195,11 @@ gen8_update_texture_surface(struct gl_context *ctx, (firstImage->_BaseFormat == GL_DEPTH_COMPONENT || firstImage->_BaseFormat == GL_DEPTH_STENCIL); + surf[7] = mt->fast_clear_color_value; + const int swizzle = unlikely(alpha_depth) ? SWIZZLE_XYZW : brw_get_texture_swizzle(ctx, tObj); - surf[7] = + surf[7] |= SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 0), false), GEN7_SURFACE_SCS_R) | SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 1), false), GEN7_SURFACE_SCS_G) | SET_FIELD(brw_swizzle_to_scs(GET_SWZ(swizzle, 2), false), GEN7_SURFACE_SCS_B) | _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
