[Mesa-dev] [PATCH 16/33] intel/blorp: Add support for clearing R9G9B9E5 surfaces

Jason Ekstrand jason at jlekstrand.net
Wed Aug 31 21:22:35 UTC 2016


---
 src/intel/blorp/blorp_clear.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/intel/blorp/blorp_clear.c b/src/intel/blorp/blorp_clear.c
index 831c8ed..b0be50b 100644
--- a/src/intel/blorp/blorp_clear.c
+++ b/src/intel/blorp/blorp_clear.c
@@ -23,6 +23,9 @@
 
 #include "util/ralloc.h"
 
+#include "main/macros.h" /* Needed for MAX3 and MAX2 for format_rgb9e5 */
+#include "util/format_rgb9e5.h"
+
 #include "blorp_priv.h"
 #include "brw_defines.h"
 
@@ -251,6 +254,11 @@ blorp_clear(struct blorp_batch *batch,
    params.x1 = x1;
    params.y1 = y1;
 
+   if (format == ISL_FORMAT_R9G9B9E5_SHAREDEXP) {
+      clear_color.u32[0] = float3_to_rgb9e5(clear_color.f32);
+      format = ISL_FORMAT_R32_UINT;
+   }
+
    memcpy(&params.wm_inputs, clear_color.f32, sizeof(float) * 4);
 
    bool use_simd16_replicated_data = true;
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list