#include "svga_cmd.h"
#include "svga_surface.h"
+#include "util/u_format.h"
#include "util/u_surface.h"
#define FILE_DEBUG_FLAG DEBUG_BLIT
}
+static void svga_blit(struct pipe_context *pipe,
+ const struct pipe_blit_info *blit_info)
+{
+ struct svga_context *svga = svga_context(pipe);
+ struct pipe_blit_info info = *blit_info;
+
+ if (info.src.resource->nr_samples > 1 &&
+ info.dst.resource->nr_samples <= 1 &&
+ !util_format_is_depth_or_stencil(info.src.resource->format) &&
+ !util_format_is_pure_integer(info.src.resource->format)) {
+ debug_printf("svga: color resolve unimplemented\n");
+ return;
+ }
+
+ if (util_try_blit_via_copy_region(pipe, &info)) {
+ return; /* done */
+ }
+
+ if (info.mask & PIPE_MASK_S) {
+ debug_printf("svga: cannot blit stencil, skipping\n");
+ info.mask &= ~PIPE_MASK_S;
+ }
+
+ if (!util_blitter_is_blit_supported(svga->blitter, &info)) {
+ debug_printf("svga: blit unsupported %s -> %s\n",
+ util_format_short_name(info.src.resource->format),
+ util_format_short_name(info.dst.resource->format));
+ return;
+ }
+
+ /* XXX turn off occlusion and streamout queries */
+
+ util_blitter_save_vertex_buffers(svga->blitter,
+ svga->curr.num_vertex_buffers,
+ svga->curr.vb);
+ util_blitter_save_vertex_elements(svga->blitter, (void*)svga->curr.velems);
+ util_blitter_save_vertex_shader(svga->blitter, svga->curr.vs);
+ /*util_blitter_save_geometry_shader(svga->blitter, svga->curr.gs);*/
+ /*util_blitter_save_so_targets(svga->blitter, svga->num_so_targets,
+ (struct pipe_stream_output_target**)svga->so_targets);*/
+ util_blitter_save_rasterizer(svga->blitter, (void*)svga->curr.rast);
+ util_blitter_save_viewport(svga->blitter, &svga->curr.viewport);
+ util_blitter_save_scissor(svga->blitter, &svga->curr.scissor);
+ util_blitter_save_fragment_shader(svga->blitter, svga->curr.fs);
+ util_blitter_save_blend(svga->blitter, (void*)svga->curr.blend);
+ util_blitter_save_depth_stencil_alpha(svga->blitter,
+ (void*)svga->curr.depth);
+ util_blitter_save_stencil_ref(svga->blitter, &svga->curr.stencil_ref);
+ /*util_blitter_save_sample_mask(svga->blitter, svga->sample_mask);*/
+ util_blitter_save_framebuffer(svga->blitter, &svga->curr.framebuffer);
+ util_blitter_save_fragment_sampler_states(svga->blitter,
+ svga->curr.num_samplers,
+ (void**)svga->curr.sampler);
+ util_blitter_save_fragment_sampler_views(svga->blitter,
+ svga->curr.num_sampler_views,
+ svga->curr.sampler_views);
+ /*util_blitter_save_render_condition(svga->blitter, svga->render_cond_query,
+ svga->render_cond_mode);*/
+ util_blitter_blit(svga->blitter, &info);
+}
+
+
void
svga_init_blit_functions(struct svga_context *svga)
{
svga->pipe.resource_copy_region = svga_surface_copy;
+ svga->pipe.blit = svga_blit;
}