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

« back to all changes in this revision

Viewing changes to src/gallium/drivers/svga/svga_draw_arrays.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:
43
43
                                         unsigned nr,
44
44
                                         unsigned index_size,
45
45
                                         u_generate_func generate,
46
 
                                         struct pipe_buffer **out_buf )
 
46
                                         struct pipe_resource **out_buf )
47
47
{
48
 
   struct pipe_screen *screen = hwtnl->svga->pipe.screen;
 
48
   struct pipe_context *pipe = &hwtnl->svga->pipe;
 
49
   struct pipe_transfer *transfer;
49
50
   unsigned size = index_size * nr;
50
 
   struct pipe_buffer *dst = NULL;
 
51
   struct pipe_resource *dst = NULL;
51
52
   void *dst_map = NULL;
52
53
 
53
 
   dst = screen->buffer_create( screen, 32, 
54
 
                                PIPE_BUFFER_USAGE_INDEX |
55
 
                                PIPE_BUFFER_USAGE_CPU_WRITE |
56
 
                                PIPE_BUFFER_USAGE_GPU_READ, 
57
 
                                size );
 
54
   dst = pipe_buffer_create( pipe->screen, 
 
55
                             PIPE_BIND_INDEX_BUFFER, 
 
56
                             size );
58
57
   if (dst == NULL)
59
58
      goto fail;
60
59
 
61
 
   dst_map = pipe_buffer_map( screen, dst, PIPE_BUFFER_USAGE_CPU_WRITE );
 
60
   dst_map = pipe_buffer_map( pipe, dst, PIPE_TRANSFER_WRITE,
 
61
                              &transfer);
62
62
   if (dst_map == NULL)
63
63
      goto fail;
64
64
 
65
65
   generate( nr,
66
66
             dst_map );
67
67
 
68
 
   pipe_buffer_unmap( screen, dst );
 
68
   pipe_buffer_unmap( pipe, dst, transfer );
69
69
 
70
70
   *out_buf = dst;
71
71
   return PIPE_OK;
72
72
 
73
73
fail:
74
74
   if (dst_map)
75
 
      screen->buffer_unmap( screen, dst );
 
75
      pipe_buffer_unmap( pipe, dst, transfer );
76
76
 
77
77
   if (dst)
78
 
      screen->buffer_destroy( dst );
79
 
 
 
78
      pipe->screen->resource_destroy( pipe->screen, dst );
 
79
   
80
80
   return PIPE_ERROR_OUT_OF_MEMORY;
81
81
}
82
82
 
96
96
                                                     unsigned gen_nr,
97
97
                                                     unsigned gen_size,
98
98
                                                     u_generate_func generate,
99
 
                                                     struct pipe_buffer **out_buf )
 
99
                                                     struct pipe_resource **out_buf )
100
100
{
101
101
   enum pipe_error ret = PIPE_OK;
102
102
   int i;
107
107
      {
108
108
         if (compare(hwtnl->index_cache[prim][i].gen_nr, gen_nr, gen_type))
109
109
         {
110
 
            pipe_buffer_reference( out_buf,
 
110
            pipe_resource_reference( out_buf,
111
111
                                   hwtnl->index_cache[prim][i].buffer );
112
112
 
113
113
            if (DBG) 
117
117
         }
118
118
         else if (gen_type == U_GENERATE_REUSABLE) 
119
119
         {
120
 
            pipe_buffer_reference( &hwtnl->index_cache[prim][i].buffer,
 
120
            pipe_resource_reference( &hwtnl->index_cache[prim][i].buffer,
121
121
                                   NULL );
122
122
 
123
123
            if (DBG) 
149
149
 
150
150
      assert (smallest != IDX_CACHE_MAX);
151
151
 
152
 
      pipe_buffer_reference( &hwtnl->index_cache[prim][smallest].buffer,
 
152
      pipe_resource_reference( &hwtnl->index_cache[prim][smallest].buffer,
153
153
                             NULL );
154
154
 
155
155
      if (DBG)
171
171
 
172
172
   hwtnl->index_cache[prim][i].generate = generate;
173
173
   hwtnl->index_cache[prim][i].gen_nr = gen_nr;
174
 
   pipe_buffer_reference( &hwtnl->index_cache[prim][i].buffer,
 
174
   pipe_resource_reference( &hwtnl->index_cache[prim][i].buffer,
175
175
                          *out_buf );
176
176
 
177
177
   if (DBG)
259
259
      return simple_draw_arrays( hwtnl, gen_prim, start, count );
260
260
   }
261
261
   else {
262
 
      struct pipe_buffer *gen_buf = NULL;
 
262
      struct pipe_resource *gen_buf = NULL;
263
263
 
264
264
      /* Need to draw as indexed primitive. 
265
265
       * Potentially need to run the gen func to build an index buffer.
277
277
      ret = svga_hwtnl_simple_draw_range_elements( hwtnl,
278
278
                                                   gen_buf,
279
279
                                                   gen_size,
 
280
                                                   start,
280
281
                                                   0,
281
282
                                                   count - 1,
282
283
                                                   gen_prim,
283
284
                                                   0,
284
 
                                                   gen_nr,
285
 
                                                   start );
 
285
                                                   gen_nr );
 
286
 
286
287
      if (ret)
287
288
         goto done;
288
289
 
289
290
   done:
290
291
      if (gen_buf)
291
 
         pipe_buffer_reference( &gen_buf, NULL );
 
292
         pipe_resource_reference( &gen_buf, NULL );
292
293
 
293
294
      return ret;
294
295
   }