* surface functions using the render engine
*/
+static void
+i915_util_blitter_save_states(struct i915_context *i915)
+{
+ 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_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_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);
+}
+
static void
i915_surface_copy_render(struct pipe_context *pipe,
struct pipe_resource *dst, unsigned dst_level,
return;
}
- 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_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);
+ i915_util_blitter_save_states(i915);
util_blitter_copy_texture(i915->blitter, dst, dst_level, dstx, dsty, dstz,
src, src_level, src_box, PIPE_MASK_RGBAZS, TRUE);
(short) src_box->width, (short) src_box->height );
}
+static void
+i915_blit(struct pipe_context *pipe, const struct pipe_blit_info *blit_info)
+{
+ struct i915_context *i915 = i915_context(pipe);
+ struct pipe_blit_info info = *blit_info;
+
+ if (util_try_blit_via_copy_region(pipe, &info)) {
+ return; /* done */
+ }
+
+ if (info.mask & PIPE_MASK_S) {
+ debug_printf("i915: cannot blit stencil, skipping\n");
+ info.mask &= ~PIPE_MASK_S;
+ }
+
+ if (!util_blitter_is_blit_supported(i915->blitter, &info)) {
+ debug_printf("i915: blit unsupported %s -> %s\n",
+ util_format_short_name(info.src.resource->format),
+ util_format_short_name(info.dst.resource->format));
+ return;
+ }
+
+ i915_util_blitter_save_states(i915);
+
+ util_blitter_blit(i915->blitter, &info);
+}
+
static void
i915_clear_render_target_blitter(struct pipe_context *pipe,
struct pipe_surface *dst,
i915->base.clear_render_target = i915_clear_render_target_render;
i915->base.clear_depth_stencil = i915_clear_depth_stencil_render;
}
+ i915->base.blit = i915_blit;
i915->base.create_surface = i915_create_surface;
i915->base.surface_destroy = i915_surface_destroy;
}