r300g: fix glean/pointSprite using lodbias correction
[mesa.git] / src / gallium / drivers / r300 / r300_state_invariant.c
index ffb175febf16ac6f2692b7b73b2e3c9dda96a66e..cd9443fa260283df1db787059f36f3a92b4b1008 100644 (file)
@@ -41,18 +41,19 @@ struct pipe_viewport_state r300_viewport_identity = {
 void r300_emit_invariant_state(struct r300_context* r300,
                                unsigned size, void* state)
 {
-    struct r300_capabilities* caps = &r300_screen(r300->context.screen)->caps;
     CS_LOCALS(r300);
 
-    BEGIN_CS(12 + (caps->has_tcl ? 2: 0));
+    if (r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0)) {
+        /* Subpixel multisampling for AA. */
+        BEGIN_CS(4);
+        OUT_CS_REG(R300_GB_MSPOS0, 0x66666666);
+        OUT_CS_REG(R300_GB_MSPOS1, 0x6666666);
+        END_CS;
+    }
+
+    BEGIN_CS(12 + (r300->screen->caps.has_tcl ? 2 : 0));
 
     /*** Graphics Backend (GB) ***/
-    /* Subpixel multisampling for AA
-     * These are commented out because glisse's CS checker doesn't like them.
-     * I presume these will be re-enabled later.
-     * OUT_CS_REG(R300_GB_MSPOS0, 0x66666666);
-     * OUT_CS_REG(R300_GB_MSPOS1, 0x6666666);
-     */
     /* Source of fog depth */
     OUT_CS_REG(R300_GB_SELECT, R300_GB_FOG_SELECT_1_1_W);
 
@@ -66,7 +67,7 @@ void r300_emit_invariant_state(struct r300_context* r300,
     /* Sign/normalize control */
     OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, R300_SGN_NORM_NO_ZERO);
     /* TCL-only stuff */
-    if (caps->has_tcl) {
+    if (r300->screen->caps.has_tcl) {
         /* Amount of time to wait for vertex fetches in PVS */
         OUT_CS_REG(VAP_PVS_VTX_TIMEOUT_REG, 0xffff);
     }
@@ -74,10 +75,10 @@ void r300_emit_invariant_state(struct r300_context* r300,
     END_CS;
 
     /* XXX unsorted stuff from surface_fill */
-    BEGIN_CS(38 + (caps->has_tcl ? 7 : 0) +
-             (caps->family >= CHIP_FAMILY_RV350 ? 4 : 0));
+    BEGIN_CS(38 + (r300->screen->caps.has_tcl ? 7 : 0) +
+             (r300->screen->caps.is_rv350 ? 4 : 0));
 
-    if (caps->has_tcl) {
+    if (r300->screen->caps.has_tcl) {
         /*Flushing PVS is required before the VAP_GB registers can be changed*/
         OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0);
         OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4);
@@ -107,7 +108,7 @@ void r300_emit_invariant_state(struct r300_context* r300,
     OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525);
     OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000);
 
-    if (caps->family >= CHIP_FAMILY_RV350) {
+    if (r300->screen->caps.is_rv350) {
         OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x01010101);
         OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFEFEFEFE);
     }