fo_state.c File Reference

Include dependency graph for fo_state.c:

Go to the source code of this file.

Functions

static void * failover_create_blend_state (struct pipe_context *pipe, const struct pipe_blend_state *blend)
static void failover_bind_blend_state (struct pipe_context *pipe, void *blend)
static void failover_delete_blend_state (struct pipe_context *pipe, void *blend)
static void failover_set_blend_color (struct pipe_context *pipe, const struct pipe_blend_color *blend_color)
static void failover_set_clip_state (struct pipe_context *pipe, const struct pipe_clip_state *clip)
static void * failover_create_depth_stencil_state (struct pipe_context *pipe, const struct pipe_depth_stencil_alpha_state *templ)
static void failover_bind_depth_stencil_state (struct pipe_context *pipe, void *depth_stencil)
static void failover_delete_depth_stencil_state (struct pipe_context *pipe, void *ds)
static void failover_set_framebuffer_state (struct pipe_context *pipe, const struct pipe_framebuffer_state *framebuffer)
static void * failover_create_fs_state (struct pipe_context *pipe, const struct pipe_shader_state *templ)
static void failover_bind_fs_state (struct pipe_context *pipe, void *fs)
static void failover_delete_fs_state (struct pipe_context *pipe, void *fs)
static void * failover_create_vs_state (struct pipe_context *pipe, const struct pipe_shader_state *templ)
static void failover_bind_vs_state (struct pipe_context *pipe, void *vs)
static void failover_delete_vs_state (struct pipe_context *pipe, void *vs)
static void failover_set_polygon_stipple (struct pipe_context *pipe, const struct pipe_poly_stipple *stipple)
static void * failover_create_rasterizer_state (struct pipe_context *pipe, const struct pipe_rasterizer_state *templ)
static void failover_bind_rasterizer_state (struct pipe_context *pipe, void *raster)
static void failover_delete_rasterizer_state (struct pipe_context *pipe, void *raster)
static void failover_set_scissor_state (struct pipe_context *pipe, const struct pipe_scissor_state *scissor)
static void * failover_create_sampler_state (struct pipe_context *pipe, const struct pipe_sampler_state *templ)
static void failover_bind_sampler_states (struct pipe_context *pipe, unsigned num, void **sampler)
static void failover_delete_sampler_state (struct pipe_context *pipe, void *sampler)
static void failover_set_sampler_textures (struct pipe_context *pipe, unsigned num, struct pipe_texture **texture)
static void failover_set_viewport_state (struct pipe_context *pipe, const struct pipe_viewport_state *viewport)
static void failover_set_vertex_buffers (struct pipe_context *pipe, unsigned count, const struct pipe_vertex_buffer *vertex_buffers)
static void failover_set_vertex_elements (struct pipe_context *pipe, unsigned count, const struct pipe_vertex_element *vertex_elements)
void failover_set_constant_buffer (struct pipe_context *pipe, uint shader, uint index, const struct pipe_constant_buffer *buf)
void failover_init_state_functions (struct failover_context *failover)


Function Documentation

static void failover_bind_blend_state ( struct pipe_context pipe,
void *  blend 
) [static]

Definition at line 66 of file fo_state.c.

References pipe_context::bind_blend_state, failover_context::blend, failover_context::dirty, failover_context(), FO_NEW_BLEND, failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00068 {
00069    struct failover_context *failover = failover_context(pipe);
00070    struct fo_state *state = (struct fo_state *)blend;
00071    failover->blend = state;
00072    failover->dirty |= FO_NEW_BLEND;
00073    failover->sw->bind_blend_state( failover->sw, state->sw_state );
00074    failover->hw->bind_blend_state( failover->hw, state->hw_state );
00075 }

static void failover_bind_depth_stencil_state ( struct pipe_context pipe,
void *  depth_stencil 
) [static]

Definition at line 130 of file fo_state.c.

References pipe_context::bind_depth_stencil_alpha_state, failover_context::depth_stencil, failover_context::dirty, failover_context(), FO_NEW_DEPTH_STENCIL, failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00132 {
00133    struct failover_context *failover = failover_context(pipe);
00134    struct fo_state *state = (struct fo_state *)depth_stencil;
00135    failover->depth_stencil = state;
00136    failover->dirty |= FO_NEW_DEPTH_STENCIL;
00137    failover->sw->bind_depth_stencil_alpha_state(failover->sw, state->sw_state);
00138    failover->hw->bind_depth_stencil_alpha_state(failover->hw, state->hw_state);
00139 }

static void failover_bind_fs_state ( struct pipe_context pipe,
void *  fs 
) [static]

Definition at line 182 of file fo_state.c.

References pipe_context::bind_fs_state, failover_context::dirty, failover_context(), FO_NEW_FRAGMENT_SHADER, failover_context::fragment_shader, failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00183 {
00184    struct failover_context *failover = failover_context(pipe);
00185    struct fo_state *state = (struct fo_state*)fs;
00186    failover->fragment_shader = state;
00187    failover->dirty |= FO_NEW_FRAGMENT_SHADER;
00188    failover->sw->bind_fs_state(failover->sw, state->sw_state);
00189    failover->hw->bind_fs_state(failover->hw, state->hw_state);
00190 }

static void failover_bind_rasterizer_state ( struct pipe_context pipe,
void *  raster 
) [static]

Definition at line 273 of file fo_state.c.

References pipe_context::bind_rasterizer_state, failover_context::dirty, failover_context(), FO_NEW_RASTERIZER, failover_context::hw, fo_state::hw_state, failover_context::rasterizer, failover_context::sw, and fo_state::sw_state.

00275 {
00276    struct failover_context *failover = failover_context(pipe);
00277 
00278    struct fo_state *state = (struct fo_state*)raster;
00279    failover->rasterizer = state;
00280    failover->dirty |= FO_NEW_RASTERIZER;
00281    failover->sw->bind_rasterizer_state(failover->sw, state->sw_state);
00282    failover->hw->bind_rasterizer_state(failover->hw, state->hw_state);
00283 }

static void failover_bind_sampler_states ( struct pipe_context pipe,
unsigned  num,
void **  sampler 
) [static]

Definition at line 327 of file fo_state.c.

References assert, pipe_context::bind_sampler_states, failover_context::dirty, failover_context(), FO_NEW_SAMPLER, failover_context::hw, failover_context::hw_sampler_state, fo_state::hw_state, failover_context::num_samplers, PIPE_MAX_SAMPLERS, failover_context::sampler, failover_context::sw, failover_context::sw_sampler_state, and fo_state::sw_state.

00329 {
00330    struct failover_context *failover = failover_context(pipe);
00331    struct fo_state *state = (struct fo_state*)sampler;
00332    uint i;
00333    assert(num <= PIPE_MAX_SAMPLERS);
00334    /* Check for no-op */
00335    if (num == failover->num_samplers &&
00336        !memcmp(failover->sampler, sampler, num * sizeof(void *)))
00337       return;
00338    for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
00339       failover->sw_sampler_state[i] = i < num ? state[i].sw_state : NULL;
00340       failover->hw_sampler_state[i] = i < num ? state[i].hw_state : NULL;
00341    }
00342    failover->dirty |= FO_NEW_SAMPLER;
00343    failover->num_samplers = num;
00344    failover->sw->bind_sampler_states(failover->sw, num,
00345                                      failover->sw_sampler_state);
00346    failover->hw->bind_sampler_states(failover->hw, num,
00347                                      failover->hw_sampler_state);
00348 }

static void failover_bind_vs_state ( struct pipe_context pipe,
void *  vs 
) [static]

Definition at line 220 of file fo_state.c.

References pipe_context::bind_vs_state, failover_context::dirty, failover_context(), FO_NEW_VERTEX_SHADER, failover_context::hw, fo_state::hw_state, failover_context::sw, fo_state::sw_state, and failover_context::vertex_shader.

00222 {
00223    struct failover_context *failover = failover_context(pipe);
00224 
00225    struct fo_state *state = (struct fo_state*)vs;
00226    failover->vertex_shader = state;
00227    failover->dirty |= FO_NEW_VERTEX_SHADER;
00228    failover->sw->bind_vs_state(failover->sw, state->sw_state);
00229    failover->hw->bind_vs_state(failover->hw, state->hw_state);
00230 }

static void* failover_create_blend_state ( struct pipe_context pipe,
const struct pipe_blend_state blend 
) [static]

Definition at line 53 of file fo_state.c.

References pipe_context::create_blend_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00055 {
00056    struct fo_state *state = malloc(sizeof(struct fo_state));
00057    struct failover_context *failover = failover_context(pipe);
00058 
00059    state->sw_state = failover->sw->create_blend_state(failover->sw, blend);
00060    state->hw_state = failover->hw->create_blend_state(failover->hw, blend);
00061 
00062    return state;
00063 }

static void* failover_create_depth_stencil_state ( struct pipe_context pipe,
const struct pipe_depth_stencil_alpha_state templ 
) [static]

Definition at line 117 of file fo_state.c.

References pipe_context::create_depth_stencil_alpha_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00119 {
00120    struct fo_state *state = malloc(sizeof(struct fo_state));
00121    struct failover_context *failover = failover_context(pipe);
00122 
00123    state->sw_state = failover->sw->create_depth_stencil_alpha_state(failover->sw, templ);
00124    state->hw_state = failover->hw->create_depth_stencil_alpha_state(failover->hw, templ);
00125 
00126    return state;
00127 }

static void* failover_create_fs_state ( struct pipe_context pipe,
const struct pipe_shader_state templ 
) [static]

Definition at line 169 of file fo_state.c.

References pipe_context::create_fs_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00171 {
00172    struct fo_state *state = malloc(sizeof(struct fo_state));
00173    struct failover_context *failover = failover_context(pipe);
00174 
00175    state->sw_state = failover->sw->create_fs_state(failover->sw, templ);
00176    state->hw_state = failover->hw->create_fs_state(failover->hw, templ);
00177 
00178    return state;
00179 }

static void* failover_create_rasterizer_state ( struct pipe_context pipe,
const struct pipe_rasterizer_state templ 
) [static]

Definition at line 260 of file fo_state.c.

References pipe_context::create_rasterizer_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00262 {
00263    struct fo_state *state = malloc(sizeof(struct fo_state));
00264    struct failover_context *failover = failover_context(pipe);
00265 
00266    state->sw_state = failover->sw->create_rasterizer_state(failover->sw, templ);
00267    state->hw_state = failover->hw->create_rasterizer_state(failover->hw, templ);
00268 
00269    return state;
00270 }

static void* failover_create_sampler_state ( struct pipe_context pipe,
const struct pipe_sampler_state templ 
) [static]

Definition at line 314 of file fo_state.c.

References pipe_context::create_sampler_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00316 {
00317    struct fo_state *state = malloc(sizeof(struct fo_state));
00318    struct failover_context *failover = failover_context(pipe);
00319 
00320    state->sw_state = failover->sw->create_sampler_state(failover->sw, templ);
00321    state->hw_state = failover->hw->create_sampler_state(failover->hw, templ);
00322 
00323    return state;
00324 }

static void* failover_create_vs_state ( struct pipe_context pipe,
const struct pipe_shader_state templ 
) [static]

Definition at line 207 of file fo_state.c.

References pipe_context::create_vs_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00209 {
00210    struct fo_state *state = malloc(sizeof(struct fo_state));
00211    struct failover_context *failover = failover_context(pipe);
00212 
00213    state->sw_state = failover->sw->create_vs_state(failover->sw, templ);
00214    state->hw_state = failover->hw->create_vs_state(failover->hw, templ);
00215 
00216    return state;
00217 }

static void failover_delete_blend_state ( struct pipe_context pipe,
void *  blend 
) [static]

Definition at line 78 of file fo_state.c.

References pipe_context::delete_blend_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00080 {
00081    struct fo_state *state = (struct fo_state*)blend;
00082    struct failover_context *failover = failover_context(pipe);
00083 
00084    failover->sw->delete_blend_state(failover->sw, state->sw_state);
00085    failover->hw->delete_blend_state(failover->hw, state->hw_state);
00086    state->sw_state = 0;
00087    state->hw_state = 0;
00088    free(state);
00089 }

static void failover_delete_depth_stencil_state ( struct pipe_context pipe,
void *  ds 
) [static]

Definition at line 142 of file fo_state.c.

References pipe_context::delete_depth_stencil_alpha_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00144 {
00145    struct fo_state *state = (struct fo_state*)ds;
00146    struct failover_context *failover = failover_context(pipe);
00147 
00148    failover->sw->delete_depth_stencil_alpha_state(failover->sw, state->sw_state);
00149    failover->hw->delete_depth_stencil_alpha_state(failover->hw, state->hw_state);
00150    state->sw_state = 0;
00151    state->hw_state = 0;
00152    free(state);
00153 }

static void failover_delete_fs_state ( struct pipe_context pipe,
void *  fs 
) [static]

Definition at line 193 of file fo_state.c.

References pipe_context::delete_fs_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00195 {
00196    struct fo_state *state = (struct fo_state*)fs;
00197    struct failover_context *failover = failover_context(pipe);
00198 
00199    failover->sw->delete_fs_state(failover->sw, state->sw_state);
00200    failover->hw->delete_fs_state(failover->hw, state->hw_state);
00201    state->sw_state = 0;
00202    state->hw_state = 0;
00203    free(state);
00204 }

static void failover_delete_rasterizer_state ( struct pipe_context pipe,
void *  raster 
) [static]

Definition at line 286 of file fo_state.c.

References pipe_context::delete_rasterizer_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00288 {
00289    struct fo_state *state = (struct fo_state*)raster;
00290    struct failover_context *failover = failover_context(pipe);
00291 
00292    failover->sw->delete_rasterizer_state(failover->sw, state->sw_state);
00293    failover->hw->delete_rasterizer_state(failover->hw, state->hw_state);
00294    state->sw_state = 0;
00295    state->hw_state = 0;
00296    free(state);
00297 }

static void failover_delete_sampler_state ( struct pipe_context pipe,
void *  sampler 
) [static]

Definition at line 351 of file fo_state.c.

References pipe_context::delete_sampler_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00352 {
00353    struct fo_state *state = (struct fo_state*)sampler;
00354    struct failover_context *failover = failover_context(pipe);
00355 
00356    failover->sw->delete_sampler_state(failover->sw, state->sw_state);
00357    failover->hw->delete_sampler_state(failover->hw, state->hw_state);
00358    state->sw_state = 0;
00359    state->hw_state = 0;
00360    free(state);
00361 }

static void failover_delete_vs_state ( struct pipe_context pipe,
void *  vs 
) [static]

Definition at line 233 of file fo_state.c.

References pipe_context::delete_vs_state, failover_context(), failover_context::hw, fo_state::hw_state, failover_context::sw, and fo_state::sw_state.

00235 {
00236    struct fo_state *state = (struct fo_state*)vs;
00237    struct failover_context *failover = failover_context(pipe);
00238 
00239    failover->sw->delete_vs_state(failover->sw, state->sw_state);
00240    failover->hw->delete_vs_state(failover->hw, state->hw_state);
00241    state->sw_state = 0;
00242    state->hw_state = 0;
00243    free(state);
00244 }

void failover_init_state_functions ( struct failover_context failover  ) 

Definition at line 452 of file fo_state.c.

References pipe_context::bind_blend_state, pipe_context::bind_depth_stencil_alpha_state, pipe_context::bind_fs_state, pipe_context::bind_rasterizer_state, pipe_context::bind_sampler_states, pipe_context::bind_vs_state, pipe_context::create_blend_state, pipe_context::create_depth_stencil_alpha_state, pipe_context::create_fs_state, pipe_context::create_rasterizer_state, pipe_context::create_sampler_state, pipe_context::create_vs_state, pipe_context::delete_blend_state, pipe_context::delete_depth_stencil_alpha_state, pipe_context::delete_fs_state, pipe_context::delete_rasterizer_state, pipe_context::delete_sampler_state, pipe_context::delete_vs_state, failover_bind_blend_state(), failover_bind_depth_stencil_state(), failover_bind_fs_state(), failover_bind_rasterizer_state(), failover_bind_sampler_states(), failover_bind_vs_state(), failover_create_blend_state(), failover_create_depth_stencil_state(), failover_create_fs_state(), failover_create_rasterizer_state(), failover_create_sampler_state(), failover_create_vs_state(), failover_delete_blend_state(), failover_delete_depth_stencil_state(), failover_delete_fs_state(), failover_delete_rasterizer_state(), failover_delete_sampler_state(), failover_delete_vs_state(), failover_set_blend_color(), failover_set_clip_state(), failover_set_constant_buffer(), failover_set_framebuffer_state(), failover_set_polygon_stipple(), failover_set_sampler_textures(), failover_set_scissor_state(), failover_set_vertex_buffers(), failover_set_vertex_elements(), failover_set_viewport_state(), failover_context::pipe, pipe_context::set_blend_color, pipe_context::set_clip_state, pipe_context::set_constant_buffer, pipe_context::set_framebuffer_state, pipe_context::set_polygon_stipple, pipe_context::set_sampler_textures, pipe_context::set_scissor_state, pipe_context::set_vertex_buffers, pipe_context::set_vertex_elements, and pipe_context::set_viewport_state.

00453 {
00454    failover->pipe.create_blend_state = failover_create_blend_state;
00455    failover->pipe.bind_blend_state   = failover_bind_blend_state;
00456    failover->pipe.delete_blend_state = failover_delete_blend_state;
00457    failover->pipe.create_sampler_state = failover_create_sampler_state;
00458    failover->pipe.bind_sampler_states  = failover_bind_sampler_states;
00459    failover->pipe.delete_sampler_state = failover_delete_sampler_state;
00460    failover->pipe.create_depth_stencil_alpha_state = failover_create_depth_stencil_state;
00461    failover->pipe.bind_depth_stencil_alpha_state   = failover_bind_depth_stencil_state;
00462    failover->pipe.delete_depth_stencil_alpha_state = failover_delete_depth_stencil_state;
00463    failover->pipe.create_rasterizer_state = failover_create_rasterizer_state;
00464    failover->pipe.bind_rasterizer_state = failover_bind_rasterizer_state;
00465    failover->pipe.delete_rasterizer_state = failover_delete_rasterizer_state;
00466    failover->pipe.create_fs_state = failover_create_fs_state;
00467    failover->pipe.bind_fs_state   = failover_bind_fs_state;
00468    failover->pipe.delete_fs_state = failover_delete_fs_state;
00469    failover->pipe.create_vs_state = failover_create_vs_state;
00470    failover->pipe.bind_vs_state   = failover_bind_vs_state;
00471    failover->pipe.delete_vs_state = failover_delete_vs_state;
00472 
00473    failover->pipe.set_blend_color = failover_set_blend_color;
00474    failover->pipe.set_clip_state = failover_set_clip_state;
00475    failover->pipe.set_framebuffer_state = failover_set_framebuffer_state;
00476    failover->pipe.set_polygon_stipple = failover_set_polygon_stipple;
00477    failover->pipe.set_scissor_state = failover_set_scissor_state;
00478    failover->pipe.set_sampler_textures = failover_set_sampler_textures;
00479    failover->pipe.set_viewport_state = failover_set_viewport_state;
00480    failover->pipe.set_vertex_buffers = failover_set_vertex_buffers;
00481    failover->pipe.set_vertex_elements = failover_set_vertex_elements;
00482    failover->pipe.set_constant_buffer = failover_set_constant_buffer;
00483 }

static void failover_set_blend_color ( struct pipe_context pipe,
const struct pipe_blend_color blend_color 
) [static]

Definition at line 92 of file fo_state.c.

References failover_context::blend_color, failover_context::dirty, failover_context(), FO_NEW_BLEND_COLOR, failover_context::hw, pipe_context::set_blend_color, and failover_context::sw.

00094 {
00095    struct failover_context *failover = failover_context(pipe);
00096 
00097    failover->blend_color = *blend_color;
00098    failover->dirty |= FO_NEW_BLEND_COLOR;
00099    failover->sw->set_blend_color( failover->sw, blend_color );
00100    failover->hw->set_blend_color( failover->hw, blend_color );
00101 }

static void failover_set_clip_state ( struct pipe_context pipe,
const struct pipe_clip_state clip 
) [static]

Definition at line 104 of file fo_state.c.

References failover_context::clip, failover_context::dirty, failover_context(), FO_NEW_CLIP, failover_context::hw, pipe_context::set_clip_state, and failover_context::sw.

00106 {
00107    struct failover_context *failover = failover_context(pipe);
00108 
00109    failover->clip = *clip;
00110    failover->dirty |= FO_NEW_CLIP;
00111    failover->sw->set_clip_state( failover->sw, clip );
00112    failover->hw->set_clip_state( failover->hw, clip );
00113 }

void failover_set_constant_buffer ( struct pipe_context pipe,
uint  shader,
uint  index,
const struct pipe_constant_buffer buf 
)

Definition at line 437 of file fo_state.c.

References assert, failover_context(), failover_context::hw, PIPE_SHADER_TYPES, pipe_context::set_constant_buffer, and failover_context::sw.

00440 {
00441    struct failover_context *failover = failover_context(pipe);
00442 
00443    assert(shader < PIPE_SHADER_TYPES);
00444    assert(index == 0);
00445 
00446    failover->sw->set_constant_buffer(failover->sw, shader, index, buf);
00447    failover->hw->set_constant_buffer(failover->hw, shader, index, buf);
00448 }

static void failover_set_framebuffer_state ( struct pipe_context pipe,
const struct pipe_framebuffer_state framebuffer 
) [static]

Definition at line 156 of file fo_state.c.

References failover_context::dirty, failover_context(), FO_NEW_FRAMEBUFFER, failover_context::framebuffer, failover_context::hw, pipe_context::set_framebuffer_state, and failover_context::sw.

00158 {
00159    struct failover_context *failover = failover_context(pipe);
00160 
00161    failover->framebuffer = *framebuffer;
00162    failover->dirty |= FO_NEW_FRAMEBUFFER;
00163    failover->sw->set_framebuffer_state( failover->sw, framebuffer );
00164    failover->hw->set_framebuffer_state( failover->hw, framebuffer );
00165 }

static void failover_set_polygon_stipple ( struct pipe_context pipe,
const struct pipe_poly_stipple stipple 
) [static]

Definition at line 247 of file fo_state.c.

References failover_context::dirty, failover_context(), FO_NEW_STIPPLE, failover_context::hw, failover_context::poly_stipple, pipe_context::set_polygon_stipple, and failover_context::sw.

00249 {
00250    struct failover_context *failover = failover_context(pipe);
00251 
00252    failover->poly_stipple = *stipple;
00253    failover->dirty |= FO_NEW_STIPPLE;
00254    failover->sw->set_polygon_stipple( failover->sw, stipple );
00255    failover->hw->set_polygon_stipple( failover->hw, stipple );
00256 }

static void failover_set_sampler_textures ( struct pipe_context pipe,
unsigned  num,
struct pipe_texture **  texture 
) [static]

Definition at line 365 of file fo_state.c.

References assert, failover_context::dirty, failover_context(), FO_NEW_TEXTURE, failover_context::hw, failover_context::num_textures, PIPE_MAX_SAMPLERS, pipe_texture_reference(), pipe_context::set_sampler_textures, failover_context::sw, and failover_context::texture.

00368 {
00369    struct failover_context *failover = failover_context(pipe);
00370    uint i;
00371 
00372    assert(num <= PIPE_MAX_SAMPLERS);
00373 
00374    /* Check for no-op */
00375    if (num == failover->num_textures &&
00376        !memcmp(failover->texture, texture, num * sizeof(struct pipe_texture *)))
00377       return;
00378    for (i = 0; i < num; i++)
00379       pipe_texture_reference((struct pipe_texture **) &failover->texture[i],
00380                              texture[i]);
00381    for (i = num; i < failover->num_textures; i++)
00382       pipe_texture_reference((struct pipe_texture **) &failover->texture[i],
00383                              NULL);
00384    failover->dirty |= FO_NEW_TEXTURE;
00385    failover->num_textures = num;
00386    failover->sw->set_sampler_textures( failover->sw, num, texture );
00387    failover->hw->set_sampler_textures( failover->hw, num, texture );
00388 }

static void failover_set_scissor_state ( struct pipe_context pipe,
const struct pipe_scissor_state scissor 
) [static]

Definition at line 301 of file fo_state.c.

References failover_context::dirty, failover_context(), FO_NEW_SCISSOR, failover_context::hw, failover_context::scissor, pipe_context::set_scissor_state, and failover_context::sw.

00303 {
00304    struct failover_context *failover = failover_context(pipe);
00305 
00306    failover->scissor = *scissor;
00307    failover->dirty |= FO_NEW_SCISSOR;
00308    failover->sw->set_scissor_state( failover->sw, scissor );
00309    failover->hw->set_scissor_state( failover->hw, scissor );
00310 }

static void failover_set_vertex_buffers ( struct pipe_context pipe,
unsigned  count,
const struct pipe_vertex_buffer vertex_buffers 
) [static]

Definition at line 405 of file fo_state.c.

References failover_context::dirty, failover_context(), FO_NEW_VERTEX_BUFFER, failover_context::hw, failover_context::num_vertex_buffers, pipe_context::set_vertex_buffers, failover_context::sw, and failover_context::vertex_buffers.

00408 {
00409    struct failover_context *failover = failover_context(pipe);
00410 
00411    memcpy(failover->vertex_buffers, vertex_buffers,
00412           count * sizeof(vertex_buffers[0]));
00413    failover->dirty |= FO_NEW_VERTEX_BUFFER;
00414    failover->num_vertex_buffers = count;
00415    failover->sw->set_vertex_buffers( failover->sw, count, vertex_buffers );
00416    failover->hw->set_vertex_buffers( failover->hw, count, vertex_buffers );
00417 }

static void failover_set_vertex_elements ( struct pipe_context pipe,
unsigned  count,
const struct pipe_vertex_element vertex_elements 
) [static]

Definition at line 421 of file fo_state.c.

References failover_context::dirty, failover_context(), FO_NEW_VERTEX_ELEMENT, failover_context::hw, failover_context::num_vertex_elements, pipe_context::set_vertex_elements, failover_context::sw, and failover_context::vertex_elements.

00424 {
00425    struct failover_context *failover = failover_context(pipe);
00426 
00427    memcpy(failover->vertex_elements, vertex_elements,
00428           count * sizeof(vertex_elements[0]));
00429 
00430    failover->dirty |= FO_NEW_VERTEX_ELEMENT;
00431    failover->num_vertex_elements = count;
00432    failover->sw->set_vertex_elements( failover->sw, count, vertex_elements );
00433    failover->hw->set_vertex_elements( failover->hw, count, vertex_elements );
00434 }

static void failover_set_viewport_state ( struct pipe_context pipe,
const struct pipe_viewport_state viewport 
) [static]

Definition at line 392 of file fo_state.c.

References failover_context::dirty, failover_context(), FO_NEW_VIEWPORT, failover_context::hw, pipe_context::set_viewport_state, failover_context::sw, and failover_context::viewport.

00394 {
00395    struct failover_context *failover = failover_context(pipe);
00396 
00397    failover->viewport = *viewport; 
00398    failover->dirty |= FO_NEW_VIEWPORT;
00399    failover->sw->set_viewport_state( failover->sw, viewport );
00400    failover->hw->set_viewport_state( failover->hw, viewport );
00401 }


Generated on Tue Sep 29 06:25:33 2009 for Gallium3D by  doxygen 1.5.4