struct fo_state *state = malloc(sizeof(struct fo_state));
struct failover_context *failover = failover_context(pipe);
- state->sw_state = failover->sw->create_blend_state(pipe, blend);
- state->hw_state = failover->hw->create_blend_state(pipe, blend);
+ state->sw_state = failover->sw->create_blend_state(failover->sw, blend);
+ state->hw_state = failover->hw->create_blend_state(failover->hw, blend);
return state;
}
struct fo_state *state = (struct fo_state *)blend;
failover->blend = state;
failover->dirty |= FO_NEW_BLEND;
+ failover->sw->bind_blend_state( failover->sw, state->sw_state );
failover->hw->bind_blend_state( failover->hw, state->hw_state );
}
struct fo_state *state = (struct fo_state*)blend;
struct failover_context *failover = failover_context(pipe);
- failover->sw->delete_blend_state(pipe, state->sw_state);
- failover->hw->delete_blend_state(pipe, state->hw_state);
+ failover->sw->delete_blend_state(failover->sw, state->sw_state);
+ failover->hw->delete_blend_state(failover->hw, state->hw_state);
state->sw_state = 0;
state->hw_state = 0;
free(state);
failover->blend_color = *blend_color;
failover->dirty |= FO_NEW_BLEND_COLOR;
+ failover->sw->set_blend_color( failover->sw, blend_color );
failover->hw->set_blend_color( failover->hw, blend_color );
}
failover->clip = *clip;
failover->dirty |= FO_NEW_CLIP;
+ failover->sw->set_clip_state( failover->sw, clip );
failover->hw->set_clip_state( failover->hw, clip );
}
struct fo_state *state = malloc(sizeof(struct fo_state));
struct failover_context *failover = failover_context(pipe);
- state->sw_state = failover->sw->create_depth_stencil_alpha_state(pipe, templ);
- state->hw_state = failover->hw->create_depth_stencil_alpha_state(pipe, templ);
+ state->sw_state = failover->sw->create_depth_stencil_alpha_state(failover->sw, templ);
+ state->hw_state = failover->hw->create_depth_stencil_alpha_state(failover->hw, templ);
return state;
}
struct fo_state *state = (struct fo_state *)depth_stencil;
failover->depth_stencil = state;
failover->dirty |= FO_NEW_DEPTH_STENCIL;
+ failover->sw->bind_depth_stencil_alpha_state(failover->sw, state->sw_state);
failover->hw->bind_depth_stencil_alpha_state(failover->hw, state->hw_state);
}
struct fo_state *state = (struct fo_state*)ds;
struct failover_context *failover = failover_context(pipe);
- failover->sw->delete_depth_stencil_alpha_state(pipe, state->sw_state);
- failover->hw->delete_depth_stencil_alpha_state(pipe, state->hw_state);
+ failover->sw->delete_depth_stencil_alpha_state(failover->sw, state->sw_state);
+ failover->hw->delete_depth_stencil_alpha_state(failover->hw, state->hw_state);
state->sw_state = 0;
state->hw_state = 0;
free(state);
failover->framebuffer = *framebuffer;
failover->dirty |= FO_NEW_FRAMEBUFFER;
+ failover->sw->set_framebuffer_state( failover->sw, framebuffer );
failover->hw->set_framebuffer_state( failover->hw, framebuffer );
}
struct fo_state *state = malloc(sizeof(struct fo_state));
struct failover_context *failover = failover_context(pipe);
- state->sw_state = failover->sw->create_fs_state(pipe, templ);
- state->hw_state = failover->hw->create_fs_state(pipe, templ);
+ state->sw_state = failover->sw->create_fs_state(failover->sw, templ);
+ state->hw_state = failover->hw->create_fs_state(failover->hw, templ);
return state;
}
struct fo_state *state = (struct fo_state*)fs;
failover->fragment_shader = state;
failover->dirty |= FO_NEW_FRAGMENT_SHADER;
+ failover->sw->bind_fs_state(failover->sw, state->sw_state);
failover->hw->bind_fs_state(failover->hw, state->hw_state);
}
struct fo_state *state = (struct fo_state*)fs;
struct failover_context *failover = failover_context(pipe);
- failover->sw->delete_fs_state(pipe, state->sw_state);
- failover->hw->delete_fs_state(pipe, state->hw_state);
+ failover->sw->delete_fs_state(failover->sw, state->sw_state);
+ failover->hw->delete_fs_state(failover->hw, state->hw_state);
state->sw_state = 0;
state->hw_state = 0;
free(state);
struct fo_state *state = malloc(sizeof(struct fo_state));
struct failover_context *failover = failover_context(pipe);
- state->sw_state = failover->sw->create_vs_state(pipe, templ);
- state->hw_state = failover->hw->create_vs_state(pipe, templ);
+ state->sw_state = failover->sw->create_vs_state(failover->sw, templ);
+ state->hw_state = failover->hw->create_vs_state(failover->hw, templ);
return state;
}
struct fo_state *state = (struct fo_state*)vs;
failover->vertex_shader = state;
failover->dirty |= FO_NEW_VERTEX_SHADER;
+ failover->sw->bind_vs_state(failover->sw, state->sw_state);
failover->hw->bind_vs_state(failover->hw, state->hw_state);
}
struct fo_state *state = (struct fo_state*)vs;
struct failover_context *failover = failover_context(pipe);
- failover->sw->delete_vs_state(pipe, state->sw_state);
- failover->hw->delete_vs_state(pipe, state->hw_state);
+ failover->sw->delete_vs_state(failover->sw, state->sw_state);
+ failover->hw->delete_vs_state(failover->hw, state->hw_state);
state->sw_state = 0;
state->hw_state = 0;
free(state);
failover->poly_stipple = *stipple;
failover->dirty |= FO_NEW_STIPPLE;
+ failover->sw->set_polygon_stipple( failover->sw, stipple );
failover->hw->set_polygon_stipple( failover->hw, stipple );
}
struct fo_state *state = malloc(sizeof(struct fo_state));
struct failover_context *failover = failover_context(pipe);
- state->sw_state = failover->sw->create_rasterizer_state(pipe, templ);
- state->hw_state = failover->hw->create_rasterizer_state(pipe, templ);
+ state->sw_state = failover->sw->create_rasterizer_state(failover->sw, templ);
+ state->hw_state = failover->hw->create_rasterizer_state(failover->hw, templ);
return state;
}
struct fo_state *state = (struct fo_state*)raster;
failover->rasterizer = state;
failover->dirty |= FO_NEW_RASTERIZER;
+ failover->sw->bind_rasterizer_state(failover->sw, state->sw_state);
failover->hw->bind_rasterizer_state(failover->hw, state->hw_state);
}
struct fo_state *state = (struct fo_state*)raster;
struct failover_context *failover = failover_context(pipe);
- failover->sw->delete_rasterizer_state(pipe, state->sw_state);
- failover->hw->delete_rasterizer_state(pipe, state->hw_state);
+ failover->sw->delete_rasterizer_state(failover->sw, state->sw_state);
+ failover->hw->delete_rasterizer_state(failover->hw, state->hw_state);
state->sw_state = 0;
state->hw_state = 0;
free(state);
failover->scissor = *scissor;
failover->dirty |= FO_NEW_SCISSOR;
+ failover->sw->set_scissor_state( failover->sw, scissor );
failover->hw->set_scissor_state( failover->hw, scissor );
}
struct fo_state *state = malloc(sizeof(struct fo_state));
struct failover_context *failover = failover_context(pipe);
- state->sw_state = failover->sw->create_sampler_state(pipe, templ);
- state->hw_state = failover->hw->create_sampler_state(pipe, templ);
+ state->sw_state = failover->sw->create_sampler_state(failover->sw, templ);
+ state->hw_state = failover->hw->create_sampler_state(failover->hw, templ);
return state;
}
failover->sampler[unit] = state;
failover->dirty |= FO_NEW_SAMPLER;
failover->dirty_sampler |= (1<<unit);
+ failover->sw->bind_sampler_state(failover->sw, unit,
+ state->sw_state);
failover->hw->bind_sampler_state(failover->hw, unit,
state->hw_state);
}
struct fo_state *state = (struct fo_state*)sampler;
struct failover_context *failover = failover_context(pipe);
- failover->sw->delete_sampler_state(pipe, state->sw_state);
- failover->hw->delete_sampler_state(pipe, state->hw_state);
+ failover->sw->delete_sampler_state(failover->sw, state->sw_state);
+ failover->hw->delete_sampler_state(failover->hw, state->hw_state);
state->sw_state = 0;
state->hw_state = 0;
free(state);
failover->texture[unit] = texture;
failover->dirty |= FO_NEW_TEXTURE;
failover->dirty_texture |= (1<<unit);
+ failover->sw->set_sampler_texture( failover->sw, unit, texture );
failover->hw->set_sampler_texture( failover->hw, unit, texture );
}
failover->viewport = *viewport;
failover->dirty |= FO_NEW_VIEWPORT;
+ failover->sw->set_viewport_state( failover->sw, viewport );
failover->hw->set_viewport_state( failover->hw, viewport );
}
failover->vertex_buffer[unit] = *vertex_buffer;
failover->dirty |= FO_NEW_VERTEX_BUFFER;
failover->dirty_vertex_buffer |= (1<<unit);
+ failover->sw->set_vertex_buffer( failover->sw, unit, vertex_buffer );
failover->hw->set_vertex_buffer( failover->hw, unit, vertex_buffer );
}
failover->vertex_element[unit] = *vertex_element;
failover->dirty |= FO_NEW_VERTEX_ELEMENT;
failover->dirty_vertex_element |= (1<<unit);
+ failover->sw->set_vertex_element( failover->sw, unit, vertex_element );
failover->hw->set_vertex_element( failover->hw, unit, vertex_element );
}
+void
+failover_set_constant_buffer(struct pipe_context *pipe,
+ uint shader, uint index,
+ const struct pipe_constant_buffer *buf)
+{
+ struct failover_context *failover = failover_context(pipe);
+
+ assert(shader < PIPE_SHADER_TYPES);
+ assert(index == 0);
+
+ failover->sw->set_constant_buffer(failover->sw, shader, index, buf);
+ failover->hw->set_constant_buffer(failover->hw, shader, index, buf);
+}
+
void
failover_init_state_functions( struct failover_context *failover )
failover->pipe.set_viewport_state = failover_set_viewport_state;
failover->pipe.set_vertex_buffer = failover_set_vertex_buffer;
failover->pipe.set_vertex_element = failover_set_vertex_element;
+ failover->pipe.set_constant_buffer = failover_set_constant_buffer;
}