summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-06-20 11:01:04 -0600
committerBrian <brian@i915.localnet.net>2007-06-20 11:01:04 -0600
commita4af3e5ab3fa0f45c25673c93d802cdff087145c (patch)
treeac9369d4875c0e10b6df58bffb9fef8ebdba0ca4 /src/mesa/drivers
parentb9080dd5493eb23af6c5c494550c7b1cb481ca7b (diff)
Effectively disable _TexEnvProgram before calling _swrast_DrawPixels().
It's OK to use _TexEnvProgram regardless of the texture state, but if fog is also enabled, the fragment program is lacking the actual fog computation so fogging doesn't appear. Fixing this might involve a new _MaintainFogProgram field and related code. For now, just disable the _TexEnvProgram and let swrast handle everything.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915/intel_pixel.c18
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_pixel_draw.c14
2 files changed, 28 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_pixel.c b/src/mesa/drivers/dri/i915/intel_pixel.c
index 535cbfcb26..a52a81bf13 100644
--- a/src/mesa/drivers/dri/i915/intel_pixel.c
+++ b/src/mesa/drivers/dri/i915/intel_pixel.c
@@ -440,9 +440,21 @@ intelDrawPixels( GLcontext *ctx,
fprintf(stderr, "%s\n", __FUNCTION__);
if (!intelTryDrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels ))
- _swrast_DrawPixels( ctx, x, y, width, height, format, type,
- unpack, pixels );
+ unpack, pixels )) {
+ if (ctx->FragmentProgram._Current ==
+ ctx->FragmentProgram._TexEnvProgram) {
+ /* don't want the i915 texenv program to be applied to DrawPixels */
+ 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 );
+ }
+ }
}
diff --git a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
index 10a079896a..46480da1b1 100644
--- a/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
+++ b/src/mesa/drivers/dri/i915tex/intel_pixel_draw.c
@@ -363,5 +363,17 @@ intelDrawPixels(GLcontext * ctx,
if (INTEL_DEBUG & DEBUG_PIXEL)
_mesa_printf("%s: fallback to swrast\n", __FUNCTION__);
- _swrast_DrawPixels(ctx, x, y, width, height, format, type, unpack, pixels);
+ if (ctx->FragmentProgram._Current ==
+ ctx->FragmentProgram._TexEnvProgram) {
+ /* don't want the i915 texenv program to be applied to DrawPixels */
+ 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 );
+ }
}