*/
void draw_do_flush( struct draw_context *draw, unsigned flags )
{
- if (!draw->flushing && !draw->vcache_flushing)
+ if (!draw->suspend_flushing)
{
+ assert(!draw->flushing); /* catch inadvertant recursion */
+
draw->flushing = TRUE;
draw_pipeline_flush( draw, flags );
static boolean
bind_aaline_fragment_shader(struct aaline_stage *aaline)
{
+ struct draw_context *draw = aaline->stage.draw;
+
if (!aaline->fs->aaline_fs &&
!generate_aaline_fs(aaline))
return FALSE;
+ draw->suspend_flushing = TRUE;
aaline->driver_bind_fs_state(aaline->pipe, aaline->fs->aaline_fs);
+ draw->suspend_flushing = FALSE;
+
return TRUE;
}
pipe_texture_reference(&aaline->state.texture[aaline->fs->sampler_unit],
aaline->texture);
+ draw->suspend_flushing = TRUE;
aaline->driver_bind_sampler_states(pipe, num_samplers, aaline->state.sampler);
aaline->driver_set_sampler_textures(pipe, num_samplers, aaline->state.texture);
+ draw->suspend_flushing = FALSE;
/* now really draw first line */
stage->line = aaline_line;
stage->line = aaline_first_line;
stage->next->flush( stage->next, flags );
- /* restore original frag shader */
+ /* restore original frag shader, texture, sampler state */
+ draw->suspend_flushing = TRUE;
aaline->driver_bind_fs_state(pipe, aaline->fs->driver_fs);
-
- /* XXX restore original texture, sampler state */
aaline->driver_bind_sampler_states(pipe, aaline->num_samplers,
aaline->state.sampler);
aaline->driver_set_sampler_textures(pipe, aaline->num_textures,
aaline->state.texture);
+ draw->suspend_flushing = FALSE;
draw->extra_vp_outputs.slot = 0;
}
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
struct aaline_fragment_shader *aafs = (struct aaline_fragment_shader *) fs;
+
/* save current */
aaline->fs = aafs;
/* pass-through */
unsigned num, void **sampler)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
+ struct draw_context *draw = aaline->stage.draw;
+
/* save current */
memcpy(aaline->state.sampler, sampler, num * sizeof(void *));
aaline->num_samplers = num;
+
/* pass-through */
aaline->driver_bind_sampler_states(aaline->pipe, num, sampler);
}
unsigned num, struct pipe_texture **texture)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
+ struct draw_context *draw = aaline->stage.draw;
uint i;
/* save current */
static boolean
bind_aapoint_fragment_shader(struct aapoint_stage *aapoint)
{
+ struct draw_context *draw = aapoint->stage.draw;
+
if (!aapoint->fs->aapoint_fs &&
!generate_aapoint_fs(aapoint))
return FALSE;
+ draw->suspend_flushing = TRUE;
aapoint->driver_bind_fs_state(aapoint->pipe, aapoint->fs->aapoint_fs);
+ draw->suspend_flushing = FALSE;
+
return TRUE;
}
stage->next->flush( stage->next, flags );
/* restore original frag shader */
+ draw->suspend_flushing = TRUE;
aapoint->driver_bind_fs_state(pipe, aapoint->fs->driver_fs);
+ draw->suspend_flushing = FALSE;
draw->extra_vp_outputs.slot = 0;
}
static boolean
bind_pstip_fragment_shader(struct pstip_stage *pstip)
{
+ struct draw_context *draw = pstip->stage.draw;
if (!pstip->fs->pstip_fs &&
!generate_pstip_fs(pstip))
return FALSE;
+ draw->suspend_flushing = TRUE;
pstip->driver_bind_fs_state(pstip->pipe, pstip->fs->pstip_fs);
+ draw->suspend_flushing = FALSE;
return TRUE;
}
{
struct pstip_stage *pstip = pstip_stage(stage);
struct pipe_context *pipe = pstip->pipe;
+ struct draw_context *draw = stage->draw;
uint num_samplers;
assert(stage->draw->rasterizer->poly_stipple_enable);
assert(num_samplers <= PIPE_MAX_SAMPLERS);
+ draw->suspend_flushing = TRUE;
pstip->driver_bind_sampler_states(pipe, num_samplers, pstip->state.samplers);
pstip->driver_set_sampler_textures(pipe, num_samplers, pstip->state.textures);
+ draw->suspend_flushing = FALSE;
/* now really draw first triangle */
stage->tri = draw_pipe_passthrough_tri;
static void
pstip_flush(struct draw_stage *stage, unsigned flags)
{
- /*struct draw_context *draw = stage->draw;*/
+ struct draw_context *draw = stage->draw;
struct pstip_stage *pstip = pstip_stage(stage);
struct pipe_context *pipe = pstip->pipe;
/* restore original frag shader */
pstip->driver_bind_fs_state(pipe, pstip->fs->driver_fs);
- /* XXX restore original texture, sampler state */
+ /* restore original texture, sampler state */
+ draw->suspend_flushing = TRUE;
pstip->driver_bind_sampler_states(pipe, pstip->num_samplers,
pstip->state.samplers);
pstip->driver_set_sampler_textures(pipe, pstip->num_textures,
pstip->state.textures);
+ draw->suspend_flushing = FALSE;
}
unsigned num, struct pipe_texture **texture)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
+ struct draw_context *draw = pstip->stage.draw;
uint i;
/* save current */
const struct pipe_poly_stipple *stipple)
{
struct pstip_stage *pstip = pstip_stage_from_pipe(pipe);
+ struct draw_context *draw = (struct draw_context *) pipe->draw;
+
/* save current */
pstip->state.stipple = stipple;
+
/* pass-through */
pstip->driver_set_polygon_stipple(pstip->pipe, stipple);
boolean bypass_clipping;
} driver;
- boolean flushing;
- boolean vcache_flushing;
- boolean bypass_clipping; /* set if either api or driver bypass_clipping true */
+ boolean flushing; /**< debugging/sanity */
+ boolean suspend_flushing; /**< internally set */
+ boolean bypass_clipping; /**< set if either api or driver bypass_clipping true */
/* pipe state that we need: */
const struct pipe_rasterizer_state *rasterizer;
static void vcache_flush( struct vcache_frontend *vcache )
{
- vcache->draw->vcache_flushing = TRUE;
if (vcache->draw_count) {
vcache->middle->run( vcache->middle,
vcache->fetch_elts,
memset(vcache->in, ~0, sizeof(vcache->in));
vcache->fetch_count = 0;
vcache->draw_count = 0;
- vcache->draw->vcache_flushing = FALSE;
}
static void vcache_check_flush( struct vcache_frontend *vcache )