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

« back to all changes in this revision

Viewing changes to src/gallium/drivers/svga/svga_draw.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:
128
128
}
129
129
 
130
130
 
 
131
/**
 
132
 * Determine whether the specified buffer is referred in the primitive queue,
 
133
 * for which no commands have been written yet.
 
134
 */
 
135
boolean
 
136
svga_hwtnl_is_buffer_referred( struct svga_hwtnl *hwtnl,
 
137
                               struct pipe_resource *buffer)
 
138
{
 
139
   unsigned i;
 
140
 
 
141
   if (svga_buffer_is_user_buffer(buffer)) {
 
142
      return FALSE;
 
143
   }
 
144
 
 
145
   if (!hwtnl->cmd.prim_count) {
 
146
      return FALSE;
 
147
   }
 
148
 
 
149
   for (i = 0; i < hwtnl->cmd.vdecl_count; ++i) {
 
150
      if (hwtnl->cmd.vdecl_vb[i] == buffer) {
 
151
         return TRUE;
 
152
      }
 
153
   }
 
154
 
 
155
   for (i = 0; i < hwtnl->cmd.prim_count; ++i) {
 
156
      if (hwtnl->cmd.prim_ib[i] == buffer) {
 
157
         return TRUE;
 
158
      }
 
159
   }
 
160
 
 
161
   return FALSE;
 
162
}
 
163
 
131
164
 
132
165
enum pipe_error
133
166
svga_hwtnl_flush( struct svga_hwtnl *hwtnl )
145
178
      unsigned i;
146
179
 
147
180
      /* Unmap upload manager vertex buffers */
148
 
      u_upload_flush(svga->upload_vb);
 
181
      u_upload_unmap(svga->upload_vb);
149
182
 
150
183
      for (i = 0; i < hwtnl->cmd.vdecl_count; i++) {
151
184
         handle = svga_buffer_handle(svga, hwtnl->cmd.vdecl_vb[i]);
156
189
      }
157
190
 
158
191
      /* Unmap upload manager index buffers */
159
 
      u_upload_flush(svga->upload_ib);
 
192
      u_upload_unmap(svga->upload_ib);
160
193
 
161
194
      for (i = 0; i < hwtnl->cmd.prim_count; i++) {
162
195
         if (hwtnl->cmd.prim_ib[i]) {
242
275
}
243
276
 
244
277
 
 
278
void svga_hwtnl_set_index_bias( struct svga_hwtnl *hwtnl,
 
279
                                int index_bias)
 
280
{
 
281
   hwtnl->index_bias = index_bias;
 
282
}
245
283
 
246
284
 
247
285
 
255
293
                                 unsigned max_index,
256
294
                                 struct pipe_resource *ib )
257
295
{
258
 
   int ret = PIPE_OK;
 
296
   enum pipe_error ret = PIPE_OK;
259
297
 
260
298
#ifdef DEBUG
261
299
   {
265
303
         unsigned size = vb ? vb->width0 : 0;
266
304
         unsigned offset = hwtnl->cmd.vdecl[i].array.offset;
267
305
         unsigned stride = hwtnl->cmd.vdecl[i].array.stride;
268
 
         unsigned index_bias = range->indexBias;
 
306
         int index_bias = (int) range->indexBias + hwtnl->index_bias;
269
307
         unsigned width;
270
308
 
271
309
         assert(vb);
272
310
         assert(size);
273
311
         assert(offset < size);
274
 
         assert(index_bias >= 0);
275
312
         assert(min_index <= max_index);
276
 
         assert(offset + index_bias*stride < size);
277
 
         if (min_index != ~0) {
 
313
         if (index_bias >= 0) {
 
314
            assert(offset + index_bias*stride < size);
 
315
         }
 
316
         if (min_index != ~0 && index_bias >= 0) {
278
317
            assert(offset + (index_bias + min_index) * stride < size);
279
318
         }
280
319
 
394
433
   hwtnl->cmd.max_index[hwtnl->cmd.prim_count] = max_index;
395
434
 
396
435
   hwtnl->cmd.prim[hwtnl->cmd.prim_count] = *range;
 
436
   hwtnl->cmd.prim[hwtnl->cmd.prim_count].indexBias += hwtnl->index_bias;
397
437
 
398
438
   pipe_resource_reference(&hwtnl->cmd.prim_ib[hwtnl->cmd.prim_count], ib);
399
439
   hwtnl->cmd.prim_count++;