summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915/intel_pixel.c
diff options
context:
space:
mode:
authorZou Nan hai <nanhai.zou@intel.com>2007-07-04 10:52:35 +0800
committerZou Nan hai <nanhai.zou@intel.com>2007-07-04 10:52:35 +0800
commitfb9ee9b323bff93973a39560b2bc007aace4bddd (patch)
tree05e1e72e8f4d321cde2c48b8518e6d9736c680dd /src/mesa/drivers/dri/i915/intel_pixel.c
parent285b326c606e9b2f90e4fe177b15b3fa23239b86 (diff)
parent7ff4359a3be1278b26950f96ab23014a667af838 (diff)
Merge branch 'master' of git+ssh://znh@git.freedesktop.org/git/mesa/mesa into 965-glsl
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_pixel.c')
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c
index 535cbfcb26..d175870a0c 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -439,10 +439,26 @@ intelDrawPixels( GLcontext *ctx,
if (INTEL_DEBUG & DEBUG_PIXEL)
fprintf(stderr, "%s\n", __FUNCTION__);
- if (!intelTryDrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels ))
+ if (intelTryDrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels ))
+ return;
+
+ if (ctx->FragmentProgram._Current == ctx->FragmentProgram._TexEnvProgram) {
+ /*
+ * We don't want the i915 texenv program to be applied to DrawPixels.
+ * This is really just a performance optimization (mesa will other-
+ * wise happily run the fragment program on each pixel in the image).
+ */
+ struct gl_fragment_program *fpSave = ctx->FragmentProgram._Current;
+ ctx->FragmentProgram._Current = NULL;
+ _swrast_DrawPixels( ctx, x, y, width, height, format, type,
+ unpack, pixels );
+ ctx->FragmentProgram._Current = fpSave;
+ }
+ else {
_swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
+ unpack, pixels );
+ }
}