diff options
author | Topi Pohjolainen <[email protected]> | 2016-05-31 10:36:12 +0300 |
---|---|---|
committer | Topi Pohjolainen <[email protected]> | 2016-06-01 09:16:36 +0300 |
commit | 30e9e6bd071097fd602a15f488b7eead45460885 (patch) | |
tree | e2566d4447c54a53a0d1852c6a424b40647f21f2 /src/mesa/drivers/dri/i965/gen8_surface_state.c | |
parent | a3dc99f3d48df3da1e997d95961747daed0ba6b9 (diff) |
i965/gen9: Configure rbc buffers as plain for non-rbc tex views
Fixes rendering in Shadow of Mordor with rbc. Application writes
RGBA_UNORM texture filling it with values the application wants to
later on treat as SRGB_ALPHA.
Intel driver enables lossless compression for the buffer by the time
of writing. However, the driver fails to make sure the buffer can be
sampled as something else later on and unfortunately there is
restriction in the hardware for using lossless compression for srgb
formats which looks to extend itself to the sampling engine also.
Requesting srgb to linear conversion on top of compressed buffer
results the color values to be pretty much garbage.
Fortunately none of tracked benchmarks showed a regression with
this.
v2 (Matt): Add missing space
Cc: "12.0" <[email protected]>
Signed-off-by: Topi Pohjolainen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen8_surface_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen8_surface_state.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/gen8_surface_state.c b/src/mesa/drivers/dri/i965/gen8_surface_state.c index a3ad108ac2e..ee4781b7d25 100644 --- a/src/mesa/drivers/dri/i965/gen8_surface_state.c +++ b/src/mesa/drivers/dri/i965/gen8_surface_state.c @@ -40,6 +40,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_wm.h" +#include "isl/isl.h" /** * Convert an swizzle enumeration (i.e. SWIZZLE_X) to one of the Gen7.5+ @@ -254,8 +255,18 @@ gen8_emit_texture_surface_state(struct brw_context *brw, * the color buffer should always have been resolved before it is used as * a texture so there is no need for it. On Gen9 it will be uploaded when * the surface is losslessly compressed (CCS_E). + * However, sampling engine is not capable of re-interpreting the + * underlying color buffer in non-compressible formats when the surface + * is configured as compressed. Therefore state upload has made sure the + * buffer is in resolved state allowing the surface to be configured as + * non-compressed. */ - if (mt->num_samples <= 1 && aux_mode != GEN9_SURFACE_AUX_MODE_CCS_E) { + if (mt->num_samples <= 1 && + (aux_mode != GEN9_SURFACE_AUX_MODE_CCS_E || + !isl_format_supports_lossless_compression( + brw->intelScreen->devinfo, format))) { + assert(!mt->mcs_mt || + mt->fast_clear_state == INTEL_FAST_CLEAR_STATE_RESOLVED); aux_mt = NULL; aux_mode = GEN8_SURFACE_AUX_MODE_NONE; } |