intel/isl: Add surface state clear value information
authorNanley Chery <nanley.g.chery@intel.com>
Tue, 24 Jan 2017 23:55:57 +0000 (15:55 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sun, 23 Jul 2017 03:12:09 +0000 (20:12 -0700)
This will be used to load and store clear values from surface state
objects.

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/isl/isl.c
src/intel/isl/isl.h

index e7e5530e5bf98795be6fced50ffe4d08e4c5fc8e..5465496b8f2a2994e8b766bc70a97ed9cc3deb95 100644 (file)
@@ -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;
index 92d2ffc31a5336765951d4b14f364fc1410c042b..fcf03b1a5b32eb1da4f9eeea508ce6a087ed8ff5 100644 (file)
@@ -919,6 +919,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;
 
    /**