- struct st_context *st = ctx->st;
- struct st_fragment_program *stfp = st->fp;
-
- if (!stfp->bitmap_program) {
- /*
- * Generate new program which is the user-defined program prefixed
- * with the bitmap sampler/kill instructions.
- */
- struct st_fragment_program *bitmap_prog;
- uint sampler;
-
- sampler = find_free_bit(st->fp->Base.Base.SamplersUsed);
- bitmap_prog = make_bitmap_fragment_program(ctx, sampler);
-
- stfp->bitmap_program = (struct st_fragment_program *)
- _mesa_combine_programs(ctx,
- &bitmap_prog->Base.Base, &stfp->Base.Base);
- stfp->bitmap_program->bitmap_sampler = sampler;
+ struct st_fragment_program *bitmap_prog;
+ struct st_fragment_program *stfpIn = (struct st_fragment_program *) fpIn;
+ struct gl_program *newProg;
+ uint sampler;
+
+ /*
+ * Generate new program which is the user-defined program prefixed
+ * with the bitmap sampler/kill instructions.
+ */
+ sampler = find_free_bit(fpIn->Base.SamplersUsed);
+
+ if (stfpIn->glsl_to_tgsi)
+ newProg = make_bitmap_fragment_program_glsl(st, stfpIn, sampler);
+ else {
+ bitmap_prog = make_bitmap_fragment_program(st->ctx, sampler);