gallium: add pipe_context::set_device_reset_callback
[mesa.git] / src / gallium / include / pipe / p_state.h
index ad7bf0f88db81dbe232e77e6a261d62c104eca5c..46df196b6ed9cb79e1e59dd89e61df9e1bb02cf9 100644 (file)
@@ -326,17 +326,7 @@ struct pipe_blend_state
 
 struct pipe_blend_color
 {
-   /**
-    * Making the color array explicitly 16-byte aligned provides a hint to
-    * compilers to make more efficient auto-vectorization optimizations.
-    * The actual performance gains from vectorizing the blend color array are
-    * fairly minimal, if any, but the alignment is necessary to work around
-    * buggy vectorization in some compilers which fail to generate the correct
-    * unaligned accessors resulting in a segfault.  Specifically several
-    * versions of the Intel compiler are known to be affected but it's likely
-    * others are as well.
-    */
-   PIPE_ALIGN_VAR(16) float color[4];
+   float color[4];
 };
 
 
@@ -438,8 +428,8 @@ struct pipe_sampler_view
          unsigned last_level:8;    /**< last mipmap level to use */
       } tex;
       struct {
-         unsigned first_element;
-         unsigned last_element;
+         unsigned offset;   /**< offset in bytes */
+         unsigned size;     /**< size of the readable sub-range in bytes */
       } buf;
    } u;
    unsigned swizzle_r:3;         /**< PIPE_SWIZZLE_x for red component */
@@ -466,8 +456,8 @@ struct pipe_image_view
          unsigned level:8;            /**< mipmap level to use */
       } tex;
       struct {
-         unsigned first_element;
-         unsigned last_element;
+         unsigned offset;   /**< offset in bytes */
+         unsigned size;     /**< size of the accessible sub-range in bytes */
       } buf;
    } u;
 };
@@ -508,6 +498,12 @@ struct pipe_resource
 
    unsigned bind;            /**< bitmask of PIPE_BIND_x */
    unsigned flags;           /**< bitmask of PIPE_RESOURCE_FLAG_x */
+
+   /**
+    * For planar images, ie. YUV EGLImage external, etc, pointer to the
+    * next plane.
+    */
+   struct pipe_resource *next;
 };
 
 
@@ -809,6 +805,12 @@ struct pipe_compute_state
  */
 struct pipe_debug_callback
 {
+   /**
+    * When set to \c true, the callback may be called asynchronously from a
+    * driver-created thread.
+    */
+   bool async;
+
    /**
     * Callback for the driver to report debug/performance/etc information back
     * to the state tracker.
@@ -828,6 +830,25 @@ struct pipe_debug_callback
    void *data;
 };
 
+/**
+ * Structure that contains a callback for device reset messages from the driver
+ * back to the state tracker.
+ *
+ * The callback must not be called from driver-created threads.
+ */
+struct pipe_device_reset_callback
+{
+   /**
+    * Callback for the driver to report when a device reset is detected.
+    *
+    * \param data   user-supplied data pointer
+    * \param status PIPE_*_RESET
+    */
+   void (*reset)(void *data, enum pipe_reset_status status);
+
+   void *data;
+};
+
 /**
  * Information about memory usage. All sizes are in kilobytes.
  */