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

« back to all changes in this revision

Viewing changes to src/gallium/drivers/rbug/rbug_context.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:
 
1
/**************************************************************************
 
2
 *
 
3
 * Copyright 2010 VMware, Inc.
 
4
 * All Rights Reserved.
 
5
 *
 
6
 * Permission is hereby granted, free of charge, to any person obtaining a
 
7
 * copy of this software and associated documentation files (the
 
8
 * "Software"), to deal in the Software without restriction, including
 
9
 * without limitation the rights to use, copy, modify, merge, publish,
 
10
 * distribute, sub license, and/or sell copies of the Software, and to
 
11
 * permit persons to whom the Software is furnished to do so, subject to
 
12
 * the following conditions:
 
13
 *
 
14
 * The above copyright notice and this permission notice (including the
 
15
 * next paragraph) shall be included in all copies or substantial portions
 
16
 * of the Software.
 
17
 *
 
18
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
19
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
20
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 
21
 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
 
22
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 
23
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 
24
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
25
 *
 
26
 **************************************************************************/
 
27
 
 
28
 
 
29
#include "pipe/p_context.h"
 
30
#include "util/u_memory.h"
 
31
#include "util/u_inlines.h"
 
32
#include "util/u_simple_list.h"
 
33
 
 
34
#include "rbug/rbug_context.h"
 
35
 
 
36
#include "rbug_context.h"
 
37
#include "rbug_objects.h"
 
38
 
 
39
 
 
40
static void
 
41
rbug_destroy(struct pipe_context *_pipe)
 
42
{
 
43
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
44
   struct pipe_context *pipe = rb_pipe->pipe;
 
45
 
 
46
   pipe->destroy(pipe);
 
47
 
 
48
   FREE(rb_pipe);
 
49
}
 
50
 
 
51
static void
 
52
rbug_draw_block_locked(struct rbug_context *rb_pipe, int flag)
 
53
{
 
54
 
 
55
   if (rb_pipe->draw_blocker & flag) {
 
56
      rb_pipe->draw_blocked |= flag;
 
57
   } else if ((rb_pipe->draw_rule.blocker & flag) &&
 
58
              (rb_pipe->draw_blocker & RBUG_BLOCK_RULE)) {
 
59
      int k;
 
60
      boolean block = FALSE;
 
61
      debug_printf("%s (%p %p) (%p %p) (%p %u) (%p %u)\n", __FUNCTION__,
 
62
                   (void *) rb_pipe->draw_rule.fs, (void *) rb_pipe->curr.fs,
 
63
                   (void *) rb_pipe->draw_rule.vs, (void *) rb_pipe->curr.vs,
 
64
                   (void *) rb_pipe->draw_rule.surf, 0,
 
65
                   (void *) rb_pipe->draw_rule.texture, 0);
 
66
      if (rb_pipe->draw_rule.fs &&
 
67
          rb_pipe->draw_rule.fs == rb_pipe->curr.fs)
 
68
         block = TRUE;
 
69
      if (rb_pipe->draw_rule.vs &&
 
70
          rb_pipe->draw_rule.vs == rb_pipe->curr.vs)
 
71
         block = TRUE;
 
72
      if (rb_pipe->draw_rule.surf &&
 
73
          rb_pipe->draw_rule.surf == rb_pipe->curr.zsbuf)
 
74
            block = TRUE;
 
75
      if (rb_pipe->draw_rule.surf)
 
76
         for (k = 0; k < rb_pipe->curr.nr_cbufs; k++)
 
77
            if (rb_pipe->draw_rule.surf == rb_pipe->curr.cbufs[k])
 
78
               block = TRUE;
 
79
      if (rb_pipe->draw_rule.texture) {
 
80
         for (k = 0; k < rb_pipe->curr.num_fs_views; k++)
 
81
            if (rb_pipe->draw_rule.texture == rb_pipe->curr.fs_texs[k])
 
82
               block = TRUE;
 
83
         for (k = 0; k < rb_pipe->curr.num_vs_views; k++) {
 
84
            if (rb_pipe->draw_rule.texture == rb_pipe->curr.vs_texs[k]) {
 
85
               block = TRUE;
 
86
            }
 
87
         }
 
88
      }
 
89
 
 
90
      if (block)
 
91
         rb_pipe->draw_blocked |= (flag | RBUG_BLOCK_RULE);
 
92
   }
 
93
 
 
94
   if (rb_pipe->draw_blocked)
 
95
      rbug_notify_draw_blocked(rb_pipe);
 
96
 
 
97
   /* wait for rbug to clear the blocked flag */
 
98
   while (rb_pipe->draw_blocked & flag) {
 
99
      rb_pipe->draw_blocked |= flag;
 
100
      pipe_condvar_wait(rb_pipe->draw_cond, rb_pipe->draw_mutex);
 
101
   }
 
102
 
 
103
}
 
104
 
 
105
static void
 
106
rbug_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
 
107
{
 
108
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
109
   struct pipe_context *pipe = rb_pipe->pipe;
 
110
 
 
111
   pipe_mutex_lock(rb_pipe->draw_mutex);
 
112
   rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_BEFORE);
 
113
 
 
114
   pipe->draw_vbo(pipe, info);
 
115
 
 
116
   rbug_draw_block_locked(rb_pipe, RBUG_BLOCK_AFTER);
 
117
   pipe_mutex_unlock(rb_pipe->draw_mutex);
 
118
}
 
119
 
 
120
static struct pipe_query *
 
121
rbug_create_query(struct pipe_context *_pipe,
 
122
                  unsigned query_type)
 
123
{
 
124
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
125
   struct pipe_context *pipe = rb_pipe->pipe;
 
126
 
 
127
   return pipe->create_query(pipe,
 
128
                             query_type);
 
129
}
 
130
 
 
131
static void
 
132
rbug_destroy_query(struct pipe_context *_pipe,
 
133
                   struct pipe_query *query)
 
134
{
 
135
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
136
   struct pipe_context *pipe = rb_pipe->pipe;
 
137
 
 
138
   pipe->destroy_query(pipe,
 
139
                       query);
 
140
}
 
141
 
 
142
static void
 
143
rbug_begin_query(struct pipe_context *_pipe,
 
144
                 struct pipe_query *query)
 
145
{
 
146
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
147
   struct pipe_context *pipe = rb_pipe->pipe;
 
148
 
 
149
   pipe->begin_query(pipe,
 
150
                     query);
 
151
}
 
152
 
 
153
static void
 
154
rbug_end_query(struct pipe_context *_pipe,
 
155
               struct pipe_query *query)
 
156
{
 
157
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
158
   struct pipe_context *pipe = rb_pipe->pipe;
 
159
 
 
160
   pipe->end_query(pipe,
 
161
                   query);
 
162
}
 
163
 
 
164
static boolean
 
165
rbug_get_query_result(struct pipe_context *_pipe,
 
166
                      struct pipe_query *query,
 
167
                      boolean wait,
 
168
                      void *result)
 
169
{
 
170
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
171
   struct pipe_context *pipe = rb_pipe->pipe;
 
172
 
 
173
   return pipe->get_query_result(pipe,
 
174
                                 query,
 
175
                                 wait,
 
176
                                 result);
 
177
}
 
178
 
 
179
static void *
 
180
rbug_create_blend_state(struct pipe_context *_pipe,
 
181
                        const struct pipe_blend_state *blend)
 
182
{
 
183
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
184
   struct pipe_context *pipe = rb_pipe->pipe;
 
185
 
 
186
   return pipe->create_blend_state(pipe,
 
187
                                   blend);
 
188
}
 
189
 
 
190
static void
 
191
rbug_bind_blend_state(struct pipe_context *_pipe,
 
192
                      void *blend)
 
193
{
 
194
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
195
   struct pipe_context *pipe = rb_pipe->pipe;
 
196
 
 
197
   pipe->bind_blend_state(pipe,
 
198
                              blend);
 
199
}
 
200
 
 
201
static void
 
202
rbug_delete_blend_state(struct pipe_context *_pipe,
 
203
                        void *blend)
 
204
{
 
205
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
206
   struct pipe_context *pipe = rb_pipe->pipe;
 
207
 
 
208
   pipe->delete_blend_state(pipe,
 
209
                            blend);
 
210
}
 
211
 
 
212
static void *
 
213
rbug_create_sampler_state(struct pipe_context *_pipe,
 
214
                          const struct pipe_sampler_state *sampler)
 
215
{
 
216
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
217
   struct pipe_context *pipe = rb_pipe->pipe;
 
218
 
 
219
   return pipe->create_sampler_state(pipe,
 
220
                                     sampler);
 
221
}
 
222
 
 
223
static void
 
224
rbug_bind_fragment_sampler_states(struct pipe_context *_pipe,
 
225
                                  unsigned num_samplers,
 
226
                                  void **samplers)
 
227
{
 
228
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
229
   struct pipe_context *pipe = rb_pipe->pipe;
 
230
 
 
231
   pipe->bind_fragment_sampler_states(pipe,
 
232
                                      num_samplers,
 
233
                                      samplers);
 
234
}
 
235
 
 
236
static void
 
237
rbug_bind_vertex_sampler_states(struct pipe_context *_pipe,
 
238
                                unsigned num_samplers,
 
239
                                void **samplers)
 
240
{
 
241
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
242
   struct pipe_context *pipe = rb_pipe->pipe;
 
243
 
 
244
   pipe->bind_vertex_sampler_states(pipe,
 
245
                                    num_samplers,
 
246
                                    samplers);
 
247
}
 
248
 
 
249
static void
 
250
rbug_delete_sampler_state(struct pipe_context *_pipe,
 
251
                          void *sampler)
 
252
{
 
253
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
254
   struct pipe_context *pipe = rb_pipe->pipe;
 
255
 
 
256
   pipe->delete_sampler_state(pipe,
 
257
                              sampler);
 
258
}
 
259
 
 
260
static void *
 
261
rbug_create_rasterizer_state(struct pipe_context *_pipe,
 
262
                             const struct pipe_rasterizer_state *rasterizer)
 
263
{
 
264
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
265
   struct pipe_context *pipe = rb_pipe->pipe;
 
266
 
 
267
   return pipe->create_rasterizer_state(pipe,
 
268
                                        rasterizer);
 
269
}
 
270
 
 
271
static void
 
272
rbug_bind_rasterizer_state(struct pipe_context *_pipe,
 
273
                           void *rasterizer)
 
274
{
 
275
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
276
   struct pipe_context *pipe = rb_pipe->pipe;
 
277
 
 
278
   pipe->bind_rasterizer_state(pipe,
 
279
                               rasterizer);
 
280
}
 
281
 
 
282
static void
 
283
rbug_delete_rasterizer_state(struct pipe_context *_pipe,
 
284
                             void *rasterizer)
 
285
{
 
286
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
287
   struct pipe_context *pipe = rb_pipe->pipe;
 
288
 
 
289
   pipe->delete_rasterizer_state(pipe,
 
290
                                 rasterizer);
 
291
}
 
292
 
 
293
static void *
 
294
rbug_create_depth_stencil_alpha_state(struct pipe_context *_pipe,
 
295
                                      const struct pipe_depth_stencil_alpha_state *depth_stencil_alpha)
 
296
{
 
297
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
298
   struct pipe_context *pipe = rb_pipe->pipe;
 
299
 
 
300
   return pipe->create_depth_stencil_alpha_state(pipe,
 
301
                                                 depth_stencil_alpha);
 
302
}
 
303
 
 
304
static void
 
305
rbug_bind_depth_stencil_alpha_state(struct pipe_context *_pipe,
 
306
                                    void *depth_stencil_alpha)
 
307
{
 
308
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
309
   struct pipe_context *pipe = rb_pipe->pipe;
 
310
 
 
311
   pipe->bind_depth_stencil_alpha_state(pipe,
 
312
                                        depth_stencil_alpha);
 
313
}
 
314
 
 
315
static void
 
316
rbug_delete_depth_stencil_alpha_state(struct pipe_context *_pipe,
 
317
                                      void *depth_stencil_alpha)
 
318
{
 
319
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
320
   struct pipe_context *pipe = rb_pipe->pipe;
 
321
 
 
322
   pipe->delete_depth_stencil_alpha_state(pipe,
 
323
                                          depth_stencil_alpha);
 
324
}
 
325
 
 
326
static void *
 
327
rbug_create_fs_state(struct pipe_context *_pipe,
 
328
                     const struct pipe_shader_state *state)
 
329
{
 
330
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
331
   struct pipe_context *pipe = rb_pipe->pipe;
 
332
   void *result;
 
333
 
 
334
   result = pipe->create_fs_state(pipe, state);
 
335
   if (!result)
 
336
      return NULL;
 
337
 
 
338
   return rbug_shader_create(rb_pipe, state, result, RBUG_SHADER_FRAGMENT);
 
339
}
 
340
 
 
341
static void
 
342
rbug_bind_fs_state(struct pipe_context *_pipe,
 
343
                   void *_fs)
 
344
{
 
345
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
346
   struct pipe_context *pipe = rb_pipe->pipe;
 
347
   void *fs;
 
348
 
 
349
   fs = rbug_shader_unwrap(_fs);
 
350
   rb_pipe->curr.fs = rbug_shader(_fs);
 
351
   pipe->bind_fs_state(pipe,
 
352
                       fs);
 
353
}
 
354
 
 
355
static void
 
356
rbug_delete_fs_state(struct pipe_context *_pipe,
 
357
                     void *_fs)
 
358
{
 
359
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
360
   struct rbug_shader *rb_shader = rbug_shader(_fs);
 
361
 
 
362
   rbug_shader_destroy(rb_pipe, rb_shader);
 
363
}
 
364
 
 
365
static void *
 
366
rbug_create_vs_state(struct pipe_context *_pipe,
 
367
                     const struct pipe_shader_state *state)
 
368
{
 
369
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
370
   struct pipe_context *pipe = rb_pipe->pipe;
 
371
   void *result;
 
372
 
 
373
   result = pipe->create_vs_state(pipe, state);
 
374
   if (!result)
 
375
      return NULL;
 
376
 
 
377
   return rbug_shader_create(rb_pipe, state, result, RBUG_SHADER_VERTEX);
 
378
}
 
379
 
 
380
static void
 
381
rbug_bind_vs_state(struct pipe_context *_pipe,
 
382
                   void *_vs)
 
383
{
 
384
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
385
   struct pipe_context *pipe = rb_pipe->pipe;
 
386
   void *vs;
 
387
 
 
388
   vs = rbug_shader_unwrap(_vs);
 
389
   rb_pipe->curr.vs = rbug_shader(_vs);
 
390
   pipe->bind_vs_state(pipe,
 
391
                       vs);
 
392
}
 
393
 
 
394
static void
 
395
rbug_delete_vs_state(struct pipe_context *_pipe,
 
396
                     void *_vs)
 
397
{
 
398
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
399
   struct rbug_shader *rb_shader = rbug_shader(_vs);
 
400
 
 
401
   rbug_shader_destroy(rb_pipe, rb_shader);
 
402
}
 
403
 
 
404
static void *
 
405
rbug_create_gs_state(struct pipe_context *_pipe,
 
406
                     const struct pipe_shader_state *state)
 
407
{
 
408
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
409
   struct pipe_context *pipe = rb_pipe->pipe;
 
410
   void *result;
 
411
 
 
412
   result = pipe->create_gs_state(pipe, state);
 
413
   if (!result)
 
414
      return NULL;
 
415
 
 
416
   return rbug_shader_create(rb_pipe, state, result, RBUG_SHADER_GEOM);
 
417
}
 
418
 
 
419
static void
 
420
rbug_bind_gs_state(struct pipe_context *_pipe,
 
421
                   void *_gs)
 
422
{
 
423
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
424
   struct pipe_context *pipe = rb_pipe->pipe;
 
425
   void *gs;
 
426
 
 
427
   gs = rbug_shader_unwrap(_gs);
 
428
   rb_pipe->curr.gs = rbug_shader(_gs);
 
429
   pipe->bind_gs_state(pipe,
 
430
                       gs);
 
431
}
 
432
 
 
433
static void
 
434
rbug_delete_gs_state(struct pipe_context *_pipe,
 
435
                     void *_gs)
 
436
{
 
437
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
438
   struct rbug_shader *rb_shader = rbug_shader(_gs);
 
439
 
 
440
   rbug_shader_destroy(rb_pipe, rb_shader);
 
441
}
 
442
 
 
443
static void *
 
444
rbug_create_vertex_elements_state(struct pipe_context *_pipe,
 
445
                                  unsigned num_elements,
 
446
                                  const struct pipe_vertex_element *vertex_elements)
 
447
{
 
448
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
449
   struct pipe_context *pipe = rb_pipe->pipe;
 
450
 
 
451
   return pipe->create_vertex_elements_state(pipe,
 
452
                                             num_elements,
 
453
                                             vertex_elements);
 
454
}
 
455
 
 
456
static void
 
457
rbug_bind_vertex_elements_state(struct pipe_context *_pipe,
 
458
                                void *velems)
 
459
{
 
460
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
461
   struct pipe_context *pipe = rb_pipe->pipe;
 
462
 
 
463
   pipe->bind_vertex_elements_state(pipe,
 
464
                                    velems);
 
465
}
 
466
 
 
467
static void
 
468
rbug_delete_vertex_elements_state(struct pipe_context *_pipe,
 
469
                                  void *velems)
 
470
{
 
471
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
472
   struct pipe_context *pipe = rb_pipe->pipe;
 
473
 
 
474
   pipe->delete_vertex_elements_state(pipe,
 
475
                                      velems);
 
476
}
 
477
 
 
478
static void
 
479
rbug_set_blend_color(struct pipe_context *_pipe,
 
480
                     const struct pipe_blend_color *blend_color)
 
481
{
 
482
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
483
   struct pipe_context *pipe = rb_pipe->pipe;
 
484
 
 
485
   pipe->set_blend_color(pipe,
 
486
                         blend_color);
 
487
}
 
488
 
 
489
static void
 
490
rbug_set_stencil_ref(struct pipe_context *_pipe,
 
491
                     const struct pipe_stencil_ref *stencil_ref)
 
492
{
 
493
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
494
   struct pipe_context *pipe = rb_pipe->pipe;
 
495
 
 
496
   pipe->set_stencil_ref(pipe,
 
497
                         stencil_ref);
 
498
}
 
499
 
 
500
static void
 
501
rbug_set_clip_state(struct pipe_context *_pipe,
 
502
                    const struct pipe_clip_state *clip)
 
503
{
 
504
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
505
   struct pipe_context *pipe = rb_pipe->pipe;
 
506
 
 
507
   pipe->set_clip_state(pipe,
 
508
                        clip);
 
509
}
 
510
 
 
511
static void
 
512
rbug_set_constant_buffer(struct pipe_context *_pipe,
 
513
                         uint shader,
 
514
                         uint index,
 
515
                         struct pipe_resource *_resource)
 
516
{
 
517
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
518
   struct pipe_context *pipe = rb_pipe->pipe;
 
519
   struct pipe_resource *unwrapped_resource;
 
520
   struct pipe_resource *resource = NULL;
 
521
 
 
522
   /* XXX hmm? unwrap the input state */
 
523
   if (_resource) {
 
524
      unwrapped_resource = rbug_resource_unwrap(_resource);
 
525
      resource = unwrapped_resource;
 
526
   }
 
527
 
 
528
   pipe->set_constant_buffer(pipe,
 
529
                             shader,
 
530
                             index,
 
531
                             resource);
 
532
}
 
533
 
 
534
static void
 
535
rbug_set_framebuffer_state(struct pipe_context *_pipe,
 
536
                           const struct pipe_framebuffer_state *_state)
 
537
{
 
538
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
539
   struct pipe_context *pipe = rb_pipe->pipe;
 
540
   struct pipe_framebuffer_state unwrapped_state;
 
541
   struct pipe_framebuffer_state *state = NULL;
 
542
   unsigned i;
 
543
 
 
544
   rb_pipe->curr.nr_cbufs = 0;
 
545
   memset(rb_pipe->curr.cbufs, 0, sizeof(rb_pipe->curr.cbufs));
 
546
 
 
547
   /* unwrap the input state */
 
548
   if (_state) {
 
549
      memcpy(&unwrapped_state, _state, sizeof(unwrapped_state));
 
550
 
 
551
      rb_pipe->curr.nr_cbufs = _state->nr_cbufs;
 
552
      for(i = 0; i < _state->nr_cbufs; i++) {
 
553
         unwrapped_state.cbufs[i] = rbug_surface_unwrap(_state->cbufs[i]);
 
554
         if (_state->cbufs[i])
 
555
            rb_pipe->curr.cbufs[i] = rbug_resource(_state->cbufs[i]->texture);
 
556
      }
 
557
      unwrapped_state.zsbuf = rbug_surface_unwrap(_state->zsbuf);
 
558
      state = &unwrapped_state;
 
559
   }
 
560
 
 
561
   pipe->set_framebuffer_state(pipe,
 
562
                               state);
 
563
}
 
564
 
 
565
static void
 
566
rbug_set_polygon_stipple(struct pipe_context *_pipe,
 
567
                         const struct pipe_poly_stipple *poly_stipple)
 
568
{
 
569
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
570
   struct pipe_context *pipe = rb_pipe->pipe;
 
571
 
 
572
   pipe->set_polygon_stipple(pipe,
 
573
                             poly_stipple);
 
574
}
 
575
 
 
576
static void
 
577
rbug_set_scissor_state(struct pipe_context *_pipe,
 
578
                       const struct pipe_scissor_state *scissor)
 
579
{
 
580
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
581
   struct pipe_context *pipe = rb_pipe->pipe;
 
582
 
 
583
   pipe->set_scissor_state(pipe,
 
584
                           scissor);
 
585
}
 
586
 
 
587
static void
 
588
rbug_set_viewport_state(struct pipe_context *_pipe,
 
589
                        const struct pipe_viewport_state *viewport)
 
590
{
 
591
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
592
   struct pipe_context *pipe = rb_pipe->pipe;
 
593
 
 
594
   pipe->set_viewport_state(pipe,
 
595
                            viewport);
 
596
}
 
597
 
 
598
static void
 
599
rbug_set_fragment_sampler_views(struct pipe_context *_pipe,
 
600
                                unsigned num,
 
601
                                struct pipe_sampler_view **_views)
 
602
{
 
603
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
604
   struct pipe_context *pipe = rb_pipe->pipe;
 
605
   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS];
 
606
   struct pipe_sampler_view **views = NULL;
 
607
   unsigned i;
 
608
 
 
609
   rb_pipe->curr.num_fs_views = 0;
 
610
   memset(rb_pipe->curr.fs_views, 0, sizeof(rb_pipe->curr.fs_views));
 
611
   memset(rb_pipe->curr.fs_texs, 0, sizeof(rb_pipe->curr.fs_texs));
 
612
   memset(unwrapped_views, 0, sizeof(unwrapped_views));
 
613
 
 
614
   if (_views) {
 
615
      rb_pipe->curr.num_fs_views = num;
 
616
      for (i = 0; i < num; i++) {
 
617
         rb_pipe->curr.fs_views[i] = rbug_sampler_view(_views[i]);
 
618
         rb_pipe->curr.fs_texs[i] = rbug_resource(_views[i] ? _views[i]->texture : NULL);
 
619
         unwrapped_views[i] = rbug_sampler_view_unwrap(_views[i]);
 
620
      }
 
621
      views = unwrapped_views;
 
622
   }
 
623
 
 
624
   pipe->set_fragment_sampler_views(pipe, num, views);
 
625
}
 
626
 
 
627
static void
 
628
rbug_set_vertex_sampler_views(struct pipe_context *_pipe,
 
629
                              unsigned num,
 
630
                              struct pipe_sampler_view **_views)
 
631
{
 
632
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
633
   struct pipe_context *pipe = rb_pipe->pipe;
 
634
   struct pipe_sampler_view *unwrapped_views[PIPE_MAX_VERTEX_SAMPLERS];
 
635
   struct pipe_sampler_view **views = NULL;
 
636
   unsigned i;
 
637
 
 
638
   rb_pipe->curr.num_vs_views = 0;
 
639
   memset(rb_pipe->curr.vs_views, 0, sizeof(rb_pipe->curr.vs_views));
 
640
   memset(rb_pipe->curr.vs_texs, 0, sizeof(rb_pipe->curr.vs_texs));
 
641
   memset(unwrapped_views, 0, sizeof(unwrapped_views));
 
642
 
 
643
   if (_views) {
 
644
      rb_pipe->curr.num_vs_views = num;
 
645
      for (i = 0; i < num; i++) {
 
646
         rb_pipe->curr.vs_views[i] = rbug_sampler_view(_views[i]);
 
647
         rb_pipe->curr.vs_texs[i] = rbug_resource(_views[i]->texture);
 
648
         unwrapped_views[i] = rbug_sampler_view_unwrap(_views[i]);
 
649
      }
 
650
      views = unwrapped_views;
 
651
   }
 
652
 
 
653
   pipe->set_vertex_sampler_views(pipe, num, views);
 
654
}
 
655
 
 
656
static void
 
657
rbug_set_vertex_buffers(struct pipe_context *_pipe,
 
658
                        unsigned num_buffers,
 
659
                        const struct pipe_vertex_buffer *_buffers)
 
660
{
 
661
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
662
   struct pipe_context *pipe = rb_pipe->pipe;
 
663
   struct pipe_vertex_buffer unwrapped_buffers[PIPE_MAX_SHADER_INPUTS];
 
664
   struct pipe_vertex_buffer *buffers = NULL;
 
665
   unsigned i;
 
666
 
 
667
   if (num_buffers) {
 
668
      memcpy(unwrapped_buffers, _buffers, num_buffers * sizeof(*_buffers));
 
669
      for (i = 0; i < num_buffers; i++)
 
670
         unwrapped_buffers[i].buffer = rbug_resource_unwrap(_buffers[i].buffer);
 
671
      buffers = unwrapped_buffers;
 
672
   }
 
673
 
 
674
   pipe->set_vertex_buffers(pipe,
 
675
                            num_buffers,
 
676
                            buffers);
 
677
}
 
678
 
 
679
static void
 
680
rbug_set_index_buffer(struct pipe_context *_pipe,
 
681
                      const struct pipe_index_buffer *_ib)
 
682
{
 
683
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
684
   struct pipe_context *pipe = rb_pipe->pipe;
 
685
   struct pipe_index_buffer unwrapped_ib, *ib = NULL;
 
686
 
 
687
   if (_ib) {
 
688
      unwrapped_ib = *_ib;
 
689
      unwrapped_ib.buffer = rbug_resource_unwrap(_ib->buffer);
 
690
      ib = &unwrapped_ib;
 
691
   }
 
692
 
 
693
   pipe->set_index_buffer(pipe, ib);
 
694
}
 
695
 
 
696
static void
 
697
rbug_set_sample_mask(struct pipe_context *_pipe,
 
698
                     unsigned sample_mask)
 
699
{
 
700
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
701
   struct pipe_context *pipe = rb_pipe->pipe;
 
702
 
 
703
   pipe->set_sample_mask(pipe, sample_mask);
 
704
}
 
705
 
 
706
static void
 
707
rbug_resource_copy_region(struct pipe_context *_pipe,
 
708
                          struct pipe_resource *_dst,
 
709
                          struct pipe_subresource subdst,
 
710
                          unsigned dstx,
 
711
                          unsigned dsty,
 
712
                          unsigned dstz,
 
713
                          struct pipe_resource *_src,
 
714
                          struct pipe_subresource subsrc,
 
715
                          unsigned srcx,
 
716
                          unsigned srcy,
 
717
                          unsigned srcz,
 
718
                          unsigned width,
 
719
                          unsigned height)
 
720
{
 
721
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
722
   struct rbug_resource *rb_resource_dst = rbug_resource(_dst);
 
723
   struct rbug_resource *rb_resource_src = rbug_resource(_src);
 
724
   struct pipe_context *pipe = rb_pipe->pipe;
 
725
   struct pipe_resource *dst = rb_resource_dst->resource;
 
726
   struct pipe_resource *src = rb_resource_src->resource;
 
727
 
 
728
   pipe->resource_copy_region(pipe,
 
729
                              dst,
 
730
                              subdst,
 
731
                              dstx,
 
732
                              dsty,
 
733
                              dstz,
 
734
                              src,
 
735
                              subsrc,
 
736
                              srcx,
 
737
                              srcy,
 
738
                              srcz,
 
739
                              width,
 
740
                              height);
 
741
}
 
742
 
 
743
static void
 
744
rbug_clear(struct pipe_context *_pipe,
 
745
           unsigned buffers,
 
746
           const float *rgba,
 
747
           double depth,
 
748
           unsigned stencil)
 
749
{
 
750
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
751
   struct pipe_context *pipe = rb_pipe->pipe;
 
752
 
 
753
   pipe->clear(pipe,
 
754
               buffers,
 
755
               rgba,
 
756
               depth,
 
757
               stencil);
 
758
}
 
759
 
 
760
static void
 
761
rbug_clear_render_target(struct pipe_context *_pipe,
 
762
                         struct pipe_surface *_dst,
 
763
                         const float *rgba,
 
764
                         unsigned dstx, unsigned dsty,
 
765
                         unsigned width, unsigned height)
 
766
{
 
767
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
768
   struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
 
769
   struct pipe_context *pipe = rb_pipe->pipe;
 
770
   struct pipe_surface *dst = rb_surface_dst->surface;
 
771
 
 
772
   pipe->clear_render_target(pipe,
 
773
                             dst,
 
774
                             rgba,
 
775
                             dstx,
 
776
                             dsty,
 
777
                             width,
 
778
                             height);
 
779
}
 
780
 
 
781
static void
 
782
rbug_clear_depth_stencil(struct pipe_context *_pipe,
 
783
                         struct pipe_surface *_dst,
 
784
                         unsigned clear_flags,
 
785
                         double depth,
 
786
                         unsigned stencil,
 
787
                         unsigned dstx, unsigned dsty,
 
788
                         unsigned width, unsigned height)
 
789
{
 
790
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
791
   struct rbug_surface *rb_surface_dst = rbug_surface(_dst);
 
792
   struct pipe_context *pipe = rb_pipe->pipe;
 
793
   struct pipe_surface *dst = rb_surface_dst->surface;
 
794
 
 
795
   pipe->clear_depth_stencil(pipe,
 
796
                             dst,
 
797
                             clear_flags,
 
798
                             depth,
 
799
                             stencil,
 
800
                             dstx,
 
801
                             dsty,
 
802
                             width,
 
803
                             height);
 
804
}
 
805
 
 
806
static void
 
807
rbug_flush(struct pipe_context *_pipe,
 
808
           unsigned flags,
 
809
           struct pipe_fence_handle **fence)
 
810
{
 
811
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
812
   struct pipe_context *pipe = rb_pipe->pipe;
 
813
 
 
814
   pipe->flush(pipe,
 
815
               flags,
 
816
               fence);
 
817
}
 
818
 
 
819
static unsigned int
 
820
rbug_is_resource_referenced(struct pipe_context *_pipe,
 
821
                            struct pipe_resource *_resource,
 
822
                            unsigned face,
 
823
                            unsigned level)
 
824
{
 
825
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
826
   struct rbug_resource *rb_resource = rbug_resource(_resource);
 
827
   struct pipe_context *pipe = rb_pipe->pipe;
 
828
   struct pipe_resource *resource = rb_resource->resource;
 
829
 
 
830
   return pipe->is_resource_referenced(pipe,
 
831
                                       resource,
 
832
                                       face,
 
833
                                       level);
 
834
}
 
835
 
 
836
static struct pipe_sampler_view *
 
837
rbug_context_create_sampler_view(struct pipe_context *_pipe,
 
838
                                 struct pipe_resource *_resource,
 
839
                                 const struct pipe_sampler_view *templ)
 
840
{
 
841
   struct rbug_context *rb_pipe = rbug_context(_pipe);
 
842
   struct rbug_resource *rb_resource = rbug_resource(_resource);
 
843
   struct pipe_context *pipe = rb_pipe->pipe;
 
844
   struct pipe_resource *resource = rb_resource->resource;
 
845
   struct pipe_sampler_view *result;
 
846
 
 
847
   result = pipe->create_sampler_view(pipe,
 
848
                                      resource,
 
849
                                      templ);
 
850
 
 
851
   if (result)
 
852
      return rbug_sampler_view_create(rb_pipe, rb_resource, result);
 
853
   return NULL;
 
854
}
 
855
 
 
856
static void
 
857
rbug_context_sampler_view_destroy(struct pipe_context *_pipe,
 
858
                                  struct pipe_sampler_view *_view)
 
859
{
 
860
   rbug_sampler_view_destroy(rbug_context(_pipe),
 
861
                             rbug_sampler_view(_view));
 
862
}
 
863
 
 
864
static struct pipe_transfer *
 
865
rbug_context_get_transfer(struct pipe_context *_context,
 
866
                          struct pipe_resource *_resource,
 
867
                          struct pipe_subresource sr,
 
868
                          unsigned usage,
 
869
                          const struct pipe_box *box)
 
870
{
 
871
   struct rbug_context *rb_pipe = rbug_context(_context);
 
872
   struct rbug_resource *rb_resource = rbug_resource(_resource);
 
873
   struct pipe_context *context = rb_pipe->pipe;
 
874
   struct pipe_resource *resource = rb_resource->resource;
 
875
   struct pipe_transfer *result;
 
876
 
 
877
   result = context->get_transfer(context,
 
878
                                  resource,
 
879
                                  sr,
 
880
                                  usage,
 
881
                                  box);
 
882
 
 
883
   if (result)
 
884
      return rbug_transfer_create(rb_pipe, rb_resource, result);
 
885
   return NULL;
 
886
}
 
887
 
 
888
static void
 
889
rbug_context_transfer_destroy(struct pipe_context *_pipe,
 
890
                              struct pipe_transfer *_transfer)
 
891
{
 
892
   rbug_transfer_destroy(rbug_context(_pipe),
 
893
                             rbug_transfer(_transfer));
 
894
}
 
895
 
 
896
static void *
 
897
rbug_context_transfer_map(struct pipe_context *_context,
 
898
                          struct pipe_transfer *_transfer)
 
899
{
 
900
   struct rbug_context *rb_pipe = rbug_context(_context);
 
901
   struct rbug_transfer *rb_transfer = rbug_transfer(_transfer);
 
902
   struct pipe_context *context = rb_pipe->pipe;
 
903
   struct pipe_transfer *transfer = rb_transfer->transfer;
 
904
 
 
905
   return context->transfer_map(context,
 
906
                                transfer);
 
907
}
 
908
 
 
909
 
 
910
 
 
911
static void
 
912
rbug_context_transfer_flush_region(struct pipe_context *_context,
 
913
                                   struct pipe_transfer *_transfer,
 
914
                                   const struct pipe_box *box)
 
915
{
 
916
   struct rbug_context *rb_pipe = rbug_context(_context);
 
917
   struct rbug_transfer *rb_transfer = rbug_transfer(_transfer);
 
918
   struct pipe_context *context = rb_pipe->pipe;
 
919
   struct pipe_transfer *transfer = rb_transfer->transfer;
 
920
 
 
921
   context->transfer_flush_region(context,
 
922
                                  transfer,
 
923
                                  box);
 
924
}
 
925
 
 
926
 
 
927
static void
 
928
rbug_context_transfer_unmap(struct pipe_context *_context,
 
929
                            struct pipe_transfer *_transfer)
 
930
{
 
931
   struct rbug_context *rb_pipe = rbug_context(_context);
 
932
   struct rbug_transfer *rb_transfer = rbug_transfer(_transfer);
 
933
   struct pipe_context *context = rb_pipe->pipe;
 
934
   struct pipe_transfer *transfer = rb_transfer->transfer;
 
935
 
 
936
   context->transfer_unmap(context,
 
937
                           transfer);
 
938
}
 
939
 
 
940
 
 
941
static void
 
942
rbug_context_transfer_inline_write(struct pipe_context *_context,
 
943
                                   struct pipe_resource *_resource,
 
944
                                   struct pipe_subresource sr,
 
945
                                   unsigned usage,
 
946
                                   const struct pipe_box *box,
 
947
                                   const void *data,
 
948
                                   unsigned stride,
 
949
                                   unsigned slice_stride)
 
950
{
 
951
   struct rbug_context *rb_pipe = rbug_context(_context);
 
952
   struct rbug_resource *rb_resource = rbug_resource(_resource);
 
953
   struct pipe_context *context = rb_pipe->pipe;
 
954
   struct pipe_resource *resource = rb_resource->resource;
 
955
 
 
956
   context->transfer_inline_write(context,
 
957
                                  resource,
 
958
                                  sr,
 
959
                                  usage,
 
960
                                  box,
 
961
                                  data,
 
962
                                  stride,
 
963
                                  slice_stride);
 
964
}
 
965
 
 
966
 
 
967
struct pipe_context *
 
968
rbug_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
 
969
{
 
970
   struct rbug_context *rb_pipe;
 
971
   struct rbug_screen *rb_screen = rbug_screen(_screen);
 
972
 
 
973
   if (!rb_screen)
 
974
      return NULL;
 
975
 
 
976
   rb_pipe = CALLOC_STRUCT(rbug_context);
 
977
   if (!rb_pipe)
 
978
      return NULL;
 
979
 
 
980
   pipe_mutex_init(rb_pipe->draw_mutex);
 
981
   pipe_condvar_init(rb_pipe->draw_cond);
 
982
   pipe_mutex_init(rb_pipe->call_mutex);
 
983
   pipe_mutex_init(rb_pipe->list_mutex);
 
984
   make_empty_list(&rb_pipe->shaders);
 
985
 
 
986
   rb_pipe->base.winsys = NULL;
 
987
   rb_pipe->base.screen = _screen;
 
988
   rb_pipe->base.priv = pipe->priv; /* expose wrapped data */
 
989
   rb_pipe->base.draw = NULL;
 
990
 
 
991
   rb_pipe->base.destroy = rbug_destroy;
 
992
   rb_pipe->base.draw_vbo = rbug_draw_vbo;
 
993
   rb_pipe->base.create_query = rbug_create_query;
 
994
   rb_pipe->base.destroy_query = rbug_destroy_query;
 
995
   rb_pipe->base.begin_query = rbug_begin_query;
 
996
   rb_pipe->base.end_query = rbug_end_query;
 
997
   rb_pipe->base.get_query_result = rbug_get_query_result;
 
998
   rb_pipe->base.create_blend_state = rbug_create_blend_state;
 
999
   rb_pipe->base.bind_blend_state = rbug_bind_blend_state;
 
1000
   rb_pipe->base.delete_blend_state = rbug_delete_blend_state;
 
1001
   rb_pipe->base.create_sampler_state = rbug_create_sampler_state;
 
1002
   rb_pipe->base.bind_fragment_sampler_states = rbug_bind_fragment_sampler_states;
 
1003
   rb_pipe->base.bind_vertex_sampler_states = rbug_bind_vertex_sampler_states;
 
1004
   rb_pipe->base.delete_sampler_state = rbug_delete_sampler_state;
 
1005
   rb_pipe->base.create_rasterizer_state = rbug_create_rasterizer_state;
 
1006
   rb_pipe->base.bind_rasterizer_state = rbug_bind_rasterizer_state;
 
1007
   rb_pipe->base.delete_rasterizer_state = rbug_delete_rasterizer_state;
 
1008
   rb_pipe->base.create_depth_stencil_alpha_state = rbug_create_depth_stencil_alpha_state;
 
1009
   rb_pipe->base.bind_depth_stencil_alpha_state = rbug_bind_depth_stencil_alpha_state;
 
1010
   rb_pipe->base.delete_depth_stencil_alpha_state = rbug_delete_depth_stencil_alpha_state;
 
1011
   rb_pipe->base.create_fs_state = rbug_create_fs_state;
 
1012
   rb_pipe->base.bind_fs_state = rbug_bind_fs_state;
 
1013
   rb_pipe->base.delete_fs_state = rbug_delete_fs_state;
 
1014
   rb_pipe->base.create_vs_state = rbug_create_vs_state;
 
1015
   rb_pipe->base.bind_vs_state = rbug_bind_vs_state;
 
1016
   rb_pipe->base.delete_vs_state = rbug_delete_vs_state;
 
1017
   rb_pipe->base.create_gs_state = rbug_create_gs_state;
 
1018
   rb_pipe->base.bind_gs_state = rbug_bind_gs_state;
 
1019
   rb_pipe->base.delete_gs_state = rbug_delete_gs_state;
 
1020
   rb_pipe->base.create_vertex_elements_state = rbug_create_vertex_elements_state;
 
1021
   rb_pipe->base.bind_vertex_elements_state = rbug_bind_vertex_elements_state;
 
1022
   rb_pipe->base.delete_vertex_elements_state = rbug_delete_vertex_elements_state;
 
1023
   rb_pipe->base.set_blend_color = rbug_set_blend_color;
 
1024
   rb_pipe->base.set_stencil_ref = rbug_set_stencil_ref;
 
1025
   rb_pipe->base.set_clip_state = rbug_set_clip_state;
 
1026
   rb_pipe->base.set_constant_buffer = rbug_set_constant_buffer;
 
1027
   rb_pipe->base.set_framebuffer_state = rbug_set_framebuffer_state;
 
1028
   rb_pipe->base.set_polygon_stipple = rbug_set_polygon_stipple;
 
1029
   rb_pipe->base.set_scissor_state = rbug_set_scissor_state;
 
1030
   rb_pipe->base.set_viewport_state = rbug_set_viewport_state;
 
1031
   rb_pipe->base.set_fragment_sampler_views = rbug_set_fragment_sampler_views;
 
1032
   rb_pipe->base.set_vertex_sampler_views = rbug_set_vertex_sampler_views;
 
1033
   rb_pipe->base.set_vertex_buffers = rbug_set_vertex_buffers;
 
1034
   rb_pipe->base.set_index_buffer = rbug_set_index_buffer;
 
1035
   rb_pipe->base.set_sample_mask = rbug_set_sample_mask;
 
1036
   rb_pipe->base.resource_copy_region = rbug_resource_copy_region;
 
1037
   rb_pipe->base.clear = rbug_clear;
 
1038
   rb_pipe->base.clear_render_target = rbug_clear_render_target;
 
1039
   rb_pipe->base.clear_depth_stencil = rbug_clear_depth_stencil;
 
1040
   rb_pipe->base.flush = rbug_flush;
 
1041
   rb_pipe->base.is_resource_referenced = rbug_is_resource_referenced;
 
1042
   rb_pipe->base.create_sampler_view = rbug_context_create_sampler_view;
 
1043
   rb_pipe->base.sampler_view_destroy = rbug_context_sampler_view_destroy;
 
1044
   rb_pipe->base.get_transfer = rbug_context_get_transfer;
 
1045
   rb_pipe->base.transfer_destroy = rbug_context_transfer_destroy;
 
1046
   rb_pipe->base.transfer_map = rbug_context_transfer_map;
 
1047
   rb_pipe->base.transfer_unmap = rbug_context_transfer_unmap;
 
1048
   rb_pipe->base.transfer_flush_region = rbug_context_transfer_flush_region;
 
1049
   rb_pipe->base.transfer_inline_write = rbug_context_transfer_inline_write;
 
1050
 
 
1051
   rb_pipe->pipe = pipe;
 
1052
 
 
1053
   rbug_screen_add_to_list(rb_screen, contexts, rb_pipe);
 
1054
 
 
1055
   return &rb_pipe->base;
 
1056
}