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
,
72 struct identity_context
*id_pipe
= identity_context(_pipe
);
73 struct identity_resource
*id_resource
= identity_resource(_indexResource
);
74 struct pipe_context
*pipe
= id_pipe
->pipe
;
75 struct pipe_resource
*indexResource
= id_resource
->resource
;
77 pipe
->draw_elements(pipe
,
87 identity_draw_range_elements(struct pipe_context
*_pipe
,
88 struct pipe_resource
*_indexResource
,
97 struct identity_context
*id_pipe
= identity_context(_pipe
);
98 struct identity_resource
*id_resource
= identity_resource(_indexResource
);
99 struct pipe_context
*pipe
= id_pipe
->pipe
;
100 struct pipe_resource
*indexResource
= id_resource
->resource
;
102 pipe
->draw_range_elements(pipe
,
113 static struct pipe_query
*
114 identity_create_query(struct pipe_context
*_pipe
,
117 struct identity_context
*id_pipe
= identity_context(_pipe
);
118 struct pipe_context
*pipe
= id_pipe
->pipe
;
120 return pipe
->create_query(pipe
,
125 identity_destroy_query(struct pipe_context
*_pipe
,
126 struct pipe_query
*query
)
128 struct identity_context
*id_pipe
= identity_context(_pipe
);
129 struct pipe_context
*pipe
= id_pipe
->pipe
;
131 pipe
->destroy_query(pipe
,
136 identity_begin_query(struct pipe_context
*_pipe
,
137 struct pipe_query
*query
)
139 struct identity_context
*id_pipe
= identity_context(_pipe
);
140 struct pipe_context
*pipe
= id_pipe
->pipe
;
142 pipe
->begin_query(pipe
,
147 identity_end_query(struct pipe_context
*_pipe
,
148 struct pipe_query
*query
)
150 struct identity_context
*id_pipe
= identity_context(_pipe
);
151 struct pipe_context
*pipe
= id_pipe
->pipe
;
153 pipe
->end_query(pipe
,
158 identity_get_query_result(struct pipe_context
*_pipe
,
159 struct pipe_query
*query
,
163 struct identity_context
*id_pipe
= identity_context(_pipe
);
164 struct pipe_context
*pipe
= id_pipe
->pipe
;
166 return pipe
->get_query_result(pipe
,
173 identity_create_blend_state(struct pipe_context
*_pipe
,
174 const struct pipe_blend_state
*blend
)
176 struct identity_context
*id_pipe
= identity_context(_pipe
);
177 struct pipe_context
*pipe
= id_pipe
->pipe
;
179 return pipe
->create_blend_state(pipe
,
184 identity_bind_blend_state(struct pipe_context
*_pipe
,
187 struct identity_context
*id_pipe
= identity_context(_pipe
);
188 struct pipe_context
*pipe
= id_pipe
->pipe
;
190 pipe
->bind_blend_state(pipe
,
195 identity_delete_blend_state(struct pipe_context
*_pipe
,
198 struct identity_context
*id_pipe
= identity_context(_pipe
);
199 struct pipe_context
*pipe
= id_pipe
->pipe
;
201 pipe
->delete_blend_state(pipe
,
206 identity_create_sampler_state(struct pipe_context
*_pipe
,
207 const struct pipe_sampler_state
*sampler
)
209 struct identity_context
*id_pipe
= identity_context(_pipe
);
210 struct pipe_context
*pipe
= id_pipe
->pipe
;
212 return pipe
->create_sampler_state(pipe
,
217 identity_bind_fragment_sampler_states(struct pipe_context
*_pipe
,
218 unsigned num_samplers
,
221 struct identity_context
*id_pipe
= identity_context(_pipe
);
222 struct pipe_context
*pipe
= id_pipe
->pipe
;
224 pipe
->bind_fragment_sampler_states(pipe
,
230 identity_bind_vertex_sampler_states(struct pipe_context
*_pipe
,
231 unsigned num_samplers
,
234 struct identity_context
*id_pipe
= identity_context(_pipe
);
235 struct pipe_context
*pipe
= id_pipe
->pipe
;
237 pipe
->bind_vertex_sampler_states(pipe
,
243 identity_delete_sampler_state(struct pipe_context
*_pipe
,
246 struct identity_context
*id_pipe
= identity_context(_pipe
);
247 struct pipe_context
*pipe
= id_pipe
->pipe
;
249 pipe
->delete_sampler_state(pipe
,
254 identity_create_rasterizer_state(struct pipe_context
*_pipe
,
255 const struct pipe_rasterizer_state
*rasterizer
)
257 struct identity_context
*id_pipe
= identity_context(_pipe
);
258 struct pipe_context
*pipe
= id_pipe
->pipe
;
260 return pipe
->create_rasterizer_state(pipe
,
265 identity_bind_rasterizer_state(struct pipe_context
*_pipe
,
268 struct identity_context
*id_pipe
= identity_context(_pipe
);
269 struct pipe_context
*pipe
= id_pipe
->pipe
;
271 pipe
->bind_rasterizer_state(pipe
,
276 identity_delete_rasterizer_state(struct pipe_context
*_pipe
,
279 struct identity_context
*id_pipe
= identity_context(_pipe
);
280 struct pipe_context
*pipe
= id_pipe
->pipe
;
282 pipe
->delete_rasterizer_state(pipe
,
287 identity_create_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
288 const struct pipe_depth_stencil_alpha_state
*depth_stencil_alpha
)
290 struct identity_context
*id_pipe
= identity_context(_pipe
);
291 struct pipe_context
*pipe
= id_pipe
->pipe
;
293 return pipe
->create_depth_stencil_alpha_state(pipe
,
294 depth_stencil_alpha
);
298 identity_bind_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
299 void *depth_stencil_alpha
)
301 struct identity_context
*id_pipe
= identity_context(_pipe
);
302 struct pipe_context
*pipe
= id_pipe
->pipe
;
304 pipe
->bind_depth_stencil_alpha_state(pipe
,
305 depth_stencil_alpha
);
309 identity_delete_depth_stencil_alpha_state(struct pipe_context
*_pipe
,
310 void *depth_stencil_alpha
)
312 struct identity_context
*id_pipe
= identity_context(_pipe
);
313 struct pipe_context
*pipe
= id_pipe
->pipe
;
315 pipe
->delete_depth_stencil_alpha_state(pipe
,
316 depth_stencil_alpha
);
320 identity_create_fs_state(struct pipe_context
*_pipe
,
321 const struct pipe_shader_state
*fs
)
323 struct identity_context
*id_pipe
= identity_context(_pipe
);
324 struct pipe_context
*pipe
= id_pipe
->pipe
;
326 return pipe
->create_fs_state(pipe
,
331 identity_bind_fs_state(struct pipe_context
*_pipe
,
334 struct identity_context
*id_pipe
= identity_context(_pipe
);
335 struct pipe_context
*pipe
= id_pipe
->pipe
;
337 pipe
->bind_fs_state(pipe
,
342 identity_delete_fs_state(struct pipe_context
*_pipe
,
345 struct identity_context
*id_pipe
= identity_context(_pipe
);
346 struct pipe_context
*pipe
= id_pipe
->pipe
;
348 pipe
->delete_fs_state(pipe
,
353 identity_create_vs_state(struct pipe_context
*_pipe
,
354 const struct pipe_shader_state
*vs
)
356 struct identity_context
*id_pipe
= identity_context(_pipe
);
357 struct pipe_context
*pipe
= id_pipe
->pipe
;
359 return pipe
->create_vs_state(pipe
,
364 identity_bind_vs_state(struct pipe_context
*_pipe
,
367 struct identity_context
*id_pipe
= identity_context(_pipe
);
368 struct pipe_context
*pipe
= id_pipe
->pipe
;
370 pipe
->bind_vs_state(pipe
,
375 identity_delete_vs_state(struct pipe_context
*_pipe
,
378 struct identity_context
*id_pipe
= identity_context(_pipe
);
379 struct pipe_context
*pipe
= id_pipe
->pipe
;
381 pipe
->delete_vs_state(pipe
,
387 identity_create_vertex_elements_state(struct pipe_context
*_pipe
,
388 unsigned num_elements
,
389 const struct pipe_vertex_element
*vertex_elements
)
391 struct identity_context
*id_pipe
= identity_context(_pipe
);
392 struct pipe_context
*pipe
= id_pipe
->pipe
;
394 return pipe
->create_vertex_elements_state(pipe
,
400 identity_bind_vertex_elements_state(struct pipe_context
*_pipe
,
403 struct identity_context
*id_pipe
= identity_context(_pipe
);
404 struct pipe_context
*pipe
= id_pipe
->pipe
;
406 pipe
->bind_vertex_elements_state(pipe
,
411 identity_delete_vertex_elements_state(struct pipe_context
*_pipe
,
414 struct identity_context
*id_pipe
= identity_context(_pipe
);
415 struct pipe_context
*pipe
= id_pipe
->pipe
;
417 pipe
->delete_vertex_elements_state(pipe
,
422 identity_set_blend_color(struct pipe_context
*_pipe
,
423 const struct pipe_blend_color
*blend_color
)
425 struct identity_context
*id_pipe
= identity_context(_pipe
);
426 struct pipe_context
*pipe
= id_pipe
->pipe
;
428 pipe
->set_blend_color(pipe
,
433 identity_set_stencil_ref(struct pipe_context
*_pipe
,
434 const struct pipe_stencil_ref
*stencil_ref
)
436 struct identity_context
*id_pipe
= identity_context(_pipe
);
437 struct pipe_context
*pipe
= id_pipe
->pipe
;
439 pipe
->set_stencil_ref(pipe
,
444 identity_set_clip_state(struct pipe_context
*_pipe
,
445 const struct pipe_clip_state
*clip
)
447 struct identity_context
*id_pipe
= identity_context(_pipe
);
448 struct pipe_context
*pipe
= id_pipe
->pipe
;
450 pipe
->set_clip_state(pipe
,
455 identity_set_constant_buffer(struct pipe_context
*_pipe
,
458 struct pipe_resource
*_resource
)
460 struct identity_context
*id_pipe
= identity_context(_pipe
);
461 struct pipe_context
*pipe
= id_pipe
->pipe
;
462 struct pipe_resource
*unwrapped_resource
;
463 struct pipe_resource
*resource
= NULL
;
465 /* XXX hmm? unwrap the input state */
467 unwrapped_resource
= identity_resource_unwrap(_resource
);
468 resource
= unwrapped_resource
;
471 pipe
->set_constant_buffer(pipe
,
478 identity_set_framebuffer_state(struct pipe_context
*_pipe
,
479 const struct pipe_framebuffer_state
*_state
)
481 struct identity_context
*id_pipe
= identity_context(_pipe
);
482 struct pipe_context
*pipe
= id_pipe
->pipe
;
483 struct pipe_framebuffer_state unwrapped_state
;
484 struct pipe_framebuffer_state
*state
= NULL
;
487 /* unwrap the input state */
489 memcpy(&unwrapped_state
, _state
, sizeof(unwrapped_state
));
490 for(i
= 0; i
< _state
->nr_cbufs
; i
++)
491 unwrapped_state
.cbufs
[i
] = identity_surface_unwrap(_state
->cbufs
[i
]);
492 for (; i
< PIPE_MAX_COLOR_BUFS
; i
++)
493 unwrapped_state
.cbufs
[i
] = NULL
;
494 unwrapped_state
.zsbuf
= identity_surface_unwrap(_state
->zsbuf
);
495 state
= &unwrapped_state
;
498 pipe
->set_framebuffer_state(pipe
,
503 identity_set_polygon_stipple(struct pipe_context
*_pipe
,
504 const struct pipe_poly_stipple
*poly_stipple
)
506 struct identity_context
*id_pipe
= identity_context(_pipe
);
507 struct pipe_context
*pipe
= id_pipe
->pipe
;
509 pipe
->set_polygon_stipple(pipe
,
514 identity_set_scissor_state(struct pipe_context
*_pipe
,
515 const struct pipe_scissor_state
*scissor
)
517 struct identity_context
*id_pipe
= identity_context(_pipe
);
518 struct pipe_context
*pipe
= id_pipe
->pipe
;
520 pipe
->set_scissor_state(pipe
,
525 identity_set_viewport_state(struct pipe_context
*_pipe
,
526 const struct pipe_viewport_state
*viewport
)
528 struct identity_context
*id_pipe
= identity_context(_pipe
);
529 struct pipe_context
*pipe
= id_pipe
->pipe
;
531 pipe
->set_viewport_state(pipe
,
536 identity_set_fragment_sampler_views(struct pipe_context
*_pipe
,
538 struct pipe_sampler_view
**_views
)
540 struct identity_context
*id_pipe
= identity_context(_pipe
);
541 struct pipe_context
*pipe
= id_pipe
->pipe
;
542 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_SAMPLERS
];
543 struct pipe_sampler_view
**views
= NULL
;
547 for (i
= 0; i
< num
; i
++)
548 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
549 for (; i
< PIPE_MAX_SAMPLERS
; i
++)
550 unwrapped_views
[i
] = NULL
;
552 views
= unwrapped_views
;
555 pipe
->set_fragment_sampler_views(pipe
, num
, views
);
559 identity_set_vertex_sampler_views(struct pipe_context
*_pipe
,
561 struct pipe_sampler_view
**_views
)
563 struct identity_context
*id_pipe
= identity_context(_pipe
);
564 struct pipe_context
*pipe
= id_pipe
->pipe
;
565 struct pipe_sampler_view
*unwrapped_views
[PIPE_MAX_VERTEX_SAMPLERS
];
566 struct pipe_sampler_view
**views
= NULL
;
570 for (i
= 0; i
< num
; i
++)
571 unwrapped_views
[i
] = identity_sampler_view_unwrap(_views
[i
]);
572 for (; i
< PIPE_MAX_VERTEX_SAMPLERS
; i
++)
573 unwrapped_views
[i
] = NULL
;
575 views
= unwrapped_views
;
578 pipe
->set_vertex_sampler_views(pipe
, num
, views
);
582 identity_set_vertex_buffers(struct pipe_context
*_pipe
,
583 unsigned num_buffers
,
584 const struct pipe_vertex_buffer
*_buffers
)
586 struct identity_context
*id_pipe
= identity_context(_pipe
);
587 struct pipe_context
*pipe
= id_pipe
->pipe
;
588 struct pipe_vertex_buffer unwrapped_buffers
[PIPE_MAX_SHADER_INPUTS
];
589 struct pipe_vertex_buffer
*buffers
= NULL
;
593 memcpy(unwrapped_buffers
, _buffers
, num_buffers
* sizeof(*_buffers
));
594 for (i
= 0; i
< num_buffers
; i
++)
595 unwrapped_buffers
[i
].buffer
= identity_resource_unwrap(_buffers
[i
].buffer
);
596 buffers
= unwrapped_buffers
;
599 pipe
->set_vertex_buffers(pipe
,
604 identity_surface_copy(struct pipe_context
*_pipe
,
605 struct pipe_surface
*_dst
,
608 struct pipe_surface
*_src
,
614 struct identity_context
*id_pipe
= identity_context(_pipe
);
615 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
616 struct identity_surface
*id_surface_src
= identity_surface(_src
);
617 struct pipe_context
*pipe
= id_pipe
->pipe
;
618 struct pipe_surface
*dst
= id_surface_dst
->surface
;
619 struct pipe_surface
*src
= id_surface_src
->surface
;
621 pipe
->surface_copy(pipe
,
633 identity_surface_fill(struct pipe_context
*_pipe
,
634 struct pipe_surface
*_dst
,
641 struct identity_context
*id_pipe
= identity_context(_pipe
);
642 struct identity_surface
*id_surface_dst
= identity_surface(_dst
);
643 struct pipe_context
*pipe
= id_pipe
->pipe
;
644 struct pipe_surface
*dst
= id_surface_dst
->surface
;
646 pipe
->surface_fill(pipe
,
656 identity_clear(struct pipe_context
*_pipe
,
662 struct identity_context
*id_pipe
= identity_context(_pipe
);
663 struct pipe_context
*pipe
= id_pipe
->pipe
;
673 identity_flush(struct pipe_context
*_pipe
,
675 struct pipe_fence_handle
**fence
)
677 struct identity_context
*id_pipe
= identity_context(_pipe
);
678 struct pipe_context
*pipe
= id_pipe
->pipe
;
686 identity_is_resource_referenced(struct pipe_context
*_pipe
,
687 struct pipe_resource
*_resource
,
691 struct identity_context
*id_pipe
= identity_context(_pipe
);
692 struct identity_resource
*id_resource
= identity_resource(_resource
);
693 struct pipe_context
*pipe
= id_pipe
->pipe
;
694 struct pipe_resource
*texture
= id_resource
->resource
;
696 return pipe
->is_resource_referenced(pipe
,
702 static struct pipe_sampler_view
*
703 identity_create_sampler_view(struct pipe_context
*pipe
,
704 struct pipe_resource
*texture
,
705 const struct pipe_sampler_view
*templ
)
707 struct identity_context
*id_pipe
= identity_context(pipe
);
708 struct identity_resource
*id_resource
= identity_resource(texture
);
709 struct pipe_context
*pipe_unwrapped
= id_pipe
->pipe
;
710 struct pipe_resource
*texture_unwrapped
= id_resource
->resource
;
711 struct identity_sampler_view
*view
= MALLOC(sizeof(struct identity_sampler_view
));
713 view
->sampler_view
= pipe_unwrapped
->create_sampler_view(pipe_unwrapped
,
718 view
->base
.reference
.count
= 1;
719 view
->base
.texture
= NULL
;
720 pipe_resource_reference(&view
->base
.texture
, texture
);
721 view
->base
.context
= pipe
;
727 identity_sampler_view_destroy(struct pipe_context
*pipe
,
728 struct pipe_sampler_view
*view
)
730 struct identity_context
*id_pipe
= identity_context(pipe
);
731 struct identity_sampler_view
*id_view
= identity_sampler_view(view
);
732 struct pipe_context
*pipe_unwrapped
= id_pipe
->pipe
;
733 struct pipe_sampler_view
*view_unwrapped
= id_view
->sampler_view
;
735 pipe_unwrapped
->sampler_view_destroy(pipe_unwrapped
,
738 pipe_resource_reference(&view
->texture
, NULL
);
742 static struct pipe_transfer
*
743 identity_context_get_transfer(struct pipe_context
*_context
,
744 struct pipe_resource
*_resource
,
745 struct pipe_subresource sr
,
747 const struct pipe_box
*box
)
749 struct identity_context
*id_context
= identity_context(_context
);
750 struct identity_resource
*id_resource
= identity_resource(_resource
);
751 struct pipe_context
*context
= id_context
->pipe
;
752 struct pipe_resource
*texture
= id_resource
->resource
;
753 struct pipe_transfer
*result
;
755 result
= context
->get_transfer(context
,
762 return identity_transfer_create(id_context
, id_resource
, result
);
767 identity_context_transfer_destroy(struct pipe_context
*_pipe
,
768 struct pipe_transfer
*_transfer
)
770 identity_transfer_destroy(identity_context(_pipe
),
771 identity_transfer(_transfer
));
775 identity_context_transfer_map(struct pipe_context
*_context
,
776 struct pipe_transfer
*_transfer
)
778 struct identity_context
*id_context
= identity_context(_context
);
779 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
780 struct pipe_context
*context
= id_context
->pipe
;
781 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
783 return context
->transfer_map(context
,
790 identity_context_transfer_flush_region(struct pipe_context
*_context
,
791 struct pipe_transfer
*_transfer
,
792 const struct pipe_box
*box
)
794 struct identity_context
*id_context
= identity_context(_context
);
795 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
796 struct pipe_context
*context
= id_context
->pipe
;
797 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
799 context
->transfer_flush_region(context
,
806 identity_context_transfer_unmap(struct pipe_context
*_context
,
807 struct pipe_transfer
*_transfer
)
809 struct identity_context
*id_context
= identity_context(_context
);
810 struct identity_transfer
*id_transfer
= identity_transfer(_transfer
);
811 struct pipe_context
*context
= id_context
->pipe
;
812 struct pipe_transfer
*transfer
= id_transfer
->transfer
;
814 context
->transfer_unmap(context
,
820 identity_context_transfer_inline_write(struct pipe_context
*_context
,
821 struct pipe_resource
*_resource
,
822 struct pipe_subresource sr
,
824 const struct pipe_box
*box
,
827 unsigned slice_stride
)
829 struct identity_context
*id_context
= identity_context(_context
);
830 struct identity_resource
*id_resource
= identity_resource(_resource
);
831 struct pipe_context
*context
= id_context
->pipe
;
832 struct pipe_resource
*texture
= id_resource
->resource
;
834 context
->transfer_inline_write(context
,
845 struct pipe_context
*
846 identity_context_create(struct pipe_screen
*_screen
, struct pipe_context
*pipe
)
848 struct identity_context
*id_pipe
;
849 (void)identity_screen(_screen
);
851 id_pipe
= CALLOC_STRUCT(identity_context
);
856 id_pipe
->base
.winsys
= NULL
;
857 id_pipe
->base
.screen
= _screen
;
858 id_pipe
->base
.priv
= pipe
->priv
; /* expose wrapped data */
859 id_pipe
->base
.draw
= NULL
;
861 id_pipe
->base
.destroy
= identity_destroy
;
862 id_pipe
->base
.draw_arrays
= identity_draw_arrays
;
863 id_pipe
->base
.draw_elements
= identity_draw_elements
;
864 id_pipe
->base
.draw_range_elements
= identity_draw_range_elements
;
865 id_pipe
->base
.create_query
= identity_create_query
;
866 id_pipe
->base
.destroy_query
= identity_destroy_query
;
867 id_pipe
->base
.begin_query
= identity_begin_query
;
868 id_pipe
->base
.end_query
= identity_end_query
;
869 id_pipe
->base
.get_query_result
= identity_get_query_result
;
870 id_pipe
->base
.create_blend_state
= identity_create_blend_state
;
871 id_pipe
->base
.bind_blend_state
= identity_bind_blend_state
;
872 id_pipe
->base
.delete_blend_state
= identity_delete_blend_state
;
873 id_pipe
->base
.create_sampler_state
= identity_create_sampler_state
;
874 id_pipe
->base
.bind_fragment_sampler_states
= identity_bind_fragment_sampler_states
;
875 id_pipe
->base
.bind_vertex_sampler_states
= identity_bind_vertex_sampler_states
;
876 id_pipe
->base
.delete_sampler_state
= identity_delete_sampler_state
;
877 id_pipe
->base
.create_rasterizer_state
= identity_create_rasterizer_state
;
878 id_pipe
->base
.bind_rasterizer_state
= identity_bind_rasterizer_state
;
879 id_pipe
->base
.delete_rasterizer_state
= identity_delete_rasterizer_state
;
880 id_pipe
->base
.create_depth_stencil_alpha_state
= identity_create_depth_stencil_alpha_state
;
881 id_pipe
->base
.bind_depth_stencil_alpha_state
= identity_bind_depth_stencil_alpha_state
;
882 id_pipe
->base
.delete_depth_stencil_alpha_state
= identity_delete_depth_stencil_alpha_state
;
883 id_pipe
->base
.create_fs_state
= identity_create_fs_state
;
884 id_pipe
->base
.bind_fs_state
= identity_bind_fs_state
;
885 id_pipe
->base
.delete_fs_state
= identity_delete_fs_state
;
886 id_pipe
->base
.create_vs_state
= identity_create_vs_state
;
887 id_pipe
->base
.bind_vs_state
= identity_bind_vs_state
;
888 id_pipe
->base
.delete_vs_state
= identity_delete_vs_state
;
889 id_pipe
->base
.create_vertex_elements_state
= identity_create_vertex_elements_state
;
890 id_pipe
->base
.bind_vertex_elements_state
= identity_bind_vertex_elements_state
;
891 id_pipe
->base
.delete_vertex_elements_state
= identity_delete_vertex_elements_state
;
892 id_pipe
->base
.set_blend_color
= identity_set_blend_color
;
893 id_pipe
->base
.set_stencil_ref
= identity_set_stencil_ref
;
894 id_pipe
->base
.set_clip_state
= identity_set_clip_state
;
895 id_pipe
->base
.set_constant_buffer
= identity_set_constant_buffer
;
896 id_pipe
->base
.set_framebuffer_state
= identity_set_framebuffer_state
;
897 id_pipe
->base
.set_polygon_stipple
= identity_set_polygon_stipple
;
898 id_pipe
->base
.set_scissor_state
= identity_set_scissor_state
;
899 id_pipe
->base
.set_viewport_state
= identity_set_viewport_state
;
900 id_pipe
->base
.set_fragment_sampler_views
= identity_set_fragment_sampler_views
;
901 id_pipe
->base
.set_vertex_sampler_views
= identity_set_vertex_sampler_views
;
902 id_pipe
->base
.set_vertex_buffers
= identity_set_vertex_buffers
;
903 id_pipe
->base
.surface_copy
= identity_surface_copy
;
904 id_pipe
->base
.surface_fill
= identity_surface_fill
;
905 id_pipe
->base
.clear
= identity_clear
;
906 id_pipe
->base
.flush
= identity_flush
;
907 id_pipe
->base
.is_resource_referenced
= identity_is_resource_referenced
;
908 id_pipe
->base
.create_sampler_view
= identity_create_sampler_view
;
909 id_pipe
->base
.sampler_view_destroy
= identity_sampler_view_destroy
;
910 id_pipe
->base
.get_transfer
= identity_context_get_transfer
;
911 id_pipe
->base
.transfer_destroy
= identity_context_transfer_destroy
;
912 id_pipe
->base
.transfer_map
= identity_context_transfer_map
;
913 id_pipe
->base
.transfer_unmap
= identity_context_transfer_unmap
;
914 id_pipe
->base
.transfer_flush_region
= identity_context_transfer_flush_region
;
915 id_pipe
->base
.transfer_inline_write
= identity_context_transfer_inline_write
;
917 id_pipe
->pipe
= pipe
;
919 return &id_pipe
->base
;