Merge branch '7.8'
[mesa.git] / src / gallium / include / pipe / p_state.h
index 23748acbdc293031c32b98213caa72b5c11f3af0..11072407d93b78b0685bfd7c85cc89b69011ab78 100644 (file)
@@ -113,16 +113,6 @@ struct pipe_rasterizer_state
    unsigned line_stipple_pattern:16;
    unsigned line_last_pixel:1;
 
-   /** 
-    * Vertex coordinates are pre-transformed to screen space.  Skip
-    * the vertex shader, clipping and viewport processing.  Note that
-    * a vertex shader is still needed though, to indicate the mapping
-    * from vertex elements to fragment shader input semantics.
-    *
-    * XXX: considered for removal.
-    */
-   unsigned bypass_vs_clip_and_viewport:1;
-
    /** 
     * Use the first vertex of a primitive as the provoking vertex for
     * flat shading.
@@ -259,7 +249,7 @@ struct pipe_framebuffer_state
 {
    unsigned width, height;
 
-   /** multiple colorbuffers for multiple render targets */
+   /** multiple color buffers for multiple render targets */
    unsigned nr_cbufs;
    struct pipe_surface *cbufs[PIPE_MAX_COLOR_BUFS];
 
@@ -281,10 +271,10 @@ struct pipe_sampler_state
    unsigned compare_mode:1;      /**< PIPE_TEX_COMPARE_x */
    unsigned compare_func:3;      /**< PIPE_FUNC_x */
    unsigned normalized_coords:1; /**< Are coords normalized to [0,1]? */
+   unsigned max_anisotropy:6;
    float lod_bias;               /**< LOD/lambda bias */
    float min_lod, max_lod;       /**< LOD clamp range, after bias */
    float border_color[4];
-   float max_anisotropy;
 };
 
 
@@ -295,12 +285,12 @@ struct pipe_sampler_state
 struct pipe_surface
 {
    struct pipe_reference reference;
-   enum pipe_format format;      /**< PIPE_FORMAT_x */
+   enum pipe_format format;
    unsigned width;               /**< logical width in pixels */
    unsigned height;              /**< logical height in pixels */
    unsigned layout;              /**< PIPE_SURFACE_LAYOUT_x */
    unsigned offset;              /**< offset from start of buffer, in bytes */
-   unsigned usage;               /**< PIPE_BUFFER_USAGE_*  */
+   unsigned usage;               /**< bitmask of PIPE_BUFFER_USAGE_x */
 
    unsigned zslice;
    struct pipe_texture *texture; /**< texture into which this is a view  */
@@ -309,6 +299,24 @@ struct pipe_surface
 };
 
 
+/**
+ * A view into a texture that can be bound to a shader stage.
+ */
+struct pipe_sampler_view
+{
+   struct pipe_reference reference;
+   enum pipe_format format;      /**< typed PIPE_FORMAT_x */
+   struct pipe_texture *texture; /**< texture into which this is a view  */
+   struct pipe_context *context; /**< context this view belongs to */
+   unsigned first_level:8;       /**< first mipmap level */
+   unsigned last_level:8;        /**< last mipmap level */
+   unsigned swizzle_r:3;         /**< PIPE_SWIZZLE_x for red component */
+   unsigned swizzle_g:3;         /**< PIPE_SWIZZLE_x for green component */
+   unsigned swizzle_b:3;         /**< PIPE_SWIZZLE_x for blue component */
+   unsigned swizzle_a:3;         /**< PIPE_SWIZZLE_x for alpha component */
+};
+
+
 /**
  * Transfer object.  For data transfer to/from a texture.
  */
@@ -346,7 +354,7 @@ struct pipe_texture
 
    unsigned nr_samples:8;    /**< for multisampled surfaces, nr of samples */
 
-   unsigned tex_usage;       /* PIPE_TEXTURE_USAGE_* */
+   unsigned tex_usage;       /**< bitmask of PIPE_TEXTURE_USAGE_* */
 
    struct pipe_screen *screen; /**< screen that this texture belongs to */
 };
@@ -383,9 +391,8 @@ struct pipe_vertex_element
     * this attribute live in?
     */
    unsigned vertex_buffer_index:8;
-   unsigned nr_components:8;
  
-   enum pipe_format src_format;           /**< PIPE_FORMAT_* */
+   enum pipe_format src_format;
 };