1 /**************************************************************************
3 * Copyright 2015 Advanced Micro Devices, Inc.
4 * Copyright 2008 VMware, Inc.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * on the rights to use, copy, modify, merge, publish, distribute, sub
11 * license, and/or sell copies of the Software, and to permit persons to whom
12 * the Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice (including the next
15 * paragraph) shall be included in all copies or substantial portions of the
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
22 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24 * USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
29 #include "tgsi/tgsi_parse.h"
30 #include "util/u_memory.h"
34 safe_memcpy(void *dst
, const void *src
, size_t size
)
37 memcpy(dst
, src
, size
);
43 /********************************************************************
47 static struct dd_query
*
48 dd_query(struct pipe_query
*query
)
50 return (struct dd_query
*)query
;
53 static struct pipe_query
*
54 dd_query_unwrap(struct pipe_query
*query
)
57 return dd_query(query
)->query
;
63 static struct pipe_query
*
64 dd_context_create_query(struct pipe_context
*_pipe
, unsigned query_type
,
67 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
68 struct pipe_query
*query
;
70 query
= pipe
->create_query(pipe
, query_type
, index
);
72 /* Wrap query object. */
74 struct dd_query
*dd_query
= CALLOC_STRUCT(dd_query
);
76 dd_query
->type
= query_type
;
77 dd_query
->query
= query
;
78 query
= (struct pipe_query
*)dd_query
;
80 pipe
->destroy_query(pipe
, query
);
89 dd_context_destroy_query(struct pipe_context
*_pipe
,
90 struct pipe_query
*query
)
92 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
94 pipe
->destroy_query(pipe
, dd_query_unwrap(query
));
99 dd_context_begin_query(struct pipe_context
*_pipe
, struct pipe_query
*query
)
101 struct dd_context
*dctx
= dd_context(_pipe
);
102 struct pipe_context
*pipe
= dctx
->pipe
;
104 return pipe
->begin_query(pipe
, dd_query_unwrap(query
));
108 dd_context_end_query(struct pipe_context
*_pipe
, struct pipe_query
*query
)
110 struct dd_context
*dctx
= dd_context(_pipe
);
111 struct pipe_context
*pipe
= dctx
->pipe
;
113 return pipe
->end_query(pipe
, dd_query_unwrap(query
));
117 dd_context_get_query_result(struct pipe_context
*_pipe
,
118 struct pipe_query
*query
, boolean wait
,
119 union pipe_query_result
*result
)
121 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
123 return pipe
->get_query_result(pipe
, dd_query_unwrap(query
), wait
, result
);
127 dd_context_set_active_query_state(struct pipe_context
*_pipe
, boolean enable
)
129 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
131 pipe
->set_active_query_state(pipe
, enable
);
135 dd_context_render_condition(struct pipe_context
*_pipe
,
136 struct pipe_query
*query
, boolean condition
,
139 struct dd_context
*dctx
= dd_context(_pipe
);
140 struct pipe_context
*pipe
= dctx
->pipe
;
142 pipe
->render_condition(pipe
, dd_query_unwrap(query
), condition
, mode
);
143 dctx
->render_cond
.query
= dd_query(query
);
144 dctx
->render_cond
.condition
= condition
;
145 dctx
->render_cond
.mode
= mode
;
149 /********************************************************************
150 * constant (immutable) non-shader states
153 #define DD_CSO_CREATE(name, shortname) \
155 dd_context_create_##name##_state(struct pipe_context *_pipe, \
156 const struct pipe_##name##_state *state) \
158 struct pipe_context *pipe = dd_context(_pipe)->pipe; \
159 struct dd_state *hstate = CALLOC_STRUCT(dd_state); \
163 hstate->cso = pipe->create_##name##_state(pipe, state); \
164 hstate->state.shortname = *state; \
168 #define DD_CSO_BIND(name, shortname) \
170 dd_context_bind_##name##_state(struct pipe_context *_pipe, void *state) \
172 struct dd_context *dctx = dd_context(_pipe); \
173 struct pipe_context *pipe = dctx->pipe; \
174 struct dd_state *hstate = state; \
176 dctx->shortname = hstate; \
177 pipe->bind_##name##_state(pipe, hstate ? hstate->cso : NULL); \
180 #define DD_CSO_DELETE(name) \
182 dd_context_delete_##name##_state(struct pipe_context *_pipe, void *state) \
184 struct dd_context *dctx = dd_context(_pipe); \
185 struct pipe_context *pipe = dctx->pipe; \
186 struct dd_state *hstate = state; \
188 pipe->delete_##name##_state(pipe, hstate->cso); \
192 #define DD_CSO_WHOLE(name, shortname) \
193 DD_CSO_CREATE(name, shortname) \
194 DD_CSO_BIND(name, shortname) \
197 DD_CSO_WHOLE(blend
, blend
)
198 DD_CSO_WHOLE(rasterizer
, rs
)
199 DD_CSO_WHOLE(depth_stencil_alpha
, dsa
)
201 DD_CSO_CREATE(sampler
, sampler
)
202 DD_CSO_DELETE(sampler
)
205 dd_context_bind_sampler_states(struct pipe_context
*_pipe
, unsigned shader
,
206 unsigned start
, unsigned count
, void **states
)
208 struct dd_context
*dctx
= dd_context(_pipe
);
209 struct pipe_context
*pipe
= dctx
->pipe
;
211 memcpy(&dctx
->sampler_states
[shader
][start
], states
,
212 sizeof(void*) * count
);
215 void *samp
[PIPE_MAX_SAMPLERS
];
218 for (i
= 0; i
< count
; i
++) {
219 struct dd_state
*s
= states
[i
];
220 samp
[i
] = s
? s
->cso
: NULL
;
223 pipe
->bind_sampler_states(pipe
, shader
, start
, count
, samp
);
226 pipe
->bind_sampler_states(pipe
, shader
, start
, count
, NULL
);
230 dd_context_create_vertex_elements_state(struct pipe_context
*_pipe
,
232 const struct pipe_vertex_element
*elems
)
234 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
235 struct dd_state
*hstate
= CALLOC_STRUCT(dd_state
);
239 hstate
->cso
= pipe
->create_vertex_elements_state(pipe
, num_elems
, elems
);
240 memcpy(hstate
->state
.velems
.velems
, elems
, sizeof(elems
[0]) * num_elems
);
241 hstate
->state
.velems
.count
= num_elems
;
245 DD_CSO_BIND(vertex_elements
, velems
)
246 DD_CSO_DELETE(vertex_elements
)
249 /********************************************************************
253 #define DD_SHADER_NOCREATE(NAME, name) \
255 dd_context_bind_##name##_state(struct pipe_context *_pipe, void *state) \
257 struct dd_context *dctx = dd_context(_pipe); \
258 struct pipe_context *pipe = dctx->pipe; \
259 struct dd_state *hstate = state; \
261 dctx->shaders[PIPE_SHADER_##NAME] = hstate; \
262 pipe->bind_##name##_state(pipe, hstate ? hstate->cso : NULL); \
266 dd_context_delete_##name##_state(struct pipe_context *_pipe, void *state) \
268 struct dd_context *dctx = dd_context(_pipe); \
269 struct pipe_context *pipe = dctx->pipe; \
270 struct dd_state *hstate = state; \
272 pipe->delete_##name##_state(pipe, hstate->cso); \
273 tgsi_free_tokens(hstate->state.shader.tokens); \
277 #define DD_SHADER(NAME, name) \
279 dd_context_create_##name##_state(struct pipe_context *_pipe, \
280 const struct pipe_shader_state *state) \
282 struct pipe_context *pipe = dd_context(_pipe)->pipe; \
283 struct dd_state *hstate = CALLOC_STRUCT(dd_state); \
287 hstate->cso = pipe->create_##name##_state(pipe, state); \
288 hstate->state.shader = *state; \
289 hstate->state.shader.tokens = tgsi_dup_tokens(state->tokens); \
293 DD_SHADER_NOCREATE(NAME, name)
295 DD_SHADER(FRAGMENT
, fs
)
296 DD_SHADER(VERTEX
, vs
)
297 DD_SHADER(GEOMETRY
, gs
)
298 DD_SHADER(TESS_CTRL
, tcs
)
299 DD_SHADER(TESS_EVAL
, tes
)
302 dd_context_create_compute_state(struct pipe_context
*_pipe
,
303 const struct pipe_compute_state
*state
)
305 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
306 struct dd_state
*hstate
= CALLOC_STRUCT(dd_state
);
310 hstate
->cso
= pipe
->create_compute_state(pipe
, state
);
312 if (state
->ir_type
== PIPE_SHADER_IR_TGSI
)
313 hstate
->state
.shader
.tokens
= tgsi_dup_tokens(state
->prog
);
318 DD_SHADER_NOCREATE(COMPUTE
, compute
)
320 /********************************************************************
324 #define DD_IMM_STATE(name, type, deref, ref) \
326 dd_context_set_##name(struct pipe_context *_pipe, type deref) \
328 struct dd_context *dctx = dd_context(_pipe); \
329 struct pipe_context *pipe = dctx->pipe; \
331 dctx->name = deref; \
332 pipe->set_##name(pipe, ref); \
335 DD_IMM_STATE(blend_color
, const struct pipe_blend_color
, *state
, state
)
336 DD_IMM_STATE(stencil_ref
, const struct pipe_stencil_ref
, *state
, state
)
337 DD_IMM_STATE(clip_state
, const struct pipe_clip_state
, *state
, state
)
338 DD_IMM_STATE(sample_mask
, unsigned, sample_mask
, sample_mask
)
339 DD_IMM_STATE(min_samples
, unsigned, min_samples
, min_samples
)
340 DD_IMM_STATE(framebuffer_state
, const struct pipe_framebuffer_state
, *state
, state
)
341 DD_IMM_STATE(polygon_stipple
, const struct pipe_poly_stipple
, *state
, state
)
344 dd_context_set_constant_buffer(struct pipe_context
*_pipe
,
345 uint shader
, uint index
,
346 struct pipe_constant_buffer
*constant_buffer
)
348 struct dd_context
*dctx
= dd_context(_pipe
);
349 struct pipe_context
*pipe
= dctx
->pipe
;
351 safe_memcpy(&dctx
->constant_buffers
[shader
][index
], constant_buffer
,
352 sizeof(*constant_buffer
));
353 pipe
->set_constant_buffer(pipe
, shader
, index
, constant_buffer
);
357 dd_context_set_scissor_states(struct pipe_context
*_pipe
,
358 unsigned start_slot
, unsigned num_scissors
,
359 const struct pipe_scissor_state
*states
)
361 struct dd_context
*dctx
= dd_context(_pipe
);
362 struct pipe_context
*pipe
= dctx
->pipe
;
364 safe_memcpy(&dctx
->scissors
[start_slot
], states
,
365 sizeof(*states
) * num_scissors
);
366 pipe
->set_scissor_states(pipe
, start_slot
, num_scissors
, states
);
370 dd_context_set_viewport_states(struct pipe_context
*_pipe
,
371 unsigned start_slot
, unsigned num_viewports
,
372 const struct pipe_viewport_state
*states
)
374 struct dd_context
*dctx
= dd_context(_pipe
);
375 struct pipe_context
*pipe
= dctx
->pipe
;
377 safe_memcpy(&dctx
->viewports
[start_slot
], states
,
378 sizeof(*states
) * num_viewports
);
379 pipe
->set_viewport_states(pipe
, start_slot
, num_viewports
, states
);
382 static void dd_context_set_tess_state(struct pipe_context
*_pipe
,
383 const float default_outer_level
[4],
384 const float default_inner_level
[2])
386 struct dd_context
*dctx
= dd_context(_pipe
);
387 struct pipe_context
*pipe
= dctx
->pipe
;
389 memcpy(dctx
->tess_default_levels
, default_outer_level
, sizeof(float) * 4);
390 memcpy(dctx
->tess_default_levels
+4, default_inner_level
, sizeof(float) * 2);
391 pipe
->set_tess_state(pipe
, default_outer_level
, default_inner_level
);
395 /********************************************************************
399 static struct pipe_surface
*
400 dd_context_create_surface(struct pipe_context
*_pipe
,
401 struct pipe_resource
*resource
,
402 const struct pipe_surface
*surf_tmpl
)
404 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
405 struct pipe_surface
*view
=
406 pipe
->create_surface(pipe
, resource
, surf_tmpl
);
410 view
->context
= _pipe
;
415 dd_context_surface_destroy(struct pipe_context
*_pipe
,
416 struct pipe_surface
*surf
)
418 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
420 pipe
->surface_destroy(pipe
, surf
);
423 static struct pipe_sampler_view
*
424 dd_context_create_sampler_view(struct pipe_context
*_pipe
,
425 struct pipe_resource
*resource
,
426 const struct pipe_sampler_view
*templ
)
428 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
429 struct pipe_sampler_view
*view
=
430 pipe
->create_sampler_view(pipe
, resource
, templ
);
434 view
->context
= _pipe
;
439 dd_context_sampler_view_destroy(struct pipe_context
*_pipe
,
440 struct pipe_sampler_view
*view
)
442 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
444 pipe
->sampler_view_destroy(pipe
, view
);
447 static struct pipe_stream_output_target
*
448 dd_context_create_stream_output_target(struct pipe_context
*_pipe
,
449 struct pipe_resource
*res
,
450 unsigned buffer_offset
,
451 unsigned buffer_size
)
453 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
454 struct pipe_stream_output_target
*view
=
455 pipe
->create_stream_output_target(pipe
, res
, buffer_offset
,
460 view
->context
= _pipe
;
465 dd_context_stream_output_target_destroy(struct pipe_context
*_pipe
,
466 struct pipe_stream_output_target
*target
)
468 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
470 pipe
->stream_output_target_destroy(pipe
, target
);
474 /********************************************************************
479 dd_context_set_sampler_views(struct pipe_context
*_pipe
, unsigned shader
,
480 unsigned start
, unsigned num
,
481 struct pipe_sampler_view
**views
)
483 struct dd_context
*dctx
= dd_context(_pipe
);
484 struct pipe_context
*pipe
= dctx
->pipe
;
486 safe_memcpy(&dctx
->sampler_views
[shader
][start
], views
,
487 sizeof(views
[0]) * num
);
488 pipe
->set_sampler_views(pipe
, shader
, start
, num
, views
);
492 dd_context_set_shader_images(struct pipe_context
*_pipe
, unsigned shader
,
493 unsigned start
, unsigned num
,
494 struct pipe_image_view
*views
)
496 struct dd_context
*dctx
= dd_context(_pipe
);
497 struct pipe_context
*pipe
= dctx
->pipe
;
499 safe_memcpy(&dctx
->shader_images
[shader
][start
], views
,
500 sizeof(views
[0]) * num
);
501 pipe
->set_shader_images(pipe
, shader
, start
, num
, views
);
505 dd_context_set_shader_buffers(struct pipe_context
*_pipe
, unsigned shader
,
506 unsigned start
, unsigned num_buffers
,
507 struct pipe_shader_buffer
*buffers
)
509 struct dd_context
*dctx
= dd_context(_pipe
);
510 struct pipe_context
*pipe
= dctx
->pipe
;
512 safe_memcpy(&dctx
->shader_buffers
[shader
][start
], buffers
,
513 sizeof(buffers
[0]) * num_buffers
);
514 pipe
->set_shader_buffers(pipe
, shader
, start
, num_buffers
, buffers
);
518 dd_context_set_vertex_buffers(struct pipe_context
*_pipe
,
519 unsigned start
, unsigned num_buffers
,
520 const struct pipe_vertex_buffer
*buffers
)
522 struct dd_context
*dctx
= dd_context(_pipe
);
523 struct pipe_context
*pipe
= dctx
->pipe
;
525 safe_memcpy(&dctx
->vertex_buffers
[start
], buffers
,
526 sizeof(buffers
[0]) * num_buffers
);
527 pipe
->set_vertex_buffers(pipe
, start
, num_buffers
, buffers
);
531 dd_context_set_index_buffer(struct pipe_context
*_pipe
,
532 const struct pipe_index_buffer
*ib
)
534 struct dd_context
*dctx
= dd_context(_pipe
);
535 struct pipe_context
*pipe
= dctx
->pipe
;
537 safe_memcpy(&dctx
->index_buffer
, ib
, sizeof(*ib
));
538 pipe
->set_index_buffer(pipe
, ib
);
542 dd_context_set_stream_output_targets(struct pipe_context
*_pipe
,
543 unsigned num_targets
,
544 struct pipe_stream_output_target
**tgs
,
545 const unsigned *offsets
)
547 struct dd_context
*dctx
= dd_context(_pipe
);
548 struct pipe_context
*pipe
= dctx
->pipe
;
550 dctx
->num_so_targets
= num_targets
;
551 safe_memcpy(dctx
->so_targets
, tgs
, sizeof(*tgs
) * num_targets
);
552 safe_memcpy(dctx
->so_offsets
, offsets
, sizeof(*offsets
) * num_targets
);
553 pipe
->set_stream_output_targets(pipe
, num_targets
, tgs
, offsets
);
557 dd_context_destroy(struct pipe_context
*_pipe
)
559 struct dd_context
*dctx
= dd_context(_pipe
);
560 struct pipe_context
*pipe
= dctx
->pipe
;
567 /********************************************************************
572 dd_context_transfer_map(struct pipe_context
*_pipe
,
573 struct pipe_resource
*resource
, unsigned level
,
574 unsigned usage
, const struct pipe_box
*box
,
575 struct pipe_transfer
**transfer
)
577 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
579 return pipe
->transfer_map(pipe
, resource
, level
, usage
, box
, transfer
);
583 dd_context_transfer_flush_region(struct pipe_context
*_pipe
,
584 struct pipe_transfer
*transfer
,
585 const struct pipe_box
*box
)
587 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
589 pipe
->transfer_flush_region(pipe
, transfer
, box
);
593 dd_context_transfer_unmap(struct pipe_context
*_pipe
,
594 struct pipe_transfer
*transfer
)
596 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
598 pipe
->transfer_unmap(pipe
, transfer
);
602 dd_context_transfer_inline_write(struct pipe_context
*_pipe
,
603 struct pipe_resource
*resource
,
604 unsigned level
, unsigned usage
,
605 const struct pipe_box
*box
,
606 const void *data
, unsigned stride
,
607 unsigned layer_stride
)
609 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
611 pipe
->transfer_inline_write(pipe
, resource
, level
, usage
, box
, data
,
612 stride
, layer_stride
);
616 /********************************************************************
621 dd_context_texture_barrier(struct pipe_context
*_pipe
)
623 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
625 pipe
->texture_barrier(pipe
);
629 dd_context_memory_barrier(struct pipe_context
*_pipe
, unsigned flags
)
631 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
633 pipe
->memory_barrier(pipe
, flags
);
637 dd_context_get_sample_position(struct pipe_context
*_pipe
,
638 unsigned sample_count
, unsigned sample_index
,
641 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
643 return pipe
->get_sample_position(pipe
, sample_count
, sample_index
,
648 dd_context_invalidate_resource(struct pipe_context
*_pipe
,
649 struct pipe_resource
*resource
)
651 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
653 pipe
->invalidate_resource(pipe
, resource
);
656 static enum pipe_reset_status
657 dd_context_get_device_reset_status(struct pipe_context
*_pipe
)
659 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
661 return pipe
->get_device_reset_status(pipe
);
665 dd_context_dump_debug_state(struct pipe_context
*_pipe
, FILE *stream
,
668 struct pipe_context
*pipe
= dd_context(_pipe
)->pipe
;
670 return pipe
->dump_debug_state(pipe
, stream
, flags
);
673 struct pipe_context
*
674 dd_context_create(struct dd_screen
*dscreen
, struct pipe_context
*pipe
)
676 struct dd_context
*dctx
;
681 dctx
= CALLOC_STRUCT(dd_context
);
688 dctx
->base
.priv
= pipe
->priv
; /* expose wrapped priv data */
689 dctx
->base
.screen
= &dscreen
->base
;
691 dctx
->base
.destroy
= dd_context_destroy
;
693 CTX_INIT(render_condition
);
694 CTX_INIT(create_query
);
695 CTX_INIT(destroy_query
);
696 CTX_INIT(begin_query
);
698 CTX_INIT(get_query_result
);
699 CTX_INIT(set_active_query_state
);
700 CTX_INIT(create_blend_state
);
701 CTX_INIT(bind_blend_state
);
702 CTX_INIT(delete_blend_state
);
703 CTX_INIT(create_sampler_state
);
704 CTX_INIT(bind_sampler_states
);
705 CTX_INIT(delete_sampler_state
);
706 CTX_INIT(create_rasterizer_state
);
707 CTX_INIT(bind_rasterizer_state
);
708 CTX_INIT(delete_rasterizer_state
);
709 CTX_INIT(create_depth_stencil_alpha_state
);
710 CTX_INIT(bind_depth_stencil_alpha_state
);
711 CTX_INIT(delete_depth_stencil_alpha_state
);
712 CTX_INIT(create_fs_state
);
713 CTX_INIT(bind_fs_state
);
714 CTX_INIT(delete_fs_state
);
715 CTX_INIT(create_vs_state
);
716 CTX_INIT(bind_vs_state
);
717 CTX_INIT(delete_vs_state
);
718 CTX_INIT(create_gs_state
);
719 CTX_INIT(bind_gs_state
);
720 CTX_INIT(delete_gs_state
);
721 CTX_INIT(create_tcs_state
);
722 CTX_INIT(bind_tcs_state
);
723 CTX_INIT(delete_tcs_state
);
724 CTX_INIT(create_tes_state
);
725 CTX_INIT(bind_tes_state
);
726 CTX_INIT(delete_tes_state
);
727 CTX_INIT(create_compute_state
);
728 CTX_INIT(bind_compute_state
);
729 CTX_INIT(delete_compute_state
);
730 CTX_INIT(create_vertex_elements_state
);
731 CTX_INIT(bind_vertex_elements_state
);
732 CTX_INIT(delete_vertex_elements_state
);
733 CTX_INIT(set_blend_color
);
734 CTX_INIT(set_stencil_ref
);
735 CTX_INIT(set_sample_mask
);
736 CTX_INIT(set_min_samples
);
737 CTX_INIT(set_clip_state
);
738 CTX_INIT(set_constant_buffer
);
739 CTX_INIT(set_framebuffer_state
);
740 CTX_INIT(set_polygon_stipple
);
741 CTX_INIT(set_scissor_states
);
742 CTX_INIT(set_viewport_states
);
743 CTX_INIT(set_sampler_views
);
744 CTX_INIT(set_tess_state
);
745 CTX_INIT(set_shader_buffers
);
746 CTX_INIT(set_shader_images
);
747 CTX_INIT(set_vertex_buffers
);
748 CTX_INIT(set_index_buffer
);
749 CTX_INIT(create_stream_output_target
);
750 CTX_INIT(stream_output_target_destroy
);
751 CTX_INIT(set_stream_output_targets
);
752 CTX_INIT(create_sampler_view
);
753 CTX_INIT(sampler_view_destroy
);
754 CTX_INIT(create_surface
);
755 CTX_INIT(surface_destroy
);
756 CTX_INIT(transfer_map
);
757 CTX_INIT(transfer_flush_region
);
758 CTX_INIT(transfer_unmap
);
759 CTX_INIT(transfer_inline_write
);
760 CTX_INIT(texture_barrier
);
761 CTX_INIT(memory_barrier
);
762 /* create_video_codec */
763 /* create_video_buffer */
764 /* create_compute_state */
765 /* bind_compute_state */
766 /* delete_compute_state */
767 /* set_compute_resources */
768 /* set_global_binding */
769 CTX_INIT(get_sample_position
);
770 CTX_INIT(invalidate_resource
);
771 CTX_INIT(get_device_reset_status
);
772 CTX_INIT(dump_debug_state
);
774 dd_init_draw_functions(dctx
);
776 dctx
->sample_mask
= ~0;