diff options
author | Kenneth Graunke <[email protected]> | 2018-08-09 23:28:24 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2018-08-11 12:34:01 -0700 |
commit | de57926dc909b3fb180ff06a6c5235309fdbf4df (patch) | |
tree | 05bc4c49abd8371a951f8c9cce218acfeb49a543 /src/intel/blorp/blorp_blit.c | |
parent | 8a290862859bade4b238f595378d63bb920e763a (diff) |
blorp: Properly handle Z24X8 blits.
One of the reasons we didn't notice that R24_UNORM_X8_TYPELESS
destinations were broken was that an earlier layer was swapping it
out for B8G8R8A8_UNORM. That made Z24X8 -> Z24X8 blits work.
However, R32_FLOAT -> R24_UNORM_X8_TYPELESS was still totally broken.
The old code only considered one format at a time, without thinking
that format conversion may need to occur.
This patch moves the translation out to a place where it can consider
both formats. If both are Z24X8, we continue using B8G8R8A8_UNORM to
avoid having to do shader math workarounds. If we have a Z24X8
destination, but a non-matching source, we use our shader hacks to
actually render to it properly.
Fixes: 804856fa5735164cc0733ad0ea62adad39b00ae2 (intel/blorp: Handle more exotic destination formats)
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp_blit.c')
-rw-r--r-- | src/intel/blorp/blorp_blit.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index f4bf26d84a6..7cc580abd06 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -2250,6 +2250,17 @@ blorp_blit(struct blorp_batch *batch, } } + /* ISL_FORMAT_R24_UNORM_X8_TYPELESS it isn't supported as a render target, + * which requires shader math to render to it. Blitting Z24X8 to Z24X8 + * is fairly common though, so we'd like to avoid it. Since we don't need + * to blend depth values, we can simply pick a renderable format with the + * right number of bits-per-pixel, like 8-bit BGRA. + */ + if (dst_surf->surf->format == ISL_FORMAT_R24_UNORM_X8_TYPELESS && + src_surf->surf->format == ISL_FORMAT_R24_UNORM_X8_TYPELESS) { + src_format = dst_format = ISL_FORMAT_B8G8R8A8_UNORM; + } + brw_blorp_surface_info_init(batch->blorp, ¶ms.src, src_surf, src_level, src_layer, src_format, false); brw_blorp_surface_info_init(batch->blorp, ¶ms.dst, dst_surf, dst_level, |