summaryrefslogtreecommitdiff
path: root/src/intel
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2018-08-09 23:11:07 -0700
committerAndres Gomez <agomez@igalia.com>2018-08-13 12:44:46 +0300
commitf7e8bc0f23ee9e81c686885f97e153c721c88eef (patch)
treef2cce59114d5f812785f67d8b2836166ec9b8408 /src/intel
parent90278c7f951e9bb9909c0e7a0fd543fa59643600 (diff)
blorp: Don't try to use R32_UNORM for R24_UNORM_X8_TYPELESS rendering.
The hardware doesn't support rendering to R24_UNORM_X8_TYPELESS, so Jason decided to fake it with a bit of shader math and R32_UNORM RTs. The only problem is that R32_UNORM isn't renderable either...so we've just traded one bad format for another. This patch makes us use R32_UINT instead. Fixes: 804856fa5735164cc0733ad0ea62adad39b00ae2 (intel/blorp: Handle more exotic destination formats) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 8a290862859bade4b238f595378d63bb920e763a)
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/blorp/blorp_blit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index e811cb0be37..f4bf26d84a6 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -994,14 +994,14 @@ convert_color(struct nir_builder *b, nir_ssa_def *color,
nir_ssa_def *value;
if (key->dst_format == ISL_FORMAT_R24_UNORM_X8_TYPELESS) {
- /* The destination image is bound as R32_UNORM but the data needs to be
+ /* The destination image is bound as R32_UINT but the data needs to be
* in R24_UNORM_X8_TYPELESS. The bottom 24 are the actual data and the
* top 8 need to be zero. We can accomplish this by simply multiplying
* by a factor to scale things down.
*/
- float factor = (float)((1 << 24) - 1) / (float)UINT32_MAX;
- value = nir_fmul(b, nir_fsat(b, nir_channel(b, color, 0)),
- nir_imm_float(b, factor));
+ unsigned factor = (1 << 24) - 1;
+ value = nir_fsat(b, nir_channel(b, color, 0));
+ value = nir_f2i32(b, nir_fmul(b, value, nir_imm_float(b, factor)));
} else if (key->dst_format == ISL_FORMAT_L8_UNORM_SRGB) {
value = nir_format_linear_to_srgb(b, nir_channel(b, color, 0));
} else if (key->dst_format == ISL_FORMAT_R8G8B8_UNORM_SRGB) {
@@ -1986,7 +1986,7 @@ try_blorp_blit(struct blorp_batch *batch,
isl_format_rgbx_to_rgba(params->dst.view.format);
} else if (params->dst.view.format == ISL_FORMAT_R24_UNORM_X8_TYPELESS) {
wm_prog_key->dst_format = params->dst.view.format;
- params->dst.view.format = ISL_FORMAT_R32_UNORM;
+ params->dst.view.format = ISL_FORMAT_R32_UINT;
} else if (params->dst.view.format == ISL_FORMAT_A4B4G4R4_UNORM) {
params->dst.view.swizzle =
isl_swizzle_compose(params->dst.view.swizzle,