1 /**************************************************************************
3 * Copyright 2011 Lauri Kasanen
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
32 #include "postprocess.h"
33 #include "cso_cache/cso_context.h"
37 * Internal control details.
41 struct pipe_screen
*screen
;
42 struct pipe_context
*pipe
;
43 struct cso_context
*cso
;
45 struct pipe_blend_state blend
;
46 struct pipe_depth_stencil_alpha_state depthstencil
;
47 struct pipe_rasterizer_state rasterizer
;
48 struct pipe_sampler_state sampler
; /* bilinear */
49 struct pipe_sampler_state sampler_point
; /* point */
50 struct pipe_viewport_state viewport
;
51 struct pipe_framebuffer_state framebuffer
;
52 struct cso_velems_state velem
;
54 union pipe_color_union clear_color
;
58 struct pipe_resource
*vbuf
;
59 struct pipe_surface surf
;
60 struct pipe_sampler_view
*view
;
66 * The main post-processing queue.
70 pp_func
*pp_queue
; /* An array of pp_funcs */
71 unsigned int n_filters
; /* Number of enabled filters */
73 struct pipe_resource
*tmp
[2]; /* Two temp FBOs for the queue */
74 struct pipe_resource
*inner_tmp
[3]; /* Three for filter use */
76 unsigned int n_tmp
, n_inner_tmp
;
78 struct pipe_resource
*depth
; /* depth of original input */
79 struct pipe_resource
*stencil
; /* stencil shared by inner_tmps */
80 struct pipe_resource
*areamaptex
; /* MLAA area map texture */
82 struct pipe_surface
*tmps
[2], *inner_tmps
[3], *stencils
;
84 void ***shaders
; /* Shaders in TGSI form */
85 unsigned int *filters
; /* Active filter to filters.h mapping. */
92 void pp_free_fbos(struct pp_queue_t
*);
94 void pp_debug(const char *, ...);
96 struct pp_program
*pp_init_prog(struct pp_queue_t
*, struct pipe_context
*pipe
,
97 struct cso_context
*);
99 void pp_blit(struct pipe_context
*pipe
,
100 struct pipe_resource
*src_tex
,
101 int srcX0
, int srcY0
,
102 int srcX1
, int srcY1
,
104 struct pipe_surface
*dst
,
105 int dstX0
, int dstY0
,
106 int dstX1
, int dstY1
);
109 #endif /* PP_PRIVATE_H */