r300g: re-order caps
[mesa.git] / src / gallium / drivers / r300 / r300_context.h
index 2e8601b65efccff019de9d87f5dc09bfa26beb03..5ad448978b9d572efe04127de030a397ec5ecff8 100644 (file)
@@ -45,6 +45,8 @@ struct r300_atom {
     struct r300_atom *prev, *next;
     /* Name, for debugging. */
     const char* name;
+    /* Stat counter. */
+    uint64_t counter;
     /* Opaque state. */
     void* state;
     /* Emit the state to the context. */
@@ -92,6 +94,7 @@ struct r300_rs_state {
     uint32_t vap_control_status;    /* R300_VAP_CNTL_STATUS: 0x2140 */
     uint32_t antialiasing_config;   /* R300_GB_AA_CONFIG: 0x4020 */
     uint32_t point_size;            /* R300_GA_POINT_SIZE: 0x421c */
+    uint32_t point_minmax;          /* R300_GA_POINT_MINMAX: 0x4230 */
     uint32_t line_control;          /* R300_GA_LINE_CNTL: 0x4234 */
     float depth_scale;            /* R300_SU_POLY_OFFSET_FRONT_SCALE: 0x42a4 */
                                   /* R300_SU_POLY_OFFSET_BACK_SCALE: 0x42ac */
@@ -117,6 +120,10 @@ struct r300_rs_state {
 };
 
 struct r300_rs_block {
+    uint32_t vap_vtx_state_cntl;  /* R300_VAP_VTX_STATE_CNTL: 0x2180 */
+    uint32_t vap_vsm_vtx_assm;    /* R300_VAP_VSM_VTX_ASSM: 0x2184 */
+    uint32_t vap_out_vtx_fmt[2];  /* R300_VAP_OUTPUT_VTX_FMT_[0-1]: 0x2090 */
+
     uint32_t ip[8]; /* R300_RS_IP_[0-7], R500_RS_IP_[0-7] */
     uint32_t count; /* R300_RS_COUNT */
     uint32_t inst_count; /* R300_RS_INST_COUNT */
@@ -145,6 +152,10 @@ struct r300_texture_format_state {
 struct r300_sampler_view {
     struct pipe_sampler_view base;
 
+    /* Swizzles in the UTIL_FORMAT_SWIZZLE_* representation,
+     * derived from base. */
+    unsigned char swizzle[4];
+
     /* Copy of r300_texture::texture_format_state with format-specific bits
      * added. */
     struct r300_texture_format_state format;
@@ -160,6 +171,13 @@ struct r300_texture_fb_state {
     uint32_t zb_format; /* R300_ZB_FORMAT */
 };
 
+struct r300_texture_sampler_state {
+    struct r300_texture_format_state format;
+    uint32_t filter0;      /* R300_TX_FILTER0: 0x4400 */
+    uint32_t filter1;      /* R300_TX_FILTER1: 0x4440 */
+    uint32_t border_color;  /* R300_TX_BORDER_COLOR: 0x45c0 */
+};
+
 struct r300_textures_state {
     /* Textures. */
     struct r300_sampler_view *sampler_views[16];
@@ -171,12 +189,7 @@ struct r300_textures_state {
     /* This is the merge of the texture and sampler states. */
     unsigned count;
     uint32_t tx_enable;         /* R300_TX_ENABLE: 0x4101 */
-    struct r300_texture_sampler_state {
-        struct r300_texture_format_state format;
-        uint32_t filter0;      /* R300_TX_FILTER0: 0x4400 */
-        uint32_t filter1;      /* R300_TX_FILTER1: 0x4440 */
-        uint32_t border_color;  /* R300_TX_BORDER_COLOR: 0x45c0 */
-    } regs[16];
+    struct r300_texture_sampler_state regs[16];
 };
 
 struct r300_vertex_stream_state {
@@ -188,12 +201,6 @@ struct r300_vertex_stream_state {
     unsigned count;
 };
 
-struct r300_vap_output_state {
-    uint32_t vap_vtx_state_cntl;  /* R300_VAP_VTX_STATE_CNTL: 0x2180 */
-    uint32_t vap_vsm_vtx_assm;    /* R300_VAP_VSM_VTX_ASSM: 0x2184 */
-    uint32_t vap_out_vtx_fmt[2];  /* R300_VAP_OUTPUT_VTX_FMT_[0-1]: 0x2090 */
-};
-
 struct r300_viewport_state {
     float xscale;         /* R300_VAP_VPORT_XSCALE:  0x2098 */
     float xoffset;        /* R300_VAP_VPORT_XOFFSET: 0x209c */
@@ -255,6 +262,10 @@ struct r300_texture {
     /* A pitch for each mip-level */
     unsigned pitch[R300_MAX_TEXTURE_LEVELS];
 
+    /* A pitch multiplied by blockwidth as hardware wants
+     * the number of pixels instead of the number of blocks. */
+    unsigned hwpitch[R300_MAX_TEXTURE_LEVELS];
+
     /* Size of one zslice or face based on the texture target */
     unsigned layer_size[R300_MAX_TEXTURE_LEVELS];
 
@@ -310,8 +321,6 @@ struct r300_vertex_element_state {
     struct r300_vertex_stream_state vertex_stream;
 };
 
-extern struct pipe_viewport_state r300_viewport_identity;
-
 struct r300_context {
     /* Parent class */
     struct pipe_context context;
@@ -374,7 +383,7 @@ struct r300_context {
     struct r300_atom query_start;
     /* Rasterizer state. */
     struct r300_atom rs_state;
-    /* RS block state. */
+    /* RS block state + VAP (vertex shader) output mapping state. */
     struct r300_atom rs_block_state;
     /* Scissor state. */
     struct r300_atom scissor_state;
@@ -382,8 +391,6 @@ struct r300_context {
     struct r300_atom textures_state;
     /* Vertex stream formatting state. */
     struct r300_atom vertex_stream_state;
-    /* VAP (vertex shader) output mapping state. */
-    struct r300_atom vap_output_state;
     /* Vertex shader. */
     struct r300_atom vs_state;
     /* Vertex shader constant buffer. */
@@ -417,6 +424,9 @@ struct r300_context {
 
     struct pipe_viewport_state viewport;
 
+    /* Stream locations for SWTCL. */
+    int stream_loc_notcl[16];
+
     /* Flag indicating whether or not the HW is dirty. */
     uint32_t dirty_hw;
     /* Whether polygon offset is enabled. */
@@ -430,10 +440,15 @@ struct r300_context {
     boolean stencil_ref_bf_fallback;
     /* Point sprites texcoord index,  1 bit per texcoord */
     int sprite_coord_enable;
+    /* Whether two-sided color selection is enabled (AKA light_twoside). */
+    boolean two_sided_color;
 
     /* upload managers */
     struct u_upload_mgr *upload_vb;
     struct u_upload_mgr *upload_ib;
+
+    /* Stat counter. */
+    uint64_t flush_counter;
 };
 
 /* Convenience cast wrapper. */