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
,
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_fragment_sampler_states(struct pipe_context
*_pipe
,
163 unsigned num_samplers
,
166 struct identity_context
*id_pipe
= identity_context(_pipe
);
167 struct pipe_context
*pipe
= id_pipe
->pipe
;
169 pipe
->bind_fragment_sampler_states(pipe
,
175 identity_bind_vertex_sampler_states(struct pipe_context
*_pipe
,
176 unsigned num_samplers
,
179 struct identity_context
*id_pipe
= identity_context(_pipe
);
180 struct pipe_context
*pipe
= id_pipe
->pipe
;
182 pipe
->bind_vertex_sampler_states(pipe
,
188 identity_delete_sampler_state(struct pipe_context
*_pipe
,
191 struct identity_context
*id_pipe
= identity_context(_pipe
);
192 struct pipe_context
*pipe
= id_pipe
->pipe
;
194 pipe
->delete_sampler_state(pipe
,
199 identity_create_rasterizer_state(struct pipe_context
*_pipe
,
200 const struct pipe_rasterizer_state
*rasterizer
)
202 struct identity_context
*id_pipe
= identity_context(_pipe
);
203 struct pipe_context
*pipe
= id_pipe
->pipe
;
205 return pipe
->create_rasterizer_state(pipe
,
210 identity_bind_rasterizer_state(struct pipe_context
*_pipe
,
213 struct identity_context
*id_pipe
= identity_context(_pipe
);
214 struct pipe_context
*pipe
= id_pipe
->pipe
;
216 pipe
->bind_rasterizer_state(pipe
,
221 identity_delete_rasterizer_state(struct pipe_context
*_pipe
,
224 struct identity_context
*id_pipe
= identity_context(_pipe
);
225 struct pipe_context
*pipe
= id_pipe
->pipe
;
227 pipe
->delete_rasterizer_state(pipe
,
232 identity_create_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
233 const struct pipe_depth_stencil_alpha_state
*depth_stencil_alpha
)
235 struct identity_context
*id_pipe
= identity_context(_pipe
);
236 struct pipe_context
*pipe
= id_pipe
->pipe
;
238 return pipe
->create_depth_stencil_alpha_state(pipe
,
239 depth_stencil_alpha
);
243 identity_bind_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
244 void *depth_stencil_alpha
)
246 struct identity_context
*id_pipe
= identity_context(_pipe
);
247 struct pipe_context
*pipe
= id_pipe
->pipe
;
249 pipe
->bind_depth_stencil_alpha_state(pipe
,
250 depth_stencil_alpha
);
254 identity_delete_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
255 void *depth_stencil_alpha
)
257 struct identity_context
*id_pipe
= identity_context(_pipe
);
258 struct pipe_context
*pipe
= id_pipe
->pipe
;
260 pipe
->delete_depth_stencil_alpha_state(pipe
,
261 depth_stencil_alpha
);
265 identity_create_fs_state(struct pipe_context
*_pipe
,
266 const struct pipe_shader_state
*fs
)
268 struct identity_context
*id_pipe
= identity_context(_pipe
);
269 struct pipe_context
*pipe
= id_pipe
->pipe
;
271 return pipe
->create_fs_state(pipe
,
276 identity_bind_fs_state(struct pipe_context
*_pipe
,
279 struct identity_context
*id_pipe
= identity_context(_pipe
);
280 struct pipe_context
*pipe
= id_pipe
->pipe
;
282 pipe
->bind_fs_state(pipe
,
287 identity_delete_fs_state(struct pipe_context
*_pipe
,
290 struct identity_context
*id_pipe
= identity_context(_pipe
);
291 struct pipe_context
*pipe
= id_pipe
->pipe
;
293 pipe
->delete_fs_state(pipe
,
298 identity_create_vs_state(struct pipe_context
*_pipe
,
299 const struct pipe_shader_state
*vs
)
301 struct identity_context
*id_pipe
= identity_context(_pipe
);
302 struct pipe_context
*pipe
= id_pipe
->pipe
;
304 return pipe
->create_vs_state(pipe
,
309 identity_bind_vs_state(struct pipe_context
*_pipe
,
312 struct identity_context
*id_pipe
= identity_context(_pipe
);
313 struct pipe_context
*pipe
= id_pipe
->pipe
;
315 pipe
->bind_vs_state(pipe
,
320 identity_delete_vs_state(struct pipe_context
*_pipe
,
323 struct identity_context
*id_pipe
= identity_context(_pipe
);
324 struct pipe_context
*pipe
= id_pipe
->pipe
;
326 pipe
->delete_vs_state(pipe
,
332 identity_create_vertex_elements_state(struct pipe_context
*_pipe
,
333 unsigned num_elements
,
334 const struct pipe_vertex_element
*vertex_elements
)
336 struct identity_context
*id_pipe
= identity_context(_pipe
);
337 struct pipe_context
*pipe
= id_pipe
->pipe
;
339 return pipe
->create_vertex_elements_state(pipe
,
345 identity_bind_vertex_elements_state(struct pipe_context
*_pipe
,
348 struct identity_context
*id_pipe
= identity_context(_pipe
);
349 struct pipe_context
*pipe
= id_pipe
->pipe
;
351 pipe
->bind_vertex_elements_state(pipe
,
356 identity_delete_vertex_elements_state(struct pipe_context
*_pipe
,
359 struct identity_context
*id_pipe
= identity_context(_pipe
);
360 struct pipe_context
*pipe
= id_pipe
->pipe
;
362 pipe
->delete_vertex_elements_state(pipe
,
367 identity_set_blend_color(struct pipe_context
*_pipe
,
368 const struct pipe_blend_color
*blend_color
)
370 struct identity_context
*id_pipe
= identity_context(_pipe
);
371 struct pipe_context
*pipe
= id_pipe
->pipe
;
373 pipe
->set_blend_color(pipe
,
378 identity_set_stencil_ref(struct pipe_context
*_pipe
,
379 const struct pipe_stencil_ref
*stencil_ref
)
381 struct identity_context
*id_pipe
= identity_context(_pipe
);
382 struct pipe_context
*pipe
= id_pipe
->pipe
;
384 pipe
->set_stencil_ref(pipe
,
389 identity_set_clip_state(struct pipe_context
*_pipe
,
390 const struct pipe_clip_state
*clip
)
392 struct identity_context
*id_pipe
= identity_context(_pipe
);
393 struct pipe_context
*pipe
= id_pipe
->pipe
;
395 pipe
->set_clip_state(pipe
,
400 identity_set_sample_mask(struct pipe_context
*_pipe
,
401 unsigned sample_mask
)
403 struct identity_context
*id_pipe
= identity_context(_pipe
);
404 struct pipe_context
*pipe
= id_pipe
->pipe
;
406 pipe
->set_sample_mask(pipe
,
411 identity_set_constant_buffer(struct pipe_context
*_pipe
,
414 struct pipe_resource
*_resource
)
416 struct identity_context
*id_pipe
= identity_context(_pipe
);
417 struct pipe_context
*pipe
= id_pipe
->pipe
;
418 struct pipe_resource
*unwrapped_resource
;
419 struct pipe_resource
*resource
= NULL
;
421 /* XXX hmm? unwrap the input state */
423 unwrapped_resource
= identity_resource_unwrap(_resource
);
424 resource
= unwrapped_resource
;
427 pipe
->set_constant_buffer(pipe
,
434 identity_set_framebuffer_state(struct pipe_context
*_pipe
,
435 const struct pipe_framebuffer_state
*_state
)
437 struct identity_context
*id_pipe
= identity_context(_pipe
);
438 struct pipe_context
*pipe
= id_pipe
->pipe
;
439 struct pipe_framebuffer_state unwrapped_state
;
440 struct pipe_framebuffer_state
*state
= NULL
;
443 /* unwrap the input state */
445 memcpy(&unwrapped_state
, _state
, sizeof(unwrapped_state
));
446 for(i
= 0; i
< _state
->nr_cbufs
; i
++)
447 unwrapped_state
.cbufs
[i
] = identity_surface_unwrap(_state
->cbufs
[i
]);
448 for (; i
< PIPE_MAX_COLOR_BUFS
; i
++)
449 unwrapped_state
.cbufs
[i
] = NULL
;
450 unwrapped_state
.zsbuf
= identity_surface_unwrap(_state
->zsbuf
);
451 state
= &unwrapped_state
;
454 pipe
->set_framebuffer_state(pipe
,
459 identity_set_polygon_stipple(struct pipe_context
*_pipe
,
460 const struct pipe_poly_stipple
*poly_stipple
)
462 struct identity_context
*id_pipe
= identity_context(_pipe
);
463 struct pipe_context
*pipe
= id_pipe
->pipe
;
465 pipe
->set_polygon_stipple(pipe
,
470 identity_set_scissor_state(struct pipe_context
*_pipe
,
471 const struct pipe_scissor_state
*scissor
)
473 struct identity_context
*id_pipe
= identity_context(_pipe
);
474 struct pipe_context
*pipe
= id_pipe
->pipe
;
476 pipe
->set_scissor_state(pipe
,
481 identity_set_viewport_state(struct pipe_context
*_pipe
,
482 const struct pipe_viewport_state
*viewport
)
484 struct identity_context
*id_pipe
= identity_context(_pipe
);
485 struct pipe_context
*pipe
= id_pipe
->pipe
;
487 pipe
->set_viewport_state(pipe
,
492 identity_set_fragment_sampler_views(struct pipe_context
*_pipe
,
494 struct pipe_sampler_view
**_views
)
496 struct identity_context
*id_pipe
= identity_context(_pipe
);
497 struct pipe_context
*pipe
= id_pipe
->pipe
;
498 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_SAMPLERS
];
499 struct pipe_sampler_view
**views
= NULL
;
503 for (i
= 0; i
< num
; i
++)
504 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
505 for (; i
< PIPE_MAX_SAMPLERS
; i
++)
506 unwrapped_views
[i
] = NULL
;
508 views
= unwrapped_views
;
511 pipe
->set_fragment_sampler_views(pipe
, num
, views
);
515 identity_set_vertex_sampler_views(struct pipe_context
*_pipe
,
517 struct pipe_sampler_view
**_views
)
519 struct identity_context
*id_pipe
= identity_context(_pipe
);
520 struct pipe_context
*pipe
= id_pipe
->pipe
;
521 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_VERTEX_SAMPLERS
];
522 struct pipe_sampler_view
**views
= NULL
;
526 for (i
= 0; i
< num
; i
++)
527 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
528 for (; i
< PIPE_MAX_VERTEX_SAMPLERS
; i
++)
529 unwrapped_views
[i
] = NULL
;
531 views
= unwrapped_views
;
534 pipe
->set_vertex_sampler_views(pipe
, num
, views
);
538 identity_set_vertex_buffers(struct pipe_context
*_pipe
,
539 unsigned num_buffers
,
540 const struct pipe_vertex_buffer
*_buffers
)
542 struct identity_context
*id_pipe
= identity_context(_pipe
);
543 struct pipe_context
*pipe
= id_pipe
->pipe
;
544 struct pipe_vertex_buffer unwrapped_buffers
[PIPE_MAX_SHADER_INPUTS
];
545 struct pipe_vertex_buffer
*buffers
= NULL
;
549 memcpy(unwrapped_buffers
, _buffers
, num_buffers
* sizeof(*_buffers
));
550 for (i
= 0; i
< num_buffers
; i
++)
551 unwrapped_buffers
[i
].buffer
= identity_resource_unwrap(_buffers
[i
].buffer
);
552 buffers
= unwrapped_buffers
;
555 pipe
->set_vertex_buffers(pipe
,
561 identity_set_index_buffer(struct pipe_context
*_pipe
,
562 const struct pipe_index_buffer
*_ib
)
564 struct identity_context
*id_pipe
= identity_context(_pipe
);
565 struct pipe_context
*pipe
= id_pipe
->pipe
;
566 struct pipe_index_buffer unwrapped_ib
, *ib
= NULL
;
570 unwrapped_ib
.buffer
= identity_resource_unwrap(_ib
->buffer
);
574 pipe
->set_index_buffer(pipe
, ib
);
578 identity_resource_copy_region(struct pipe_context
*_pipe
,
579 struct pipe_resource
*_dst
,
580 struct pipe_subresource subdst
,
584 struct pipe_resource
*_src
,
585 struct pipe_subresource subsrc
,
592 struct identity_context
*id_pipe
= identity_context(_pipe
);
593 struct identity_resource
*id_resource_dst
= identity_resource(_dst
);
594 struct identity_resource
*id_resource_src
= identity_resource(_src
);
595 struct pipe_context
*pipe
= id_pipe
->pipe
;
596 struct pipe_resource
*dst
= id_resource_dst
->resource
;
597 struct pipe_resource
*src
= id_resource_src
->resource
;
599 pipe
->resource_copy_region(pipe
,
615 identity_clear(struct pipe_context
*_pipe
,
621 struct identity_context
*id_pipe
= identity_context(_pipe
);
622 struct pipe_context
*pipe
= id_pipe
->pipe
;
632 identity_clear_render_target(struct pipe_context
*_pipe
,
633 struct pipe_surface
*_dst
,
635 unsigned dstx
, unsigned dsty
,
636 unsigned width
, unsigned height
)
638 struct identity_context
*id_pipe
= identity_context(_pipe
);
639 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
640 struct pipe_context
*pipe
= id_pipe
->pipe
;
641 struct pipe_surface
*dst
= id_surface_dst
->surface
;
643 pipe
->clear_render_target(pipe
,
652 identity_clear_depth_stencil(struct pipe_context
*_pipe
,
653 struct pipe_surface
*_dst
,
654 unsigned clear_flags
,
657 unsigned dstx
, unsigned dsty
,
658 unsigned width
, unsigned height
)
660 struct identity_context
*id_pipe
= identity_context(_pipe
);
661 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
662 struct pipe_context
*pipe
= id_pipe
->pipe
;
663 struct pipe_surface
*dst
= id_surface_dst
->surface
;
665 pipe
->clear_depth_stencil(pipe
,
678 identity_flush(struct pipe_context
*_pipe
,
680 struct pipe_fence_handle
**fence
)
682 struct identity_context
*id_pipe
= identity_context(_pipe
);
683 struct pipe_context
*pipe
= id_pipe
->pipe
;
691 identity_is_resource_referenced(struct pipe_context
*_pipe
,
692 struct pipe_resource
*_resource
,
696 struct identity_context
*id_pipe
= identity_context(_pipe
);
697 struct identity_resource
*id_resource
= identity_resource(_resource
);
698 struct pipe_context
*pipe
= id_pipe
->pipe
;
699 struct pipe_resource
*resource
= id_resource
->resource
;
701 return pipe
->is_resource_referenced(pipe
,
707 static struct pipe_sampler_view
*
708 identity_context_create_sampler_view(struct pipe_context
*_pipe
,
709 struct pipe_resource
*_resource
,
710 const struct pipe_sampler_view
*templ
)
712 struct identity_context
*id_context
= identity_context(_pipe
);
713 struct identity_resource
*id_resource
= identity_resource(_resource
);
714 struct pipe_context
*pipe
= id_context
->pipe
;
715 struct pipe_resource
*resource
= id_resource
->resource
;
716 struct pipe_sampler_view
*result
;
718 result
= pipe
->create_sampler_view(pipe
,
723 return identity_sampler_view_create(id_context
, id_resource
, result
);
728 identity_context_sampler_view_destroy(struct pipe_context
*_pipe
,
729 struct pipe_sampler_view
*_view
)
731 identity_sampler_view_destroy(identity_context(_pipe
),
732 identity_sampler_view(_view
));
735 static struct pipe_transfer
*
736 identity_context_get_transfer(struct pipe_context
*_context
,
737 struct pipe_resource
*_resource
,
738 struct pipe_subresource sr
,
740 const struct pipe_box
*box
)
742 struct identity_context
*id_context
= identity_context(_context
);
743 struct identity_resource
*id_resource
= identity_resource(_resource
);
744 struct pipe_context
*context
= id_context
->pipe
;
745 struct pipe_resource
*resource
= id_resource
->resource
;
746 struct pipe_transfer
*result
;
748 result
= context
->get_transfer(context
,
755 return identity_transfer_create(id_context
, id_resource
, result
);
760 identity_context_transfer_destroy(struct pipe_context
*_pipe
,
761 struct pipe_transfer
*_transfer
)
763 identity_transfer_destroy(identity_context(_pipe
),
764 identity_transfer(_transfer
));
768 identity_context_transfer_map(struct pipe_context
*_context
,
769 struct pipe_transfer
*_transfer
)
771 struct identity_context
*id_context
= identity_context(_context
);
772 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
773 struct pipe_context
*context
= id_context
->pipe
;
774 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
776 return context
->transfer_map(context
,
783 identity_context_transfer_flush_region(struct pipe_context
*_context
,
784 struct pipe_transfer
*_transfer
,
785 const struct pipe_box
*box
)
787 struct identity_context
*id_context
= identity_context(_context
);
788 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
789 struct pipe_context
*context
= id_context
->pipe
;
790 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
792 context
->transfer_flush_region(context
,
799 identity_context_transfer_unmap(struct pipe_context
*_context
,
800 struct pipe_transfer
*_transfer
)
802 struct identity_context
*id_context
= identity_context(_context
);
803 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
804 struct pipe_context
*context
= id_context
->pipe
;
805 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
807 context
->transfer_unmap(context
,
813 identity_context_transfer_inline_write(struct pipe_context
*_context
,
814 struct pipe_resource
*_resource
,
815 struct pipe_subresource sr
,
817 const struct pipe_box
*box
,
820 unsigned slice_stride
)
822 struct identity_context
*id_context
= identity_context(_context
);
823 struct identity_resource
*id_resource
= identity_resource(_resource
);
824 struct pipe_context
*context
= id_context
->pipe
;
825 struct pipe_resource
*resource
= id_resource
->resource
;
827 context
->transfer_inline_write(context
,
838 struct pipe_context
*
839 identity_context_create(struct pipe_screen
*_screen
, struct pipe_context
*pipe
)
841 struct identity_context
*id_pipe
;
842 (void)identity_screen(_screen
);
844 id_pipe
= CALLOC_STRUCT(identity_context
);
849 id_pipe
->base
.winsys
= NULL
;
850 id_pipe
->base
.screen
= _screen
;
851 id_pipe
->base
.priv
= pipe
->priv
; /* expose wrapped data */
852 id_pipe
->base
.draw
= NULL
;
854 id_pipe
->base
.destroy
= identity_destroy
;
855 id_pipe
->base
.draw_vbo
= identity_draw_vbo
;
856 id_pipe
->base
.create_query
= identity_create_query
;
857 id_pipe
->base
.destroy_query
= identity_destroy_query
;
858 id_pipe
->base
.begin_query
= identity_begin_query
;
859 id_pipe
->base
.end_query
= identity_end_query
;
860 id_pipe
->base
.get_query_result
= identity_get_query_result
;
861 id_pipe
->base
.create_blend_state
= identity_create_blend_state
;
862 id_pipe
->base
.bind_blend_state
= identity_bind_blend_state
;
863 id_pipe
->base
.delete_blend_state
= identity_delete_blend_state
;
864 id_pipe
->base
.create_sampler_state
= identity_create_sampler_state
;
865 id_pipe
->base
.bind_fragment_sampler_states
= identity_bind_fragment_sampler_states
;
866 id_pipe
->base
.bind_vertex_sampler_states
= identity_bind_vertex_sampler_states
;
867 id_pipe
->base
.delete_sampler_state
= identity_delete_sampler_state
;
868 id_pipe
->base
.create_rasterizer_state
= identity_create_rasterizer_state
;
869 id_pipe
->base
.bind_rasterizer_state
= identity_bind_rasterizer_state
;
870 id_pipe
->base
.delete_rasterizer_state
= identity_delete_rasterizer_state
;
871 id_pipe
->base
.create_depth_stencil_alpha_state
= identity_create_depth_stencil_alpha_state
;
872 id_pipe
->base
.bind_depth_stencil_alpha_state
= identity_bind_depth_stencil_alpha_state
;
873 id_pipe
->base
.delete_depth_stencil_alpha_state
= identity_delete_depth_stencil_alpha_state
;
874 id_pipe
->base
.create_fs_state
= identity_create_fs_state
;
875 id_pipe
->base
.bind_fs_state
= identity_bind_fs_state
;
876 id_pipe
->base
.delete_fs_state
= identity_delete_fs_state
;
877 id_pipe
->base
.create_vs_state
= identity_create_vs_state
;
878 id_pipe
->base
.bind_vs_state
= identity_bind_vs_state
;
879 id_pipe
->base
.delete_vs_state
= identity_delete_vs_state
;
880 id_pipe
->base
.create_vertex_elements_state
= identity_create_vertex_elements_state
;
881 id_pipe
->base
.bind_vertex_elements_state
= identity_bind_vertex_elements_state
;
882 id_pipe
->base
.delete_vertex_elements_state
= identity_delete_vertex_elements_state
;
883 id_pipe
->base
.set_blend_color
= identity_set_blend_color
;
884 id_pipe
->base
.set_stencil_ref
= identity_set_stencil_ref
;
885 id_pipe
->base
.set_clip_state
= identity_set_clip_state
;
886 id_pipe
->base
.set_sample_mask
= identity_set_sample_mask
;
887 id_pipe
->base
.set_constant_buffer
= identity_set_constant_buffer
;
888 id_pipe
->base
.set_framebuffer_state
= identity_set_framebuffer_state
;
889 id_pipe
->base
.set_polygon_stipple
= identity_set_polygon_stipple
;
890 id_pipe
->base
.set_scissor_state
= identity_set_scissor_state
;
891 id_pipe
->base
.set_viewport_state
= identity_set_viewport_state
;
892 id_pipe
->base
.set_fragment_sampler_views
= identity_set_fragment_sampler_views
;
893 id_pipe
->base
.set_vertex_sampler_views
= identity_set_vertex_sampler_views
;
894 id_pipe
->base
.set_vertex_buffers
= identity_set_vertex_buffers
;
895 id_pipe
->base
.set_index_buffer
= identity_set_index_buffer
;
896 id_pipe
->base
.resource_copy_region
= identity_resource_copy_region
;
897 id_pipe
->base
.clear
= identity_clear
;
898 id_pipe
->base
.clear_render_target
= identity_clear_render_target
;
899 id_pipe
->base
.clear_depth_stencil
= identity_clear_depth_stencil
;
900 id_pipe
->base
.flush
= identity_flush
;
901 id_pipe
->base
.is_resource_referenced
= identity_is_resource_referenced
;
902 id_pipe
->base
.create_sampler_view
= identity_context_create_sampler_view
;
903 id_pipe
->base
.sampler_view_destroy
= identity_context_sampler_view_destroy
;
904 id_pipe
->base
.get_transfer
= identity_context_get_transfer
;
905 id_pipe
->base
.transfer_destroy
= identity_context_transfer_destroy
;
906 id_pipe
->base
.transfer_map
= identity_context_transfer_map
;
907 id_pipe
->base
.transfer_unmap
= identity_context_transfer_unmap
;
908 id_pipe
->base
.transfer_flush_region
= identity_context_transfer_flush_region
;
909 id_pipe
->base
.transfer_inline_write
= identity_context_transfer_inline_write
;
911 id_pipe
->pipe
= pipe
;
913 return &id_pipe
->base
;