summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorZou Nan hai <[email protected]>2007-09-27 15:47:00 +0800
committerZou Nan hai <[email protected]>2007-09-27 15:47:00 +0800
commit35a0634e358baac832d6e5a76630fcae57a948a7 (patch)
tree7cce01bd7c8b55dc00714f77b188f4d5c7931e26 /src/mesa/drivers/dri/i965
parentec9e7bc753316cebed9c9ce12aa5513486c6b8d0 (diff)
fix issue when only fragment shader or vertex shader is used
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 8366f14dbea..2031d556c1b 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -69,11 +69,18 @@ static void brwUseProgram(GLcontext *ctx, GLuint program)
_mesa_use_program(ctx, program);
sh_prog = ctx->Shader.CurrentProgram;
if (sh_prog) {
- ctx->VertexProgram.Enabled = GL_TRUE;
- ctx->FragmentProgram.Enabled = GL_TRUE;
- brw->attribs.VertexProgram->Current = sh_prog->VertexProgram;
- brw->attribs.FragmentProgram->Current = sh_prog->FragmentProgram;
- }
+ if (sh_prog->VertexProgram) {
+ brw->attribs.VertexProgram->Current = sh_prog->VertexProgram;
+ ctx->VertexProgram.Enabled = GL_TRUE;
+ }else
+ ctx->VertexProgram.Enabled = GL_FALSE;
+
+ if (sh_prog->FragmentProgram) {
+ brw->attribs.FragmentProgram->Current = sh_prog->FragmentProgram;
+ ctx->FragmentProgram.Enabled = GL_TRUE;
+ } else
+ ctx->VertexProgram.Enabled = GL_FALSE;
+ }
}
static void brwInitProgFuncs( struct dd_function_table *functions )