r300: operate on copy of a program when pairing instructions
authorMaciej Cencora <m.cencora@gmail.com>
Sat, 4 Jul 2009 14:52:48 +0000 (16:52 +0200)
committerMaciej Cencora <m.cencora@gmail.com>
Mon, 13 Jul 2009 17:28:12 +0000 (19:28 +0200)
We need to keep unpaired program for vertex program NQSSADCE.

src/mesa/drivers/dri/r300/radeon_program_pair.c

index 906d36e522614deb35718420f32b0fad7dcb0010..d6fb474cf23b65c92edb212ed31d801bf336af7a 100644 (file)
@@ -870,7 +870,7 @@ GLboolean radeonPairProgram(GLcontext *ctx, struct gl_program *program,
 
        _mesa_bzero(&s, sizeof(s));
        s.Ctx = ctx;
-       s.Program = program;
+       s.Program = _mesa_clone_program(ctx, program);
        s.Handler = handler;
        s.UserData = userdata;
        s.Debug = (RADEON_DEBUG & DEBUG_PIXEL) ? GL_TRUE : GL_FALSE;
@@ -904,6 +904,8 @@ GLboolean radeonPairProgram(GLcontext *ctx, struct gl_program *program,
        _mesa_free(s.ValuePool);
        _mesa_free(s.ReaderPool);
 
+       _mesa_reference_program(ctx, &s.Program, NULL);
+
        return !s.Error;
 }