struct i915_fragment_shader *fs;
+ void *vs;
+
+ struct i915_velems_state *velems;
+ unsigned nr_vertex_buffers;
+ struct pipe_vertex_buffer vertex_buffers[PIPE_MAX_ATTRIBS];
+
struct pipe_blend_color blend_color;
struct pipe_stencil_ref stencil_ref;
struct pipe_clip_state clip;
struct blitter_context* blitter;
/** State tracking needed by u_blitter for save/restore. */
- void *saved_fs;
void (*saved_bind_fs_state)(struct pipe_context *pipe, void *shader);
- void *saved_vs;
- struct pipe_clip_state saved_clip;
- struct i915_velems_state *saved_velems;
- unsigned saved_nr_vertex_buffers;
- struct pipe_vertex_buffer saved_vertex_buffers[PIPE_MAX_ATTRIBS];
- unsigned saved_nr_samplers;
- void *saved_samplers[PIPE_MAX_SAMPLERS];
void (*saved_bind_sampler_states)(struct pipe_context *pipe,
unsigned num, void **sampler);
- unsigned saved_nr_sampler_views;
- struct pipe_sampler_view *saved_sampler_views[PIPE_MAX_SAMPLERS];
void (*saved_set_sampler_views)(struct pipe_context *pipe,
unsigned num, struct pipe_sampler_view **views);
};
{
struct i915_context *i915 = i915_context(pipe);
- i915->saved_nr_samplers = num;
- memcpy(&i915->saved_samplers, sampler, sizeof(void *) * num);
-
i915->saved_bind_sampler_states(pipe, num, sampler);
}
{
struct i915_context *i915 = i915_context(pipe);
- if (i915->saved_fs == shader)
- return;
-
- i915->saved_fs = shader;
-
i915->saved_bind_fs_state(pipe, shader);
}
{
struct i915_context *i915 = i915_context(pipe);
- if (i915->saved_vs == shader)
+ if (i915->vs == shader)
return;
- i915->saved_vs = shader;
+ i915->vs = shader;
/* just pass-through to draw module */
draw_bind_vertex_shader(i915->draw, (struct draw_vertex_shader *) shader);
struct pipe_sampler_view **views)
{
struct i915_context *i915 = i915_context(pipe);
- int i;
-
- for (i = 0; i < num; i++)
- pipe_sampler_view_reference(&i915->saved_sampler_views[i],
- views[i]);
-
- for (i = num; i < i915->saved_nr_sampler_views; i++)
- pipe_sampler_view_reference(&i915->saved_sampler_views[i],
- NULL);
-
- i915->saved_nr_sampler_views = num;
i915->saved_set_sampler_views(pipe, num, views);
}
}
pipe_surface_reference(&i915->framebuffer.zsbuf, fb->zsbuf);
- i915->dirty |= I915_NEW_FRAMEBUFFER;
+ i915->dirty |= I915_NEW_FRAMEBUFFER | I915_NEW_FS;
}
{
struct i915_context *i915 = i915_context(pipe);
- i915->saved_clip = *clip;
+ i915->clip = *clip;
draw_set_clip_state(i915->draw, clip);
struct draw_context *draw = i915->draw;
int i;
- util_copy_vertex_buffers(i915->saved_vertex_buffers,
- &i915->saved_nr_vertex_buffers,
+ util_copy_vertex_buffers(i915->vertex_buffers,
+ &i915->nr_vertex_buffers,
buffers, count);
#if 0
/* XXX doesn't look like this is needed */
struct i915_context *i915 = i915_context(pipe);
struct i915_velems_state *i915_velems = (struct i915_velems_state *) velems;
- if (i915->saved_velems == velems)
+ if (i915->velems == velems)
return;
- i915->saved_velems = velems;
+ i915->velems = velems;
/* pass-through to draw module */
if (i915_velems) {
util_blitter_save_depth_stencil_alpha(i915->blitter, (void *)i915->depth_stencil);
util_blitter_save_stencil_ref(i915->blitter, &i915->stencil_ref);
util_blitter_save_rasterizer(i915->blitter, (void *)i915->rasterizer);
- util_blitter_save_fragment_shader(i915->blitter, i915->saved_fs);
- util_blitter_save_vertex_shader(i915->blitter, i915->saved_vs);
+ util_blitter_save_fragment_shader(i915->blitter, i915->fs);
+ util_blitter_save_vertex_shader(i915->blitter, i915->vs);
util_blitter_save_viewport(i915->blitter, &i915->viewport);
util_blitter_save_scissor(i915->blitter, &i915->scissor);
- util_blitter_save_vertex_elements(i915->blitter, i915->saved_velems);
- util_blitter_save_vertex_buffers(i915->blitter, i915->saved_nr_vertex_buffers,
- i915->saved_vertex_buffers);
+ util_blitter_save_vertex_elements(i915->blitter, i915->velems);
+ util_blitter_save_vertex_buffers(i915->blitter, i915->nr_vertex_buffers,
+ i915->vertex_buffers);
util_blitter_save_framebuffer(i915->blitter, &i915->framebuffer);
util_blitter_save_fragment_sampler_states(i915->blitter,
- i915->saved_nr_samplers,
- i915->saved_samplers);
+ i915->num_samplers,
+ i915->sampler);
util_blitter_save_fragment_sampler_views(i915->blitter,
- i915->saved_nr_sampler_views,
- i915->saved_sampler_views);
+ i915->num_fragment_sampler_views,
+ i915->fragment_sampler_views);
}
static void