summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_surface.c
diff options
context:
space:
mode:
authorDaniel Vetter <[email protected]>2011-03-11 20:21:00 +0100
committerDaniel Vetter <[email protected]>2011-03-12 20:32:29 +0100
commitf0c56e2a23ec3a6ffa5aebe613a469e39601e7af (patch)
treea4e4ecf38fdc0a4b093d5a8730e182d31c821fb8 /src/gallium/drivers/i915/i915_surface.c
parent06713a40798d97aa520b119731418ff16a92e4ba (diff)
i915g: implement copy_region using u_blitter
Signed-off-by: Daniel Vetter <[email protected]>works
Diffstat (limited to 'src/gallium/drivers/i915/i915_surface.c')
-rw-r--r--src/gallium/drivers/i915/i915_surface.c48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c
index 5dcb6c2ee7f..d02c420f6c2 100644
--- a/src/gallium/drivers/i915/i915_surface.c
+++ b/src/gallium/drivers/i915/i915_surface.c
@@ -43,6 +43,40 @@
*/
static void
+i915_surface_copy_render(struct pipe_context *pipe,
+ struct pipe_resource *dst, unsigned dst_level,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src, unsigned src_level,
+ const struct pipe_box *src_box)
+{
+ struct i915_context *i915 = i915_context(pipe);
+
+ util_blitter_save_blend(i915->blitter, (void *)i915->blend);
+ 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_viewport(i915->blitter, &i915->viewport);
+ util_blitter_save_clip(i915->blitter, &i915->saved_clip);
+ 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_framebuffer(i915->blitter, &i915->framebuffer);
+
+ util_blitter_save_fragment_sampler_states(i915->blitter,
+ i915->saved_nr_samplers,
+ i915->saved_samplers);
+ util_blitter_save_fragment_sampler_views(i915->blitter,
+ i915->saved_nr_sampler_views,
+ i915->saved_sampler_views);
+
+ util_blitter_copy_region(i915->blitter, dst, dst_level, dstx, dsty, dstz,
+ src, src_level, src_box, TRUE);
+}
+
+static void
i915_clear_render_target_render(struct pipe_context *pipe,
struct pipe_surface *dst,
const float *rgba,
@@ -112,11 +146,11 @@ i915_clear_depth_stencil_render(struct pipe_context *pipe,
* do it higher up if required.
*/
static void
-i915_surface_copy(struct pipe_context *pipe,
- struct pipe_resource *dst, unsigned dst_level,
- unsigned dstx, unsigned dsty, unsigned dstz,
- struct pipe_resource *src, unsigned src_level,
- const struct pipe_box *src_box)
+i915_surface_copy_blitter(struct pipe_context *pipe,
+ struct pipe_resource *dst, unsigned dst_level,
+ unsigned dstx, unsigned dsty, unsigned dstz,
+ struct pipe_resource *src, unsigned src_level,
+ const struct pipe_box *src_box)
{
struct i915_texture *dst_tex = i915_texture(dst);
struct i915_texture *src_tex = i915_texture(src);
@@ -150,7 +184,6 @@ i915_surface_copy(struct pipe_context *pipe,
(short) src_box->width, (short) src_box->height );
}
-
static void
i915_clear_render_target_blitter(struct pipe_context *pipe,
struct pipe_surface *dst,
@@ -262,11 +295,12 @@ i915_surface_destroy(struct pipe_context *ctx,
void
i915_init_surface_functions(struct i915_context *i915)
{
- i915->base.resource_copy_region = i915_surface_copy;
if (i915_screen(i915->base.screen)->debug.use_blitter) {
+ i915->base.resource_copy_region = i915_surface_copy_blitter;
i915->base.clear_render_target = i915_clear_render_target_blitter;
i915->base.clear_depth_stencil = i915_clear_depth_stencil_blitter;
} else {
+ i915->base.resource_copy_region = i915_surface_copy_render;
i915->base.clear_render_target = i915_clear_render_target_render;
i915->base.clear_depth_stencil = i915_clear_depth_stencil_render;
}