diff options
author | Jason Ekstrand <[email protected]> | 2017-08-02 15:07:33 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-09-19 12:06:26 -0700 |
commit | a8ba57d35686bd55ffd2f7786b2ad10539ce0cc5 (patch) | |
tree | 7fcbd499b7e8852d486161703c75c95efca60e68 /src/intel/blorp/blorp_clear.c | |
parent | 4df0d50857aaf2f309333b0d69985a6d126e63dd (diff) |
intel/blorp: Support clearing L8_UNORM_SRGB surfaces
Vulkan needs to be able to clear any texture you can create. We want to
add support for VK_FORMAT_R8_SRGB and we need to use L8_UNORM_SRGB to do
that so we need to be able to clear it.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp_clear.c')
-rw-r--r-- | src/intel/blorp/blorp_clear.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c index 0feebefc575..94eba7ba783 100644 --- a/src/intel/blorp/blorp_clear.c +++ b/src/intel/blorp/blorp_clear.c @@ -25,6 +25,7 @@ #include "main/macros.h" /* Needed for MAX3 and MAX2 for format_rgb9e5 */ #include "util/format_rgb9e5.h" +#include "util/format_srgb.h" #include "blorp_priv.h" #include "compiler/brw_eu_defines.h" @@ -382,6 +383,9 @@ blorp_clear(struct blorp_batch *batch, if (format == ISL_FORMAT_R9G9B9E5_SHAREDEXP) { clear_color.u32[0] = float3_to_rgb9e5(clear_color.f32); format = ISL_FORMAT_R32_UINT; + } else if (format == ISL_FORMAT_L8_UNORM_SRGB) { + clear_color.f32[0] = util_format_linear_to_srgb_float(clear_color.f32[0]); + format = ISL_FORMAT_R8_UNORM; } else if (format == ISL_FORMAT_A4B4G4R4_UNORM) { /* Broadwell and earlier cannot render to this format so we need to work * around it by swapping the colors around and using B4G4R4A4 instead. |