[Mesa-dev] [PATCH 03/22] intel/isl: Add surface state clear value information

Nanley Chery nanleychery at gmail.com
Thu Apr 27 18:32:02 UTC 2017


This will be used to load and store clear values from surface state
objects.

Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
---
 src/intel/isl/isl.c | 9 +++++++++
 src/intel/isl/isl.h | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index ff3e2fb86d..a3e91b2688 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -73,6 +73,15 @@ isl_device_init(struct isl_device *dev,
    dev->ss.size = RENDER_SURFACE_STATE_length(info) * 4;
    dev->ss.align = isl_align(dev->ss.size, 32);
 
+   dev->ss.clear_value_size =
+      isl_align(RENDER_SURFACE_STATE_RedClearColor_bits(info) +
+                RENDER_SURFACE_STATE_GreenClearColor_bits(info) +
+                RENDER_SURFACE_STATE_BlueClearColor_bits(info) +
+                RENDER_SURFACE_STATE_AlphaClearColor_bits(info), 32) / 8;
+
+   dev->ss.clear_value_offset =
+      RENDER_SURFACE_STATE_RedClearColor_start(info) / 32 * 4;
+
    assert(RENDER_SURFACE_STATE_SurfaceBaseAddress_start(info) % 8 == 0);
    dev->ss.addr_offset =
       RENDER_SURFACE_STATE_SurfaceBaseAddress_start(info) / 8;
diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h
index 7778551579..b714562492 100644
--- a/src/intel/isl/isl.h
+++ b/src/intel/isl/isl.h
@@ -681,6 +681,10 @@ struct isl_device {
       uint8_t align;
       uint8_t addr_offset;
       uint8_t aux_addr_offset;
+
+      /* Rounded up to the nearest dword to simplify GPU memcpy operations. */
+      uint8_t clear_value_size;
+      uint8_t clear_value_offset;
    } ss;
 
    /**
-- 
2.12.2



More information about the mesa-dev mailing list