Merge remote branch 'origin/7.8'
[mesa.git] / src / mesa / drivers / dri / r300 / compiler / radeon_code.h
index 6f5bc288316d1b7c9b5d122406511d9407b58d07..6d979bbaecf7b17060dc66e426e31b9dcf0dde37 100644 (file)
@@ -59,7 +59,9 @@ enum {
        RC_STATE_SHADOW_AMBIENT = 0,
 
        RC_STATE_R300_WINDOW_DIMENSION,
-       RC_STATE_R300_TEXRECT_FACTOR
+       RC_STATE_R300_TEXRECT_FACTOR,
+       RC_STATE_R300_VIEWPORT_SCALE,
+       RC_STATE_R300_VIEWPORT_OFFSET
 };
 
 struct rc_constant {
@@ -88,6 +90,23 @@ unsigned rc_constants_add_state(struct rc_constant_list * c, unsigned state1, un
 unsigned rc_constants_add_immediate_vec4(struct rc_constant_list * c, const float * data);
 unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float data, unsigned * swizzle);
 
+/**
+ * Compare functions.
+ *
+ * \note By design, RC_COMPARE_FUNC_xxx + GL_NEVER gives you
+ * the correct GL compare function.
+ */
+typedef enum {
+       RC_COMPARE_FUNC_NEVER = 0,
+       RC_COMPARE_FUNC_LESS,
+       RC_COMPARE_FUNC_EQUAL,
+       RC_COMPARE_FUNC_LEQUAL,
+       RC_COMPARE_FUNC_GREATER,
+       RC_COMPARE_FUNC_NOTEQUAL,
+       RC_COMPARE_FUNC_GEQUAL,
+       RC_COMPARE_FUNC_ALWAYS
+} rc_compare_func;
+
 /**
  * Stores state that influences the compilation of a fragment program.
  */
@@ -105,10 +124,12 @@ struct r300_fragment_program_external_state {
 
                /**
                 * If the sampler is used as a shadow sampler,
-                * this field is (texture_compare_func - GL_NEVER).
-                * [e.g. if compare function is GL_LEQUAL, this field is 3]
+                * this field specifies the compare function.
+                *
+                * Otherwise, this field is \ref RC_COMPARE_FUNC_NEVER (aka 0).
                 *
                 * Otherwise, this field is 0.
+                * \sa rc_compare_func
                 */
                unsigned texture_compare_func : 3;
        } unit[16];
@@ -160,10 +181,11 @@ struct r500_fragment_program_code {
                uint32_t inst5;
        } inst[R500_PFS_MAX_INST];
 
-       int inst_offset;
-       int inst_end;
+       int inst_end; /* Number of instructions - 1; also, last instruction to be executed */
 
        int max_temp_idx;
+
+       uint32_t us_fc_ctrl;
 };
 
 struct rX00_fragment_program_code {
@@ -204,4 +226,5 @@ struct r300_vertex_program_code {
 
 void r300_vertex_program_dump(struct r300_vertex_program_code * vs);
 
-#endif /* RADEON_CODE_H */
\ No newline at end of file
+#endif /* RADEON_CODE_H */
+