1 /**************************************************************************
3 * Copyright 2010 VMware, Inc.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
29 #include "pipe/p_context.h"
30 #include "util/u_memory.h"
31 #include "util/u_inlines.h"
32 #include "util/simple_list.h"
34 #include "rbug/rbug_context.h"
36 #include "rbug_context.h"
37 #include "rbug_objects.h"
41 rbug_destroy(struct pipe_context
*_pipe
)
43 struct rbug_screen
*rb_screen
= rbug_screen(_pipe
->screen
);
44 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
45 struct pipe_context
*pipe
= rb_pipe
->pipe
;
47 rbug_screen_remove_from_list(rb_screen
, contexts
, rb_pipe
);
49 pipe_mutex_lock(rb_pipe
->call_mutex
);
52 pipe_mutex_unlock(rb_pipe
->call_mutex
);
58 rbug_draw_block_locked(struct rbug_context
*rb_pipe
, int flag
)
61 if (rb_pipe
->draw_blocker
& flag
) {
62 rb_pipe
->draw_blocked
|= flag
;
63 } else if ((rb_pipe
->draw_rule
.blocker
& flag
) &&
64 (rb_pipe
->draw_blocker
& RBUG_BLOCK_RULE
)) {
66 boolean block
= FALSE
;
69 debug_printf("%s (%p %p) (%p %p) (%p %u) (%p %u)\n", __FUNCTION__
,
70 (void *) rb_pipe
->draw_rule
.shader
[PIPE_SHADER_FRAGMENT
],
71 (void *) rb_pipe
->curr
.shader
[PIPE_SHADER_FRAGMENT
],
72 (void *) rb_pipe
->draw_rule
.shader
[PIPE_SHADER_VERTEX
],
73 (void *) rb_pipe
->curr
.shader
[PIPE_SHADER_VERTEX
],
74 (void *) rb_pipe
->draw_rule
.surf
, 0,
75 (void *) rb_pipe
->draw_rule
.texture
, 0);
76 for (sh
= 0; sh
< PIPE_SHADER_TYPES
; sh
++) {
77 if (rb_pipe
->draw_rule
.shader
[sh
] &&
78 rb_pipe
->draw_rule
.shader
[sh
] == rb_pipe
->curr
.shader
[sh
])
82 if (rb_pipe
->draw_rule
.surf
&&
83 rb_pipe
->draw_rule
.surf
== rb_pipe
->curr
.zsbuf
)
85 if (rb_pipe
->draw_rule
.surf
)
86 for (k
= 0; k
< rb_pipe
->curr
.nr_cbufs
; k
++)
87 if (rb_pipe
->draw_rule
.surf
== rb_pipe
->curr
.cbufs
[k
])
89 if (rb_pipe
->draw_rule
.texture
) {
90 for (sh
= 0; sh
< ARRAY_SIZE(rb_pipe
->curr
.num_views
); sh
++) {
91 for (k
= 0; k
< rb_pipe
->curr
.num_views
[sh
]; k
++) {
92 if (rb_pipe
->draw_rule
.texture
== rb_pipe
->curr
.texs
[sh
][k
]) {
94 sh
= PIPE_SHADER_TYPES
; /* to break out of both loops */
102 rb_pipe
->draw_blocked
|= (flag
| RBUG_BLOCK_RULE
);
105 if (rb_pipe
->draw_blocked
)
106 rbug_notify_draw_blocked(rb_pipe
);
108 /* wait for rbug to clear the blocked flag */
109 while (rb_pipe
->draw_blocked
& flag
) {
110 rb_pipe
->draw_blocked
|= flag
;
111 pipe_condvar_wait(rb_pipe
->draw_cond
, rb_pipe
->draw_mutex
);
117 rbug_draw_vbo(struct pipe_context
*_pipe
, const struct pipe_draw_info
*info
)
119 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
120 struct pipe_context
*pipe
= rb_pipe
->pipe
;
122 pipe_mutex_lock(rb_pipe
->draw_mutex
);
123 rbug_draw_block_locked(rb_pipe
, RBUG_BLOCK_BEFORE
);
125 pipe_mutex_lock(rb_pipe
->call_mutex
);
126 /* XXX loop over PIPE_SHADER_x here */
127 if (!(rb_pipe
->curr
.shader
[PIPE_SHADER_FRAGMENT
] && rb_pipe
->curr
.shader
[PIPE_SHADER_FRAGMENT
]->disabled
) &&
128 !(rb_pipe
->curr
.shader
[PIPE_SHADER_GEOMETRY
] && rb_pipe
->curr
.shader
[PIPE_SHADER_GEOMETRY
]->disabled
) &&
129 !(rb_pipe
->curr
.shader
[PIPE_SHADER_VERTEX
] && rb_pipe
->curr
.shader
[PIPE_SHADER_VERTEX
]->disabled
))
130 pipe
->draw_vbo(pipe
, info
);
131 pipe_mutex_unlock(rb_pipe
->call_mutex
);
133 rbug_draw_block_locked(rb_pipe
, RBUG_BLOCK_AFTER
);
134 pipe_mutex_unlock(rb_pipe
->draw_mutex
);
137 static struct pipe_query
*
138 rbug_create_query(struct pipe_context
*_pipe
,
142 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
143 struct pipe_context
*pipe
= rb_pipe
->pipe
;
144 struct pipe_query
*query
;
146 pipe_mutex_lock(rb_pipe
->call_mutex
);
147 query
= pipe
->create_query(pipe
,
150 pipe_mutex_unlock(rb_pipe
->call_mutex
);
155 rbug_destroy_query(struct pipe_context
*_pipe
,
156 struct pipe_query
*query
)
158 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
159 struct pipe_context
*pipe
= rb_pipe
->pipe
;
161 pipe_mutex_lock(rb_pipe
->call_mutex
);
162 pipe
->destroy_query(pipe
,
164 pipe_mutex_unlock(rb_pipe
->call_mutex
);
168 rbug_begin_query(struct pipe_context
*_pipe
,
169 struct pipe_query
*query
)
171 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
172 struct pipe_context
*pipe
= rb_pipe
->pipe
;
175 pipe_mutex_lock(rb_pipe
->call_mutex
);
176 ret
= pipe
->begin_query(pipe
, query
);
177 pipe_mutex_unlock(rb_pipe
->call_mutex
);
182 rbug_end_query(struct pipe_context
*_pipe
,
183 struct pipe_query
*query
)
185 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
186 struct pipe_context
*pipe
= rb_pipe
->pipe
;
189 pipe_mutex_lock(rb_pipe
->call_mutex
);
190 ret
= pipe
->end_query(pipe
,
192 pipe_mutex_unlock(rb_pipe
->call_mutex
);
198 rbug_get_query_result(struct pipe_context
*_pipe
,
199 struct pipe_query
*query
,
201 union pipe_query_result
*result
)
203 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
204 struct pipe_context
*pipe
= rb_pipe
->pipe
;
207 pipe_mutex_lock(rb_pipe
->call_mutex
);
208 ret
= pipe
->get_query_result(pipe
,
212 pipe_mutex_unlock(rb_pipe
->call_mutex
);
218 rbug_set_active_query_state(struct pipe_context
*_pipe
, boolean enable
)
220 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
221 struct pipe_context
*pipe
= rb_pipe
->pipe
;
223 pipe_mutex_lock(rb_pipe
->call_mutex
);
224 pipe
->set_active_query_state(pipe
, enable
);
225 pipe_mutex_unlock(rb_pipe
->call_mutex
);
229 rbug_create_blend_state(struct pipe_context
*_pipe
,
230 const struct pipe_blend_state
*blend
)
232 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
233 struct pipe_context
*pipe
= rb_pipe
->pipe
;
236 pipe_mutex_lock(rb_pipe
->call_mutex
);
237 ret
= pipe
->create_blend_state(pipe
,
239 pipe_mutex_unlock(rb_pipe
->call_mutex
);
245 rbug_bind_blend_state(struct pipe_context
*_pipe
,
248 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
249 struct pipe_context
*pipe
= rb_pipe
->pipe
;
251 pipe_mutex_lock(rb_pipe
->call_mutex
);
252 pipe
->bind_blend_state(pipe
,
254 pipe_mutex_unlock(rb_pipe
->call_mutex
);
258 rbug_delete_blend_state(struct pipe_context
*_pipe
,
261 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
262 struct pipe_context
*pipe
= rb_pipe
->pipe
;
264 pipe_mutex_lock(rb_pipe
->call_mutex
);
265 pipe
->delete_blend_state(pipe
,
267 pipe_mutex_unlock(rb_pipe
->call_mutex
);
271 rbug_create_sampler_state(struct pipe_context
*_pipe
,
272 const struct pipe_sampler_state
*sampler
)
274 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
275 struct pipe_context
*pipe
= rb_pipe
->pipe
;
278 pipe_mutex_lock(rb_pipe
->call_mutex
);
279 ret
= pipe
->create_sampler_state(pipe
,
281 pipe_mutex_unlock(rb_pipe
->call_mutex
);
287 rbug_bind_sampler_states(struct pipe_context
*_pipe
,
288 enum pipe_shader_type shader
,
289 unsigned start
, unsigned count
,
292 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
293 struct pipe_context
*pipe
= rb_pipe
->pipe
;
295 pipe_mutex_lock(rb_pipe
->call_mutex
);
296 pipe
->bind_sampler_states(pipe
, shader
, start
, count
, samplers
);
297 pipe_mutex_unlock(rb_pipe
->call_mutex
);
301 rbug_delete_sampler_state(struct pipe_context
*_pipe
,
304 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
305 struct pipe_context
*pipe
= rb_pipe
->pipe
;
307 pipe_mutex_lock(rb_pipe
->call_mutex
);
308 pipe
->delete_sampler_state(pipe
,
310 pipe_mutex_unlock(rb_pipe
->call_mutex
);
314 rbug_create_rasterizer_state(struct pipe_context
*_pipe
,
315 const struct pipe_rasterizer_state
*rasterizer
)
317 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
318 struct pipe_context
*pipe
= rb_pipe
->pipe
;
321 pipe_mutex_lock(rb_pipe
->call_mutex
);
322 ret
= pipe
->create_rasterizer_state(pipe
,
324 pipe_mutex_unlock(rb_pipe
->call_mutex
);
330 rbug_bind_rasterizer_state(struct pipe_context
*_pipe
,
333 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
334 struct pipe_context
*pipe
= rb_pipe
->pipe
;
336 pipe_mutex_lock(rb_pipe
->call_mutex
);
337 pipe
->bind_rasterizer_state(pipe
,
339 pipe_mutex_unlock(rb_pipe
->call_mutex
);
343 rbug_delete_rasterizer_state(struct pipe_context
*_pipe
,
346 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
347 struct pipe_context
*pipe
= rb_pipe
->pipe
;
349 pipe_mutex_lock(rb_pipe
->call_mutex
);
350 pipe
->delete_rasterizer_state(pipe
,
352 pipe_mutex_unlock(rb_pipe
->call_mutex
);
356 rbug_create_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
357 const struct pipe_depth_stencil_alpha_state
*depth_stencil_alpha
)
359 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
360 struct pipe_context
*pipe
= rb_pipe
->pipe
;
363 pipe_mutex_lock(rb_pipe
->call_mutex
);
364 ret
= pipe
->create_depth_stencil_alpha_state(pipe
,
365 depth_stencil_alpha
);
366 pipe_mutex_unlock(rb_pipe
->call_mutex
);
372 rbug_bind_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
373 void *depth_stencil_alpha
)
375 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
376 struct pipe_context
*pipe
= rb_pipe
->pipe
;
378 pipe_mutex_lock(rb_pipe
->call_mutex
);
379 pipe
->bind_depth_stencil_alpha_state(pipe
,
380 depth_stencil_alpha
);
381 pipe_mutex_unlock(rb_pipe
->call_mutex
);
385 rbug_delete_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
386 void *depth_stencil_alpha
)
388 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
389 struct pipe_context
*pipe
= rb_pipe
->pipe
;
391 pipe_mutex_lock(rb_pipe
->call_mutex
);
392 pipe
->delete_depth_stencil_alpha_state(pipe
,
393 depth_stencil_alpha
);
394 pipe_mutex_unlock(rb_pipe
->call_mutex
);
398 rbug_create_fs_state(struct pipe_context
*_pipe
,
399 const struct pipe_shader_state
*state
)
401 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
402 struct pipe_context
*pipe
= rb_pipe
->pipe
;
405 pipe_mutex_lock(rb_pipe
->call_mutex
);
406 result
= pipe
->create_fs_state(pipe
, state
);
407 pipe_mutex_unlock(rb_pipe
->call_mutex
);
412 return rbug_shader_create(rb_pipe
, state
, result
, RBUG_SHADER_FRAGMENT
);
416 rbug_bind_fs_state(struct pipe_context
*_pipe
,
419 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
420 struct pipe_context
*pipe
= rb_pipe
->pipe
;
423 pipe_mutex_lock(rb_pipe
->call_mutex
);
425 fs
= rbug_shader_unwrap(_fs
);
426 rb_pipe
->curr
.shader
[PIPE_SHADER_FRAGMENT
] = rbug_shader(_fs
);
427 pipe
->bind_fs_state(pipe
,
430 pipe_mutex_unlock(rb_pipe
->call_mutex
);
434 rbug_delete_fs_state(struct pipe_context
*_pipe
,
437 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
438 struct rbug_shader
*rb_shader
= rbug_shader(_fs
);
440 pipe_mutex_lock(rb_pipe
->call_mutex
);
441 rbug_shader_destroy(rb_pipe
, rb_shader
);
442 pipe_mutex_unlock(rb_pipe
->call_mutex
);
446 rbug_create_vs_state(struct pipe_context
*_pipe
,
447 const struct pipe_shader_state
*state
)
449 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
450 struct pipe_context
*pipe
= rb_pipe
->pipe
;
453 pipe_mutex_lock(rb_pipe
->call_mutex
);
454 result
= pipe
->create_vs_state(pipe
, state
);
455 pipe_mutex_unlock(rb_pipe
->call_mutex
);
460 return rbug_shader_create(rb_pipe
, state
, result
, RBUG_SHADER_VERTEX
);
464 rbug_bind_vs_state(struct pipe_context
*_pipe
,
467 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
468 struct pipe_context
*pipe
= rb_pipe
->pipe
;
471 pipe_mutex_lock(rb_pipe
->call_mutex
);
473 vs
= rbug_shader_unwrap(_vs
);
474 rb_pipe
->curr
.shader
[PIPE_SHADER_VERTEX
] = rbug_shader(_vs
);
475 pipe
->bind_vs_state(pipe
,
478 pipe_mutex_unlock(rb_pipe
->call_mutex
);
482 rbug_delete_vs_state(struct pipe_context
*_pipe
,
485 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
486 struct rbug_shader
*rb_shader
= rbug_shader(_vs
);
488 pipe_mutex_unlock(rb_pipe
->call_mutex
);
489 rbug_shader_destroy(rb_pipe
, rb_shader
);
490 pipe_mutex_unlock(rb_pipe
->call_mutex
);
494 rbug_create_gs_state(struct pipe_context
*_pipe
,
495 const struct pipe_shader_state
*state
)
497 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
498 struct pipe_context
*pipe
= rb_pipe
->pipe
;
501 pipe_mutex_lock(rb_pipe
->call_mutex
);
502 result
= pipe
->create_gs_state(pipe
, state
);
503 pipe_mutex_unlock(rb_pipe
->call_mutex
);
508 return rbug_shader_create(rb_pipe
, state
, result
, RBUG_SHADER_GEOM
);
512 rbug_bind_gs_state(struct pipe_context
*_pipe
,
515 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
516 struct pipe_context
*pipe
= rb_pipe
->pipe
;
519 pipe_mutex_lock(rb_pipe
->call_mutex
);
521 gs
= rbug_shader_unwrap(_gs
);
522 rb_pipe
->curr
.shader
[PIPE_SHADER_GEOMETRY
] = rbug_shader(_gs
);
523 pipe
->bind_gs_state(pipe
,
526 pipe_mutex_unlock(rb_pipe
->call_mutex
);
530 rbug_delete_gs_state(struct pipe_context
*_pipe
,
533 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
534 struct rbug_shader
*rb_shader
= rbug_shader(_gs
);
536 pipe_mutex_lock(rb_pipe
->call_mutex
);
537 rbug_shader_destroy(rb_pipe
, rb_shader
);
538 pipe_mutex_unlock(rb_pipe
->call_mutex
);
542 rbug_create_vertex_elements_state(struct pipe_context
*_pipe
,
543 unsigned num_elements
,
544 const struct pipe_vertex_element
*vertex_elements
)
546 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
547 struct pipe_context
*pipe
= rb_pipe
->pipe
;
550 pipe_mutex_lock(rb_pipe
->call_mutex
);
551 ret
= pipe
->create_vertex_elements_state(pipe
,
554 pipe_mutex_unlock(rb_pipe
->call_mutex
);
560 rbug_bind_vertex_elements_state(struct pipe_context
*_pipe
,
563 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
564 struct pipe_context
*pipe
= rb_pipe
->pipe
;
566 pipe_mutex_lock(rb_pipe
->call_mutex
);
567 pipe
->bind_vertex_elements_state(pipe
,
569 pipe_mutex_unlock(rb_pipe
->call_mutex
);
573 rbug_delete_vertex_elements_state(struct pipe_context
*_pipe
,
576 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
577 struct pipe_context
*pipe
= rb_pipe
->pipe
;
579 pipe_mutex_lock(rb_pipe
->call_mutex
);
580 pipe
->delete_vertex_elements_state(pipe
,
582 pipe_mutex_unlock(rb_pipe
->call_mutex
);
586 rbug_set_blend_color(struct pipe_context
*_pipe
,
587 const struct pipe_blend_color
*blend_color
)
589 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
590 struct pipe_context
*pipe
= rb_pipe
->pipe
;
592 pipe_mutex_lock(rb_pipe
->call_mutex
);
593 pipe
->set_blend_color(pipe
,
595 pipe_mutex_unlock(rb_pipe
->call_mutex
);
599 rbug_set_stencil_ref(struct pipe_context
*_pipe
,
600 const struct pipe_stencil_ref
*stencil_ref
)
602 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
603 struct pipe_context
*pipe
= rb_pipe
->pipe
;
605 pipe_mutex_lock(rb_pipe
->call_mutex
);
606 pipe
->set_stencil_ref(pipe
,
608 pipe_mutex_unlock(rb_pipe
->call_mutex
);
612 rbug_set_clip_state(struct pipe_context
*_pipe
,
613 const struct pipe_clip_state
*clip
)
615 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
616 struct pipe_context
*pipe
= rb_pipe
->pipe
;
618 pipe_mutex_lock(rb_pipe
->call_mutex
);
619 pipe
->set_clip_state(pipe
,
621 pipe_mutex_unlock(rb_pipe
->call_mutex
);
625 rbug_set_constant_buffer(struct pipe_context
*_pipe
,
628 const struct pipe_constant_buffer
*_cb
)
630 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
631 struct pipe_context
*pipe
= rb_pipe
->pipe
;
632 struct pipe_constant_buffer cb
;
634 /* XXX hmm? unwrap the input state */
637 cb
.buffer
= rbug_resource_unwrap(_cb
->buffer
);
640 pipe_mutex_lock(rb_pipe
->call_mutex
);
641 pipe
->set_constant_buffer(pipe
,
645 pipe_mutex_unlock(rb_pipe
->call_mutex
);
649 rbug_set_framebuffer_state(struct pipe_context
*_pipe
,
650 const struct pipe_framebuffer_state
*_state
)
652 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
653 struct pipe_context
*pipe
= rb_pipe
->pipe
;
654 struct pipe_framebuffer_state unwrapped_state
;
655 struct pipe_framebuffer_state
*state
= NULL
;
658 /* must protect curr status */
659 pipe_mutex_lock(rb_pipe
->call_mutex
);
661 rb_pipe
->curr
.nr_cbufs
= 0;
662 memset(rb_pipe
->curr
.cbufs
, 0, sizeof(rb_pipe
->curr
.cbufs
));
663 rb_pipe
->curr
.zsbuf
= NULL
;
665 /* unwrap the input state */
667 memcpy(&unwrapped_state
, _state
, sizeof(unwrapped_state
));
669 rb_pipe
->curr
.nr_cbufs
= _state
->nr_cbufs
;
670 for(i
= 0; i
< _state
->nr_cbufs
; i
++) {
671 unwrapped_state
.cbufs
[i
] = rbug_surface_unwrap(_state
->cbufs
[i
]);
672 if (_state
->cbufs
[i
])
673 rb_pipe
->curr
.cbufs
[i
] = rbug_resource(_state
->cbufs
[i
]->texture
);
675 unwrapped_state
.zsbuf
= rbug_surface_unwrap(_state
->zsbuf
);
677 rb_pipe
->curr
.zsbuf
= rbug_resource(_state
->zsbuf
->texture
);
678 state
= &unwrapped_state
;
681 pipe
->set_framebuffer_state(pipe
,
684 pipe_mutex_unlock(rb_pipe
->call_mutex
);
688 rbug_set_polygon_stipple(struct pipe_context
*_pipe
,
689 const struct pipe_poly_stipple
*poly_stipple
)
691 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
692 struct pipe_context
*pipe
= rb_pipe
->pipe
;
694 pipe_mutex_lock(rb_pipe
->call_mutex
);
695 pipe
->set_polygon_stipple(pipe
,
697 pipe_mutex_unlock(rb_pipe
->call_mutex
);
701 rbug_set_scissor_states(struct pipe_context
*_pipe
,
703 unsigned num_scissors
,
704 const struct pipe_scissor_state
*scissor
)
706 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
707 struct pipe_context
*pipe
= rb_pipe
->pipe
;
709 pipe_mutex_lock(rb_pipe
->call_mutex
);
710 pipe
->set_scissor_states(pipe
, start_slot
, num_scissors
, scissor
);
711 pipe_mutex_unlock(rb_pipe
->call_mutex
);
715 rbug_set_viewport_states(struct pipe_context
*_pipe
,
717 unsigned num_viewports
,
718 const struct pipe_viewport_state
*viewport
)
720 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
721 struct pipe_context
*pipe
= rb_pipe
->pipe
;
723 pipe_mutex_lock(rb_pipe
->call_mutex
);
724 pipe
->set_viewport_states(pipe
, start_slot
, num_viewports
, viewport
);
725 pipe_mutex_unlock(rb_pipe
->call_mutex
);
729 rbug_set_sampler_views(struct pipe_context
*_pipe
,
730 enum pipe_shader_type shader
,
733 struct pipe_sampler_view
**_views
)
735 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
736 struct pipe_context
*pipe
= rb_pipe
->pipe
;
737 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_SHADER_SAMPLER_VIEWS
];
738 struct pipe_sampler_view
**views
= NULL
;
741 assert(start
== 0); /* XXX fix */
743 /* must protect curr status */
744 pipe_mutex_lock(rb_pipe
->call_mutex
);
746 rb_pipe
->curr
.num_views
[shader
] = 0;
747 memset(rb_pipe
->curr
.views
[shader
], 0, sizeof(rb_pipe
->curr
.views
[shader
]));
748 memset(rb_pipe
->curr
.texs
[shader
], 0, sizeof(rb_pipe
->curr
.texs
[shader
]));
749 memset(unwrapped_views
, 0, sizeof(unwrapped_views
));
752 rb_pipe
->curr
.num_views
[shader
] = num
;
753 for (i
= 0; i
< num
; i
++) {
754 rb_pipe
->curr
.views
[shader
][i
] = rbug_sampler_view(_views
[i
]);
755 rb_pipe
->curr
.texs
[shader
][i
] = rbug_resource(_views
[i
] ? _views
[i
]->texture
: NULL
);
756 unwrapped_views
[i
] = rbug_sampler_view_unwrap(_views
[i
]);
758 views
= unwrapped_views
;
761 pipe
->set_sampler_views(pipe
, shader
, start
, num
, views
);
763 pipe_mutex_unlock(rb_pipe
->call_mutex
);
767 rbug_set_vertex_buffers(struct pipe_context
*_pipe
,
768 unsigned start_slot
, unsigned num_buffers
,
769 const struct pipe_vertex_buffer
*_buffers
)
771 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
772 struct pipe_context
*pipe
= rb_pipe
->pipe
;
773 struct pipe_vertex_buffer unwrapped_buffers
[PIPE_MAX_SHADER_INPUTS
];
774 struct pipe_vertex_buffer
*buffers
= NULL
;
777 pipe_mutex_lock(rb_pipe
->call_mutex
);
779 if (num_buffers
&& _buffers
) {
780 memcpy(unwrapped_buffers
, _buffers
, num_buffers
* sizeof(*_buffers
));
781 for (i
= 0; i
< num_buffers
; i
++)
782 unwrapped_buffers
[i
].buffer
= rbug_resource_unwrap(_buffers
[i
].buffer
);
783 buffers
= unwrapped_buffers
;
786 pipe
->set_vertex_buffers(pipe
, start_slot
,
790 pipe_mutex_unlock(rb_pipe
->call_mutex
);
794 rbug_set_index_buffer(struct pipe_context
*_pipe
,
795 const struct pipe_index_buffer
*_ib
)
797 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
798 struct pipe_context
*pipe
= rb_pipe
->pipe
;
799 struct pipe_index_buffer unwrapped_ib
, *ib
= NULL
;
803 unwrapped_ib
.buffer
= rbug_resource_unwrap(_ib
->buffer
);
807 pipe_mutex_lock(rb_pipe
->call_mutex
);
808 pipe
->set_index_buffer(pipe
, ib
);
809 pipe_mutex_unlock(rb_pipe
->call_mutex
);
813 rbug_set_sample_mask(struct pipe_context
*_pipe
,
814 unsigned sample_mask
)
816 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
817 struct pipe_context
*pipe
= rb_pipe
->pipe
;
819 pipe_mutex_lock(rb_pipe
->call_mutex
);
820 pipe
->set_sample_mask(pipe
, sample_mask
);
821 pipe_mutex_unlock(rb_pipe
->call_mutex
);
824 static struct pipe_stream_output_target
*
825 rbug_create_stream_output_target(struct pipe_context
*_pipe
,
826 struct pipe_resource
*_res
,
827 unsigned buffer_offset
, unsigned buffer_size
)
829 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
830 struct pipe_context
*pipe
= rb_pipe
->pipe
;
831 struct pipe_resource
*res
= rbug_resource_unwrap(_res
);
832 struct pipe_stream_output_target
*target
;
834 pipe_mutex_lock(rb_pipe
->call_mutex
);
835 target
= pipe
->create_stream_output_target(pipe
, res
, buffer_offset
,
837 pipe_mutex_unlock(rb_pipe
->call_mutex
);
842 rbug_stream_output_target_destroy(struct pipe_context
*_pipe
,
843 struct pipe_stream_output_target
*target
)
845 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
846 struct pipe_context
*pipe
= rb_pipe
->pipe
;
848 pipe_mutex_lock(rb_pipe
->call_mutex
);
849 pipe
->stream_output_target_destroy(pipe
, target
);
850 pipe_mutex_unlock(rb_pipe
->call_mutex
);
854 rbug_set_stream_output_targets(struct pipe_context
*_pipe
,
855 unsigned num_targets
,
856 struct pipe_stream_output_target
**targets
,
857 const unsigned *offsets
)
859 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
860 struct pipe_context
*pipe
= rb_pipe
->pipe
;
862 pipe_mutex_lock(rb_pipe
->call_mutex
);
863 pipe
->set_stream_output_targets(pipe
, num_targets
, targets
, offsets
);
864 pipe_mutex_unlock(rb_pipe
->call_mutex
);
868 rbug_resource_copy_region(struct pipe_context
*_pipe
,
869 struct pipe_resource
*_dst
,
874 struct pipe_resource
*_src
,
876 const struct pipe_box
*src_box
)
878 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
879 struct rbug_resource
*rb_resource_dst
= rbug_resource(_dst
);
880 struct rbug_resource
*rb_resource_src
= rbug_resource(_src
);
881 struct pipe_context
*pipe
= rb_pipe
->pipe
;
882 struct pipe_resource
*dst
= rb_resource_dst
->resource
;
883 struct pipe_resource
*src
= rb_resource_src
->resource
;
885 pipe_mutex_lock(rb_pipe
->call_mutex
);
886 pipe
->resource_copy_region(pipe
,
895 pipe_mutex_unlock(rb_pipe
->call_mutex
);
899 rbug_blit(struct pipe_context
*_pipe
, const struct pipe_blit_info
*_blit_info
)
901 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
902 struct rbug_resource
*rb_resource_dst
= rbug_resource(_blit_info
->dst
.resource
);
903 struct rbug_resource
*rb_resource_src
= rbug_resource(_blit_info
->src
.resource
);
904 struct pipe_context
*pipe
= rb_pipe
->pipe
;
905 struct pipe_resource
*dst
= rb_resource_dst
->resource
;
906 struct pipe_resource
*src
= rb_resource_src
->resource
;
907 struct pipe_blit_info blit_info
;
909 blit_info
= *_blit_info
;
910 blit_info
.dst
.resource
= dst
;
911 blit_info
.src
.resource
= src
;
913 pipe_mutex_lock(rb_pipe
->call_mutex
);
914 pipe
->blit(pipe
, &blit_info
);
915 pipe_mutex_unlock(rb_pipe
->call_mutex
);
919 rbug_flush_resource(struct pipe_context
*_pipe
,
920 struct pipe_resource
*_res
)
922 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
923 struct rbug_resource
*rb_resource_res
= rbug_resource(_res
);
924 struct pipe_context
*pipe
= rb_pipe
->pipe
;
925 struct pipe_resource
*res
= rb_resource_res
->resource
;
927 pipe_mutex_lock(rb_pipe
->call_mutex
);
928 pipe
->flush_resource(pipe
, res
);
929 pipe_mutex_unlock(rb_pipe
->call_mutex
);
933 rbug_clear(struct pipe_context
*_pipe
,
935 const union pipe_color_union
*color
,
939 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
940 struct pipe_context
*pipe
= rb_pipe
->pipe
;
942 pipe_mutex_lock(rb_pipe
->call_mutex
);
948 pipe_mutex_unlock(rb_pipe
->call_mutex
);
952 rbug_clear_render_target(struct pipe_context
*_pipe
,
953 struct pipe_surface
*_dst
,
954 const union pipe_color_union
*color
,
955 unsigned dstx
, unsigned dsty
,
956 unsigned width
, unsigned height
,
957 bool render_condition_enabled
)
959 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
960 struct rbug_surface
*rb_surface_dst
= rbug_surface(_dst
);
961 struct pipe_context
*pipe
= rb_pipe
->pipe
;
962 struct pipe_surface
*dst
= rb_surface_dst
->surface
;
964 pipe_mutex_lock(rb_pipe
->call_mutex
);
965 pipe
->clear_render_target(pipe
,
972 render_condition_enabled
);
973 pipe_mutex_unlock(rb_pipe
->call_mutex
);
977 rbug_clear_depth_stencil(struct pipe_context
*_pipe
,
978 struct pipe_surface
*_dst
,
979 unsigned clear_flags
,
982 unsigned dstx
, unsigned dsty
,
983 unsigned width
, unsigned height
,
984 bool render_condition_enabled
)
986 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
987 struct rbug_surface
*rb_surface_dst
= rbug_surface(_dst
);
988 struct pipe_context
*pipe
= rb_pipe
->pipe
;
989 struct pipe_surface
*dst
= rb_surface_dst
->surface
;
991 pipe_mutex_lock(rb_pipe
->call_mutex
);
992 pipe
->clear_depth_stencil(pipe
,
1001 render_condition_enabled
);
1002 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1006 rbug_flush(struct pipe_context
*_pipe
,
1007 struct pipe_fence_handle
**fence
,
1010 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
1011 struct pipe_context
*pipe
= rb_pipe
->pipe
;
1013 pipe_mutex_lock(rb_pipe
->call_mutex
);
1014 pipe
->flush(pipe
, fence
, flags
);
1015 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1018 static struct pipe_sampler_view
*
1019 rbug_context_create_sampler_view(struct pipe_context
*_pipe
,
1020 struct pipe_resource
*_resource
,
1021 const struct pipe_sampler_view
*templ
)
1023 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
1024 struct rbug_resource
*rb_resource
= rbug_resource(_resource
);
1025 struct pipe_context
*pipe
= rb_pipe
->pipe
;
1026 struct pipe_resource
*resource
= rb_resource
->resource
;
1027 struct pipe_sampler_view
*result
;
1029 pipe_mutex_lock(rb_pipe
->call_mutex
);
1030 result
= pipe
->create_sampler_view(pipe
,
1033 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1036 return rbug_sampler_view_create(rb_pipe
, rb_resource
, result
);
1041 rbug_context_sampler_view_destroy(struct pipe_context
*_pipe
,
1042 struct pipe_sampler_view
*_view
)
1044 rbug_sampler_view_destroy(rbug_context(_pipe
),
1045 rbug_sampler_view(_view
));
1048 static struct pipe_surface
*
1049 rbug_context_create_surface(struct pipe_context
*_pipe
,
1050 struct pipe_resource
*_resource
,
1051 const struct pipe_surface
*surf_tmpl
)
1053 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
1054 struct rbug_resource
*rb_resource
= rbug_resource(_resource
);
1055 struct pipe_context
*pipe
= rb_pipe
->pipe
;
1056 struct pipe_resource
*resource
= rb_resource
->resource
;
1057 struct pipe_surface
*result
;
1059 pipe_mutex_lock(rb_pipe
->call_mutex
);
1060 result
= pipe
->create_surface(pipe
,
1063 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1066 return rbug_surface_create(rb_pipe
, rb_resource
, result
);
1071 rbug_context_surface_destroy(struct pipe_context
*_pipe
,
1072 struct pipe_surface
*_surface
)
1074 struct rbug_context
*rb_pipe
= rbug_context(_pipe
);
1075 struct rbug_surface
*rb_surface
= rbug_surface(_surface
);
1077 pipe_mutex_lock(rb_pipe
->call_mutex
);
1078 rbug_surface_destroy(rb_pipe
,
1080 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1086 rbug_context_transfer_map(struct pipe_context
*_context
,
1087 struct pipe_resource
*_resource
,
1090 const struct pipe_box
*box
,
1091 struct pipe_transfer
**transfer
)
1093 struct rbug_context
*rb_pipe
= rbug_context(_context
);
1094 struct rbug_resource
*rb_resource
= rbug_resource(_resource
);
1095 struct pipe_context
*context
= rb_pipe
->pipe
;
1096 struct pipe_resource
*resource
= rb_resource
->resource
;
1097 struct pipe_transfer
*result
;
1100 pipe_mutex_lock(rb_pipe
->call_mutex
);
1101 map
= context
->transfer_map(context
,
1106 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1108 *transfer
= rbug_transfer_create(rb_pipe
, rb_resource
, result
);
1109 return *transfer
? map
: NULL
;
1113 rbug_context_transfer_flush_region(struct pipe_context
*_context
,
1114 struct pipe_transfer
*_transfer
,
1115 const struct pipe_box
*box
)
1117 struct rbug_context
*rb_pipe
= rbug_context(_context
);
1118 struct rbug_transfer
*rb_transfer
= rbug_transfer(_transfer
);
1119 struct pipe_context
*context
= rb_pipe
->pipe
;
1120 struct pipe_transfer
*transfer
= rb_transfer
->transfer
;
1122 pipe_mutex_lock(rb_pipe
->call_mutex
);
1123 context
->transfer_flush_region(context
,
1126 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1131 rbug_context_transfer_unmap(struct pipe_context
*_context
,
1132 struct pipe_transfer
*_transfer
)
1134 struct rbug_context
*rb_pipe
= rbug_context(_context
);
1135 struct rbug_transfer
*rb_transfer
= rbug_transfer(_transfer
);
1136 struct pipe_context
*context
= rb_pipe
->pipe
;
1137 struct pipe_transfer
*transfer
= rb_transfer
->transfer
;
1139 pipe_mutex_lock(rb_pipe
->call_mutex
);
1140 context
->transfer_unmap(context
,
1142 rbug_transfer_destroy(rb_pipe
,
1144 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1149 rbug_context_buffer_subdata(struct pipe_context
*_context
,
1150 struct pipe_resource
*_resource
,
1151 unsigned usage
, unsigned offset
,
1152 unsigned size
, const void *data
)
1154 struct rbug_context
*rb_pipe
= rbug_context(_context
);
1155 struct rbug_resource
*rb_resource
= rbug_resource(_resource
);
1156 struct pipe_context
*context
= rb_pipe
->pipe
;
1157 struct pipe_resource
*resource
= rb_resource
->resource
;
1159 pipe_mutex_lock(rb_pipe
->call_mutex
);
1160 context
->buffer_subdata(context
, resource
, usage
, offset
, size
, data
);
1161 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1166 rbug_context_texture_subdata(struct pipe_context
*_context
,
1167 struct pipe_resource
*_resource
,
1170 const struct pipe_box
*box
,
1173 unsigned layer_stride
)
1175 struct rbug_context
*rb_pipe
= rbug_context(_context
);
1176 struct rbug_resource
*rb_resource
= rbug_resource(_resource
);
1177 struct pipe_context
*context
= rb_pipe
->pipe
;
1178 struct pipe_resource
*resource
= rb_resource
->resource
;
1180 pipe_mutex_lock(rb_pipe
->call_mutex
);
1181 context
->texture_subdata(context
,
1189 pipe_mutex_unlock(rb_pipe
->call_mutex
);
1193 struct pipe_context
*
1194 rbug_context_create(struct pipe_screen
*_screen
, struct pipe_context
*pipe
)
1196 struct rbug_context
*rb_pipe
;
1197 struct rbug_screen
*rb_screen
= rbug_screen(_screen
);
1202 rb_pipe
= CALLOC_STRUCT(rbug_context
);
1206 pipe_mutex_init(rb_pipe
->draw_mutex
);
1207 pipe_condvar_init(rb_pipe
->draw_cond
);
1208 pipe_mutex_init(rb_pipe
->call_mutex
);
1209 pipe_mutex_init(rb_pipe
->list_mutex
);
1210 make_empty_list(&rb_pipe
->shaders
);
1212 rb_pipe
->base
.screen
= _screen
;
1213 rb_pipe
->base
.priv
= pipe
->priv
; /* expose wrapped data */
1214 rb_pipe
->base
.draw
= NULL
;
1216 rb_pipe
->base
.destroy
= rbug_destroy
;
1217 rb_pipe
->base
.draw_vbo
= rbug_draw_vbo
;
1218 rb_pipe
->base
.create_query
= rbug_create_query
;
1219 rb_pipe
->base
.destroy_query
= rbug_destroy_query
;
1220 rb_pipe
->base
.begin_query
= rbug_begin_query
;
1221 rb_pipe
->base
.end_query
= rbug_end_query
;
1222 rb_pipe
->base
.get_query_result
= rbug_get_query_result
;
1223 rb_pipe
->base
.set_active_query_state
= rbug_set_active_query_state
;
1224 rb_pipe
->base
.create_blend_state
= rbug_create_blend_state
;
1225 rb_pipe
->base
.bind_blend_state
= rbug_bind_blend_state
;
1226 rb_pipe
->base
.delete_blend_state
= rbug_delete_blend_state
;
1227 rb_pipe
->base
.create_sampler_state
= rbug_create_sampler_state
;
1228 rb_pipe
->base
.bind_sampler_states
= rbug_bind_sampler_states
;
1229 rb_pipe
->base
.delete_sampler_state
= rbug_delete_sampler_state
;
1230 rb_pipe
->base
.create_rasterizer_state
= rbug_create_rasterizer_state
;
1231 rb_pipe
->base
.bind_rasterizer_state
= rbug_bind_rasterizer_state
;
1232 rb_pipe
->base
.delete_rasterizer_state
= rbug_delete_rasterizer_state
;
1233 rb_pipe
->base
.create_depth_stencil_alpha_state
= rbug_create_depth_stencil_alpha_state
;
1234 rb_pipe
->base
.bind_depth_stencil_alpha_state
= rbug_bind_depth_stencil_alpha_state
;
1235 rb_pipe
->base
.delete_depth_stencil_alpha_state
= rbug_delete_depth_stencil_alpha_state
;
1236 rb_pipe
->base
.create_fs_state
= rbug_create_fs_state
;
1237 rb_pipe
->base
.bind_fs_state
= rbug_bind_fs_state
;
1238 rb_pipe
->base
.delete_fs_state
= rbug_delete_fs_state
;
1239 rb_pipe
->base
.create_vs_state
= rbug_create_vs_state
;
1240 rb_pipe
->base
.bind_vs_state
= rbug_bind_vs_state
;
1241 rb_pipe
->base
.delete_vs_state
= rbug_delete_vs_state
;
1242 rb_pipe
->base
.create_gs_state
= rbug_create_gs_state
;
1243 rb_pipe
->base
.bind_gs_state
= rbug_bind_gs_state
;
1244 rb_pipe
->base
.delete_gs_state
= rbug_delete_gs_state
;
1245 rb_pipe
->base
.create_vertex_elements_state
= rbug_create_vertex_elements_state
;
1246 rb_pipe
->base
.bind_vertex_elements_state
= rbug_bind_vertex_elements_state
;
1247 rb_pipe
->base
.delete_vertex_elements_state
= rbug_delete_vertex_elements_state
;
1248 rb_pipe
->base
.set_blend_color
= rbug_set_blend_color
;
1249 rb_pipe
->base
.set_stencil_ref
= rbug_set_stencil_ref
;
1250 rb_pipe
->base
.set_clip_state
= rbug_set_clip_state
;
1251 rb_pipe
->base
.set_constant_buffer
= rbug_set_constant_buffer
;
1252 rb_pipe
->base
.set_framebuffer_state
= rbug_set_framebuffer_state
;
1253 rb_pipe
->base
.set_polygon_stipple
= rbug_set_polygon_stipple
;
1254 rb_pipe
->base
.set_scissor_states
= rbug_set_scissor_states
;
1255 rb_pipe
->base
.set_viewport_states
= rbug_set_viewport_states
;
1256 rb_pipe
->base
.set_sampler_views
= rbug_set_sampler_views
;
1257 rb_pipe
->base
.set_vertex_buffers
= rbug_set_vertex_buffers
;
1258 rb_pipe
->base
.set_index_buffer
= rbug_set_index_buffer
;
1259 rb_pipe
->base
.set_sample_mask
= rbug_set_sample_mask
;
1260 rb_pipe
->base
.create_stream_output_target
= rbug_create_stream_output_target
;
1261 rb_pipe
->base
.stream_output_target_destroy
= rbug_stream_output_target_destroy
;
1262 rb_pipe
->base
.set_stream_output_targets
= rbug_set_stream_output_targets
;
1263 rb_pipe
->base
.resource_copy_region
= rbug_resource_copy_region
;
1264 rb_pipe
->base
.blit
= rbug_blit
;
1265 rb_pipe
->base
.flush_resource
= rbug_flush_resource
;
1266 rb_pipe
->base
.clear
= rbug_clear
;
1267 rb_pipe
->base
.clear_render_target
= rbug_clear_render_target
;
1268 rb_pipe
->base
.clear_depth_stencil
= rbug_clear_depth_stencil
;
1269 rb_pipe
->base
.flush
= rbug_flush
;
1270 rb_pipe
->base
.create_sampler_view
= rbug_context_create_sampler_view
;
1271 rb_pipe
->base
.sampler_view_destroy
= rbug_context_sampler_view_destroy
;
1272 rb_pipe
->base
.create_surface
= rbug_context_create_surface
;
1273 rb_pipe
->base
.surface_destroy
= rbug_context_surface_destroy
;
1274 rb_pipe
->base
.transfer_map
= rbug_context_transfer_map
;
1275 rb_pipe
->base
.transfer_unmap
= rbug_context_transfer_unmap
;
1276 rb_pipe
->base
.transfer_flush_region
= rbug_context_transfer_flush_region
;
1277 rb_pipe
->base
.buffer_subdata
= rbug_context_buffer_subdata
;
1278 rb_pipe
->base
.texture_subdata
= rbug_context_texture_subdata
;
1280 rb_pipe
->pipe
= pipe
;
1282 rbug_screen_add_to_list(rb_screen
, contexts
, rb_pipe
);
1284 if (debug_get_bool_option("GALLIUM_RBUG_START_BLOCKED", FALSE
)) {
1285 rb_pipe
->draw_blocked
= RBUG_BLOCK_BEFORE
;
1288 return &rb_pipe
->base
;