Merge branch 'master' into opengl-es-v2
[mesa.git] / src / mesa / drivers / dri / r300 / r300_state.c
index 3060f49aaf8ac27376255137bd4300cc80d2be71..c51285aad9313971aa35ab8156f329864a41465f 100644 (file)
@@ -45,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/framebuffer.h"
 #include "main/simple_list.h"
 #include "main/api_arrayelt.h"
-#include "main/texformat.h"
 
 #include "swrast/swrast.h"
 #include "swrast_setup/swrast_setup.h"
@@ -56,7 +55,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "tnl/t_vp_build.h"
 
 #include "r300_context.h"
-#include "r300_ioctl.h"
 #include "r300_state.h"
 #include "r300_reg.h"
 #include "r300_emit.h"
@@ -999,7 +997,7 @@ static void r300StencilOpSeparate(GLcontext * ctx, GLenum face,
 static void r300UpdateWindow(GLcontext * ctx)
 {
        r300ContextPtr rmesa = R300_CONTEXT(ctx);
-       __DRIdrawablePrivate *dPriv = radeon_get_drawable(&rmesa->radeon);
+       __DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
        GLfloat xoffset = dPriv ? (GLfloat) dPriv->x : 0;
        GLfloat yoffset = dPriv ? (GLfloat) dPriv->y + dPriv->h : 0;
        const GLfloat *v = ctx->Viewport._WindowMap.m;
@@ -1052,7 +1050,7 @@ static void r300DepthRange(GLcontext * ctx, GLclampd nearval, GLclampd farval)
 void r300UpdateViewportOffset(GLcontext * ctx)
 {
        r300ContextPtr rmesa = R300_CONTEXT(ctx);
-       __DRIdrawablePrivate *dPriv = radeon_get_drawable(&rmesa->radeon);
+       __DRIdrawable *dPriv = radeon_get_drawable(&rmesa->radeon);
        GLfloat xoffset = (GLfloat) dPriv->x;
        GLfloat yoffset = (GLfloat) dPriv->y + dPriv->h;
        const GLfloat *v = ctx->Viewport._WindowMap.m;
@@ -1313,7 +1311,7 @@ static void r300SetupTextures(GLcontext * ctx)
                fprintf(stderr,
                        "Aiiee ! mtu=%d is greater than R300_MAX_TEXTURE_UNITS=%d\n",
                        mtu, R300_MAX_TEXTURE_UNITS);
-               _mesa_exit(-1);
+               exit(-1);
        }
 
        /* We cannot let disabled tmu offsets pass DRM */
@@ -1770,9 +1768,10 @@ static void r300ResetHwState(r300ContextPtr r300)
        radeon_firevertices(&r300->radeon);
 
        r300ColorMask(ctx,
-                     ctx->Color.ColorMask[RCOMP],
-                     ctx->Color.ColorMask[GCOMP],
-                     ctx->Color.ColorMask[BCOMP], ctx->Color.ColorMask[ACOMP]);
+                     ctx->Color.ColorMask[0][RCOMP],
+                     ctx->Color.ColorMask[0][GCOMP],
+                     ctx->Color.ColorMask[0][BCOMP],
+                      ctx->Color.ColorMask[0][ACOMP]);
 
        r300Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test);
        r300DepthMask(ctx, ctx->Depth.Mask);
@@ -2041,7 +2040,7 @@ static const GLfloat *get_fragmentprogram_constant(GLcontext *ctx, GLuint index,
                }
 
                case RC_STATE_R300_WINDOW_DIMENSION: {
-                       __DRIdrawablePrivate * drawable = radeon_get_drawable(&rmesa->radeon);
+                       __DRIdrawable * drawable = radeon_get_drawable(&rmesa->radeon);
                        buffer[0] = drawable->w * 0.5f; /* width*0.5 */
                        buffer[1] = drawable->h * 0.5f; /* height*0.5 */
                        buffer[2] = 0.5F;       /* for moving range [-1 1] -> [0 1] */