ffb2d372630bc477a40295f168c990c473030b70
2 * Copyright 2009 Marek Olšák <maraeo@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #include <pipe/p_screen.h>
28 #include <util/u_blitter.h>
29 #include <util/u_inlines.h>
30 #include <util/u_memory.h>
31 #include "r600_screen.h"
32 #include "r600_context.h"
34 static void r600_blitter_save_states(struct pipe_context
*ctx
)
36 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
38 util_blitter_save_blend(rctx
->blitter
,
39 rctx
->draw
->state
[R600_BLEND
]);
40 util_blitter_save_depth_stencil_alpha(rctx
->blitter
,
41 rctx
->draw
->state
[R600_DSA
]);
42 util_blitter_save_stencil_ref(rctx
->blitter
, &rctx
->stencil_ref
);
43 util_blitter_save_rasterizer(rctx
->blitter
,
44 rctx
->draw
->state
[R600_RASTERIZER
]);
45 util_blitter_save_fragment_shader(rctx
->blitter
,
47 util_blitter_save_vertex_shader(rctx
->blitter
,
49 util_blitter_save_vertex_elements(rctx
->blitter
,
50 rctx
->vertex_elements
);
51 util_blitter_save_viewport(rctx
->blitter
,
55 void r600_clear(struct pipe_context
*ctx
, unsigned buffers
,
56 const float *rgba
, double depth
, unsigned stencil
)
58 struct r600_context
*rctx
= (struct r600_context
*)ctx
;
59 struct pipe_framebuffer_state
*fb
= &rctx
->fb_state
;
61 r600_blitter_save_states(ctx
);
62 util_blitter_clear(rctx
->blitter
, fb
->width
, fb
->height
,
63 fb
->nr_cbufs
, buffers
, rgba
, depth
,
67 void r600_clear_render_target(struct pipe_context
*pipe
,
68 struct pipe_surface
*dst
,
70 unsigned dstx
, unsigned dsty
,
71 unsigned width
, unsigned height
)
75 void r300_clear_depth_stencil(struct pipe_context
*pipe
,
76 struct pipe_surface
*dst
,
80 unsigned dstx
, unsigned dsty
,
81 unsigned width
, unsigned height
)
85 void r600_resource_copy_region(struct pipe_context
*pipe
,
86 struct pipe_resource
*dst
,
87 struct pipe_subresource subdst
,
88 unsigned dstx
, unsigned dsty
, unsigned dstz
,
89 struct pipe_resource
*src
,
90 struct pipe_subresource subsrc
,
91 unsigned srcx
, unsigned srcy
, unsigned srcz
,
92 unsigned width
, unsigned height
)