gallium: add flags parameter to pipe_screen::context_create
[mesa.git] / src / gallium / include / pipe / p_screen.h
index bdd727d8cb45a7aedc4f7c06ca4d6acb1f092558..a7b7b72ac89e4ed88b9c115edcc7e026f9b12efa 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  * 
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -18,7 +18,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -71,6 +71,14 @@ struct pipe_screen {
 
    const char *(*get_vendor)( struct pipe_screen * );
 
+   /**
+    * Returns the device vendor.
+    *
+    * The returned value should return the actual device vendor/manufacturer,
+    * rather than a potentially generic driver string.
+    */
+   const char *(*get_device_vendor)( struct pipe_screen * );
+
    /**
     * Query an integer-valued capability/parameter/limit
     * \param param  one of PIPE_CAP_x
@@ -117,8 +125,15 @@ struct pipe_screen {
     */
    uint64_t (*get_timestamp)(struct pipe_screen *);
 
-   struct pipe_context * (*context_create)( struct pipe_screen *,
-                                           void *priv );
+   /**
+    * Create a context.
+    *
+    * \param screen      pipe screen
+    * \param priv        a pointer to set in pipe_context::priv
+    * \param flags       a mask of PIPE_CONTEXT_* flags
+    */
+   struct pipe_context * (*context_create)(struct pipe_screen *screen,
+                                          void *priv, unsigned flags);
 
    /**
     * Check if the given pipe_format is supported as a texture or
@@ -147,7 +162,7 @@ struct pipe_screen {
     */
    boolean (*can_create_resource)(struct pipe_screen *screen,
                                   const struct pipe_resource *templat);
-                               
+
    /**
     * Create a new texture object, using the given template info.
     */
@@ -163,6 +178,14 @@ struct pipe_screen {
                                                  const struct pipe_resource *templat,
                                                  struct winsys_handle *handle);
 
+   /**
+    * Create a resource from user memory. This maps the user memory into
+    * the device address space.
+    */
+   struct pipe_resource * (*resource_from_user_memory)(struct pipe_screen *,
+                                                       const struct pipe_resource *t,
+                                                       void *user_memory);
+
    /**
     * Get a winsys_handle from a texture. Some platforms/winsys requires
     * that the texture is created with a special usage flag like
@@ -195,12 +218,6 @@ struct pipe_screen {
                             struct pipe_fence_handle **ptr,
                             struct pipe_fence_handle *fence );
 
-   /**
-    * Checks whether the fence has been signalled.
-    */
-   boolean (*fence_signalled)( struct pipe_screen *screen,
-                               struct pipe_fence_handle *fence );
-
    /**
     * Wait for the fence to finish.
     * \param timeout  in nanoseconds (may be PIPE_TIMEOUT_INFINITE).
@@ -220,6 +237,17 @@ struct pipe_screen {
                                 unsigned index,
                                 struct pipe_driver_query_info *info);
 
+   /**
+    * Returns a driver-specific query group.
+    *
+    * If \p info is NULL, the number of available groups is returned.
+    * Otherwise, the driver query group at the specified \p index is returned
+    * in \p info. The function returns non-zero on success.
+    */
+   int (*get_driver_query_group_info)(struct pipe_screen *screen,
+                                      unsigned index,
+                                      struct pipe_driver_query_group_info *info);
+
 };