Merge branch '7.8'
[mesa.git] / src / gallium / drivers / failover / fo_state.c
1 /**************************************************************************
2 *
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
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 TUNGSTEN GRAPHICS 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 /* Authors: Keith Whitwell <keith@tungstengraphics.com>
29 */
30
31 #include "util/u_inlines.h"
32 #include "util/u_memory.h"
33
34 #include "fo_context.h"
35
36
37 /* This looks like a lot of work at the moment - we're keeping a
38 * duplicate copy of the state up-to-date.
39 *
40 * This can change in two ways:
41 * - With constant state objects we would only need to save a pointer,
42 * not the whole object.
43 * - By adding a callback in the state tracker to re-emit state. The
44 * state tracker knows the current state already and can re-emit it
45 * without additional complexity.
46 *
47 * This works as a proof-of-concept, but a final version will have
48 * lower overheads.
49 */
50
51
52
53 static void *
54 failover_create_blend_state( struct pipe_context *pipe,
55 const struct pipe_blend_state *blend )
56 {
57 struct fo_state *state = MALLOC(sizeof(struct fo_state));
58 struct failover_context *failover = failover_context(pipe);
59
60 state->sw_state = failover->sw->create_blend_state(failover->sw, blend);
61 state->hw_state = failover->hw->create_blend_state(failover->hw, blend);
62
63 return state;
64 }
65
66 static void
67 failover_bind_blend_state( struct pipe_context *pipe,
68 void *blend )
69 {
70 struct failover_context *failover = failover_context(pipe);
71 struct fo_state *state = (struct fo_state *)blend;
72 failover->blend = state;
73 failover->dirty |= FO_NEW_BLEND;
74 failover->sw->bind_blend_state( failover->sw, state->sw_state );
75 failover->hw->bind_blend_state( failover->hw, state->hw_state );
76 }
77
78 static void
79 failover_delete_blend_state( struct pipe_context *pipe,
80 void *blend )
81 {
82 struct fo_state *state = (struct fo_state*)blend;
83 struct failover_context *failover = failover_context(pipe);
84
85 failover->sw->delete_blend_state(failover->sw, state->sw_state);
86 failover->hw->delete_blend_state(failover->hw, state->hw_state);
87 state->sw_state = 0;
88 state->hw_state = 0;
89 FREE(state);
90 }
91
92 static void
93 failover_set_blend_color( struct pipe_context *pipe,
94 const struct pipe_blend_color *blend_color )
95 {
96 struct failover_context *failover = failover_context(pipe);
97
98 failover->blend_color = *blend_color;
99 failover->dirty |= FO_NEW_BLEND_COLOR;
100 failover->sw->set_blend_color( failover->sw, blend_color );
101 failover->hw->set_blend_color( failover->hw, blend_color );
102 }
103
104 static void
105 failover_set_stencil_ref( struct pipe_context *pipe,
106 const struct pipe_stencil_ref *stencil_ref )
107 {
108 struct failover_context *failover = failover_context(pipe);
109
110 failover->stencil_ref = *stencil_ref;
111 failover->dirty |= FO_NEW_STENCIL_REF;
112 failover->sw->set_stencil_ref( failover->sw, stencil_ref );
113 failover->hw->set_stencil_ref( failover->hw, stencil_ref );
114 }
115
116 static void
117 failover_set_clip_state( struct pipe_context *pipe,
118 const struct pipe_clip_state *clip )
119 {
120 struct failover_context *failover = failover_context(pipe);
121
122 failover->clip = *clip;
123 failover->dirty |= FO_NEW_CLIP;
124 failover->sw->set_clip_state( failover->sw, clip );
125 failover->hw->set_clip_state( failover->hw, clip );
126 }
127
128
129 static void *
130 failover_create_depth_stencil_state(struct pipe_context *pipe,
131 const struct pipe_depth_stencil_alpha_state *templ)
132 {
133 struct fo_state *state = MALLOC(sizeof(struct fo_state));
134 struct failover_context *failover = failover_context(pipe);
135
136 state->sw_state = failover->sw->create_depth_stencil_alpha_state(failover->sw, templ);
137 state->hw_state = failover->hw->create_depth_stencil_alpha_state(failover->hw, templ);
138
139 return state;
140 }
141
142 static void
143 failover_bind_depth_stencil_state(struct pipe_context *pipe,
144 void *depth_stencil)
145 {
146 struct failover_context *failover = failover_context(pipe);
147 struct fo_state *state = (struct fo_state *)depth_stencil;
148 failover->depth_stencil = state;
149 failover->dirty |= FO_NEW_DEPTH_STENCIL;
150 failover->sw->bind_depth_stencil_alpha_state(failover->sw, state->sw_state);
151 failover->hw->bind_depth_stencil_alpha_state(failover->hw, state->hw_state);
152 }
153
154 static void
155 failover_delete_depth_stencil_state(struct pipe_context *pipe,
156 void *ds)
157 {
158 struct fo_state *state = (struct fo_state*)ds;
159 struct failover_context *failover = failover_context(pipe);
160
161 failover->sw->delete_depth_stencil_alpha_state(failover->sw, state->sw_state);
162 failover->hw->delete_depth_stencil_alpha_state(failover->hw, state->hw_state);
163 state->sw_state = 0;
164 state->hw_state = 0;
165 FREE(state);
166 }
167
168 static void
169 failover_set_framebuffer_state(struct pipe_context *pipe,
170 const struct pipe_framebuffer_state *framebuffer)
171 {
172 struct failover_context *failover = failover_context(pipe);
173
174 failover->framebuffer = *framebuffer;
175 failover->dirty |= FO_NEW_FRAMEBUFFER;
176 failover->sw->set_framebuffer_state( failover->sw, framebuffer );
177 failover->hw->set_framebuffer_state( failover->hw, framebuffer );
178 }
179
180
181 static void *
182 failover_create_fs_state(struct pipe_context *pipe,
183 const struct pipe_shader_state *templ)
184 {
185 struct fo_state *state = MALLOC(sizeof(struct fo_state));
186 struct failover_context *failover = failover_context(pipe);
187
188 state->sw_state = failover->sw->create_fs_state(failover->sw, templ);
189 state->hw_state = failover->hw->create_fs_state(failover->hw, templ);
190
191 return state;
192 }
193
194 static void
195 failover_bind_fs_state(struct pipe_context *pipe, void *fs)
196 {
197 struct failover_context *failover = failover_context(pipe);
198 struct fo_state *state = (struct fo_state*)fs;
199 failover->fragment_shader = state;
200 failover->dirty |= FO_NEW_FRAGMENT_SHADER;
201 failover->sw->bind_fs_state(failover->sw, state->sw_state);
202 failover->hw->bind_fs_state(failover->hw, state->hw_state);
203 }
204
205 static void
206 failover_delete_fs_state(struct pipe_context *pipe,
207 void *fs)
208 {
209 struct fo_state *state = (struct fo_state*)fs;
210 struct failover_context *failover = failover_context(pipe);
211
212 failover->sw->delete_fs_state(failover->sw, state->sw_state);
213 failover->hw->delete_fs_state(failover->hw, state->hw_state);
214 state->sw_state = 0;
215 state->hw_state = 0;
216 FREE(state);
217 }
218
219 static void *
220 failover_create_vs_state(struct pipe_context *pipe,
221 const struct pipe_shader_state *templ)
222 {
223 struct fo_state *state = MALLOC(sizeof(struct fo_state));
224 struct failover_context *failover = failover_context(pipe);
225
226 state->sw_state = failover->sw->create_vs_state(failover->sw, templ);
227 state->hw_state = failover->hw->create_vs_state(failover->hw, templ);
228
229 return state;
230 }
231
232 static void
233 failover_bind_vs_state(struct pipe_context *pipe,
234 void *vs)
235 {
236 struct failover_context *failover = failover_context(pipe);
237
238 struct fo_state *state = (struct fo_state*)vs;
239 failover->vertex_shader = state;
240 failover->dirty |= FO_NEW_VERTEX_SHADER;
241 failover->sw->bind_vs_state(failover->sw, state->sw_state);
242 failover->hw->bind_vs_state(failover->hw, state->hw_state);
243 }
244
245 static void
246 failover_delete_vs_state(struct pipe_context *pipe,
247 void *vs)
248 {
249 struct fo_state *state = (struct fo_state*)vs;
250 struct failover_context *failover = failover_context(pipe);
251
252 failover->sw->delete_vs_state(failover->sw, state->sw_state);
253 failover->hw->delete_vs_state(failover->hw, state->hw_state);
254 state->sw_state = 0;
255 state->hw_state = 0;
256 FREE(state);
257 }
258
259
260
261 static void *
262 failover_create_vertex_elements_state( struct pipe_context *pipe,
263 unsigned count,
264 const struct pipe_vertex_element *velems )
265 {
266 struct fo_state *state = MALLOC(sizeof(struct fo_state));
267 struct failover_context *failover = failover_context(pipe);
268
269 state->sw_state = failover->sw->create_vertex_elements_state(failover->sw, count, velems);
270 state->hw_state = failover->hw->create_vertex_elements_state(failover->hw, count, velems);
271
272 return state;
273 }
274
275 static void
276 failover_bind_vertex_elements_state(struct pipe_context *pipe,
277 void *velems )
278 {
279 struct failover_context *failover = failover_context(pipe);
280 struct fo_state *state = (struct fo_state*)velems;
281
282 failover->vertex_elements = state;
283 failover->dirty |= FO_NEW_VERTEX_ELEMENT;
284 failover->sw->bind_vertex_elements_state( failover->sw, velems );
285 failover->hw->bind_vertex_elements_state( failover->hw, velems );
286 }
287
288 static void
289 failover_delete_vertex_elements_state( struct pipe_context *pipe,
290 void *velems )
291 {
292 struct fo_state *state = (struct fo_state*)velems;
293 struct failover_context *failover = failover_context(pipe);
294
295 failover->sw->delete_vertex_elements_state(failover->sw, state->sw_state);
296 failover->hw->delete_vertex_elements_state(failover->hw, state->hw_state);
297 state->sw_state = 0;
298 state->hw_state = 0;
299 FREE(state);
300 }
301
302 static void
303 failover_set_polygon_stipple( struct pipe_context *pipe,
304 const struct pipe_poly_stipple *stipple )
305 {
306 struct failover_context *failover = failover_context(pipe);
307
308 failover->poly_stipple = *stipple;
309 failover->dirty |= FO_NEW_STIPPLE;
310 failover->sw->set_polygon_stipple( failover->sw, stipple );
311 failover->hw->set_polygon_stipple( failover->hw, stipple );
312 }
313
314
315 static void *
316 failover_create_rasterizer_state(struct pipe_context *pipe,
317 const struct pipe_rasterizer_state *templ)
318 {
319 struct fo_state *state = MALLOC(sizeof(struct fo_state));
320 struct failover_context *failover = failover_context(pipe);
321
322 state->sw_state = failover->sw->create_rasterizer_state(failover->sw, templ);
323 state->hw_state = failover->hw->create_rasterizer_state(failover->hw, templ);
324
325 return state;
326 }
327
328 static void
329 failover_bind_rasterizer_state(struct pipe_context *pipe,
330 void *raster)
331 {
332 struct failover_context *failover = failover_context(pipe);
333
334 struct fo_state *state = (struct fo_state*)raster;
335 failover->rasterizer = state;
336 failover->dirty |= FO_NEW_RASTERIZER;
337 failover->sw->bind_rasterizer_state(failover->sw, state->sw_state);
338 failover->hw->bind_rasterizer_state(failover->hw, state->hw_state);
339 }
340
341 static void
342 failover_delete_rasterizer_state(struct pipe_context *pipe,
343 void *raster)
344 {
345 struct fo_state *state = (struct fo_state*)raster;
346 struct failover_context *failover = failover_context(pipe);
347
348 failover->sw->delete_rasterizer_state(failover->sw, state->sw_state);
349 failover->hw->delete_rasterizer_state(failover->hw, state->hw_state);
350 state->sw_state = 0;
351 state->hw_state = 0;
352 FREE(state);
353 }
354
355
356 static void
357 failover_set_scissor_state( struct pipe_context *pipe,
358 const struct pipe_scissor_state *scissor )
359 {
360 struct failover_context *failover = failover_context(pipe);
361
362 failover->scissor = *scissor;
363 failover->dirty |= FO_NEW_SCISSOR;
364 failover->sw->set_scissor_state( failover->sw, scissor );
365 failover->hw->set_scissor_state( failover->hw, scissor );
366 }
367
368
369 static void *
370 failover_create_sampler_state(struct pipe_context *pipe,
371 const struct pipe_sampler_state *templ)
372 {
373 struct fo_state *state = MALLOC(sizeof(struct fo_state));
374 struct failover_context *failover = failover_context(pipe);
375
376 state->sw_state = failover->sw->create_sampler_state(failover->sw, templ);
377 state->hw_state = failover->hw->create_sampler_state(failover->hw, templ);
378
379 return state;
380 }
381
382 static void
383 failover_bind_fragment_sampler_states(struct pipe_context *pipe,
384 unsigned num,
385 void **sampler)
386 {
387 struct failover_context *failover = failover_context(pipe);
388 struct fo_state *state = (struct fo_state*)sampler;
389 uint i;
390 assert(num <= PIPE_MAX_SAMPLERS);
391 /* Check for no-op */
392 if (num == failover->num_samplers &&
393 !memcmp(failover->sampler, sampler, num * sizeof(void *)))
394 return;
395 for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
396 failover->sw_sampler_state[i] = i < num ? state[i].sw_state : NULL;
397 failover->hw_sampler_state[i] = i < num ? state[i].hw_state : NULL;
398 }
399 failover->dirty |= FO_NEW_SAMPLER;
400 failover->num_samplers = num;
401 failover->sw->bind_fragment_sampler_states(failover->sw, num,
402 failover->sw_sampler_state);
403 failover->hw->bind_fragment_sampler_states(failover->hw, num,
404 failover->hw_sampler_state);
405 }
406
407 static void
408 failover_bind_vertex_sampler_states(struct pipe_context *pipe,
409 unsigned num_samplers,
410 void **samplers)
411 {
412 struct failover_context *failover = failover_context(pipe);
413 struct fo_state *state = (struct fo_state*)samplers;
414 uint i;
415
416 assert(num_samplers <= PIPE_MAX_VERTEX_SAMPLERS);
417
418 /* Check for no-op */
419 if (num_samplers == failover->num_vertex_samplers &&
420 !memcmp(failover->vertex_samplers, samplers, num_samplers * sizeof(void *))) {
421 return;
422 }
423 for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
424 failover->sw_vertex_sampler_state[i] = i < num_samplers ? state[i].sw_state : NULL;
425 failover->hw_vertex_sampler_state[i] = i < num_samplers ? state[i].hw_state : NULL;
426 }
427 failover->dirty |= FO_NEW_SAMPLER;
428 failover->num_vertex_samplers = num_samplers;
429 failover->sw->bind_vertex_sampler_states(failover->sw,
430 num_samplers,
431 failover->sw_vertex_sampler_state);
432 failover->hw->bind_vertex_sampler_states(failover->hw,
433 num_samplers,
434 failover->hw_vertex_sampler_state);
435 }
436
437 static void
438 failover_delete_sampler_state(struct pipe_context *pipe, void *sampler)
439 {
440 struct fo_state *state = (struct fo_state*)sampler;
441 struct failover_context *failover = failover_context(pipe);
442
443 failover->sw->delete_sampler_state(failover->sw, state->sw_state);
444 failover->hw->delete_sampler_state(failover->hw, state->hw_state);
445 state->sw_state = 0;
446 state->hw_state = 0;
447 FREE(state);
448 }
449
450
451 static struct pipe_sampler_view *
452 failover_create_sampler_view(struct pipe_context *pipe,
453 struct pipe_resource *texture,
454 const struct pipe_sampler_view *templ)
455 {
456 struct fo_sampler_view *view = MALLOC(sizeof(struct fo_sampler_view));
457 struct failover_context *failover = failover_context(pipe);
458
459 view->sw = failover->sw->create_sampler_view(failover->sw, texture, templ);
460 view->hw = failover->hw->create_sampler_view(failover->hw, texture, templ);
461
462 view->base = *templ;
463 view->base.reference.count = 1;
464 view->base.texture = NULL;
465 pipe_resource_reference(&view->base.texture, texture);
466 view->base.context = pipe;
467
468 return &view->base;
469 }
470
471 static void
472 failover_sampler_view_destroy(struct pipe_context *pipe,
473 struct pipe_sampler_view *view)
474 {
475 struct fo_sampler_view *fo_view = (struct fo_sampler_view *)view;
476 struct failover_context *failover = failover_context(pipe);
477
478 failover->sw->sampler_view_destroy(failover->sw, fo_view->sw);
479 failover->hw->sampler_view_destroy(failover->hw, fo_view->hw);
480
481 pipe_resource_reference(&fo_view->base.texture, NULL);
482 FREE(fo_view);
483 }
484
485 static void
486 failover_set_fragment_sampler_views(struct pipe_context *pipe,
487 unsigned num,
488 struct pipe_sampler_view **views)
489 {
490 struct failover_context *failover = failover_context(pipe);
491 struct pipe_sampler_view *hw_views[PIPE_MAX_SAMPLERS];
492 uint i;
493
494 assert(num <= PIPE_MAX_SAMPLERS);
495
496 /* Check for no-op */
497 if (num == failover->num_fragment_sampler_views &&
498 !memcmp(failover->fragment_sampler_views, views, num * sizeof(struct pipe_sampler_view *)))
499 return;
500 for (i = 0; i < num; i++) {
501 struct fo_sampler_view *fo_view = (struct fo_sampler_view *)views[i];
502
503 pipe_sampler_view_reference((struct pipe_sampler_view **)&failover->fragment_sampler_views[i], views[i]);
504 hw_views[i] = fo_view->hw;
505 }
506 for (i = num; i < failover->num_fragment_sampler_views; i++)
507 pipe_sampler_view_reference((struct pipe_sampler_view **)&failover->fragment_sampler_views[i], NULL);
508 failover->dirty |= FO_NEW_SAMPLER_VIEW;
509 failover->num_fragment_sampler_views = num;
510 failover->hw->set_fragment_sampler_views(failover->hw, num, hw_views);
511 }
512
513
514 static void
515 failover_set_vertex_sampler_views(struct pipe_context *pipe,
516 unsigned num,
517 struct pipe_sampler_view **views)
518 {
519 struct failover_context *failover = failover_context(pipe);
520 struct pipe_sampler_view *hw_views[PIPE_MAX_VERTEX_SAMPLERS];
521 uint i;
522
523 assert(num <= PIPE_MAX_VERTEX_SAMPLERS);
524
525 /* Check for no-op */
526 if (num == failover->num_vertex_sampler_views &&
527 !memcmp(failover->vertex_sampler_views, views, num * sizeof(struct pipe_sampler_view *))) {
528 return;
529 }
530 for (i = 0; i < num; i++) {
531 struct fo_sampler_view *fo_view = (struct fo_sampler_view *)views[i];
532
533 pipe_sampler_view_reference((struct pipe_sampler_view **)&failover->vertex_sampler_views[i], views[i]);
534 hw_views[i] = fo_view->hw;
535 }
536 for (i = num; i < failover->num_vertex_sampler_views; i++)
537 pipe_sampler_view_reference((struct pipe_sampler_view **)&failover->vertex_sampler_views[i], NULL);
538 failover->dirty |= FO_NEW_SAMPLER_VIEW;
539 failover->num_vertex_sampler_views = num;
540 failover->hw->set_vertex_sampler_views(failover->hw, num, hw_views);
541 }
542
543
544 static void
545 failover_set_viewport_state( struct pipe_context *pipe,
546 const struct pipe_viewport_state *viewport )
547 {
548 struct failover_context *failover = failover_context(pipe);
549
550 failover->viewport = *viewport;
551 failover->dirty |= FO_NEW_VIEWPORT;
552 failover->sw->set_viewport_state( failover->sw, viewport );
553 failover->hw->set_viewport_state( failover->hw, viewport );
554 }
555
556
557 static void
558 failover_set_vertex_buffers(struct pipe_context *pipe,
559 unsigned count,
560 const struct pipe_vertex_buffer *vertex_buffers)
561 {
562 struct failover_context *failover = failover_context(pipe);
563
564 memcpy(failover->vertex_buffers, vertex_buffers,
565 count * sizeof(vertex_buffers[0]));
566 failover->dirty |= FO_NEW_VERTEX_BUFFER;
567 failover->num_vertex_buffers = count;
568 failover->sw->set_vertex_buffers( failover->sw, count, vertex_buffers );
569 failover->hw->set_vertex_buffers( failover->hw, count, vertex_buffers );
570 }
571
572
573 void
574 failover_set_constant_buffer(struct pipe_context *pipe,
575 uint shader, uint index,
576 struct pipe_resource *res)
577 {
578 struct failover_context *failover = failover_context(pipe);
579
580 assert(shader < PIPE_SHADER_TYPES);
581 assert(index == 0);
582
583 failover->sw->set_constant_buffer(failover->sw, shader, index, res);
584 failover->hw->set_constant_buffer(failover->hw, shader, index, res);
585 }
586
587
588 void
589 failover_init_state_functions( struct failover_context *failover )
590 {
591 failover->pipe.create_blend_state = failover_create_blend_state;
592 failover->pipe.bind_blend_state = failover_bind_blend_state;
593 failover->pipe.delete_blend_state = failover_delete_blend_state;
594 failover->pipe.create_sampler_state = failover_create_sampler_state;
595 failover->pipe.bind_fragment_sampler_states = failover_bind_fragment_sampler_states;
596 failover->pipe.bind_vertex_sampler_states = failover_bind_vertex_sampler_states;
597 failover->pipe.delete_sampler_state = failover_delete_sampler_state;
598 failover->pipe.create_depth_stencil_alpha_state = failover_create_depth_stencil_state;
599 failover->pipe.bind_depth_stencil_alpha_state = failover_bind_depth_stencil_state;
600 failover->pipe.delete_depth_stencil_alpha_state = failover_delete_depth_stencil_state;
601 failover->pipe.create_rasterizer_state = failover_create_rasterizer_state;
602 failover->pipe.bind_rasterizer_state = failover_bind_rasterizer_state;
603 failover->pipe.delete_rasterizer_state = failover_delete_rasterizer_state;
604 failover->pipe.create_fs_state = failover_create_fs_state;
605 failover->pipe.bind_fs_state = failover_bind_fs_state;
606 failover->pipe.delete_fs_state = failover_delete_fs_state;
607 failover->pipe.create_vs_state = failover_create_vs_state;
608 failover->pipe.bind_vs_state = failover_bind_vs_state;
609 failover->pipe.delete_vs_state = failover_delete_vs_state;
610 failover->pipe.create_vertex_elements_state = failover_create_vertex_elements_state;
611 failover->pipe.bind_vertex_elements_state = failover_bind_vertex_elements_state;
612 failover->pipe.delete_vertex_elements_state = failover_delete_vertex_elements_state;
613
614 failover->pipe.set_blend_color = failover_set_blend_color;
615 failover->pipe.set_stencil_ref = failover_set_stencil_ref;
616 failover->pipe.set_clip_state = failover_set_clip_state;
617 failover->pipe.set_framebuffer_state = failover_set_framebuffer_state;
618 failover->pipe.set_polygon_stipple = failover_set_polygon_stipple;
619 failover->pipe.set_scissor_state = failover_set_scissor_state;
620 failover->pipe.set_fragment_sampler_views = failover_set_fragment_sampler_views;
621 failover->pipe.set_vertex_sampler_views = failover_set_vertex_sampler_views;
622 failover->pipe.set_viewport_state = failover_set_viewport_state;
623 failover->pipe.set_vertex_buffers = failover_set_vertex_buffers;
624 failover->pipe.set_constant_buffer = failover_set_constant_buffer;
625 failover->pipe.create_sampler_view = failover_create_sampler_view;
626 failover->pipe.sampler_view_destroy = failover_sampler_view_destroy;
627 }