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_arrays(struct pipe_context
*_pipe
,
54 struct identity_context
*id_pipe
= identity_context(_pipe
);
55 struct pipe_context
*pipe
= id_pipe
->pipe
;
57 pipe
->draw_arrays(pipe
,
64 identity_draw_elements(struct pipe_context
*_pipe
,
65 struct pipe_resource
*_indexResource
,
71 struct identity_context
*id_pipe
= identity_context(_pipe
);
72 struct identity_resource
*id_resource
= identity_resource(_indexResource
);
73 struct pipe_context
*pipe
= id_pipe
->pipe
;
74 struct pipe_resource
*indexResource
= id_resource
->resource
;
76 pipe
->draw_elements(pipe
,
85 identity_draw_range_elements(struct pipe_context
*_pipe
,
86 struct pipe_resource
*_indexResource
,
94 struct identity_context
*id_pipe
= identity_context(_pipe
);
95 struct identity_resource
*id_resource
= identity_resource(_indexResource
);
96 struct pipe_context
*pipe
= id_pipe
->pipe
;
97 struct pipe_resource
*indexResource
= id_resource
->resource
;
99 pipe
->draw_range_elements(pipe
,
109 static struct pipe_query
*
110 identity_create_query(struct pipe_context
*_pipe
,
113 struct identity_context
*id_pipe
= identity_context(_pipe
);
114 struct pipe_context
*pipe
= id_pipe
->pipe
;
116 return pipe
->create_query(pipe
,
121 identity_destroy_query(struct pipe_context
*_pipe
,
122 struct pipe_query
*query
)
124 struct identity_context
*id_pipe
= identity_context(_pipe
);
125 struct pipe_context
*pipe
= id_pipe
->pipe
;
127 pipe
->destroy_query(pipe
,
132 identity_begin_query(struct pipe_context
*_pipe
,
133 struct pipe_query
*query
)
135 struct identity_context
*id_pipe
= identity_context(_pipe
);
136 struct pipe_context
*pipe
= id_pipe
->pipe
;
138 pipe
->begin_query(pipe
,
143 identity_end_query(struct pipe_context
*_pipe
,
144 struct pipe_query
*query
)
146 struct identity_context
*id_pipe
= identity_context(_pipe
);
147 struct pipe_context
*pipe
= id_pipe
->pipe
;
149 pipe
->end_query(pipe
,
154 identity_get_query_result(struct pipe_context
*_pipe
,
155 struct pipe_query
*query
,
159 struct identity_context
*id_pipe
= identity_context(_pipe
);
160 struct pipe_context
*pipe
= id_pipe
->pipe
;
162 return pipe
->get_query_result(pipe
,
169 identity_create_blend_state(struct pipe_context
*_pipe
,
170 const struct pipe_blend_state
*blend
)
172 struct identity_context
*id_pipe
= identity_context(_pipe
);
173 struct pipe_context
*pipe
= id_pipe
->pipe
;
175 return pipe
->create_blend_state(pipe
,
180 identity_bind_blend_state(struct pipe_context
*_pipe
,
183 struct identity_context
*id_pipe
= identity_context(_pipe
);
184 struct pipe_context
*pipe
= id_pipe
->pipe
;
186 pipe
->bind_blend_state(pipe
,
191 identity_delete_blend_state(struct pipe_context
*_pipe
,
194 struct identity_context
*id_pipe
= identity_context(_pipe
);
195 struct pipe_context
*pipe
= id_pipe
->pipe
;
197 pipe
->delete_blend_state(pipe
,
202 identity_create_sampler_state(struct pipe_context
*_pipe
,
203 const struct pipe_sampler_state
*sampler
)
205 struct identity_context
*id_pipe
= identity_context(_pipe
);
206 struct pipe_context
*pipe
= id_pipe
->pipe
;
208 return pipe
->create_sampler_state(pipe
,
213 identity_bind_fragment_sampler_states(struct pipe_context
*_pipe
,
214 unsigned num_samplers
,
217 struct identity_context
*id_pipe
= identity_context(_pipe
);
218 struct pipe_context
*pipe
= id_pipe
->pipe
;
220 pipe
->bind_fragment_sampler_states(pipe
,
226 identity_bind_vertex_sampler_states(struct pipe_context
*_pipe
,
227 unsigned num_samplers
,
230 struct identity_context
*id_pipe
= identity_context(_pipe
);
231 struct pipe_context
*pipe
= id_pipe
->pipe
;
233 pipe
->bind_vertex_sampler_states(pipe
,
239 identity_delete_sampler_state(struct pipe_context
*_pipe
,
242 struct identity_context
*id_pipe
= identity_context(_pipe
);
243 struct pipe_context
*pipe
= id_pipe
->pipe
;
245 pipe
->delete_sampler_state(pipe
,
250 identity_create_rasterizer_state(struct pipe_context
*_pipe
,
251 const struct pipe_rasterizer_state
*rasterizer
)
253 struct identity_context
*id_pipe
= identity_context(_pipe
);
254 struct pipe_context
*pipe
= id_pipe
->pipe
;
256 return pipe
->create_rasterizer_state(pipe
,
261 identity_bind_rasterizer_state(struct pipe_context
*_pipe
,
264 struct identity_context
*id_pipe
= identity_context(_pipe
);
265 struct pipe_context
*pipe
= id_pipe
->pipe
;
267 pipe
->bind_rasterizer_state(pipe
,
272 identity_delete_rasterizer_state(struct pipe_context
*_pipe
,
275 struct identity_context
*id_pipe
= identity_context(_pipe
);
276 struct pipe_context
*pipe
= id_pipe
->pipe
;
278 pipe
->delete_rasterizer_state(pipe
,
283 identity_create_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
284 const struct pipe_depth_stencil_alpha_state
*depth_stencil_alpha
)
286 struct identity_context
*id_pipe
= identity_context(_pipe
);
287 struct pipe_context
*pipe
= id_pipe
->pipe
;
289 return pipe
->create_depth_stencil_alpha_state(pipe
,
290 depth_stencil_alpha
);
294 identity_bind_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
295 void *depth_stencil_alpha
)
297 struct identity_context
*id_pipe
= identity_context(_pipe
);
298 struct pipe_context
*pipe
= id_pipe
->pipe
;
300 pipe
->bind_depth_stencil_alpha_state(pipe
,
301 depth_stencil_alpha
);
305 identity_delete_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
306 void *depth_stencil_alpha
)
308 struct identity_context
*id_pipe
= identity_context(_pipe
);
309 struct pipe_context
*pipe
= id_pipe
->pipe
;
311 pipe
->delete_depth_stencil_alpha_state(pipe
,
312 depth_stencil_alpha
);
316 identity_create_fs_state(struct pipe_context
*_pipe
,
317 const struct pipe_shader_state
*fs
)
319 struct identity_context
*id_pipe
= identity_context(_pipe
);
320 struct pipe_context
*pipe
= id_pipe
->pipe
;
322 return pipe
->create_fs_state(pipe
,
327 identity_bind_fs_state(struct pipe_context
*_pipe
,
330 struct identity_context
*id_pipe
= identity_context(_pipe
);
331 struct pipe_context
*pipe
= id_pipe
->pipe
;
333 pipe
->bind_fs_state(pipe
,
338 identity_delete_fs_state(struct pipe_context
*_pipe
,
341 struct identity_context
*id_pipe
= identity_context(_pipe
);
342 struct pipe_context
*pipe
= id_pipe
->pipe
;
344 pipe
->delete_fs_state(pipe
,
349 identity_create_vs_state(struct pipe_context
*_pipe
,
350 const struct pipe_shader_state
*vs
)
352 struct identity_context
*id_pipe
= identity_context(_pipe
);
353 struct pipe_context
*pipe
= id_pipe
->pipe
;
355 return pipe
->create_vs_state(pipe
,
360 identity_bind_vs_state(struct pipe_context
*_pipe
,
363 struct identity_context
*id_pipe
= identity_context(_pipe
);
364 struct pipe_context
*pipe
= id_pipe
->pipe
;
366 pipe
->bind_vs_state(pipe
,
371 identity_delete_vs_state(struct pipe_context
*_pipe
,
374 struct identity_context
*id_pipe
= identity_context(_pipe
);
375 struct pipe_context
*pipe
= id_pipe
->pipe
;
377 pipe
->delete_vs_state(pipe
,
383 identity_create_vertex_elements_state(struct pipe_context
*_pipe
,
384 unsigned num_elements
,
385 const struct pipe_vertex_element
*vertex_elements
)
387 struct identity_context
*id_pipe
= identity_context(_pipe
);
388 struct pipe_context
*pipe
= id_pipe
->pipe
;
390 return pipe
->create_vertex_elements_state(pipe
,
396 identity_bind_vertex_elements_state(struct pipe_context
*_pipe
,
399 struct identity_context
*id_pipe
= identity_context(_pipe
);
400 struct pipe_context
*pipe
= id_pipe
->pipe
;
402 pipe
->bind_vertex_elements_state(pipe
,
407 identity_delete_vertex_elements_state(struct pipe_context
*_pipe
,
410 struct identity_context
*id_pipe
= identity_context(_pipe
);
411 struct pipe_context
*pipe
= id_pipe
->pipe
;
413 pipe
->delete_vertex_elements_state(pipe
,
418 identity_set_blend_color(struct pipe_context
*_pipe
,
419 const struct pipe_blend_color
*blend_color
)
421 struct identity_context
*id_pipe
= identity_context(_pipe
);
422 struct pipe_context
*pipe
= id_pipe
->pipe
;
424 pipe
->set_blend_color(pipe
,
429 identity_set_stencil_ref(struct pipe_context
*_pipe
,
430 const struct pipe_stencil_ref
*stencil_ref
)
432 struct identity_context
*id_pipe
= identity_context(_pipe
);
433 struct pipe_context
*pipe
= id_pipe
->pipe
;
435 pipe
->set_stencil_ref(pipe
,
440 identity_set_clip_state(struct pipe_context
*_pipe
,
441 const struct pipe_clip_state
*clip
)
443 struct identity_context
*id_pipe
= identity_context(_pipe
);
444 struct pipe_context
*pipe
= id_pipe
->pipe
;
446 pipe
->set_clip_state(pipe
,
451 identity_set_constant_buffer(struct pipe_context
*_pipe
,
454 struct pipe_resource
*_resource
)
456 struct identity_context
*id_pipe
= identity_context(_pipe
);
457 struct pipe_context
*pipe
= id_pipe
->pipe
;
458 struct pipe_resource
*unwrapped_resource
;
459 struct pipe_resource
*resource
= NULL
;
461 /* XXX hmm? unwrap the input state */
463 unwrapped_resource
= identity_resource_unwrap(_resource
);
464 resource
= unwrapped_resource
;
467 pipe
->set_constant_buffer(pipe
,
474 identity_set_framebuffer_state(struct pipe_context
*_pipe
,
475 const struct pipe_framebuffer_state
*_state
)
477 struct identity_context
*id_pipe
= identity_context(_pipe
);
478 struct pipe_context
*pipe
= id_pipe
->pipe
;
479 struct pipe_framebuffer_state unwrapped_state
;
480 struct pipe_framebuffer_state
*state
= NULL
;
483 /* unwrap the input state */
485 memcpy(&unwrapped_state
, _state
, sizeof(unwrapped_state
));
486 for(i
= 0; i
< _state
->nr_cbufs
; i
++)
487 unwrapped_state
.cbufs
[i
] = identity_surface_unwrap(_state
->cbufs
[i
]);
488 for (; i
< PIPE_MAX_COLOR_BUFS
; i
++)
489 unwrapped_state
.cbufs
[i
] = NULL
;
490 unwrapped_state
.zsbuf
= identity_surface_unwrap(_state
->zsbuf
);
491 state
= &unwrapped_state
;
494 pipe
->set_framebuffer_state(pipe
,
499 identity_set_polygon_stipple(struct pipe_context
*_pipe
,
500 const struct pipe_poly_stipple
*poly_stipple
)
502 struct identity_context
*id_pipe
= identity_context(_pipe
);
503 struct pipe_context
*pipe
= id_pipe
->pipe
;
505 pipe
->set_polygon_stipple(pipe
,
510 identity_set_scissor_state(struct pipe_context
*_pipe
,
511 const struct pipe_scissor_state
*scissor
)
513 struct identity_context
*id_pipe
= identity_context(_pipe
);
514 struct pipe_context
*pipe
= id_pipe
->pipe
;
516 pipe
->set_scissor_state(pipe
,
521 identity_set_viewport_state(struct pipe_context
*_pipe
,
522 const struct pipe_viewport_state
*viewport
)
524 struct identity_context
*id_pipe
= identity_context(_pipe
);
525 struct pipe_context
*pipe
= id_pipe
->pipe
;
527 pipe
->set_viewport_state(pipe
,
532 identity_set_fragment_sampler_views(struct pipe_context
*_pipe
,
534 struct pipe_sampler_view
**_views
)
536 struct identity_context
*id_pipe
= identity_context(_pipe
);
537 struct pipe_context
*pipe
= id_pipe
->pipe
;
538 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_SAMPLERS
];
539 struct pipe_sampler_view
**views
= NULL
;
543 for (i
= 0; i
< num
; i
++)
544 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
545 for (; i
< PIPE_MAX_SAMPLERS
; i
++)
546 unwrapped_views
[i
] = NULL
;
548 views
= unwrapped_views
;
551 pipe
->set_fragment_sampler_views(pipe
, num
, views
);
555 identity_set_vertex_sampler_views(struct pipe_context
*_pipe
,
557 struct pipe_sampler_view
**_views
)
559 struct identity_context
*id_pipe
= identity_context(_pipe
);
560 struct pipe_context
*pipe
= id_pipe
->pipe
;
561 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_VERTEX_SAMPLERS
];
562 struct pipe_sampler_view
**views
= NULL
;
566 for (i
= 0; i
< num
; i
++)
567 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
568 for (; i
< PIPE_MAX_VERTEX_SAMPLERS
; i
++)
569 unwrapped_views
[i
] = NULL
;
571 views
= unwrapped_views
;
574 pipe
->set_vertex_sampler_views(pipe
, num
, views
);
578 identity_set_vertex_buffers(struct pipe_context
*_pipe
,
579 unsigned num_buffers
,
580 const struct pipe_vertex_buffer
*_buffers
)
582 struct identity_context
*id_pipe
= identity_context(_pipe
);
583 struct pipe_context
*pipe
= id_pipe
->pipe
;
584 struct pipe_vertex_buffer unwrapped_buffers
[PIPE_MAX_SHADER_INPUTS
];
585 struct pipe_vertex_buffer
*buffers
= NULL
;
589 memcpy(unwrapped_buffers
, _buffers
, num_buffers
* sizeof(*_buffers
));
590 for (i
= 0; i
< num_buffers
; i
++)
591 unwrapped_buffers
[i
].buffer
= identity_resource_unwrap(_buffers
[i
].buffer
);
592 buffers
= unwrapped_buffers
;
595 pipe
->set_vertex_buffers(pipe
,
600 identity_surface_copy(struct pipe_context
*_pipe
,
601 struct pipe_surface
*_dst
,
604 struct pipe_surface
*_src
,
610 struct identity_context
*id_pipe
= identity_context(_pipe
);
611 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
612 struct identity_surface
*id_surface_src
= identity_surface(_src
);
613 struct pipe_context
*pipe
= id_pipe
->pipe
;
614 struct pipe_surface
*dst
= id_surface_dst
->surface
;
615 struct pipe_surface
*src
= id_surface_src
->surface
;
617 pipe
->surface_copy(pipe
,
629 identity_surface_fill(struct pipe_context
*_pipe
,
630 struct pipe_surface
*_dst
,
637 struct identity_context
*id_pipe
= identity_context(_pipe
);
638 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
639 struct pipe_context
*pipe
= id_pipe
->pipe
;
640 struct pipe_surface
*dst
= id_surface_dst
->surface
;
642 pipe
->surface_fill(pipe
,
652 identity_clear(struct pipe_context
*_pipe
,
658 struct identity_context
*id_pipe
= identity_context(_pipe
);
659 struct pipe_context
*pipe
= id_pipe
->pipe
;
669 identity_flush(struct pipe_context
*_pipe
,
671 struct pipe_fence_handle
**fence
)
673 struct identity_context
*id_pipe
= identity_context(_pipe
);
674 struct pipe_context
*pipe
= id_pipe
->pipe
;
682 identity_is_resource_referenced(struct pipe_context
*_pipe
,
683 struct pipe_resource
*_resource
,
687 struct identity_context
*id_pipe
= identity_context(_pipe
);
688 struct identity_resource
*id_resource
= identity_resource(_resource
);
689 struct pipe_context
*pipe
= id_pipe
->pipe
;
690 struct pipe_resource
*texture
= id_resource
->resource
;
692 return pipe
->is_resource_referenced(pipe
,
698 static struct pipe_sampler_view
*
699 identity_create_sampler_view(struct pipe_context
*pipe
,
700 struct pipe_resource
*texture
,
701 const struct pipe_sampler_view
*templ
)
703 struct identity_context
*id_pipe
= identity_context(pipe
);
704 struct identity_resource
*id_resource
= identity_resource(texture
);
705 struct pipe_context
*pipe_unwrapped
= id_pipe
->pipe
;
706 struct pipe_resource
*texture_unwrapped
= id_resource
->resource
;
707 struct identity_sampler_view
*view
= malloc(sizeof(struct identity_sampler_view
));
709 view
->sampler_view
= pipe_unwrapped
->create_sampler_view(pipe_unwrapped
,
714 view
->base
.reference
.count
= 1;
715 view
->base
.texture
= NULL
;
716 pipe_resource_reference(&view
->base
.texture
, texture
);
717 view
->base
.context
= pipe
;
723 identity_sampler_view_destroy(struct pipe_context
*pipe
,
724 struct pipe_sampler_view
*view
)
726 struct identity_context
*id_pipe
= identity_context(pipe
);
727 struct identity_sampler_view
*id_view
= identity_sampler_view(view
);
728 struct pipe_context
*pipe_unwrapped
= id_pipe
->pipe
;
729 struct pipe_sampler_view
*view_unwrapped
= id_view
->sampler_view
;
731 pipe_unwrapped
->sampler_view_destroy(pipe_unwrapped
,
734 pipe_resource_reference(&view
->texture
, NULL
);
738 static struct pipe_transfer
*
739 identity_context_get_transfer(struct pipe_context
*_context
,
740 struct pipe_resource
*_resource
,
741 struct pipe_subresource sr
,
743 const struct pipe_box
*box
)
745 struct identity_context
*id_context
= identity_context(_context
);
746 struct identity_resource
*id_resource
= identity_resource(_resource
);
747 struct pipe_context
*context
= id_context
->pipe
;
748 struct pipe_resource
*texture
= id_resource
->resource
;
749 struct pipe_transfer
*result
;
751 result
= context
->get_transfer(context
,
758 return identity_transfer_create(id_context
, id_resource
, result
);
763 identity_context_transfer_destroy(struct pipe_context
*_pipe
,
764 struct pipe_transfer
*_transfer
)
766 identity_transfer_destroy(identity_context(_pipe
),
767 identity_transfer(_transfer
));
771 identity_context_transfer_map(struct pipe_context
*_context
,
772 struct pipe_transfer
*_transfer
)
774 struct identity_context
*id_context
= identity_context(_context
);
775 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
776 struct pipe_context
*context
= id_context
->pipe
;
777 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
779 return context
->transfer_map(context
,
786 identity_context_transfer_flush_region( struct pipe_context
*_context
,
787 struct pipe_transfer
*_transfer
,
788 const struct pipe_box
*box
)
790 struct identity_context
*id_context
= identity_context(_context
);
791 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
792 struct pipe_context
*context
= id_context
->pipe
;
793 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
795 context
->transfer_flush_region(context
,
802 identity_context_transfer_unmap(struct pipe_context
*_context
,
803 struct pipe_transfer
*_transfer
)
805 struct identity_context
*id_context
= identity_context(_context
);
806 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
807 struct pipe_context
*context
= id_context
->pipe
;
808 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
810 context
->transfer_unmap(context
,
816 identity_context_transfer_inline_write( struct pipe_context
*_context
,
817 struct pipe_resource
*_resource
,
818 struct pipe_subresource sr
,
820 const struct pipe_box
*box
,
823 unsigned slice_stride
)
825 struct identity_context
*id_context
= identity_context(_context
);
826 struct identity_resource
*id_resource
= identity_resource(_resource
);
827 struct pipe_context
*context
= id_context
->pipe
;
828 struct pipe_resource
*texture
= id_resource
->resource
;
830 context
->transfer_inline_write(context
,
841 struct pipe_context
*
842 identity_context_create(struct pipe_screen
*_screen
, struct pipe_context
*pipe
)
844 struct identity_context
*id_pipe
;
845 (void)identity_screen(_screen
);
847 id_pipe
= CALLOC_STRUCT(identity_context
);
852 id_pipe
->base
.winsys
= NULL
;
853 id_pipe
->base
.screen
= _screen
;
854 id_pipe
->base
.priv
= pipe
->priv
; /* expose wrapped data */
855 id_pipe
->base
.draw
= NULL
;
857 id_pipe
->base
.destroy
= identity_destroy
;
858 id_pipe
->base
.draw_arrays
= identity_draw_arrays
;
859 id_pipe
->base
.draw_elements
= identity_draw_elements
;
860 id_pipe
->base
.draw_range_elements
= identity_draw_range_elements
;
861 id_pipe
->base
.create_query
= identity_create_query
;
862 id_pipe
->base
.destroy_query
= identity_destroy_query
;
863 id_pipe
->base
.begin_query
= identity_begin_query
;
864 id_pipe
->base
.end_query
= identity_end_query
;
865 id_pipe
->base
.get_query_result
= identity_get_query_result
;
866 id_pipe
->base
.create_blend_state
= identity_create_blend_state
;
867 id_pipe
->base
.bind_blend_state
= identity_bind_blend_state
;
868 id_pipe
->base
.delete_blend_state
= identity_delete_blend_state
;
869 id_pipe
->base
.create_sampler_state
= identity_create_sampler_state
;
870 id_pipe
->base
.bind_fragment_sampler_states
= identity_bind_fragment_sampler_states
;
871 id_pipe
->base
.bind_vertex_sampler_states
= identity_bind_vertex_sampler_states
;
872 id_pipe
->base
.delete_sampler_state
= identity_delete_sampler_state
;
873 id_pipe
->base
.create_rasterizer_state
= identity_create_rasterizer_state
;
874 id_pipe
->base
.bind_rasterizer_state
= identity_bind_rasterizer_state
;
875 id_pipe
->base
.delete_rasterizer_state
= identity_delete_rasterizer_state
;
876 id_pipe
->base
.create_depth_stencil_alpha_state
= identity_create_depth_stencil_alpha_state
;
877 id_pipe
->base
.bind_depth_stencil_alpha_state
= identity_bind_depth_stencil_alpha_state
;
878 id_pipe
->base
.delete_depth_stencil_alpha_state
= identity_delete_depth_stencil_alpha_state
;
879 id_pipe
->base
.create_fs_state
= identity_create_fs_state
;
880 id_pipe
->base
.bind_fs_state
= identity_bind_fs_state
;
881 id_pipe
->base
.delete_fs_state
= identity_delete_fs_state
;
882 id_pipe
->base
.create_vs_state
= identity_create_vs_state
;
883 id_pipe
->base
.bind_vs_state
= identity_bind_vs_state
;
884 id_pipe
->base
.delete_vs_state
= identity_delete_vs_state
;
885 id_pipe
->base
.create_vertex_elements_state
= identity_create_vertex_elements_state
;
886 id_pipe
->base
.bind_vertex_elements_state
= identity_bind_vertex_elements_state
;
887 id_pipe
->base
.delete_vertex_elements_state
= identity_delete_vertex_elements_state
;
888 id_pipe
->base
.set_blend_color
= identity_set_blend_color
;
889 id_pipe
->base
.set_stencil_ref
= identity_set_stencil_ref
;
890 id_pipe
->base
.set_clip_state
= identity_set_clip_state
;
891 id_pipe
->base
.set_constant_buffer
= identity_set_constant_buffer
;
892 id_pipe
->base
.set_framebuffer_state
= identity_set_framebuffer_state
;
893 id_pipe
->base
.set_polygon_stipple
= identity_set_polygon_stipple
;
894 id_pipe
->base
.set_scissor_state
= identity_set_scissor_state
;
895 id_pipe
->base
.set_viewport_state
= identity_set_viewport_state
;
896 id_pipe
->base
.set_fragment_sampler_views
= identity_set_fragment_sampler_views
;
897 id_pipe
->base
.set_vertex_sampler_views
= identity_set_vertex_sampler_views
;
898 id_pipe
->base
.set_vertex_buffers
= identity_set_vertex_buffers
;
899 id_pipe
->base
.surface_copy
= identity_surface_copy
;
900 id_pipe
->base
.surface_fill
= identity_surface_fill
;
901 id_pipe
->base
.clear
= identity_clear
;
902 id_pipe
->base
.flush
= identity_flush
;
903 id_pipe
->base
.is_resource_referenced
= identity_is_resource_referenced
;
904 id_pipe
->base
.create_sampler_view
= identity_create_sampler_view
;
905 id_pipe
->base
.sampler_view_destroy
= identity_sampler_view_destroy
;
906 id_pipe
->base
.get_transfer
= identity_context_get_transfer
;
907 id_pipe
->base
.transfer_destroy
= identity_context_transfer_destroy
;
908 id_pipe
->base
.transfer_map
= identity_context_transfer_map
;
909 id_pipe
->base
.transfer_unmap
= identity_context_transfer_unmap
;
910 id_pipe
->base
.transfer_flush_region
= identity_context_transfer_flush_region
;
911 id_pipe
->base
.transfer_inline_write
= identity_context_transfer_inline_write
;
913 id_pipe
->pipe
= pipe
;
915 return &id_pipe
->base
;