00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #include "fo_context.h"
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 void
00054 failover_state_emit( struct failover_context *failover )
00055 {
00056 if (failover->dirty & FO_NEW_BLEND)
00057 failover->sw->bind_blend_state( failover->sw,
00058 failover->blend->sw_state );
00059
00060 if (failover->dirty & FO_NEW_BLEND_COLOR)
00061 failover->sw->set_blend_color( failover->sw, &failover->blend_color );
00062
00063 if (failover->dirty & FO_NEW_CLIP)
00064 failover->sw->set_clip_state( failover->sw, &failover->clip );
00065
00066 if (failover->dirty & FO_NEW_DEPTH_STENCIL)
00067 failover->sw->bind_depth_stencil_alpha_state( failover->sw,
00068 failover->depth_stencil->sw_state );
00069
00070 if (failover->dirty & FO_NEW_FRAMEBUFFER)
00071 failover->sw->set_framebuffer_state( failover->sw, &failover->framebuffer );
00072
00073 if (failover->dirty & FO_NEW_FRAGMENT_SHADER)
00074 failover->sw->bind_fs_state( failover->sw,
00075 failover->fragment_shader->sw_state );
00076
00077 if (failover->dirty & FO_NEW_VERTEX_SHADER)
00078 failover->sw->bind_vs_state( failover->sw,
00079 failover->vertex_shader->sw_state );
00080
00081 if (failover->dirty & FO_NEW_STIPPLE)
00082 failover->sw->set_polygon_stipple( failover->sw, &failover->poly_stipple );
00083
00084 if (failover->dirty & FO_NEW_RASTERIZER)
00085 failover->sw->bind_rasterizer_state( failover->sw,
00086 failover->rasterizer->sw_state );
00087
00088 if (failover->dirty & FO_NEW_SCISSOR)
00089 failover->sw->set_scissor_state( failover->sw, &failover->scissor );
00090
00091 if (failover->dirty & FO_NEW_VIEWPORT)
00092 failover->sw->set_viewport_state( failover->sw, &failover->viewport );
00093
00094 if (failover->dirty & FO_NEW_SAMPLER) {
00095 failover->sw->bind_sampler_states( failover->sw, failover->num_samplers,
00096 failover->sw_sampler_state );
00097 }
00098
00099 if (failover->dirty & FO_NEW_TEXTURE) {
00100 failover->sw->set_sampler_textures( failover->sw, failover->num_textures,
00101 failover->texture );
00102 }
00103
00104 if (failover->dirty & FO_NEW_VERTEX_BUFFER) {
00105 failover->sw->set_vertex_buffers( failover->sw,
00106 failover->num_vertex_buffers,
00107 failover->vertex_buffers );
00108 }
00109
00110 if (failover->dirty & FO_NEW_VERTEX_ELEMENT) {
00111 failover->sw->set_vertex_elements( failover->sw,
00112 failover->num_vertex_elements,
00113 failover->vertex_elements );
00114 }
00115
00116 failover->dirty = 0;
00117 }