~ubuntu-branches/ubuntu/precise/mesa/precise-updates

« back to all changes in this revision

Viewing changes to src/mesa/program/program.c

  • Committer: Package Import Robot
  • Author(s): Robert Hooker
  • Date: 2012-02-02 12:05:48 UTC
  • mfrom: (1.7.1) (3.3.27 sid)
  • Revision ID: package-import@ubuntu.com-20120202120548-nvkma85jq0h4coix
Tags: 8.0~rc2-0ubuntu4
Drop drisearchdir handling, it is no longer needed with multiarch
and dri-alternates being removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
   ASSERT(MAX_TEXTURE_UNITS <= (1 << 5));
79
79
 
80
80
   /* If this fails, increase prog_instruction::TexSrcTarget size */
81
 
   ASSERT(NUM_TEXTURE_TARGETS <= (1 << 3));
 
81
   ASSERT(NUM_TEXTURE_TARGETS <= (1 << 4));
82
82
 
83
83
   ctx->Program.ErrorPos = -1;
84
84
   ctx->Program.ErrorString = _mesa_strdup("");
140
140
#endif
141
141
#if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program
142
142
   _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
143
 
   _mesa_delete_program_cache(ctx, ctx->FragmentProgram.Cache);
 
143
   _mesa_delete_shader_cache(ctx, ctx->FragmentProgram.Cache);
144
144
#endif
145
145
#if FEATURE_ARB_geometry_shader4
146
146
   _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
388
388
   if (prog->String)
389
389
      free(prog->String);
390
390
 
391
 
   _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
392
 
 
 
391
   if (prog->Instructions) {
 
392
      _mesa_free_instructions(prog->Instructions, prog->NumInstructions);
 
393
   }
393
394
   if (prog->Parameters) {
394
395
      _mesa_free_parameter_list(prog->Parameters);
395
396
   }
396
 
   if (prog->Varying) {
397
 
      _mesa_free_parameter_list(prog->Varying);
398
 
   }
399
 
   if (prog->Attributes) {
400
 
      _mesa_free_parameter_list(prog->Attributes);
401
 
   }
402
397
 
403
398
   free(prog);
404
399
}
421
416
 
422
417
/**
423
418
 * Reference counting for vertex/fragment programs
 
419
 * This is normally only called from the _mesa_reference_program() macro
 
420
 * when there's a real pointer change.
424
421
 */
425
422
void
426
 
_mesa_reference_program(struct gl_context *ctx,
427
 
                        struct gl_program **ptr,
428
 
                        struct gl_program *prog)
 
423
_mesa_reference_program_(struct gl_context *ctx,
 
424
                         struct gl_program **ptr,
 
425
                         struct gl_program *prog)
429
426
{
 
427
#ifndef NDEBUG
430
428
   assert(ptr);
431
429
   if (*ptr && prog) {
432
430
      /* sanity check */
438
436
      else if ((*ptr)->Target == MESA_GEOMETRY_PROGRAM)
439
437
         ASSERT(prog->Target == MESA_GEOMETRY_PROGRAM);
440
438
   }
441
 
   if (*ptr == prog) {
442
 
      return;  /* no change */
443
 
   }
 
439
#endif
 
440
 
444
441
   if (*ptr) {
445
442
      GLboolean deleteFlag;
446
443
 
519
516
   if (prog->Parameters)
520
517
      clone->Parameters = _mesa_clone_parameter_list(prog->Parameters);
521
518
   memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
522
 
   if (prog->Varying)
523
 
      clone->Varying = _mesa_clone_parameter_list(prog->Varying);
524
 
   if (prog->Attributes)
525
 
      clone->Attributes = _mesa_clone_parameter_list(prog->Attributes);
526
519
   memcpy(clone->LocalParams, prog->LocalParams, sizeof(clone->LocalParams));
527
520
   clone->IndirectRegisterFiles = prog->IndirectRegisterFiles;
528
521
   clone->NumInstructions = prog->NumInstructions;
1029
1022
   GLuint i;
1030
1023
   GLuint whiteSwizzle;
1031
1024
   GLint whiteIndex = _mesa_add_unnamed_constant(prog->Parameters,
1032
 
                                                 white, 4, &whiteSwizzle);
 
1025
                                                 (gl_constant_value *) white,
 
1026
                                                 4, &whiteSwizzle);
1033
1027
 
1034
1028
   (void) whiteIndex;
1035
1029