diff options
author | Nanley Chery <[email protected]> | 2019-09-18 09:44:02 -0700 |
---|---|---|
committer | Nanley Chery <[email protected]> | 2019-10-28 10:47:06 -0700 |
commit | 8e7644e48f8122409faf558ad3252a515576d2f0 (patch) | |
tree | b03388f47953082cc9cc133e3e72845809c5bfac /src | |
parent | 0aa308f4200ad88c9b9ac0fd3e2ad30bde74edb9 (diff) |
intel/blorp: Satisfy clear color rules for HIZ_CCS
Store the converted depth value into two dwords. Avoids regressing the
piglit test "fbo-depth-array depth-clear", when HIZ_CCS sampling is
enabled in a later commit.
Reviewed-by: Sagar Ghuge <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel/blorp/blorp_genX_exec.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/intel/blorp/blorp_genX_exec.h b/src/intel/blorp/blorp_genX_exec.h index fca7ae6b779..fd913315d0c 100644 --- a/src/intel/blorp/blorp_genX_exec.h +++ b/src/intel/blorp/blorp_genX_exec.h @@ -1775,17 +1775,51 @@ blorp_update_clear_color(struct blorp_batch *batch, pipe.TextureCacheInvalidationEnable = true; } #elif GEN_GEN >= 9 + + /* According to GEN:BUG:2201730850, in the Clear Color Programming Note + * under the Red channel, "Software shall write the converted Depth + * Clear to this dword." The only depth formats listed under the red + * channel are IEEE_FP and UNORM24_X8. These two requirements are + * incompatible with the UNORM16 depth format, so just ignore that case + * and simply perform the conversion for all depth formats. + */ + union isl_color_value fixed_color = info->clear_color; + if (GEN_GEN == 12 && isl_surf_usage_is_depth(info->surf.usage)) { + isl_color_value_pack(&info->clear_color, info->surf.format, + fixed_color.u32); + } + for (int i = 0; i < 4; i++) { blorp_emit(batch, GENX(MI_STORE_DATA_IMM), sdi) { sdi.Address = info->clear_color_addr; sdi.Address.offset += i * 4; - sdi.ImmediateData = info->clear_color.u32[i]; + sdi.ImmediateData = fixed_color.u32[i]; #if GEN_GEN >= 12 if (i == 3) sdi.ForceWriteCompletionCheck = true; #endif } } + +/* The RENDER_SURFACE_STATE::ClearColor field states that software should + * write the converted depth value 16B after the clear address: + * + * 3D Sampler will always fetch clear depth from the location 16-bytes + * above this address, where the clear depth, converted to native + * surface format by software, will be stored. + * + */ +#if GEN_GEN >= 12 + if (isl_surf_usage_is_depth(info->surf.usage)) { + blorp_emit(batch, GENX(MI_STORE_DATA_IMM), sdi) { + sdi.Address = info->clear_color_addr; + sdi.Address.offset += 4 * 4; + sdi.ImmediateData = fixed_color.u32[0]; + sdi.ForceWriteCompletionCheck = true; + } + } +#endif + #elif GEN_GEN >= 7 blorp_emit(batch, GENX(MI_STORE_DATA_IMM), sdi) { sdi.Address = info->clear_color_addr; |