nv30: fix typo
[mesa.git] / src / gallium / drivers / identity / id_context.c
1 /**************************************************************************
2 *
3 * Copyright 2009 VMware, Inc.
4 * All Rights Reserved.
5 *
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:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
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.
25 *
26 **************************************************************************/
27
28
29 #include "pipe/p_context.h"
30 #include "util/u_memory.h"
31
32 #include "id_context.h"
33 #include "id_objects.h"
34
35
36 static void
37 identity_destroy(struct pipe_context *_pipe)
38 {
39 struct identity_context *id_pipe = identity_context(_pipe);
40 struct pipe_context *pipe = id_pipe->pipe;
41
42 pipe->destroy(pipe);
43
44 free(id_pipe);
45 }
46
47 static void
48 identity_draw_arrays(struct pipe_context *_pipe,
49 unsigned prim,
50 unsigned start,
51 unsigned count)
52 {
53 struct identity_context *id_pipe = identity_context(_pipe);
54 struct pipe_context *pipe = id_pipe->pipe;
55
56 pipe->draw_arrays(pipe,
57 prim,
58 start,
59 count);
60 }
61
62 static void
63 identity_draw_elements(struct pipe_context *_pipe,
64 struct pipe_buffer *_indexBuffer,
65 unsigned indexSize,
66 unsigned prim,
67 unsigned start,
68 unsigned count)
69 {
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;
74
75 pipe->draw_elements(pipe,
76 indexBuffer,
77 indexSize,
78 prim,
79 start,
80 count);
81 }
82
83 static void
84 identity_draw_range_elements(struct pipe_context *_pipe,
85 struct pipe_buffer *_indexBuffer,
86 unsigned indexSize,
87 unsigned minIndex,
88 unsigned maxIndex,
89 unsigned mode,
90 unsigned start,
91 unsigned count)
92 {
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;
97
98 pipe->draw_range_elements(pipe,
99 indexBuffer,
100 indexSize,
101 minIndex,
102 maxIndex,
103 mode,
104 start,
105 count);
106 }
107
108 static struct pipe_query *
109 identity_create_query(struct pipe_context *_pipe,
110 unsigned query_type)
111 {
112 struct identity_context *id_pipe = identity_context(_pipe);
113 struct pipe_context *pipe = id_pipe->pipe;
114
115 return pipe->create_query(pipe,
116 query_type);
117 }
118
119 static void
120 identity_destroy_query(struct pipe_context *_pipe,
121 struct pipe_query *query)
122 {
123 struct identity_context *id_pipe = identity_context(_pipe);
124 struct pipe_context *pipe = id_pipe->pipe;
125
126 pipe->destroy_query(pipe,
127 query);
128 }
129
130 static void
131 identity_begin_query(struct pipe_context *_pipe,
132 struct pipe_query *query)
133 {
134 struct identity_context *id_pipe = identity_context(_pipe);
135 struct pipe_context *pipe = id_pipe->pipe;
136
137 pipe->begin_query(pipe,
138 query);
139 }
140
141 static void
142 identity_end_query(struct pipe_context *_pipe,
143 struct pipe_query *query)
144 {
145 struct identity_context *id_pipe = identity_context(_pipe);
146 struct pipe_context *pipe = id_pipe->pipe;
147
148 pipe->end_query(pipe,
149 query);
150 }
151
152 static boolean
153 identity_get_query_result(struct pipe_context *_pipe,
154 struct pipe_query *query,
155 boolean wait,
156 uint64_t *result)
157 {
158 struct identity_context *id_pipe = identity_context(_pipe);
159 struct pipe_context *pipe = id_pipe->pipe;
160
161 return pipe->get_query_result(pipe,
162 query,
163 wait,
164 result);
165 }
166
167 static void *
168 identity_create_blend_state(struct pipe_context *_pipe,
169 const struct pipe_blend_state *blend)
170 {
171 struct identity_context *id_pipe = identity_context(_pipe);
172 struct pipe_context *pipe = id_pipe->pipe;
173
174 return pipe->create_blend_state(pipe,
175 blend);
176 }
177
178 static void
179 identity_bind_blend_state(struct pipe_context *_pipe,
180 void *blend)
181 {
182 struct identity_context *id_pipe = identity_context(_pipe);
183 struct pipe_context *pipe = id_pipe->pipe;
184
185 pipe->bind_blend_state(pipe,
186 blend);
187 }
188
189 static void
190 identity_delete_blend_state(struct pipe_context *_pipe,
191 void *blend)
192 {
193 struct identity_context *id_pipe = identity_context(_pipe);
194 struct pipe_context *pipe = id_pipe->pipe;
195
196 pipe->delete_blend_state(pipe,
197 blend);
198 }
199
200 static void *
201 identity_create_sampler_state(struct pipe_context *_pipe,
202 const struct pipe_sampler_state *sampler)
203 {
204 struct identity_context *id_pipe = identity_context(_pipe);
205 struct pipe_context *pipe = id_pipe->pipe;
206
207 return pipe->create_sampler_state(pipe,
208 sampler);
209 }
210
211 static void
212 identity_bind_fragment_sampler_states(struct pipe_context *_pipe,
213 unsigned num_samplers,
214 void **samplers)
215 {
216 struct identity_context *id_pipe = identity_context(_pipe);
217 struct pipe_context *pipe = id_pipe->pipe;
218
219 pipe->bind_fragment_sampler_states(pipe,
220 num_samplers,
221 samplers);
222 }
223
224 static void
225 identity_bind_vertex_sampler_states(struct pipe_context *_pipe,
226 unsigned num_samplers,
227 void **samplers)
228 {
229 struct identity_context *id_pipe = identity_context(_pipe);
230 struct pipe_context *pipe = id_pipe->pipe;
231
232 pipe->bind_vertex_sampler_states(pipe,
233 num_samplers,
234 samplers);
235 }
236
237 static void
238 identity_delete_sampler_state(struct pipe_context *_pipe,
239 void *sampler)
240 {
241 struct identity_context *id_pipe = identity_context(_pipe);
242 struct pipe_context *pipe = id_pipe->pipe;
243
244 pipe->delete_sampler_state(pipe,
245 sampler);
246 }
247
248 static void *
249 identity_create_rasterizer_state(struct pipe_context *_pipe,
250 const struct pipe_rasterizer_state *rasterizer)
251 {
252 struct identity_context *id_pipe = identity_context(_pipe);
253 struct pipe_context *pipe = id_pipe->pipe;
254
255 return pipe->create_rasterizer_state(pipe,
256 rasterizer);
257 }
258
259 static void
260 identity_bind_rasterizer_state(struct pipe_context *_pipe,
261 void *rasterizer)
262 {
263 struct identity_context *id_pipe = identity_context(_pipe);
264 struct pipe_context *pipe = id_pipe->pipe;
265
266 pipe->bind_rasterizer_state(pipe,
267 rasterizer);
268 }
269
270 static void
271 identity_delete_rasterizer_state(struct pipe_context *_pipe,
272 void *rasterizer)
273 {
274 struct identity_context *id_pipe = identity_context(_pipe);
275 struct pipe_context *pipe = id_pipe->pipe;
276
277 pipe->delete_rasterizer_state(pipe,
278 rasterizer);
279 }
280
281 static void *
282 identity_create_depth_stencil_alpha_state(struct pipe_context *_pipe,
283 const struct pipe_depth_stencil_alpha_state *depth_stencil_alpha)
284 {
285 struct identity_context *id_pipe = identity_context(_pipe);
286 struct pipe_context *pipe = id_pipe->pipe;
287
288 return pipe->create_depth_stencil_alpha_state(pipe,
289 depth_stencil_alpha);
290 }
291
292 static void
293 identity_bind_depth_stencil_alpha_state(struct pipe_context *_pipe,
294 void *depth_stencil_alpha)
295 {
296 struct identity_context *id_pipe = identity_context(_pipe);
297 struct pipe_context *pipe = id_pipe->pipe;
298
299 pipe->bind_depth_stencil_alpha_state(pipe,
300 depth_stencil_alpha);
301 }
302
303 static void
304 identity_delete_depth_stencil_alpha_state(struct pipe_context *_pipe,
305 void *depth_stencil_alpha)
306 {
307 struct identity_context *id_pipe = identity_context(_pipe);
308 struct pipe_context *pipe = id_pipe->pipe;
309
310 pipe->delete_depth_stencil_alpha_state(pipe,
311 depth_stencil_alpha);
312 }
313
314 static void *
315 identity_create_fs_state(struct pipe_context *_pipe,
316 const struct pipe_shader_state *fs)
317 {
318 struct identity_context *id_pipe = identity_context(_pipe);
319 struct pipe_context *pipe = id_pipe->pipe;
320
321 return pipe->create_fs_state(pipe,
322 fs);
323 }
324
325 static void
326 identity_bind_fs_state(struct pipe_context *_pipe,
327 void *fs)
328 {
329 struct identity_context *id_pipe = identity_context(_pipe);
330 struct pipe_context *pipe = id_pipe->pipe;
331
332 pipe->bind_fs_state(pipe,
333 fs);
334 }
335
336 static void
337 identity_delete_fs_state(struct pipe_context *_pipe,
338 void *fs)
339 {
340 struct identity_context *id_pipe = identity_context(_pipe);
341 struct pipe_context *pipe = id_pipe->pipe;
342
343 pipe->delete_fs_state(pipe,
344 fs);
345 }
346
347 static void *
348 identity_create_vs_state(struct pipe_context *_pipe,
349 const struct pipe_shader_state *vs)
350 {
351 struct identity_context *id_pipe = identity_context(_pipe);
352 struct pipe_context *pipe = id_pipe->pipe;
353
354 return pipe->create_vs_state(pipe,
355 vs);
356 }
357
358 static void
359 identity_bind_vs_state(struct pipe_context *_pipe,
360 void *vs)
361 {
362 struct identity_context *id_pipe = identity_context(_pipe);
363 struct pipe_context *pipe = id_pipe->pipe;
364
365 pipe->bind_vs_state(pipe,
366 vs);
367 }
368
369 static void
370 identity_delete_vs_state(struct pipe_context *_pipe,
371 void *vs)
372 {
373 struct identity_context *id_pipe = identity_context(_pipe);
374 struct pipe_context *pipe = id_pipe->pipe;
375
376 pipe->delete_vs_state(pipe,
377 vs);
378 }
379
380 static void
381 identity_set_blend_color(struct pipe_context *_pipe,
382 const struct pipe_blend_color *blend_color)
383 {
384 struct identity_context *id_pipe = identity_context(_pipe);
385 struct pipe_context *pipe = id_pipe->pipe;
386
387 pipe->set_blend_color(pipe,
388 blend_color);
389 }
390
391 static void
392 identity_set_stencil_ref(struct pipe_context *_pipe,
393 const struct pipe_stencil_ref *stencil_ref)
394 {
395 struct identity_context *id_pipe = identity_context(_pipe);
396 struct pipe_context *pipe = id_pipe->pipe;
397
398 pipe->set_stencil_ref(pipe,
399 stencil_ref);
400 }
401
402 static void
403 identity_set_clip_state(struct pipe_context *_pipe,
404 const struct pipe_clip_state *clip)
405 {
406 struct identity_context *id_pipe = identity_context(_pipe);
407 struct pipe_context *pipe = id_pipe->pipe;
408
409 pipe->set_clip_state(pipe,
410 clip);
411 }
412
413 static void
414 identity_set_constant_buffer(struct pipe_context *_pipe,
415 uint shader,
416 uint index,
417 struct pipe_buffer *_buffer)
418 {
419 struct identity_context *id_pipe = identity_context(_pipe);
420 struct pipe_context *pipe = id_pipe->pipe;
421 struct pipe_buffer *unwrapped_buffer;
422 struct pipe_buffer *buffer = NULL;
423
424 /* XXX hmm? unwrap the input state */
425 if (_buffer) {
426 unwrapped_buffer = identity_buffer_unwrap(_buffer);
427 buffer = unwrapped_buffer;
428 }
429
430 pipe->set_constant_buffer(pipe,
431 shader,
432 index,
433 buffer);
434 }
435
436 static void
437 identity_set_framebuffer_state(struct pipe_context *_pipe,
438 const struct pipe_framebuffer_state *_state)
439 {
440 struct identity_context *id_pipe = identity_context(_pipe);
441 struct pipe_context *pipe = id_pipe->pipe;
442 struct pipe_framebuffer_state unwrapped_state;
443 struct pipe_framebuffer_state *state = NULL;
444 unsigned i;
445
446 /* unwrap the input state */
447 if (_state) {
448 memcpy(&unwrapped_state, _state, sizeof(unwrapped_state));
449 for(i = 0; i < _state->nr_cbufs; i++)
450 unwrapped_state.cbufs[i] = identity_surface_unwrap(_state->cbufs[i]);
451 for (; i < PIPE_MAX_COLOR_BUFS; i++)
452 unwrapped_state.cbufs[i] = NULL;
453 unwrapped_state.zsbuf = identity_surface_unwrap(_state->zsbuf);
454 state = &unwrapped_state;
455 }
456
457 pipe->set_framebuffer_state(pipe,
458 state);
459 }
460
461 static void
462 identity_set_polygon_stipple(struct pipe_context *_pipe,
463 const struct pipe_poly_stipple *poly_stipple)
464 {
465 struct identity_context *id_pipe = identity_context(_pipe);
466 struct pipe_context *pipe = id_pipe->pipe;
467
468 pipe->set_polygon_stipple(pipe,
469 poly_stipple);
470 }
471
472 static void
473 identity_set_scissor_state(struct pipe_context *_pipe,
474 const struct pipe_scissor_state *scissor)
475 {
476 struct identity_context *id_pipe = identity_context(_pipe);
477 struct pipe_context *pipe = id_pipe->pipe;
478
479 pipe->set_scissor_state(pipe,
480 scissor);
481 }
482
483 static void
484 identity_set_viewport_state(struct pipe_context *_pipe,
485 const struct pipe_viewport_state *viewport)
486 {
487 struct identity_context *id_pipe = identity_context(_pipe);
488 struct pipe_context *pipe = id_pipe->pipe;
489
490 pipe->set_viewport_state(pipe,
491 viewport);
492 }
493
494 static void
495 identity_set_fragment_sampler_textures(struct pipe_context *_pipe,
496 unsigned num_textures,
497 struct pipe_texture **_textures)
498 {
499 struct identity_context *id_pipe = identity_context(_pipe);
500 struct pipe_context *pipe = id_pipe->pipe;
501 struct pipe_texture *unwrapped_textures[PIPE_MAX_SAMPLERS];
502 struct pipe_texture **textures = NULL;
503 unsigned i;
504
505 if (_textures) {
506 for (i = 0; i < num_textures; i++)
507 unwrapped_textures[i] = identity_texture_unwrap(_textures[i]);
508 for (; i < PIPE_MAX_SAMPLERS; i++)
509 unwrapped_textures[i] = NULL;
510
511 textures = unwrapped_textures;
512 }
513
514 pipe->set_fragment_sampler_textures(pipe,
515 num_textures,
516 textures);
517 }
518
519 static void
520 identity_set_vertex_sampler_textures(struct pipe_context *_pipe,
521 unsigned num_textures,
522 struct pipe_texture **_textures)
523 {
524 struct identity_context *id_pipe = identity_context(_pipe);
525 struct pipe_context *pipe = id_pipe->pipe;
526 struct pipe_texture *unwrapped_textures[PIPE_MAX_VERTEX_SAMPLERS];
527 struct pipe_texture **textures = NULL;
528 unsigned i;
529
530 if (_textures) {
531 for (i = 0; i < num_textures; i++)
532 unwrapped_textures[i] = identity_texture_unwrap(_textures[i]);
533 for (; i < PIPE_MAX_VERTEX_SAMPLERS; i++)
534 unwrapped_textures[i] = NULL;
535
536 textures = unwrapped_textures;
537 }
538
539 pipe->set_vertex_sampler_textures(pipe,
540 num_textures,
541 textures);
542 }
543
544 static void
545 identity_set_vertex_buffers(struct pipe_context *_pipe,
546 unsigned num_buffers,
547 const struct pipe_vertex_buffer *_buffers)
548 {
549 struct identity_context *id_pipe = identity_context(_pipe);
550 struct pipe_context *pipe = id_pipe->pipe;
551 struct pipe_vertex_buffer unwrapped_buffers[PIPE_MAX_SHADER_INPUTS];
552 struct pipe_vertex_buffer *buffers = NULL;
553 unsigned i;
554
555 if (num_buffers) {
556 memcpy(unwrapped_buffers, _buffers, num_buffers * sizeof(*_buffers));
557 for (i = 0; i < num_buffers; i++)
558 unwrapped_buffers[i].buffer = identity_buffer_unwrap(_buffers[i].buffer);
559 buffers = unwrapped_buffers;
560 }
561
562 pipe->set_vertex_buffers(pipe,
563 num_buffers,
564 buffers);
565 }
566
567 static void
568 identity_set_vertex_elements(struct pipe_context *_pipe,
569 unsigned num_elements,
570 const struct pipe_vertex_element *vertex_elements)
571 {
572 struct identity_context *id_pipe = identity_context(_pipe);
573 struct pipe_context *pipe = id_pipe->pipe;
574
575 pipe->set_vertex_elements(pipe,
576 num_elements,
577 vertex_elements);
578 }
579
580 static void
581 identity_surface_copy(struct pipe_context *_pipe,
582 struct pipe_surface *_dst,
583 unsigned dstx,
584 unsigned dsty,
585 struct pipe_surface *_src,
586 unsigned srcx,
587 unsigned srcy,
588 unsigned width,
589 unsigned height)
590 {
591 struct identity_context *id_pipe = identity_context(_pipe);
592 struct identity_surface *id_surface_dst = identity_surface(_dst);
593 struct identity_surface *id_surface_src = identity_surface(_src);
594 struct pipe_context *pipe = id_pipe->pipe;
595 struct pipe_surface *dst = id_surface_dst->surface;
596 struct pipe_surface *src = id_surface_src->surface;
597
598 pipe->surface_copy(pipe,
599 dst,
600 dstx,
601 dsty,
602 src,
603 srcx,
604 srcy,
605 width,
606 height);
607 }
608
609 static void
610 identity_surface_fill(struct pipe_context *_pipe,
611 struct pipe_surface *_dst,
612 unsigned dstx,
613 unsigned dsty,
614 unsigned width,
615 unsigned height,
616 unsigned value)
617 {
618 struct identity_context *id_pipe = identity_context(_pipe);
619 struct identity_surface *id_surface_dst = identity_surface(_dst);
620 struct pipe_context *pipe = id_pipe->pipe;
621 struct pipe_surface *dst = id_surface_dst->surface;
622
623 pipe->surface_fill(pipe,
624 dst,
625 dstx,
626 dsty,
627 width,
628 height,
629 value);
630 }
631
632 static void
633 identity_clear(struct pipe_context *_pipe,
634 unsigned buffers,
635 const float *rgba,
636 double depth,
637 unsigned stencil)
638 {
639 struct identity_context *id_pipe = identity_context(_pipe);
640 struct pipe_context *pipe = id_pipe->pipe;
641
642 pipe->clear(pipe,
643 buffers,
644 rgba,
645 depth,
646 stencil);
647 }
648
649 static void
650 identity_flush(struct pipe_context *_pipe,
651 unsigned flags,
652 struct pipe_fence_handle **fence)
653 {
654 struct identity_context *id_pipe = identity_context(_pipe);
655 struct pipe_context *pipe = id_pipe->pipe;
656
657 pipe->flush(pipe,
658 flags,
659 fence);
660 }
661
662 static unsigned int
663 identity_is_texture_referenced(struct pipe_context *_pipe,
664 struct pipe_texture *_texture,
665 unsigned face,
666 unsigned level)
667 {
668 struct identity_context *id_pipe = identity_context(_pipe);
669 struct identity_texture *id_texture = identity_texture(_texture);
670 struct pipe_context *pipe = id_pipe->pipe;
671 struct pipe_texture *texture = id_texture->texture;
672
673 return pipe->is_texture_referenced(pipe,
674 texture,
675 face,
676 level);
677 }
678
679 static unsigned int
680 identity_is_buffer_referenced(struct pipe_context *_pipe,
681 struct pipe_buffer *_buffer)
682 {
683 struct identity_context *id_pipe = identity_context(_pipe);
684 struct identity_buffer *id_buffer = identity_buffer(_buffer);
685 struct pipe_context *pipe = id_pipe->pipe;
686 struct pipe_buffer *buffer = id_buffer->buffer;
687
688 return pipe->is_buffer_referenced(pipe,
689 buffer);
690 }
691
692 struct pipe_context *
693 identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe)
694 {
695 struct identity_context *id_pipe;
696 (void)identity_screen(_screen);
697
698 id_pipe = CALLOC_STRUCT(identity_context);
699 if (!id_pipe) {
700 return NULL;
701 }
702
703 id_pipe->base.winsys = NULL;
704 id_pipe->base.screen = _screen;
705 id_pipe->base.priv = pipe->priv; /* expose wrapped data */
706 id_pipe->base.draw = NULL;
707
708 id_pipe->base.destroy = identity_destroy;
709 id_pipe->base.draw_arrays = identity_draw_arrays;
710 id_pipe->base.draw_elements = identity_draw_elements;
711 id_pipe->base.draw_range_elements = identity_draw_range_elements;
712 id_pipe->base.create_query = identity_create_query;
713 id_pipe->base.destroy_query = identity_destroy_query;
714 id_pipe->base.begin_query = identity_begin_query;
715 id_pipe->base.end_query = identity_end_query;
716 id_pipe->base.get_query_result = identity_get_query_result;
717 id_pipe->base.create_blend_state = identity_create_blend_state;
718 id_pipe->base.bind_blend_state = identity_bind_blend_state;
719 id_pipe->base.delete_blend_state = identity_delete_blend_state;
720 id_pipe->base.create_sampler_state = identity_create_sampler_state;
721 id_pipe->base.bind_fragment_sampler_states = identity_bind_fragment_sampler_states;
722 id_pipe->base.bind_vertex_sampler_states = identity_bind_vertex_sampler_states;
723 id_pipe->base.delete_sampler_state = identity_delete_sampler_state;
724 id_pipe->base.create_rasterizer_state = identity_create_rasterizer_state;
725 id_pipe->base.bind_rasterizer_state = identity_bind_rasterizer_state;
726 id_pipe->base.delete_rasterizer_state = identity_delete_rasterizer_state;
727 id_pipe->base.create_depth_stencil_alpha_state = identity_create_depth_stencil_alpha_state;
728 id_pipe->base.bind_depth_stencil_alpha_state = identity_bind_depth_stencil_alpha_state;
729 id_pipe->base.delete_depth_stencil_alpha_state = identity_delete_depth_stencil_alpha_state;
730 id_pipe->base.create_fs_state = identity_create_fs_state;
731 id_pipe->base.bind_fs_state = identity_bind_fs_state;
732 id_pipe->base.delete_fs_state = identity_delete_fs_state;
733 id_pipe->base.create_vs_state = identity_create_vs_state;
734 id_pipe->base.bind_vs_state = identity_bind_vs_state;
735 id_pipe->base.delete_vs_state = identity_delete_vs_state;
736 id_pipe->base.set_blend_color = identity_set_blend_color;
737 id_pipe->base.set_stencil_ref = identity_set_stencil_ref;
738 id_pipe->base.set_clip_state = identity_set_clip_state;
739 id_pipe->base.set_constant_buffer = identity_set_constant_buffer;
740 id_pipe->base.set_framebuffer_state = identity_set_framebuffer_state;
741 id_pipe->base.set_polygon_stipple = identity_set_polygon_stipple;
742 id_pipe->base.set_scissor_state = identity_set_scissor_state;
743 id_pipe->base.set_viewport_state = identity_set_viewport_state;
744 id_pipe->base.set_fragment_sampler_textures = identity_set_fragment_sampler_textures;
745 id_pipe->base.set_vertex_sampler_textures = identity_set_vertex_sampler_textures;
746 id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers;
747 id_pipe->base.set_vertex_elements = identity_set_vertex_elements;
748 id_pipe->base.surface_copy = identity_surface_copy;
749 id_pipe->base.surface_fill = identity_surface_fill;
750 id_pipe->base.clear = identity_clear;
751 id_pipe->base.flush = identity_flush;
752 id_pipe->base.is_texture_referenced = identity_is_texture_referenced;
753 id_pipe->base.is_buffer_referenced = identity_is_buffer_referenced;
754
755 id_pipe->pipe = pipe;
756
757 return &id_pipe->base;
758 }