glsl: Handle continuation characters in preprocessor.
[mesa.git] / src / mesa / swrast / s_drawpix.c
index 72398f9ec130ce96bf1d1103e7df08641982bac3..a9ef8e685f1efe05d94ed08cf6b8223cf9b3842a 100644 (file)
 
 
 #include "main/glheader.h"
-#include "bufferobj.h"
+#include "main/bufferobj.h"
 #include "main/context.h"
-#include "convolve.h"
-#include "image.h"
+#include "main/convolve.h"
+#include "main/image.h"
 #include "main/macros.h"
 #include "main/imports.h"
-#include "pixel.h"
-#include "state.h"
+#include "main/pixel.h"
+#include "main/state.h"
 
 #include "s_context.h"
-#include "s_drawpix.h"
 #include "s_span.h"
 #include "s_stencil.h"
 #include "s_zoom.h"
@@ -830,8 +829,17 @@ _swrast_DrawPixels( GLcontext *ctx,
                    const GLvoid *pixels )
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
+   GLboolean save_vp_override = ctx->VertexProgram._Overriden;
 
-   RENDER_START(swrast,ctx);
+   /* We are creating fragments directly, without going through vertex programs.
+    *
+    * This override flag tells the fragment processing code that its input comes
+    * from a non-standard source, and it may therefore not rely on optimizations
+    * that assume e.g. constant color if there is no color vertex array.
+    */
+   _mesa_set_vp_override(ctx, GL_TRUE);
+
+   swrast_render_start(ctx);
 
    if (ctx->NewState)
       _mesa_update_state(ctx);
@@ -841,7 +849,8 @@ _swrast_DrawPixels( GLcontext *ctx,
 
     pixels = _mesa_map_drawpix_pbo(ctx, unpack, pixels);
     if (!pixels) {
-       RENDER_FINISH(swrast,ctx);
+       swrast_render_finish(ctx);
+       _mesa_set_vp_override(ctx, save_vp_override);
        return;
     }
 
@@ -880,9 +889,10 @@ _swrast_DrawPixels( GLcontext *ctx,
       /* don't return yet, clean-up */
    }
 
-   RENDER_FINISH(swrast,ctx);
+   swrast_render_finish(ctx);
+   _mesa_set_vp_override(ctx, save_vp_override);
 
-   _mesa_unmap_drapix_pbo(ctx, unpack);
+   _mesa_unmap_drawpix_pbo(ctx, unpack);
 }
 
 
@@ -905,7 +915,7 @@ _swrast_DrawDepthPixelsMESA( GLcontext *ctx,
    if (swrast->NewState)
       _swrast_validate_derived( ctx );
 
-   RENDER_START(swrast,ctx);
+   swrast_render_start(ctx);
 
    switch (colorFormat) {
    case GL_COLOR_INDEX:
@@ -934,6 +944,6 @@ _swrast_DrawDepthPixelsMESA( GLcontext *ctx,
       _mesa_problem(ctx, "unexpected format in glDrawDepthPixelsMESA");
    }
 
-   RENDER_FINISH(swrast,ctx);
+   swrast_render_finish(ctx);
 }
 #endif