drivers: don't include texformat.h
[mesa.git] / src / mesa / drivers / dri / r600 / r700_state.c
index fc0b5116843725e595fe7c652ee1611fdcb4dd15..65f83b831548049096e4ebc6d27d09da37b205aa 100644 (file)
@@ -46,7 +46,6 @@
 #include "shader/prog_parameter.h"
 #include "shader/prog_statevars.h"
 #include "vbo/vbo.h"
-#include "main/texformat.h"
 
 #include "r600_context.h"
 
@@ -92,7 +91,25 @@ void r700UpdateShaders (GLcontext * ctx)  //----------------------------------
            }
     }
 
-    r700SelectVertexShader(ctx);
+    r700SelectVertexShader(ctx, 1);
+    r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
+    context->radeon.NewGLState = 0;
+}
+
+void r700UpdateShaders2(GLcontext * ctx)  
+{
+    context_t *context = R700_CONTEXT(ctx);
+
+    /* should only happenen once, just after context is created */
+    /* TODO: shouldn't we fallback to sw here? */
+    if (!ctx->FragmentProgram._Current) {
+           _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n");
+           return;
+    }
+
+    r700SelectFragmentShader(ctx);
+
+    r700SelectVertexShader(ctx, 2);
     r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS);
     context->radeon.NewGLState = 0;
 }
@@ -1277,10 +1294,11 @@ void r700SetScissor(context_t *context) //---------------
                return;
        }
        if (context->radeon.state.scissor.enabled) {
+               /* r600 has exclusive scissors */
                x1 = context->radeon.state.scissor.rect.x1;
                y1 = context->radeon.state.scissor.rect.y1;
-               x2 = context->radeon.state.scissor.rect.x2;
-               y2 = context->radeon.state.scissor.rect.y2;
+               x2 = context->radeon.state.scissor.rect.x2 + 1;
+               y2 = context->radeon.state.scissor.rect.y2 + 1;
        } else {
                if (context->radeon.radeonScreen->driScreen->dri2.enabled) {
                        x1 = 0;