~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/i965/brw_draw.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
 * programs be immune to the active primitive (ie. cope with all
78
78
 * possibilities).  That may not be realistic however.
79
79
 */
80
 
static GLuint brw_set_prim(struct brw_context *brw, GLenum prim)
 
80
static GLuint brw_set_prim(struct brw_context *brw,
 
81
                           const struct _mesa_prim *prim)
81
82
{
82
83
   GLcontext *ctx = &brw->intel.ctx;
 
84
   GLenum mode = prim->mode;
83
85
 
84
86
   if (INTEL_DEBUG & DEBUG_PRIMS)
85
 
      printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim));
86
 
   
 
87
      printf("PRIM: %s\n", _mesa_lookup_enum_by_nr(prim->mode));
 
88
 
87
89
   /* Slight optimization to avoid the GS program when not needed:
88
90
    */
89
 
   if (prim == GL_QUAD_STRIP &&
 
91
   if (mode == GL_QUAD_STRIP &&
90
92
       ctx->Light.ShadeModel != GL_FLAT &&
91
93
       ctx->Polygon.FrontMode == GL_FILL &&
92
94
       ctx->Polygon.BackMode == GL_FILL)
93
 
      prim = GL_TRIANGLE_STRIP;
94
 
 
95
 
   if (prim != brw->primitive) {
96
 
      brw->primitive = prim;
 
95
      mode = GL_TRIANGLE_STRIP;
 
96
 
 
97
   if (prim->mode == GL_QUADS && prim->count == 4 &&
 
98
       ctx->Light.ShadeModel != GL_FLAT &&
 
99
       ctx->Polygon.FrontMode == GL_FILL &&
 
100
       ctx->Polygon.BackMode == GL_FILL) {
 
101
      mode = GL_TRIANGLE_FAN;
 
102
   }
 
103
 
 
104
   if (mode != brw->primitive) {
 
105
      brw->primitive = mode;
97
106
      brw->state.dirty.brw |= BRW_NEW_PRIMITIVE;
98
107
 
99
 
      if (reduced_prim[prim] != brw->intel.reduced_primitive) {
100
 
         brw->intel.reduced_primitive = reduced_prim[prim];
 
108
      if (reduced_prim[mode] != brw->intel.reduced_primitive) {
 
109
         brw->intel.reduced_primitive = reduced_prim[mode];
101
110
         brw->state.dirty.brw |= BRW_NEW_REDUCED_PRIMITIVE;
102
111
      }
103
112
   }
104
113
 
105
 
   return prim_to_hw_prim[prim];
 
114
   return prim_to_hw_prim[mode];
106
115
}
107
116
 
108
117
 
142
151
   prim_packet.start_instance_location = 0;
143
152
   prim_packet.base_vert_location = prim->basevertex;
144
153
 
145
 
   /* Can't wrap here, since we rely on the validated state. */
146
 
   intel->no_batch_wrap = GL_TRUE;
147
 
 
148
154
   /* If we're set to always flush, do it before and after the primitive emit.
149
155
    * We want to catch both missed flushes that hurt instruction/state cache
150
156
    * and missed flushes of the render cache as it heads to other parts of
160
166
   if (intel->always_flush_cache) {
161
167
      intel_batchbuffer_emit_mi_flush(intel->batch);
162
168
   }
163
 
 
164
 
   intel->no_batch_wrap = GL_FALSE;
165
169
}
166
170
 
167
171
static void brw_merge_inputs( struct brw_context *brw,
171
175
   GLuint i;
172
176
 
173
177
   for (i = 0; i < VERT_ATTRIB_MAX; i++)
174
 
      dri_bo_unreference(brw->vb.inputs[i].bo);
 
178
      drm_intel_bo_unreference(brw->vb.inputs[i].bo);
175
179
 
176
180
   memset(&brw->vb.inputs, 0, sizeof(brw->vb.inputs));
177
181
   memset(&brw->vb.info, 0, sizeof(brw->vb.info));
351
355
       */
352
356
      intel_batchbuffer_require_space(intel->batch, intel->batch->size / 4);
353
357
 
354
 
      hw_prim = brw_set_prim(brw, prim[i].mode);
 
358
      hw_prim = brw_set_prim(brw, &prim[i]);
355
359
 
356
360
      if (first_time || (brw->state.dirty.brw & BRW_NEW_PRIMITIVE)) {
357
361
         first_time = GL_FALSE;
385
389
            }
386
390
         }
387
391
 
 
392
         intel->no_batch_wrap = GL_TRUE;
388
393
         brw_upload_state(brw);
389
394
      }
390
395
 
391
396
      brw_emit_prim(brw, &prim[i], hw_prim);
392
397
 
 
398
      intel->no_batch_wrap = GL_FALSE;
 
399
 
393
400
      retval = GL_TRUE;
394
401
   }
395
402
 
466
473
   int i;
467
474
 
468
475
   if (brw->vb.upload.bo != NULL) {
469
 
      dri_bo_unreference(brw->vb.upload.bo);
 
476
      drm_intel_bo_unreference(brw->vb.upload.bo);
470
477
      brw->vb.upload.bo = NULL;
471
478
   }
472
479
 
473
480
   for (i = 0; i < VERT_ATTRIB_MAX; i++) {
474
 
      dri_bo_unreference(brw->vb.inputs[i].bo);
 
481
      drm_intel_bo_unreference(brw->vb.inputs[i].bo);
475
482
      brw->vb.inputs[i].bo = NULL;
476
483
   }
477
484
 
478
 
   dri_bo_unreference(brw->ib.bo);
 
485
   drm_intel_bo_unreference(brw->ib.bo);
479
486
   brw->ib.bo = NULL;
480
487
}