From 60b3fe6c19eb881f6193ba46450c0c9f559a10e5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 9 Feb 2009 12:12:09 -0700 Subject: i965: need to disable current shader, if any, in intel_clear_tris() Fixes bad background in all the progs/glsl/ tests. --- src/mesa/drivers/dri/intel/intel_clear.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index f95d055e62..a47c4d4050 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -39,6 +39,7 @@ #include "main/macros.h" #include "main/matrix.h" #include "main/texstate.h" +#include "main/shaders.h" #include "main/stencil.h" #include "main/varray.h" #include "glapi/dispatch.h" @@ -71,6 +72,7 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) struct gl_framebuffer *fb = ctx->DrawBuffer; int i; GLboolean saved_fp_enable = GL_FALSE, saved_vp_enable = GL_FALSE; + GLboolean saved_shader_program = 0; unsigned int saved_active_texture; assert((mask & ~(BUFFER_BIT_BACK_LEFT | BUFFER_BIT_FRONT_LEFT | @@ -109,6 +111,10 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) saved_vp_enable = GL_TRUE; _mesa_Disable(GL_VERTEX_PROGRAM_ARB); } + if (ctx->Extensions.ARB_shader_objects && ctx->Shader.CurrentProgram) { + saved_shader_program = ctx->Shader.CurrentProgram->Name; + _mesa_UseProgramObjectARB(0); + } if (ctx->Texture._EnabledUnits != 0) { int i; @@ -215,6 +221,9 @@ intel_clear_tris(GLcontext *ctx, GLbitfield mask) if (saved_vp_enable) _mesa_Enable(GL_VERTEX_PROGRAM_ARB); + if (saved_shader_program) + _mesa_UseProgramObjectARB(saved_shader_program); + _mesa_PopClientAttrib(); _mesa_PopAttrib(); } -- cgit v1.2.3