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_sample_mask(struct pipe_context *_pipe,
456 unsigned sample_mask)
458 struct identity_context *id_pipe = identity_context(_pipe);
459 struct pipe_context *pipe = id_pipe->pipe;
461 pipe->set_sample_mask(pipe,
466 identity_set_constant_buffer(struct pipe_context *_pipe,
469 struct pipe_resource *_resource)
471 struct identity_context *id_pipe = identity_context(_pipe);
472 struct pipe_context *pipe = id_pipe->pipe;
473 struct pipe_resource *unwrapped_resource;
474 struct pipe_resource *resource = NULL;
476 /* XXX hmm? unwrap the input state */
478 unwrapped_resource = identity_resource_unwrap(_resource);
479 resource = unwrapped_resource;
482 pipe->set_constant_buffer(pipe,
489 identity_set_framebuffer_state(struct pipe_context *_pipe,
490 const struct pipe_framebuffer_state *_state)
492 struct identity_context *id_pipe = identity_context(_pipe);
493 struct pipe_context *pipe = id_pipe->pipe;
494 struct pipe_framebuffer_state unwrapped_state;
495 struct pipe_framebuffer_state *state = NULL;
498 /* unwrap the input state */
500 memcpy(&unwrapped_state, _state, sizeof(unwrapped_state));
501 for(i = 0; i < _state->nr_cbufs; i++)
502 unwrapped_state.cbufs[i] = identity_surface_unwrap(_state->cbufs[i]);
503 for (; i < PIPE_MAX_COLOR_BUFS; i++)
504 unwrapped_state.cbufs[i] = NULL;
505 unwrapped_state.zsbuf = identity_surface_unwrap(_state->zsbuf);
506 state = &unwrapped_state;
509 pipe->set_framebuffer_state(pipe,
514 identity_set_polygon_stipple(struct pipe_context *_pipe,
515 const struct pipe_poly_stipple *poly_stipple)
517 struct identity_context *id_pipe = identity_context(_pipe);
518 struct pipe_context *pipe = id_pipe->pipe;
520 pipe->set_polygon_stipple(pipe,
525 identity_set_scissor_state(struct pipe_context *_pipe,
526 const struct pipe_scissor_state *scissor)
528 struct identity_context *id_pipe = identity_context(_pipe);
529 struct pipe_context *pipe = id_pipe->pipe;
531 pipe->set_scissor_state(pipe,
536 identity_set_viewport_state(struct pipe_context *_pipe,
537 const struct pipe_viewport_state *viewport)
539 struct identity_context *id_pipe = identity_context(_pipe);
540 struct pipe_context *pipe = id_pipe->pipe;
542 pipe->set_viewport_state(pipe,
547 identity_set_fragment_sampler_views(struct pipe_context *_pipe,
549 struct pipe_sampler_view **_views)
551 struct identity_context *id_pipe = identity_context(_pipe);
552 struct pipe_context *pipe = id_pipe->pipe;
553 struct pipe_sampler_view *unwrapped_views[PIPE_MAX_SAMPLERS];
554 struct pipe_sampler_view **views = NULL;
558 for (i = 0; i < num; i++)
559 unwrapped_views[i] = identity_sampler_view_unwrap(_views[i]);
560 for (; i < PIPE_MAX_SAMPLERS; i++)
561 unwrapped_views[i] = NULL;
563 views = unwrapped_views;
566 pipe->set_fragment_sampler_views(pipe, num, views);
570 identity_set_vertex_sampler_views(struct pipe_context *_pipe,
572 struct pipe_sampler_view **_views)
574 struct identity_context *id_pipe = identity_context(_pipe);
575 struct pipe_context *pipe = id_pipe->pipe;
576 struct pipe_sampler_view *unwrapped_views[PIPE_MAX_VERTEX_SAMPLERS];
577 struct pipe_sampler_view **views = NULL;
581 for (i = 0; i < num; i++)
582 unwrapped_views[i] = identity_sampler_view_unwrap(_views[i]);
583 for (; i < PIPE_MAX_VERTEX_SAMPLERS; i++)
584 unwrapped_views[i] = NULL;
586 views = unwrapped_views;
589 pipe->set_vertex_sampler_views(pipe, num, views);
593 identity_set_vertex_buffers(struct pipe_context *_pipe,
594 unsigned num_buffers,
595 const struct pipe_vertex_buffer *_buffers)
597 struct identity_context *id_pipe = identity_context(_pipe);
598 struct pipe_context *pipe = id_pipe->pipe;
599 struct pipe_vertex_buffer unwrapped_buffers[PIPE_MAX_SHADER_INPUTS];
600 struct pipe_vertex_buffer *buffers = NULL;
604 memcpy(unwrapped_buffers, _buffers, num_buffers * sizeof(*_buffers));
605 for (i = 0; i < num_buffers; i++)
606 unwrapped_buffers[i].buffer = identity_resource_unwrap(_buffers[i].buffer);
607 buffers = unwrapped_buffers;
610 pipe->set_vertex_buffers(pipe,
615 identity_resource_copy_region(struct pipe_context *_pipe,
616 struct pipe_resource *_dst,
617 struct pipe_subresource subdst,
621 struct pipe_resource *_src,
622 struct pipe_subresource subsrc,
629 struct identity_context *id_pipe = identity_context(_pipe);
630 struct identity_resource *id_resource_dst = identity_resource(_dst);
631 struct identity_resource *id_resource_src = identity_resource(_src);
632 struct pipe_context *pipe = id_pipe->pipe;
633 struct pipe_resource *dst = id_resource_dst->resource;
634 struct pipe_resource *src = id_resource_src->resource;
636 pipe->resource_copy_region(pipe,
652 identity_resource_fill_region(struct pipe_context *_pipe,
653 struct pipe_resource *_dst,
654 struct pipe_subresource subdst,
662 struct identity_context *id_pipe = identity_context(_pipe);
663 struct identity_resource *id_resource_dst = identity_resource(_dst);
664 struct pipe_context *pipe = id_pipe->pipe;
665 struct pipe_resource *dst = id_resource_dst->resource;
667 pipe->resource_fill_region(pipe,
679 identity_clear(struct pipe_context *_pipe,
685 struct identity_context *id_pipe = identity_context(_pipe);
686 struct pipe_context *pipe = id_pipe->pipe;
696 identity_flush(struct pipe_context *_pipe,
698 struct pipe_fence_handle **fence)
700 struct identity_context *id_pipe = identity_context(_pipe);
701 struct pipe_context *pipe = id_pipe->pipe;
709 identity_is_resource_referenced(struct pipe_context *_pipe,
710 struct pipe_resource *_resource,
714 struct identity_context *id_pipe = identity_context(_pipe);
715 struct identity_resource *id_resource = identity_resource(_resource);
716 struct pipe_context *pipe = id_pipe->pipe;
717 struct pipe_resource *resource = id_resource->resource;
719 return pipe->is_resource_referenced(pipe,
725 static struct pipe_sampler_view *
726 identity_context_create_sampler_view(struct pipe_context *_pipe,
727 struct pipe_resource *_resource,
728 const struct pipe_sampler_view *templ)
730 struct identity_context *id_context = identity_context(_pipe);
731 struct identity_resource *id_resource = identity_resource(_resource);
732 struct pipe_context *pipe = id_context->pipe;
733 struct pipe_resource *resource = id_resource->resource;
734 struct pipe_sampler_view *result;
736 result = pipe->create_sampler_view(pipe,
741 return identity_sampler_view_create(id_context, id_resource, result);
746 identity_context_sampler_view_destroy(struct pipe_context *_pipe,
747 struct pipe_sampler_view *_view)
749 identity_sampler_view_destroy(identity_context(_pipe),
750 identity_sampler_view(_view));
753 static struct pipe_transfer *
754 identity_context_get_transfer(struct pipe_context *_context,
755 struct pipe_resource *_resource,
756 struct pipe_subresource sr,
758 const struct pipe_box *box)
760 struct identity_context *id_context = identity_context(_context);
761 struct identity_resource *id_resource = identity_resource(_resource);
762 struct pipe_context *context = id_context->pipe;
763 struct pipe_resource *resource = id_resource->resource;
764 struct pipe_transfer *result;
766 result = context->get_transfer(context,
773 return identity_transfer_create(id_context, id_resource, result);
778 identity_context_transfer_destroy(struct pipe_context *_pipe,
779 struct pipe_transfer *_transfer)
781 identity_transfer_destroy(identity_context(_pipe),
782 identity_transfer(_transfer));
786 identity_context_transfer_map(struct pipe_context *_context,
787 struct pipe_transfer *_transfer)
789 struct identity_context *id_context = identity_context(_context);
790 struct identity_transfer *id_transfer = identity_transfer(_transfer);
791 struct pipe_context *context = id_context->pipe;
792 struct pipe_transfer *transfer = id_transfer->transfer;
794 return context->transfer_map(context,
801 identity_context_transfer_flush_region(struct pipe_context *_context,
802 struct pipe_transfer *_transfer,
803 const struct pipe_box *box)
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_flush_region(context,
817 identity_context_transfer_unmap(struct pipe_context *_context,
818 struct pipe_transfer *_transfer)
820 struct identity_context *id_context = identity_context(_context);
821 struct identity_transfer *id_transfer = identity_transfer(_transfer);
822 struct pipe_context *context = id_context->pipe;
823 struct pipe_transfer *transfer = id_transfer->transfer;
825 context->transfer_unmap(context,
831 identity_context_transfer_inline_write(struct pipe_context *_context,
832 struct pipe_resource *_resource,
833 struct pipe_subresource sr,
835 const struct pipe_box *box,
838 unsigned slice_stride)
840 struct identity_context *id_context = identity_context(_context);
841 struct identity_resource *id_resource = identity_resource(_resource);
842 struct pipe_context *context = id_context->pipe;
843 struct pipe_resource *resource = id_resource->resource;
845 context->transfer_inline_write(context,
856 struct pipe_context *
857 identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
859 struct identity_context *id_pipe;
860 (void)identity_screen(_screen);
862 id_pipe = CALLOC_STRUCT(identity_context);
867 id_pipe->base.winsys = NULL;
868 id_pipe->base.screen = _screen;
869 id_pipe->base.priv = pipe->priv; /* expose wrapped data */
870 id_pipe->base.draw = NULL;
872 id_pipe->base.destroy = identity_destroy;
873 id_pipe->base.draw_arrays = identity_draw_arrays;
874 id_pipe->base.draw_elements = identity_draw_elements;
875 id_pipe->base.draw_range_elements = identity_draw_range_elements;
876 id_pipe->base.create_query = identity_create_query;
877 id_pipe->base.destroy_query = identity_destroy_query;
878 id_pipe->base.begin_query = identity_begin_query;
879 id_pipe->base.end_query = identity_end_query;
880 id_pipe->base.get_query_result = identity_get_query_result;
881 id_pipe->base.create_blend_state = identity_create_blend_state;
882 id_pipe->base.bind_blend_state = identity_bind_blend_state;
883 id_pipe->base.delete_blend_state = identity_delete_blend_state;
884 id_pipe->base.create_sampler_state = identity_create_sampler_state;
885 id_pipe->base.bind_fragment_sampler_states = identity_bind_fragment_sampler_states;
886 id_pipe->base.bind_vertex_sampler_states = identity_bind_vertex_sampler_states;
887 id_pipe->base.delete_sampler_state = identity_delete_sampler_state;
888 id_pipe->base.create_rasterizer_state = identity_create_rasterizer_state;
889 id_pipe->base.bind_rasterizer_state = identity_bind_rasterizer_state;
890 id_pipe->base.delete_rasterizer_state = identity_delete_rasterizer_state;
891 id_pipe->base.create_depth_stencil_alpha_state = identity_create_depth_stencil_alpha_state;
892 id_pipe->base.bind_depth_stencil_alpha_state = identity_bind_depth_stencil_alpha_state;
893 id_pipe->base.delete_depth_stencil_alpha_state = identity_delete_depth_stencil_alpha_state;
894 id_pipe->base.create_fs_state = identity_create_fs_state;
895 id_pipe->base.bind_fs_state = identity_bind_fs_state;
896 id_pipe->base.delete_fs_state = identity_delete_fs_state;
897 id_pipe->base.create_vs_state = identity_create_vs_state;
898 id_pipe->base.bind_vs_state = identity_bind_vs_state;
899 id_pipe->base.delete_vs_state = identity_delete_vs_state;
900 id_pipe->base.create_vertex_elements_state = identity_create_vertex_elements_state;
901 id_pipe->base.bind_vertex_elements_state = identity_bind_vertex_elements_state;
902 id_pipe->base.delete_vertex_elements_state = identity_delete_vertex_elements_state;
903 id_pipe->base.set_blend_color = identity_set_blend_color;
904 id_pipe->base.set_stencil_ref = identity_set_stencil_ref;
905 id_pipe->base.set_clip_state = identity_set_clip_state;
906 id_pipe->base.set_sample_mask = identity_set_sample_mask;
907 id_pipe->base.set_constant_buffer = identity_set_constant_buffer;
908 id_pipe->base.set_framebuffer_state = identity_set_framebuffer_state;
909 id_pipe->base.set_polygon_stipple = identity_set_polygon_stipple;
910 id_pipe->base.set_scissor_state = identity_set_scissor_state;
911 id_pipe->base.set_viewport_state = identity_set_viewport_state;
912 id_pipe->base.set_fragment_sampler_views = identity_set_fragment_sampler_views;
913 id_pipe->base.set_vertex_sampler_views = identity_set_vertex_sampler_views;
914 id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers;
915 id_pipe->base.resource_copy_region = identity_resource_copy_region;
916 id_pipe->base.resource_fill_region = identity_resource_fill_region;
917 id_pipe->base.clear = identity_clear;
918 id_pipe->base.flush = identity_flush;
919 id_pipe->base.is_resource_referenced = identity_is_resource_referenced;
920 id_pipe->base.create_sampler_view = identity_context_create_sampler_view;
921 id_pipe->base.sampler_view_destroy = identity_context_sampler_view_destroy;
922 id_pipe->base.get_transfer = identity_context_get_transfer;
923 id_pipe->base.transfer_destroy = identity_context_transfer_destroy;
924 id_pipe->base.transfer_map = identity_context_transfer_map;
925 id_pipe->base.transfer_unmap = identity_context_transfer_unmap;
926 id_pipe->base.transfer_flush_region = identity_context_transfer_flush_region;
927 id_pipe->base.transfer_inline_write = identity_context_transfer_inline_write;
929 id_pipe->pipe = pipe;
931 return &id_pipe->base;