1 /**************************************************************************
3 * Copyright 2009 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"
33 #include "id_context.h"
34 #include "id_objects.h"
38 identity_destroy(struct pipe_context
*_pipe
)
40 struct identity_context
*id_pipe
= identity_context(_pipe
);
41 struct pipe_context
*pipe
= id_pipe
->pipe
;
49 identity_draw_vbo(struct pipe_context
*_pipe
,
50 const struct pipe_draw_info
*info
)
52 struct identity_context
*id_pipe
= identity_context(_pipe
);
53 struct pipe_context
*pipe
= id_pipe
->pipe
;
55 pipe
->draw_vbo(pipe
, info
);
58 static struct pipe_query
*
59 identity_create_query(struct pipe_context
*_pipe
,
62 struct identity_context
*id_pipe
= identity_context(_pipe
);
63 struct pipe_context
*pipe
= id_pipe
->pipe
;
65 return pipe
->create_query(pipe
,
70 identity_destroy_query(struct pipe_context
*_pipe
,
71 struct pipe_query
*query
)
73 struct identity_context
*id_pipe
= identity_context(_pipe
);
74 struct pipe_context
*pipe
= id_pipe
->pipe
;
76 pipe
->destroy_query(pipe
,
81 identity_begin_query(struct pipe_context
*_pipe
,
82 struct pipe_query
*query
)
84 struct identity_context
*id_pipe
= identity_context(_pipe
);
85 struct pipe_context
*pipe
= id_pipe
->pipe
;
87 pipe
->begin_query(pipe
,
92 identity_end_query(struct pipe_context
*_pipe
,
93 struct pipe_query
*query
)
95 struct identity_context
*id_pipe
= identity_context(_pipe
);
96 struct pipe_context
*pipe
= id_pipe
->pipe
;
103 identity_get_query_result(struct pipe_context
*_pipe
,
104 struct pipe_query
*query
,
106 union pipe_query_result
*result
)
108 struct identity_context
*id_pipe
= identity_context(_pipe
);
109 struct pipe_context
*pipe
= id_pipe
->pipe
;
111 return pipe
->get_query_result(pipe
,
118 identity_create_blend_state(struct pipe_context
*_pipe
,
119 const struct pipe_blend_state
*blend
)
121 struct identity_context
*id_pipe
= identity_context(_pipe
);
122 struct pipe_context
*pipe
= id_pipe
->pipe
;
124 return pipe
->create_blend_state(pipe
,
129 identity_bind_blend_state(struct pipe_context
*_pipe
,
132 struct identity_context
*id_pipe
= identity_context(_pipe
);
133 struct pipe_context
*pipe
= id_pipe
->pipe
;
135 pipe
->bind_blend_state(pipe
,
140 identity_delete_blend_state(struct pipe_context
*_pipe
,
143 struct identity_context
*id_pipe
= identity_context(_pipe
);
144 struct pipe_context
*pipe
= id_pipe
->pipe
;
146 pipe
->delete_blend_state(pipe
,
151 identity_create_sampler_state(struct pipe_context
*_pipe
,
152 const struct pipe_sampler_state
*sampler
)
154 struct identity_context
*id_pipe
= identity_context(_pipe
);
155 struct pipe_context
*pipe
= id_pipe
->pipe
;
157 return pipe
->create_sampler_state(pipe
,
162 identity_bind_sampler_states(struct pipe_context
*_pipe
,
165 unsigned num_samplers
,
168 struct identity_context
*id_pipe
= identity_context(_pipe
);
169 struct pipe_context
*pipe
= id_pipe
->pipe
;
171 pipe
->bind_sampler_states(pipe
, shader
, start
, num_samplers
, samplers
);
175 identity_delete_sampler_state(struct pipe_context
*_pipe
,
178 struct identity_context
*id_pipe
= identity_context(_pipe
);
179 struct pipe_context
*pipe
= id_pipe
->pipe
;
181 pipe
->delete_sampler_state(pipe
,
186 identity_create_rasterizer_state(struct pipe_context
*_pipe
,
187 const struct pipe_rasterizer_state
*rasterizer
)
189 struct identity_context
*id_pipe
= identity_context(_pipe
);
190 struct pipe_context
*pipe
= id_pipe
->pipe
;
192 return pipe
->create_rasterizer_state(pipe
,
197 identity_bind_rasterizer_state(struct pipe_context
*_pipe
,
200 struct identity_context
*id_pipe
= identity_context(_pipe
);
201 struct pipe_context
*pipe
= id_pipe
->pipe
;
203 pipe
->bind_rasterizer_state(pipe
,
208 identity_delete_rasterizer_state(struct pipe_context
*_pipe
,
211 struct identity_context
*id_pipe
= identity_context(_pipe
);
212 struct pipe_context
*pipe
= id_pipe
->pipe
;
214 pipe
->delete_rasterizer_state(pipe
,
219 identity_create_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
220 const struct pipe_depth_stencil_alpha_state
*depth_stencil_alpha
)
222 struct identity_context
*id_pipe
= identity_context(_pipe
);
223 struct pipe_context
*pipe
= id_pipe
->pipe
;
225 return pipe
->create_depth_stencil_alpha_state(pipe
,
226 depth_stencil_alpha
);
230 identity_bind_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
231 void *depth_stencil_alpha
)
233 struct identity_context
*id_pipe
= identity_context(_pipe
);
234 struct pipe_context
*pipe
= id_pipe
->pipe
;
236 pipe
->bind_depth_stencil_alpha_state(pipe
,
237 depth_stencil_alpha
);
241 identity_delete_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
242 void *depth_stencil_alpha
)
244 struct identity_context
*id_pipe
= identity_context(_pipe
);
245 struct pipe_context
*pipe
= id_pipe
->pipe
;
247 pipe
->delete_depth_stencil_alpha_state(pipe
,
248 depth_stencil_alpha
);
252 identity_create_fs_state(struct pipe_context
*_pipe
,
253 const struct pipe_shader_state
*fs
)
255 struct identity_context
*id_pipe
= identity_context(_pipe
);
256 struct pipe_context
*pipe
= id_pipe
->pipe
;
258 return pipe
->create_fs_state(pipe
,
263 identity_bind_fs_state(struct pipe_context
*_pipe
,
266 struct identity_context
*id_pipe
= identity_context(_pipe
);
267 struct pipe_context
*pipe
= id_pipe
->pipe
;
269 pipe
->bind_fs_state(pipe
,
274 identity_delete_fs_state(struct pipe_context
*_pipe
,
277 struct identity_context
*id_pipe
= identity_context(_pipe
);
278 struct pipe_context
*pipe
= id_pipe
->pipe
;
280 pipe
->delete_fs_state(pipe
,
285 identity_create_vs_state(struct pipe_context
*_pipe
,
286 const struct pipe_shader_state
*vs
)
288 struct identity_context
*id_pipe
= identity_context(_pipe
);
289 struct pipe_context
*pipe
= id_pipe
->pipe
;
291 return pipe
->create_vs_state(pipe
,
296 identity_bind_vs_state(struct pipe_context
*_pipe
,
299 struct identity_context
*id_pipe
= identity_context(_pipe
);
300 struct pipe_context
*pipe
= id_pipe
->pipe
;
302 pipe
->bind_vs_state(pipe
,
307 identity_delete_vs_state(struct pipe_context
*_pipe
,
310 struct identity_context
*id_pipe
= identity_context(_pipe
);
311 struct pipe_context
*pipe
= id_pipe
->pipe
;
313 pipe
->delete_vs_state(pipe
,
319 identity_create_vertex_elements_state(struct pipe_context
*_pipe
,
320 unsigned num_elements
,
321 const struct pipe_vertex_element
*vertex_elements
)
323 struct identity_context
*id_pipe
= identity_context(_pipe
);
324 struct pipe_context
*pipe
= id_pipe
->pipe
;
326 return pipe
->create_vertex_elements_state(pipe
,
332 identity_bind_vertex_elements_state(struct pipe_context
*_pipe
,
335 struct identity_context
*id_pipe
= identity_context(_pipe
);
336 struct pipe_context
*pipe
= id_pipe
->pipe
;
338 pipe
->bind_vertex_elements_state(pipe
,
343 identity_delete_vertex_elements_state(struct pipe_context
*_pipe
,
346 struct identity_context
*id_pipe
= identity_context(_pipe
);
347 struct pipe_context
*pipe
= id_pipe
->pipe
;
349 pipe
->delete_vertex_elements_state(pipe
,
354 identity_set_blend_color(struct pipe_context
*_pipe
,
355 const struct pipe_blend_color
*blend_color
)
357 struct identity_context
*id_pipe
= identity_context(_pipe
);
358 struct pipe_context
*pipe
= id_pipe
->pipe
;
360 pipe
->set_blend_color(pipe
,
365 identity_set_stencil_ref(struct pipe_context
*_pipe
,
366 const struct pipe_stencil_ref
*stencil_ref
)
368 struct identity_context
*id_pipe
= identity_context(_pipe
);
369 struct pipe_context
*pipe
= id_pipe
->pipe
;
371 pipe
->set_stencil_ref(pipe
,
376 identity_set_clip_state(struct pipe_context
*_pipe
,
377 const struct pipe_clip_state
*clip
)
379 struct identity_context
*id_pipe
= identity_context(_pipe
);
380 struct pipe_context
*pipe
= id_pipe
->pipe
;
382 pipe
->set_clip_state(pipe
,
387 identity_set_sample_mask(struct pipe_context
*_pipe
,
388 unsigned sample_mask
)
390 struct identity_context
*id_pipe
= identity_context(_pipe
);
391 struct pipe_context
*pipe
= id_pipe
->pipe
;
393 pipe
->set_sample_mask(pipe
,
398 identity_set_constant_buffer(struct pipe_context
*_pipe
,
401 struct pipe_constant_buffer
*_cb
)
403 struct identity_context
*id_pipe
= identity_context(_pipe
);
404 struct pipe_context
*pipe
= id_pipe
->pipe
;
405 struct pipe_constant_buffer cb
;
407 /* XXX hmm? unwrap the input state */
410 cb
.buffer
= identity_resource_unwrap(_cb
->buffer
);
413 pipe
->set_constant_buffer(pipe
,
420 identity_set_framebuffer_state(struct pipe_context
*_pipe
,
421 const struct pipe_framebuffer_state
*_state
)
423 struct identity_context
*id_pipe
= identity_context(_pipe
);
424 struct pipe_context
*pipe
= id_pipe
->pipe
;
425 struct pipe_framebuffer_state unwrapped_state
;
426 struct pipe_framebuffer_state
*state
= NULL
;
429 /* unwrap the input state */
431 memcpy(&unwrapped_state
, _state
, sizeof(unwrapped_state
));
432 for(i
= 0; i
< _state
->nr_cbufs
; i
++)
433 unwrapped_state
.cbufs
[i
] = identity_surface_unwrap(_state
->cbufs
[i
]);
434 for (; i
< PIPE_MAX_COLOR_BUFS
; i
++)
435 unwrapped_state
.cbufs
[i
] = NULL
;
436 unwrapped_state
.zsbuf
= identity_surface_unwrap(_state
->zsbuf
);
437 state
= &unwrapped_state
;
440 pipe
->set_framebuffer_state(pipe
,
445 identity_set_polygon_stipple(struct pipe_context
*_pipe
,
446 const struct pipe_poly_stipple
*poly_stipple
)
448 struct identity_context
*id_pipe
= identity_context(_pipe
);
449 struct pipe_context
*pipe
= id_pipe
->pipe
;
451 pipe
->set_polygon_stipple(pipe
,
456 identity_set_scissor_states(struct pipe_context
*_pipe
,
458 unsigned num_scissors
,
459 const struct pipe_scissor_state
*scissor
)
461 struct identity_context
*id_pipe
= identity_context(_pipe
);
462 struct pipe_context
*pipe
= id_pipe
->pipe
;
464 pipe
->set_scissor_states(pipe
, start_slot
, num_scissors
, scissor
);
468 identity_set_viewport_states(struct pipe_context
*_pipe
,
470 unsigned num_viewports
,
471 const struct pipe_viewport_state
*viewport
)
473 struct identity_context
*id_pipe
= identity_context(_pipe
);
474 struct pipe_context
*pipe
= id_pipe
->pipe
;
476 pipe
->set_viewport_states(pipe
, start_slot
, num_viewports
, viewport
);
480 identity_set_sampler_views(struct pipe_context
*_pipe
,
484 struct pipe_sampler_view
**_views
)
486 struct identity_context
*id_pipe
= identity_context(_pipe
);
487 struct pipe_context
*pipe
= id_pipe
->pipe
;
488 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_SAMPLERS
];
491 for (i
= 0; i
< num
; i
++)
492 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
494 pipe
->set_sampler_views(pipe
, shader
, start
, num
, unwrapped_views
);
498 identity_set_vertex_buffers(struct pipe_context
*_pipe
,
499 unsigned start_slot
, unsigned num_buffers
,
500 const struct pipe_vertex_buffer
*_buffers
)
502 struct identity_context
*id_pipe
= identity_context(_pipe
);
503 struct pipe_context
*pipe
= id_pipe
->pipe
;
504 struct pipe_vertex_buffer unwrapped_buffers
[PIPE_MAX_SHADER_INPUTS
];
505 struct pipe_vertex_buffer
*buffers
= NULL
;
509 memcpy(unwrapped_buffers
, _buffers
, num_buffers
* sizeof(*_buffers
));
510 for (i
= 0; i
< num_buffers
; i
++)
511 unwrapped_buffers
[i
].buffer
= identity_resource_unwrap(_buffers
[i
].buffer
);
512 buffers
= unwrapped_buffers
;
515 pipe
->set_vertex_buffers(pipe
,
516 start_slot
, num_buffers
,
521 identity_set_index_buffer(struct pipe_context
*_pipe
,
522 const struct pipe_index_buffer
*_ib
)
524 struct identity_context
*id_pipe
= identity_context(_pipe
);
525 struct pipe_context
*pipe
= id_pipe
->pipe
;
526 struct pipe_index_buffer unwrapped_ib
, *ib
= NULL
;
530 unwrapped_ib
.buffer
= identity_resource_unwrap(_ib
->buffer
);
534 pipe
->set_index_buffer(pipe
, ib
);
538 identity_resource_copy_region(struct pipe_context
*_pipe
,
539 struct pipe_resource
*_dst
,
544 struct pipe_resource
*_src
,
546 const struct pipe_box
*src_box
)
548 struct identity_context
*id_pipe
= identity_context(_pipe
);
549 struct identity_resource
*id_resource_dst
= identity_resource(_dst
);
550 struct identity_resource
*id_resource_src
= identity_resource(_src
);
551 struct pipe_context
*pipe
= id_pipe
->pipe
;
552 struct pipe_resource
*dst
= id_resource_dst
->resource
;
553 struct pipe_resource
*src
= id_resource_src
->resource
;
555 pipe
->resource_copy_region(pipe
,
567 identity_blit(struct pipe_context
*_pipe
,
568 const struct pipe_blit_info
*info
)
570 struct identity_context
*id_pipe
= identity_context(_pipe
);
571 struct pipe_context
*pipe
= id_pipe
->pipe
;
572 struct pipe_blit_info blit
= *info
;
574 blit
.src
.resource
= identity_resource(blit
.src
.resource
)->resource
;
575 blit
.dst
.resource
= identity_resource(blit
.dst
.resource
)->resource
;
577 pipe
->blit(pipe
, &blit
);
581 identity_flush_resource(struct pipe_context
*_pipe
,
582 struct pipe_resource
*resource
)
584 struct identity_context
*id_pipe
= identity_context(_pipe
);
585 struct pipe_context
*pipe
= id_pipe
->pipe
;
587 pipe
->flush_resource(pipe
, resource
);
591 identity_clear(struct pipe_context
*_pipe
,
593 const union pipe_color_union
*color
,
597 struct identity_context
*id_pipe
= identity_context(_pipe
);
598 struct pipe_context
*pipe
= id_pipe
->pipe
;
608 identity_clear_render_target(struct pipe_context
*_pipe
,
609 struct pipe_surface
*_dst
,
610 const union pipe_color_union
*color
,
611 unsigned dstx
, unsigned dsty
,
612 unsigned width
, unsigned height
)
614 struct identity_context
*id_pipe
= identity_context(_pipe
);
615 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
616 struct pipe_context
*pipe
= id_pipe
->pipe
;
617 struct pipe_surface
*dst
= id_surface_dst
->surface
;
619 pipe
->clear_render_target(pipe
,
628 identity_clear_depth_stencil(struct pipe_context
*_pipe
,
629 struct pipe_surface
*_dst
,
630 unsigned clear_flags
,
633 unsigned dstx
, unsigned dsty
,
634 unsigned width
, unsigned height
)
636 struct identity_context
*id_pipe
= identity_context(_pipe
);
637 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
638 struct pipe_context
*pipe
= id_pipe
->pipe
;
639 struct pipe_surface
*dst
= id_surface_dst
->surface
;
641 pipe
->clear_depth_stencil(pipe
,
654 identity_flush(struct pipe_context
*_pipe
,
655 struct pipe_fence_handle
**fence
,
658 struct identity_context
*id_pipe
= identity_context(_pipe
);
659 struct pipe_context
*pipe
= id_pipe
->pipe
;
661 pipe
->flush(pipe
, fence
, flags
);
664 static struct pipe_sampler_view
*
665 identity_context_create_sampler_view(struct pipe_context
*_pipe
,
666 struct pipe_resource
*_resource
,
667 const struct pipe_sampler_view
*templ
)
669 struct identity_context
*id_context
= identity_context(_pipe
);
670 struct identity_resource
*id_resource
= identity_resource(_resource
);
671 struct pipe_context
*pipe
= id_context
->pipe
;
672 struct pipe_resource
*resource
= id_resource
->resource
;
673 struct pipe_sampler_view
*result
;
675 result
= pipe
->create_sampler_view(pipe
,
680 return identity_sampler_view_create(id_context
, id_resource
, result
);
685 identity_context_sampler_view_destroy(struct pipe_context
*_pipe
,
686 struct pipe_sampler_view
*_view
)
688 identity_sampler_view_destroy(identity_context(_pipe
),
689 identity_sampler_view(_view
));
692 static struct pipe_surface
*
693 identity_context_create_surface(struct pipe_context
*_pipe
,
694 struct pipe_resource
*_resource
,
695 const struct pipe_surface
*templ
)
697 struct identity_context
*id_context
= identity_context(_pipe
);
698 struct identity_resource
*id_resource
= identity_resource(_resource
);
699 struct pipe_context
*pipe
= id_context
->pipe
;
700 struct pipe_resource
*resource
= id_resource
->resource
;
701 struct pipe_surface
*result
;
703 result
= pipe
->create_surface(pipe
,
708 return identity_surface_create(id_context
, id_resource
, result
);
713 identity_context_surface_destroy(struct pipe_context
*_pipe
,
714 struct pipe_surface
*_surf
)
716 identity_surface_destroy(identity_context(_pipe
),
717 identity_surface(_surf
));
721 identity_context_transfer_map(struct pipe_context
*_context
,
722 struct pipe_resource
*_resource
,
725 const struct pipe_box
*box
,
726 struct pipe_transfer
**transfer
)
728 struct identity_context
*id_context
= identity_context(_context
);
729 struct identity_resource
*id_resource
= identity_resource(_resource
);
730 struct pipe_context
*context
= id_context
->pipe
;
731 struct pipe_resource
*resource
= id_resource
->resource
;
732 struct pipe_transfer
*result
;
735 map
= context
->transfer_map(context
,
744 *transfer
= identity_transfer_map(id_context
, id_resource
, result
);
745 return *transfer
? map
: NULL
;
749 identity_context_transfer_flush_region(struct pipe_context
*_context
,
750 struct pipe_transfer
*_transfer
,
751 const struct pipe_box
*box
)
753 struct identity_context
*id_context
= identity_context(_context
);
754 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
755 struct pipe_context
*context
= id_context
->pipe
;
756 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
758 context
->transfer_flush_region(context
,
765 identity_context_transfer_unmap(struct pipe_context
*_context
,
766 struct pipe_transfer
*_transfer
)
768 struct identity_context
*id_context
= identity_context(_context
);
769 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
770 struct pipe_context
*context
= id_context
->pipe
;
771 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
773 context
->transfer_unmap(context
,
776 identity_transfer_destroy(identity_context(_context
),
777 identity_transfer(_transfer
));
782 identity_context_transfer_inline_write(struct pipe_context
*_context
,
783 struct pipe_resource
*_resource
,
786 const struct pipe_box
*box
,
789 unsigned layer_stride
)
791 struct identity_context
*id_context
= identity_context(_context
);
792 struct identity_resource
*id_resource
= identity_resource(_resource
);
793 struct pipe_context
*context
= id_context
->pipe
;
794 struct pipe_resource
*resource
= id_resource
->resource
;
796 context
->transfer_inline_write(context
,
807 struct pipe_context
*
808 identity_context_create(struct pipe_screen
*_screen
, struct pipe_context
*pipe
)
810 struct identity_context
*id_pipe
;
811 (void)identity_screen(_screen
);
813 id_pipe
= CALLOC_STRUCT(identity_context
);
818 id_pipe
->base
.screen
= _screen
;
819 id_pipe
->base
.priv
= pipe
->priv
; /* expose wrapped data */
820 id_pipe
->base
.draw
= NULL
;
822 id_pipe
->base
.destroy
= identity_destroy
;
823 id_pipe
->base
.draw_vbo
= identity_draw_vbo
;
824 id_pipe
->base
.create_query
= identity_create_query
;
825 id_pipe
->base
.destroy_query
= identity_destroy_query
;
826 id_pipe
->base
.begin_query
= identity_begin_query
;
827 id_pipe
->base
.end_query
= identity_end_query
;
828 id_pipe
->base
.get_query_result
= identity_get_query_result
;
829 id_pipe
->base
.create_blend_state
= identity_create_blend_state
;
830 id_pipe
->base
.bind_blend_state
= identity_bind_blend_state
;
831 id_pipe
->base
.delete_blend_state
= identity_delete_blend_state
;
832 id_pipe
->base
.create_sampler_state
= identity_create_sampler_state
;
833 id_pipe
->base
.bind_sampler_states
= identity_bind_sampler_states
;
834 id_pipe
->base
.delete_sampler_state
= identity_delete_sampler_state
;
835 id_pipe
->base
.create_rasterizer_state
= identity_create_rasterizer_state
;
836 id_pipe
->base
.bind_rasterizer_state
= identity_bind_rasterizer_state
;
837 id_pipe
->base
.delete_rasterizer_state
= identity_delete_rasterizer_state
;
838 id_pipe
->base
.create_depth_stencil_alpha_state
= identity_create_depth_stencil_alpha_state
;
839 id_pipe
->base
.bind_depth_stencil_alpha_state
= identity_bind_depth_stencil_alpha_state
;
840 id_pipe
->base
.delete_depth_stencil_alpha_state
= identity_delete_depth_stencil_alpha_state
;
841 id_pipe
->base
.create_fs_state
= identity_create_fs_state
;
842 id_pipe
->base
.bind_fs_state
= identity_bind_fs_state
;
843 id_pipe
->base
.delete_fs_state
= identity_delete_fs_state
;
844 id_pipe
->base
.create_vs_state
= identity_create_vs_state
;
845 id_pipe
->base
.bind_vs_state
= identity_bind_vs_state
;
846 id_pipe
->base
.delete_vs_state
= identity_delete_vs_state
;
847 id_pipe
->base
.create_vertex_elements_state
= identity_create_vertex_elements_state
;
848 id_pipe
->base
.bind_vertex_elements_state
= identity_bind_vertex_elements_state
;
849 id_pipe
->base
.delete_vertex_elements_state
= identity_delete_vertex_elements_state
;
850 id_pipe
->base
.set_blend_color
= identity_set_blend_color
;
851 id_pipe
->base
.set_stencil_ref
= identity_set_stencil_ref
;
852 id_pipe
->base
.set_clip_state
= identity_set_clip_state
;
853 id_pipe
->base
.set_sample_mask
= identity_set_sample_mask
;
854 id_pipe
->base
.set_constant_buffer
= identity_set_constant_buffer
;
855 id_pipe
->base
.set_framebuffer_state
= identity_set_framebuffer_state
;
856 id_pipe
->base
.set_polygon_stipple
= identity_set_polygon_stipple
;
857 id_pipe
->base
.set_scissor_states
= identity_set_scissor_states
;
858 id_pipe
->base
.set_viewport_states
= identity_set_viewport_states
;
859 id_pipe
->base
.set_sampler_views
= identity_set_sampler_views
;
860 id_pipe
->base
.set_vertex_buffers
= identity_set_vertex_buffers
;
861 id_pipe
->base
.set_index_buffer
= identity_set_index_buffer
;
862 id_pipe
->base
.resource_copy_region
= identity_resource_copy_region
;
863 id_pipe
->base
.clear
= identity_clear
;
864 id_pipe
->base
.clear_render_target
= identity_clear_render_target
;
865 id_pipe
->base
.clear_depth_stencil
= identity_clear_depth_stencil
;
866 id_pipe
->base
.flush
= identity_flush
;
867 id_pipe
->base
.create_surface
= identity_context_create_surface
;
868 id_pipe
->base
.surface_destroy
= identity_context_surface_destroy
;
869 id_pipe
->base
.create_sampler_view
= identity_context_create_sampler_view
;
870 id_pipe
->base
.sampler_view_destroy
= identity_context_sampler_view_destroy
;
871 id_pipe
->base
.transfer_map
= identity_context_transfer_map
;
872 id_pipe
->base
.transfer_unmap
= identity_context_transfer_unmap
;
873 id_pipe
->base
.transfer_flush_region
= identity_context_transfer_flush_region
;
874 id_pipe
->base
.transfer_inline_write
= identity_context_transfer_inline_write
;
875 id_pipe
->base
.blit
= identity_blit
;
876 id_pipe
->base
.flush_resource
= identity_flush_resource
;
878 id_pipe
->pipe
= pipe
;
880 return &id_pipe
->base
;