/chromium-webcl/src/third_party/mesa/MesaLib/src/gallium/drivers/failover/fo_state.c

https://bitbucket.org/peixuan/chromium_r197479_base · C · 659 lines · 503 code · 111 blank · 45 comment · 16 complexity · 7b4019ae603e20109362091c24aa23f2 MD5 · raw file

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