u_blitter: add a msaa parameter to util_blitter_clear
[mesa.git] / src / gallium / drivers / svga / svga_shader.h
index b0800c1ecad1936837c8864af44a770f62cf520e..67f6b5aeb6362f07d5b526c75e5f9e9060f58b5e 100644 (file)
@@ -77,6 +77,7 @@ struct svga_compile_key
       unsigned light_twoside:1;
       unsigned front_ccw:1;
       unsigned white_fragments:1;
+      unsigned alpha_to_one:1;
       unsigned flatshade:1;
       unsigned pstipple:1;
       unsigned alpha_func:4;  /**< SVGA3D_CMP_x */
@@ -92,20 +93,19 @@ struct svga_compile_key
    unsigned num_unnormalized_coords:8;
    unsigned clip_plane_enable:PIPE_MAX_CLIP_PLANES;
    unsigned sprite_origin_lower_left:1;
-   unsigned sprite_coord_enable;
+   uint16_t sprite_coord_enable;
    struct {
       unsigned compare_mode:1;
       unsigned compare_func:3;
       unsigned unnormalized:1;
+      unsigned texel_bias:1;
       unsigned width_height_idx:5; /**< texture unit */
-      unsigned texture_target:4;   /**< PIPE_TEXTURE_x */
-      unsigned texture_msaa:1;    /**< A multisample texture? */
-      unsigned sprite_texgen:1;
+      unsigned is_array:1;
       unsigned swizzle_r:3;
       unsigned swizzle_g:3;
       unsigned swizzle_b:3;
       unsigned swizzle_a:3;
-      unsigned return_type:3;  /**< TGSI_RETURN_TYPE_x */
+      unsigned num_samples:5;   /**< Up to 16 samples */
    } tex[PIPE_MAX_SAMPLERS];
    /* Note: svga_compile_keys_equal() depends on the variable-size
     * tex[] array being at the end of this structure.
@@ -135,6 +135,9 @@ struct svga_shader_variant
    /** Parameters used to generate this variant */
    struct svga_compile_key key;
 
+   /* svga shader type */
+   SVGA3dShaderType type;
+
    /* Compiled shader tokens:
     */
    const unsigned *tokens;
@@ -155,6 +158,14 @@ struct svga_shader_variant
                                 *  applied to any of the varyings.
                                 */
 
+   /** Is the color output just a constant value? (fragment shader only) */
+   boolean constant_color_output;
+
+   /** Bitmask indicating which texture units are doing the shadow
+    * comparison test in the shader rather than the sampler state.
+    */
+   unsigned fs_shadow_compare_units;
+
    /** For FS-based polygon stipple */
    unsigned pstipple_sampler_unit;
 
@@ -252,7 +263,8 @@ svga_remap_generic_index(int8_t remap_table[MAX_GENERIC_VARYING],
                          int generic_index);
 
 void
-svga_init_shader_key_common(const struct svga_context *svga, unsigned shader,
+svga_init_shader_key_common(const struct svga_context *svga,
+                            enum pipe_shader_type shader,
                             struct svga_compile_key *key);
 
 struct svga_shader_variant *
@@ -265,7 +277,6 @@ svga_search_shader_token_key(struct svga_shader *shader,
 
 enum pipe_error
 svga_define_shader(struct svga_context *svga,
-                   SVGA3dShaderType type,
                    struct svga_shader_variant *variant);
 
 enum pipe_error
@@ -273,9 +284,11 @@ svga_set_shader(struct svga_context *svga,
                 SVGA3dShaderType type,
                 struct svga_shader_variant *variant);
 
-enum pipe_error
+struct svga_shader_variant *
+svga_new_shader_variant(struct svga_context *svga, enum pipe_shader_type type);
+
+void
 svga_destroy_shader_variant(struct svga_context *svga,
-                            SVGA3dShaderType type,
                             struct svga_shader_variant *variant);
 
 enum pipe_error
@@ -306,7 +319,7 @@ svga_shader_too_large(const struct svga_context *svga,
  * Convert from PIPE_SHADER_* to SVGA3D_SHADERTYPE_*
  */
 static inline SVGA3dShaderType
-svga_shader_type(unsigned shader)
+svga_shader_type(enum pipe_shader_type shader)
 {
    switch (shader) {
    case PIPE_SHADER_VERTEX: