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"
32 #include "id_context.h"
33 #include "id_objects.h"
37 identity_destroy(struct pipe_context
*_pipe
)
39 struct identity_context
*id_pipe
= identity_context(_pipe
);
40 struct pipe_context
*pipe
= id_pipe
->pipe
;
48 identity_draw_arrays(struct pipe_context
*_pipe
,
53 struct identity_context
*id_pipe
= identity_context(_pipe
);
54 struct pipe_context
*pipe
= id_pipe
->pipe
;
56 pipe
->draw_arrays(pipe
,
63 identity_draw_elements(struct pipe_context
*_pipe
,
64 struct pipe_buffer
*_indexBuffer
,
70 struct identity_context
*id_pipe
= identity_context(_pipe
);
71 struct identity_buffer
*id_buffer
= identity_buffer(_indexBuffer
);
72 struct pipe_context
*pipe
= id_pipe
->pipe
;
73 struct pipe_buffer
*indexBuffer
= id_buffer
->buffer
;
75 pipe
->draw_elements(pipe
,
84 identity_draw_range_elements(struct pipe_context
*_pipe
,
85 struct pipe_buffer
*_indexBuffer
,
93 struct identity_context
*id_pipe
= identity_context(_pipe
);
94 struct identity_buffer
*id_buffer
= identity_buffer(_indexBuffer
);
95 struct pipe_context
*pipe
= id_pipe
->pipe
;
96 struct pipe_buffer
*indexBuffer
= id_buffer
->buffer
;
98 pipe
->draw_range_elements(pipe
,
108 static struct pipe_query
*
109 identity_create_query(struct pipe_context
*_pipe
,
112 struct identity_context
*id_pipe
= identity_context(_pipe
);
113 struct pipe_context
*pipe
= id_pipe
->pipe
;
115 return pipe
->create_query(pipe
,
120 identity_destroy_query(struct pipe_context
*_pipe
,
121 struct pipe_query
*query
)
123 struct identity_context
*id_pipe
= identity_context(_pipe
);
124 struct pipe_context
*pipe
= id_pipe
->pipe
;
126 pipe
->destroy_query(pipe
,
131 identity_begin_query(struct pipe_context
*_pipe
,
132 struct pipe_query
*query
)
134 struct identity_context
*id_pipe
= identity_context(_pipe
);
135 struct pipe_context
*pipe
= id_pipe
->pipe
;
137 pipe
->begin_query(pipe
,
142 identity_end_query(struct pipe_context
*_pipe
,
143 struct pipe_query
*query
)
145 struct identity_context
*id_pipe
= identity_context(_pipe
);
146 struct pipe_context
*pipe
= id_pipe
->pipe
;
148 pipe
->end_query(pipe
,
153 identity_get_query_result(struct pipe_context
*_pipe
,
154 struct pipe_query
*query
,
158 struct identity_context
*id_pipe
= identity_context(_pipe
);
159 struct pipe_context
*pipe
= id_pipe
->pipe
;
161 return pipe
->get_query_result(pipe
,
168 identity_create_blend_state(struct pipe_context
*_pipe
,
169 const struct pipe_blend_state
*blend
)
171 struct identity_context
*id_pipe
= identity_context(_pipe
);
172 struct pipe_context
*pipe
= id_pipe
->pipe
;
174 return pipe
->create_blend_state(pipe
,
179 identity_bind_blend_state(struct pipe_context
*_pipe
,
182 struct identity_context
*id_pipe
= identity_context(_pipe
);
183 struct pipe_context
*pipe
= id_pipe
->pipe
;
185 pipe
->bind_blend_state(pipe
,
190 identity_delete_blend_state(struct pipe_context
*_pipe
,
193 struct identity_context
*id_pipe
= identity_context(_pipe
);
194 struct pipe_context
*pipe
= id_pipe
->pipe
;
196 pipe
->delete_blend_state(pipe
,
201 identity_create_sampler_state(struct pipe_context
*_pipe
,
202 const struct pipe_sampler_state
*sampler
)
204 struct identity_context
*id_pipe
= identity_context(_pipe
);
205 struct pipe_context
*pipe
= id_pipe
->pipe
;
207 return pipe
->create_sampler_state(pipe
,
212 identity_bind_fragment_sampler_states(struct pipe_context
*_pipe
,
213 unsigned num_samplers
,
216 struct identity_context
*id_pipe
= identity_context(_pipe
);
217 struct pipe_context
*pipe
= id_pipe
->pipe
;
219 pipe
->bind_fragment_sampler_states(pipe
,
225 identity_bind_vertex_sampler_states(struct pipe_context
*_pipe
,
226 unsigned num_samplers
,
229 struct identity_context
*id_pipe
= identity_context(_pipe
);
230 struct pipe_context
*pipe
= id_pipe
->pipe
;
232 pipe
->bind_vertex_sampler_states(pipe
,
238 identity_delete_sampler_state(struct pipe_context
*_pipe
,
241 struct identity_context
*id_pipe
= identity_context(_pipe
);
242 struct pipe_context
*pipe
= id_pipe
->pipe
;
244 pipe
->delete_sampler_state(pipe
,
249 identity_create_rasterizer_state(struct pipe_context
*_pipe
,
250 const struct pipe_rasterizer_state
*rasterizer
)
252 struct identity_context
*id_pipe
= identity_context(_pipe
);
253 struct pipe_context
*pipe
= id_pipe
->pipe
;
255 return pipe
->create_rasterizer_state(pipe
,
260 identity_bind_rasterizer_state(struct pipe_context
*_pipe
,
263 struct identity_context
*id_pipe
= identity_context(_pipe
);
264 struct pipe_context
*pipe
= id_pipe
->pipe
;
266 pipe
->bind_rasterizer_state(pipe
,
271 identity_delete_rasterizer_state(struct pipe_context
*_pipe
,
274 struct identity_context
*id_pipe
= identity_context(_pipe
);
275 struct pipe_context
*pipe
= id_pipe
->pipe
;
277 pipe
->delete_rasterizer_state(pipe
,
282 identity_create_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
283 const struct pipe_depth_stencil_alpha_state
*depth_stencil_alpha
)
285 struct identity_context
*id_pipe
= identity_context(_pipe
);
286 struct pipe_context
*pipe
= id_pipe
->pipe
;
288 return pipe
->create_depth_stencil_alpha_state(pipe
,
289 depth_stencil_alpha
);
293 identity_bind_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
294 void *depth_stencil_alpha
)
296 struct identity_context
*id_pipe
= identity_context(_pipe
);
297 struct pipe_context
*pipe
= id_pipe
->pipe
;
299 pipe
->bind_depth_stencil_alpha_state(pipe
,
300 depth_stencil_alpha
);
304 identity_delete_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
305 void *depth_stencil_alpha
)
307 struct identity_context
*id_pipe
= identity_context(_pipe
);
308 struct pipe_context
*pipe
= id_pipe
->pipe
;
310 pipe
->delete_depth_stencil_alpha_state(pipe
,
311 depth_stencil_alpha
);
315 identity_create_fs_state(struct pipe_context
*_pipe
,
316 const struct pipe_shader_state
*fs
)
318 struct identity_context
*id_pipe
= identity_context(_pipe
);
319 struct pipe_context
*pipe
= id_pipe
->pipe
;
321 return pipe
->create_fs_state(pipe
,
326 identity_bind_fs_state(struct pipe_context
*_pipe
,
329 struct identity_context
*id_pipe
= identity_context(_pipe
);
330 struct pipe_context
*pipe
= id_pipe
->pipe
;
332 pipe
->bind_fs_state(pipe
,
337 identity_delete_fs_state(struct pipe_context
*_pipe
,
340 struct identity_context
*id_pipe
= identity_context(_pipe
);
341 struct pipe_context
*pipe
= id_pipe
->pipe
;
343 pipe
->delete_fs_state(pipe
,
348 identity_create_vs_state(struct pipe_context
*_pipe
,
349 const struct pipe_shader_state
*vs
)
351 struct identity_context
*id_pipe
= identity_context(_pipe
);
352 struct pipe_context
*pipe
= id_pipe
->pipe
;
354 return pipe
->create_vs_state(pipe
,
359 identity_bind_vs_state(struct pipe_context
*_pipe
,
362 struct identity_context
*id_pipe
= identity_context(_pipe
);
363 struct pipe_context
*pipe
= id_pipe
->pipe
;
365 pipe
->bind_vs_state(pipe
,
370 identity_delete_vs_state(struct pipe_context
*_pipe
,
373 struct identity_context
*id_pipe
= identity_context(_pipe
);
374 struct pipe_context
*pipe
= id_pipe
->pipe
;
376 pipe
->delete_vs_state(pipe
,
382 identity_create_vertex_elements_state(struct pipe_context
*_pipe
,
383 unsigned num_elements
,
384 const struct pipe_vertex_element
*vertex_elements
)
386 struct identity_context
*id_pipe
= identity_context(_pipe
);
387 struct pipe_context
*pipe
= id_pipe
->pipe
;
389 return pipe
->create_vertex_elements_state(pipe
,
395 identity_bind_vertex_elements_state(struct pipe_context
*_pipe
,
398 struct identity_context
*id_pipe
= identity_context(_pipe
);
399 struct pipe_context
*pipe
= id_pipe
->pipe
;
401 pipe
->bind_vertex_elements_state(pipe
,
406 identity_delete_vertex_elements_state(struct pipe_context
*_pipe
,
409 struct identity_context
*id_pipe
= identity_context(_pipe
);
410 struct pipe_context
*pipe
= id_pipe
->pipe
;
412 pipe
->delete_vertex_elements_state(pipe
,
417 identity_set_blend_color(struct pipe_context
*_pipe
,
418 const struct pipe_blend_color
*blend_color
)
420 struct identity_context
*id_pipe
= identity_context(_pipe
);
421 struct pipe_context
*pipe
= id_pipe
->pipe
;
423 pipe
->set_blend_color(pipe
,
428 identity_set_stencil_ref(struct pipe_context
*_pipe
,
429 const struct pipe_stencil_ref
*stencil_ref
)
431 struct identity_context
*id_pipe
= identity_context(_pipe
);
432 struct pipe_context
*pipe
= id_pipe
->pipe
;
434 pipe
->set_stencil_ref(pipe
,
439 identity_set_clip_state(struct pipe_context
*_pipe
,
440 const struct pipe_clip_state
*clip
)
442 struct identity_context
*id_pipe
= identity_context(_pipe
);
443 struct pipe_context
*pipe
= id_pipe
->pipe
;
445 pipe
->set_clip_state(pipe
,
450 identity_set_constant_buffer(struct pipe_context
*_pipe
,
453 struct pipe_buffer
*_buffer
)
455 struct identity_context
*id_pipe
= identity_context(_pipe
);
456 struct pipe_context
*pipe
= id_pipe
->pipe
;
457 struct pipe_buffer
*unwrapped_buffer
;
458 struct pipe_buffer
*buffer
= NULL
;
460 /* XXX hmm? unwrap the input state */
462 unwrapped_buffer
= identity_buffer_unwrap(_buffer
);
463 buffer
= unwrapped_buffer
;
466 pipe
->set_constant_buffer(pipe
,
473 identity_set_framebuffer_state(struct pipe_context
*_pipe
,
474 const struct pipe_framebuffer_state
*_state
)
476 struct identity_context
*id_pipe
= identity_context(_pipe
);
477 struct pipe_context
*pipe
= id_pipe
->pipe
;
478 struct pipe_framebuffer_state unwrapped_state
;
479 struct pipe_framebuffer_state
*state
= NULL
;
482 /* unwrap the input state */
484 memcpy(&unwrapped_state
, _state
, sizeof(unwrapped_state
));
485 for(i
= 0; i
< _state
->nr_cbufs
; i
++)
486 unwrapped_state
.cbufs
[i
] = identity_surface_unwrap(_state
->cbufs
[i
]);
487 for (; i
< PIPE_MAX_COLOR_BUFS
; i
++)
488 unwrapped_state
.cbufs
[i
] = NULL
;
489 unwrapped_state
.zsbuf
= identity_surface_unwrap(_state
->zsbuf
);
490 state
= &unwrapped_state
;
493 pipe
->set_framebuffer_state(pipe
,
498 identity_set_polygon_stipple(struct pipe_context
*_pipe
,
499 const struct pipe_poly_stipple
*poly_stipple
)
501 struct identity_context
*id_pipe
= identity_context(_pipe
);
502 struct pipe_context
*pipe
= id_pipe
->pipe
;
504 pipe
->set_polygon_stipple(pipe
,
509 identity_set_scissor_state(struct pipe_context
*_pipe
,
510 const struct pipe_scissor_state
*scissor
)
512 struct identity_context
*id_pipe
= identity_context(_pipe
);
513 struct pipe_context
*pipe
= id_pipe
->pipe
;
515 pipe
->set_scissor_state(pipe
,
520 identity_set_viewport_state(struct pipe_context
*_pipe
,
521 const struct pipe_viewport_state
*viewport
)
523 struct identity_context
*id_pipe
= identity_context(_pipe
);
524 struct pipe_context
*pipe
= id_pipe
->pipe
;
526 pipe
->set_viewport_state(pipe
,
531 identity_set_fragment_sampler_views(struct pipe_context
*_pipe
,
533 struct pipe_sampler_view
**_views
)
535 struct identity_context
*id_pipe
= identity_context(_pipe
);
536 struct pipe_context
*pipe
= id_pipe
->pipe
;
537 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_SAMPLERS
];
538 struct pipe_sampler_view
**views
= NULL
;
542 for (i
= 0; i
< num
; i
++)
543 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
544 for (; i
< PIPE_MAX_SAMPLERS
; i
++)
545 unwrapped_views
[i
] = NULL
;
547 views
= unwrapped_views
;
550 pipe
->set_fragment_sampler_views(pipe
, num
, views
);
554 identity_set_vertex_sampler_views(struct pipe_context
*_pipe
,
556 struct pipe_sampler_view
**_views
)
558 struct identity_context
*id_pipe
= identity_context(_pipe
);
559 struct pipe_context
*pipe
= id_pipe
->pipe
;
560 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_VERTEX_SAMPLERS
];
561 struct pipe_sampler_view
**views
= NULL
;
565 for (i
= 0; i
< num
; i
++)
566 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
567 for (; i
< PIPE_MAX_VERTEX_SAMPLERS
; i
++)
568 unwrapped_views
[i
] = NULL
;
570 views
= unwrapped_views
;
573 pipe
->set_vertex_sampler_views(pipe
, num
, views
);
577 identity_set_vertex_buffers(struct pipe_context
*_pipe
,
578 unsigned num_buffers
,
579 const struct pipe_vertex_buffer
*_buffers
)
581 struct identity_context
*id_pipe
= identity_context(_pipe
);
582 struct pipe_context
*pipe
= id_pipe
->pipe
;
583 struct pipe_vertex_buffer unwrapped_buffers
[PIPE_MAX_SHADER_INPUTS
];
584 struct pipe_vertex_buffer
*buffers
= NULL
;
588 memcpy(unwrapped_buffers
, _buffers
, num_buffers
* sizeof(*_buffers
));
589 for (i
= 0; i
< num_buffers
; i
++)
590 unwrapped_buffers
[i
].buffer
= identity_buffer_unwrap(_buffers
[i
].buffer
);
591 buffers
= unwrapped_buffers
;
594 pipe
->set_vertex_buffers(pipe
,
599 identity_surface_copy(struct pipe_context
*_pipe
,
600 struct pipe_surface
*_dst
,
603 struct pipe_surface
*_src
,
609 struct identity_context
*id_pipe
= identity_context(_pipe
);
610 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
611 struct identity_surface
*id_surface_src
= identity_surface(_src
);
612 struct pipe_context
*pipe
= id_pipe
->pipe
;
613 struct pipe_surface
*dst
= id_surface_dst
->surface
;
614 struct pipe_surface
*src
= id_surface_src
->surface
;
616 pipe
->surface_copy(pipe
,
628 identity_surface_fill(struct pipe_context
*_pipe
,
629 struct pipe_surface
*_dst
,
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
->surface_fill(pipe
,
651 identity_clear(struct pipe_context
*_pipe
,
657 struct identity_context
*id_pipe
= identity_context(_pipe
);
658 struct pipe_context
*pipe
= id_pipe
->pipe
;
668 identity_flush(struct pipe_context
*_pipe
,
670 struct pipe_fence_handle
**fence
)
672 struct identity_context
*id_pipe
= identity_context(_pipe
);
673 struct pipe_context
*pipe
= id_pipe
->pipe
;
681 identity_is_texture_referenced(struct pipe_context
*_pipe
,
682 struct pipe_texture
*_texture
,
686 struct identity_context
*id_pipe
= identity_context(_pipe
);
687 struct identity_texture
*id_texture
= identity_texture(_texture
);
688 struct pipe_context
*pipe
= id_pipe
->pipe
;
689 struct pipe_texture
*texture
= id_texture
->texture
;
691 return pipe
->is_texture_referenced(pipe
,
698 identity_is_buffer_referenced(struct pipe_context
*_pipe
,
699 struct pipe_buffer
*_buffer
)
701 struct identity_context
*id_pipe
= identity_context(_pipe
);
702 struct identity_buffer
*id_buffer
= identity_buffer(_buffer
);
703 struct pipe_context
*pipe
= id_pipe
->pipe
;
704 struct pipe_buffer
*buffer
= id_buffer
->buffer
;
706 return pipe
->is_buffer_referenced(pipe
,
710 static struct pipe_sampler_view
*
711 identity_create_sampler_view(struct pipe_context
*pipe
,
712 struct pipe_texture
*texture
,
713 const struct pipe_sampler_view
*templ
)
715 struct identity_context
*id_pipe
= identity_context(pipe
);
716 struct identity_texture
*id_texture
= identity_texture(texture
);
717 struct pipe_context
*pipe_unwrapped
= id_pipe
->pipe
;
718 struct pipe_texture
*texture_unwrapped
= id_texture
->texture
;
719 struct identity_sampler_view
*view
= malloc(sizeof(struct identity_sampler_view
));
721 view
->sampler_view
= pipe_unwrapped
->create_sampler_view(pipe_unwrapped
,
726 view
->base
.reference
.count
= 1;
727 view
->base
.texture
= NULL
;
728 pipe_texture_reference(&view
->base
.texture
, texture
);
729 view
->base
.context
= pipe
;
735 identity_sampler_view_destroy(struct pipe_context
*pipe
,
736 struct pipe_sampler_view
*view
)
738 struct identity_context
*id_pipe
= identity_context(pipe
);
739 struct identity_sampler_view
*id_view
= identity_sampler_view(view
);
740 struct pipe_context
*pipe_unwrapped
= id_pipe
->pipe
;
741 struct pipe_sampler_view
*view_unwrapped
= id_view
->sampler_view
;
743 pipe_unwrapped
->sampler_view_destroy(pipe_unwrapped
,
746 pipe_texture_reference(&view
->texture
, NULL
);
751 static struct pipe_transfer
*
752 identity_context_get_tex_transfer(struct pipe_context
*_context
,
753 struct pipe_texture
*_texture
,
757 enum pipe_transfer_usage usage
,
763 struct identity_context
*id_context
= identity_context(_context
);
764 struct identity_texture
*id_texture
= identity_texture(_texture
);
765 struct pipe_context
*context
= id_context
->pipe
;
766 struct pipe_texture
*texture
= id_texture
->texture
;
767 struct pipe_transfer
*result
;
769 result
= context
->get_tex_transfer(context
,
781 return identity_transfer_create(id_context
, id_texture
, result
);
786 identity_context_tex_transfer_destroy(struct pipe_context
*_pipe
,
787 struct pipe_transfer
*_transfer
)
789 identity_transfer_destroy(identity_context(_pipe
),
790 identity_transfer(_transfer
));
794 identity_context_transfer_map(struct pipe_context
*_context
,
795 struct pipe_transfer
*_transfer
)
797 struct identity_context
*id_context
= identity_context(_context
);
798 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
799 struct pipe_context
*context
= id_context
->pipe
;
800 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
802 return context
->transfer_map(context
,
807 identity_context_transfer_unmap(struct pipe_context
*_context
,
808 struct pipe_transfer
*_transfer
)
810 struct identity_context
*id_context
= identity_context(_context
);
811 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
812 struct pipe_context
*context
= id_context
->pipe
;
813 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
815 context
->transfer_unmap(context
,
819 struct pipe_context
*
820 identity_context_create(struct pipe_screen
*_screen
, struct pipe_context
*pipe
)
822 struct identity_context
*id_pipe
;
823 (void)identity_screen(_screen
);
825 id_pipe
= CALLOC_STRUCT(identity_context
);
830 id_pipe
->base
.winsys
= NULL
;
831 id_pipe
->base
.screen
= _screen
;
832 id_pipe
->base
.priv
= pipe
->priv
; /* expose wrapped data */
833 id_pipe
->base
.draw
= NULL
;
835 id_pipe
->base
.destroy
= identity_destroy
;
836 id_pipe
->base
.draw_arrays
= identity_draw_arrays
;
837 id_pipe
->base
.draw_elements
= identity_draw_elements
;
838 id_pipe
->base
.draw_range_elements
= identity_draw_range_elements
;
839 id_pipe
->base
.create_query
= identity_create_query
;
840 id_pipe
->base
.destroy_query
= identity_destroy_query
;
841 id_pipe
->base
.begin_query
= identity_begin_query
;
842 id_pipe
->base
.end_query
= identity_end_query
;
843 id_pipe
->base
.get_query_result
= identity_get_query_result
;
844 id_pipe
->base
.create_blend_state
= identity_create_blend_state
;
845 id_pipe
->base
.bind_blend_state
= identity_bind_blend_state
;
846 id_pipe
->base
.delete_blend_state
= identity_delete_blend_state
;
847 id_pipe
->base
.create_sampler_state
= identity_create_sampler_state
;
848 id_pipe
->base
.bind_fragment_sampler_states
= identity_bind_fragment_sampler_states
;
849 id_pipe
->base
.bind_vertex_sampler_states
= identity_bind_vertex_sampler_states
;
850 id_pipe
->base
.delete_sampler_state
= identity_delete_sampler_state
;
851 id_pipe
->base
.create_rasterizer_state
= identity_create_rasterizer_state
;
852 id_pipe
->base
.bind_rasterizer_state
= identity_bind_rasterizer_state
;
853 id_pipe
->base
.delete_rasterizer_state
= identity_delete_rasterizer_state
;
854 id_pipe
->base
.create_depth_stencil_alpha_state
= identity_create_depth_stencil_alpha_state
;
855 id_pipe
->base
.bind_depth_stencil_alpha_state
= identity_bind_depth_stencil_alpha_state
;
856 id_pipe
->base
.delete_depth_stencil_alpha_state
= identity_delete_depth_stencil_alpha_state
;
857 id_pipe
->base
.create_fs_state
= identity_create_fs_state
;
858 id_pipe
->base
.bind_fs_state
= identity_bind_fs_state
;
859 id_pipe
->base
.delete_fs_state
= identity_delete_fs_state
;
860 id_pipe
->base
.create_vs_state
= identity_create_vs_state
;
861 id_pipe
->base
.bind_vs_state
= identity_bind_vs_state
;
862 id_pipe
->base
.delete_vs_state
= identity_delete_vs_state
;
863 id_pipe
->base
.create_vertex_elements_state
= identity_create_vertex_elements_state
;
864 id_pipe
->base
.bind_vertex_elements_state
= identity_bind_vertex_elements_state
;
865 id_pipe
->base
.delete_vertex_elements_state
= identity_delete_vertex_elements_state
;
866 id_pipe
->base
.set_blend_color
= identity_set_blend_color
;
867 id_pipe
->base
.set_stencil_ref
= identity_set_stencil_ref
;
868 id_pipe
->base
.set_clip_state
= identity_set_clip_state
;
869 id_pipe
->base
.set_constant_buffer
= identity_set_constant_buffer
;
870 id_pipe
->base
.set_framebuffer_state
= identity_set_framebuffer_state
;
871 id_pipe
->base
.set_polygon_stipple
= identity_set_polygon_stipple
;
872 id_pipe
->base
.set_scissor_state
= identity_set_scissor_state
;
873 id_pipe
->base
.set_viewport_state
= identity_set_viewport_state
;
874 id_pipe
->base
.set_fragment_sampler_views
= identity_set_fragment_sampler_views
;
875 id_pipe
->base
.set_vertex_sampler_views
= identity_set_vertex_sampler_views
;
876 id_pipe
->base
.set_vertex_buffers
= identity_set_vertex_buffers
;
877 id_pipe
->base
.surface_copy
= identity_surface_copy
;
878 id_pipe
->base
.surface_fill
= identity_surface_fill
;
879 id_pipe
->base
.clear
= identity_clear
;
880 id_pipe
->base
.flush
= identity_flush
;
881 id_pipe
->base
.is_texture_referenced
= identity_is_texture_referenced
;
882 id_pipe
->base
.is_buffer_referenced
= identity_is_buffer_referenced
;
883 id_pipe
->base
.create_sampler_view
= identity_create_sampler_view
;
884 id_pipe
->base
.sampler_view_destroy
= identity_sampler_view_destroy
;
885 id_pipe
->base
.get_tex_transfer
= identity_context_get_tex_transfer
;
886 id_pipe
->base
.tex_transfer_destroy
= identity_context_tex_transfer_destroy
;
887 id_pipe
->base
.transfer_map
= identity_context_transfer_map
;
888 id_pipe
->base
.transfer_unmap
= identity_context_transfer_unmap
;
890 id_pipe
->pipe
= pipe
;
892 return &id_pipe
->base
;