1bf215546Sopenharmony_ci/**
2bf215546Sopenharmony_ci * Copyright (C) 2010 Jorge Jimenez (jorge@iryoku.com)
3bf215546Sopenharmony_ci * Copyright (C) 2010 Belen Masia (bmasia@unizar.es)
4bf215546Sopenharmony_ci * Copyright (C) 2010 Jose I. Echevarria (joseignacioechevarria@gmail.com)
5bf215546Sopenharmony_ci * Copyright (C) 2010 Fernando Navarro (fernandn@microsoft.com)
6bf215546Sopenharmony_ci * Copyright (C) 2010 Diego Gutierrez (diegog@unizar.es)
7bf215546Sopenharmony_ci * Copyright (C) 2011 Lauri Kasanen (cand@gmx.com)
8bf215546Sopenharmony_ci * All rights reserved.
9bf215546Sopenharmony_ci *
10bf215546Sopenharmony_ci * Redistribution and use in source and binary forms, with or without
11bf215546Sopenharmony_ci * modification, are permitted provided that the following conditions are met:
12bf215546Sopenharmony_ci *
13bf215546Sopenharmony_ci *    1. Redistributions of source code must retain the above copyright notice,
14bf215546Sopenharmony_ci *       this list of conditions and the following disclaimer.
15bf215546Sopenharmony_ci *
16bf215546Sopenharmony_ci *    2. Redistributions in binary form must reproduce the following statement:
17bf215546Sopenharmony_ci *
18bf215546Sopenharmony_ci *       "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
19bf215546Sopenharmony_ci *        Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
20bf215546Sopenharmony_ci *
21bf215546Sopenharmony_ci *       Only for use in the Mesa project, this point 2 is filled by naming the
22bf215546Sopenharmony_ci *       technique Jimenez's MLAA in the Mesa config options.
23bf215546Sopenharmony_ci *
24bf215546Sopenharmony_ci * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
25bf215546Sopenharmony_ci * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
26bf215546Sopenharmony_ci * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27bf215546Sopenharmony_ci * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS OR CONTRIBUTORS
28bf215546Sopenharmony_ci * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29bf215546Sopenharmony_ci * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30bf215546Sopenharmony_ci * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31bf215546Sopenharmony_ci * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32bf215546Sopenharmony_ci * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33bf215546Sopenharmony_ci * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34bf215546Sopenharmony_ci * POSSIBILITY OF SUCH DAMAGE.
35bf215546Sopenharmony_ci *
36bf215546Sopenharmony_ci * The views and conclusions contained in the software and documentation are
37bf215546Sopenharmony_ci * those of the authors and should not be interpreted as representing official
38bf215546Sopenharmony_ci * policies, either expressed or implied, of the copyright holders.
39bf215546Sopenharmony_ci */
40bf215546Sopenharmony_ci
41bf215546Sopenharmony_ci#include "pipe/p_compiler.h"
42bf215546Sopenharmony_ci
43bf215546Sopenharmony_ci#include "postprocess/postprocess.h"
44bf215546Sopenharmony_ci#include "postprocess/pp_mlaa.h"
45bf215546Sopenharmony_ci#include "postprocess/pp_filters.h"
46bf215546Sopenharmony_ci#include "postprocess/pp_private.h"
47bf215546Sopenharmony_ci
48bf215546Sopenharmony_ci#include "util/u_box.h"
49bf215546Sopenharmony_ci#include "util/u_sampler.h"
50bf215546Sopenharmony_ci#include "util/u_inlines.h"
51bf215546Sopenharmony_ci#include "util/u_memory.h"
52bf215546Sopenharmony_ci#include "util/u_string.h"
53bf215546Sopenharmony_ci#include "pipe/p_screen.h"
54bf215546Sopenharmony_ci
55bf215546Sopenharmony_ci#define IMM_SPACE 80
56bf215546Sopenharmony_ci
57bf215546Sopenharmony_cistatic float constants[] = { 1, 1, 0, 0 };
58bf215546Sopenharmony_cistatic unsigned int dimensions[2] = { 0, 0 };
59bf215546Sopenharmony_ci
60bf215546Sopenharmony_ci/** Run function of the MLAA filter. */
61bf215546Sopenharmony_cistatic void
62bf215546Sopenharmony_cipp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in,
63bf215546Sopenharmony_ci                   struct pipe_resource *out, unsigned int n, bool iscolor)
64bf215546Sopenharmony_ci{
65bf215546Sopenharmony_ci
66bf215546Sopenharmony_ci   struct pp_program *p = ppq->p;
67bf215546Sopenharmony_ci
68bf215546Sopenharmony_ci   struct pipe_depth_stencil_alpha_state mstencil;
69bf215546Sopenharmony_ci   struct pipe_sampler_view v_tmp, *arr[3];
70bf215546Sopenharmony_ci
71bf215546Sopenharmony_ci   unsigned int w = 0;
72bf215546Sopenharmony_ci   unsigned int h = 0;
73bf215546Sopenharmony_ci
74bf215546Sopenharmony_ci   const struct pipe_stencil_ref ref = { {1} };
75bf215546Sopenharmony_ci
76bf215546Sopenharmony_ci   /* Insufficient initialization checks. */
77bf215546Sopenharmony_ci   assert(p);
78bf215546Sopenharmony_ci   assert(ppq);
79bf215546Sopenharmony_ci   assert(ppq->areamaptex);
80bf215546Sopenharmony_ci   assert(ppq->inner_tmp);
81bf215546Sopenharmony_ci   assert(ppq->shaders[n]);
82bf215546Sopenharmony_ci
83bf215546Sopenharmony_ci   w = p->framebuffer.width;
84bf215546Sopenharmony_ci   h = p->framebuffer.height;
85bf215546Sopenharmony_ci
86bf215546Sopenharmony_ci   memset(&mstencil, 0, sizeof(mstencil));
87bf215546Sopenharmony_ci
88bf215546Sopenharmony_ci   cso_set_stencil_ref(p->cso, ref);
89bf215546Sopenharmony_ci
90bf215546Sopenharmony_ci   /* Init the pixel size constant */
91bf215546Sopenharmony_ci   if (dimensions[0] != p->framebuffer.width ||
92bf215546Sopenharmony_ci       dimensions[1] != p->framebuffer.height) {
93bf215546Sopenharmony_ci      constants[0] = 1.0f / p->framebuffer.width;
94bf215546Sopenharmony_ci      constants[1] = 1.0f / p->framebuffer.height;
95bf215546Sopenharmony_ci
96bf215546Sopenharmony_ci      dimensions[0] = p->framebuffer.width;
97bf215546Sopenharmony_ci      dimensions[1] = p->framebuffer.height;
98bf215546Sopenharmony_ci   }
99bf215546Sopenharmony_ci
100bf215546Sopenharmony_ci   struct pipe_constant_buffer cb;
101bf215546Sopenharmony_ci   cb.buffer = NULL;
102bf215546Sopenharmony_ci   cb.buffer_offset = 0;
103bf215546Sopenharmony_ci   cb.buffer_size = sizeof(constants);
104bf215546Sopenharmony_ci   cb.user_buffer = constants;
105bf215546Sopenharmony_ci
106bf215546Sopenharmony_ci   struct pipe_context *pipe = ppq->p->pipe;
107bf215546Sopenharmony_ci   pipe->set_constant_buffer(pipe, PIPE_SHADER_VERTEX, 0, false, &cb);
108bf215546Sopenharmony_ci   pipe->set_constant_buffer(pipe, PIPE_SHADER_FRAGMENT, 0, false, &cb);
109bf215546Sopenharmony_ci
110bf215546Sopenharmony_ci   mstencil.stencil[0].enabled = 1;
111bf215546Sopenharmony_ci   mstencil.stencil[0].valuemask = mstencil.stencil[0].writemask = ~0;
112bf215546Sopenharmony_ci   mstencil.stencil[0].func = PIPE_FUNC_ALWAYS;
113bf215546Sopenharmony_ci   mstencil.stencil[0].fail_op = PIPE_STENCIL_OP_KEEP;
114bf215546Sopenharmony_ci   mstencil.stencil[0].zfail_op = PIPE_STENCIL_OP_KEEP;
115bf215546Sopenharmony_ci   mstencil.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE;
116bf215546Sopenharmony_ci
117bf215546Sopenharmony_ci   p->framebuffer.zsbuf = ppq->stencils;
118bf215546Sopenharmony_ci
119bf215546Sopenharmony_ci   /* First pass: depth edge detection */
120bf215546Sopenharmony_ci   if (iscolor)
121bf215546Sopenharmony_ci      pp_filter_setup_in(p, in);
122bf215546Sopenharmony_ci   else
123bf215546Sopenharmony_ci      pp_filter_setup_in(p, ppq->depth);
124bf215546Sopenharmony_ci
125bf215546Sopenharmony_ci   pp_filter_setup_out(p, ppq->inner_tmp[0]);
126bf215546Sopenharmony_ci
127bf215546Sopenharmony_ci   pp_filter_set_fb(p);
128bf215546Sopenharmony_ci   pp_filter_misc_state(p);
129bf215546Sopenharmony_ci   cso_set_depth_stencil_alpha(p->cso, &mstencil);
130bf215546Sopenharmony_ci   p->pipe->clear(p->pipe, PIPE_CLEAR_STENCIL | PIPE_CLEAR_COLOR0, NULL,
131bf215546Sopenharmony_ci                  &p->clear_color, 0, 0);
132bf215546Sopenharmony_ci
133bf215546Sopenharmony_ci   {
134bf215546Sopenharmony_ci      const struct pipe_sampler_state *samplers[] = {&p->sampler_point};
135bf215546Sopenharmony_ci      cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers);
136bf215546Sopenharmony_ci   }
137bf215546Sopenharmony_ci   pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &p->view);
138bf215546Sopenharmony_ci
139bf215546Sopenharmony_ci   cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][1]);    /* offsetvs */
140bf215546Sopenharmony_ci   cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][2]);
141bf215546Sopenharmony_ci
142bf215546Sopenharmony_ci   pp_filter_draw(p);
143bf215546Sopenharmony_ci   pp_filter_end_pass(p);
144bf215546Sopenharmony_ci
145bf215546Sopenharmony_ci
146bf215546Sopenharmony_ci   /* Second pass: blend weights */
147bf215546Sopenharmony_ci   /* Sampler order: areamap, edgesmap, edgesmapL (reversed, thx compiler) */
148bf215546Sopenharmony_ci   mstencil.stencil[0].func = PIPE_FUNC_EQUAL;
149bf215546Sopenharmony_ci   mstencil.stencil[0].zpass_op = PIPE_STENCIL_OP_KEEP;
150bf215546Sopenharmony_ci   cso_set_depth_stencil_alpha(p->cso, &mstencil);
151bf215546Sopenharmony_ci
152bf215546Sopenharmony_ci   pp_filter_setup_in(p, ppq->areamaptex);
153bf215546Sopenharmony_ci   pp_filter_setup_out(p, ppq->inner_tmp[1]);
154bf215546Sopenharmony_ci
155bf215546Sopenharmony_ci   u_sampler_view_default_template(&v_tmp, ppq->inner_tmp[0],
156bf215546Sopenharmony_ci                                   ppq->inner_tmp[0]->format);
157bf215546Sopenharmony_ci   arr[1] = arr[2] = p->pipe->create_sampler_view(p->pipe,
158bf215546Sopenharmony_ci                                                  ppq->inner_tmp[0], &v_tmp);
159bf215546Sopenharmony_ci
160bf215546Sopenharmony_ci   pp_filter_set_clear_fb(p);
161bf215546Sopenharmony_ci
162bf215546Sopenharmony_ci   {
163bf215546Sopenharmony_ci      const struct pipe_sampler_state *samplers[] =
164bf215546Sopenharmony_ci         {&p->sampler_point, &p->sampler_point, &p->sampler};
165bf215546Sopenharmony_ci      cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 3, samplers);
166bf215546Sopenharmony_ci   }
167bf215546Sopenharmony_ci
168bf215546Sopenharmony_ci   arr[0] = p->view;
169bf215546Sopenharmony_ci   pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 3, 0, false, arr);
170bf215546Sopenharmony_ci
171bf215546Sopenharmony_ci   cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][0]);    /* passvs */
172bf215546Sopenharmony_ci   cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][3]);
173bf215546Sopenharmony_ci
174bf215546Sopenharmony_ci   pp_filter_draw(p);
175bf215546Sopenharmony_ci   pp_filter_end_pass(p);
176bf215546Sopenharmony_ci   pipe_sampler_view_reference(&arr[1], NULL);
177bf215546Sopenharmony_ci
178bf215546Sopenharmony_ci
179bf215546Sopenharmony_ci   /* Third pass: smoothed edges */
180bf215546Sopenharmony_ci   /* Sampler order: colormap, blendmap (wtf compiler) */
181bf215546Sopenharmony_ci   pp_filter_setup_in(p, ppq->inner_tmp[1]);
182bf215546Sopenharmony_ci   pp_filter_setup_out(p, out);
183bf215546Sopenharmony_ci
184bf215546Sopenharmony_ci   pp_filter_set_fb(p);
185bf215546Sopenharmony_ci
186bf215546Sopenharmony_ci   /* Blit the input to the output */
187bf215546Sopenharmony_ci   pp_blit(p->pipe, in, 0, 0,
188bf215546Sopenharmony_ci           w, h, 0, p->framebuffer.cbufs[0],
189bf215546Sopenharmony_ci           0, 0, w, h);
190bf215546Sopenharmony_ci
191bf215546Sopenharmony_ci   u_sampler_view_default_template(&v_tmp, in, in->format);
192bf215546Sopenharmony_ci   arr[0] = p->pipe->create_sampler_view(p->pipe, in, &v_tmp);
193bf215546Sopenharmony_ci
194bf215546Sopenharmony_ci   {
195bf215546Sopenharmony_ci      const struct pipe_sampler_state *samplers[] =
196bf215546Sopenharmony_ci         {&p->sampler_point, &p->sampler_point};
197bf215546Sopenharmony_ci      cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 2, samplers);
198bf215546Sopenharmony_ci   }
199bf215546Sopenharmony_ci
200bf215546Sopenharmony_ci   arr[1] = p->view;
201bf215546Sopenharmony_ci   pipe->set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0, 2, 0, false, arr);
202bf215546Sopenharmony_ci
203bf215546Sopenharmony_ci   cso_set_vertex_shader_handle(p->cso, ppq->shaders[n][1]);    /* offsetvs */
204bf215546Sopenharmony_ci   cso_set_fragment_shader_handle(p->cso, ppq->shaders[n][4]);
205bf215546Sopenharmony_ci
206bf215546Sopenharmony_ci   p->blend.rt[0].blend_enable = 1;
207bf215546Sopenharmony_ci   cso_set_blend(p->cso, &p->blend);
208bf215546Sopenharmony_ci
209bf215546Sopenharmony_ci   pp_filter_draw(p);
210bf215546Sopenharmony_ci   pp_filter_end_pass(p);
211bf215546Sopenharmony_ci   pipe_sampler_view_reference(&arr[0], NULL);
212bf215546Sopenharmony_ci
213bf215546Sopenharmony_ci   p->blend.rt[0].blend_enable = 0;
214bf215546Sopenharmony_ci   p->framebuffer.zsbuf = NULL;
215bf215546Sopenharmony_ci}
216bf215546Sopenharmony_ci
217bf215546Sopenharmony_ci/** The init function of the MLAA filter. */
218bf215546Sopenharmony_cistatic bool
219bf215546Sopenharmony_cipp_jimenezmlaa_init_run(struct pp_queue_t *ppq, unsigned int n,
220bf215546Sopenharmony_ci                        unsigned int val, bool iscolor)
221bf215546Sopenharmony_ci{
222bf215546Sopenharmony_ci
223bf215546Sopenharmony_ci   struct pipe_box box;
224bf215546Sopenharmony_ci   struct pipe_resource res;
225bf215546Sopenharmony_ci   char *tmp_text = NULL;
226bf215546Sopenharmony_ci
227bf215546Sopenharmony_ci   tmp_text = CALLOC(sizeof(blend2fs_1) + sizeof(blend2fs_2) +
228bf215546Sopenharmony_ci                     IMM_SPACE, sizeof(char));
229bf215546Sopenharmony_ci
230bf215546Sopenharmony_ci   if (!tmp_text) {
231bf215546Sopenharmony_ci      pp_debug("Failed to allocate shader space\n");
232bf215546Sopenharmony_ci      return FALSE;
233bf215546Sopenharmony_ci   }
234bf215546Sopenharmony_ci
235bf215546Sopenharmony_ci   pp_debug("mlaa: using %u max search steps\n", val);
236bf215546Sopenharmony_ci
237bf215546Sopenharmony_ci   sprintf(tmp_text, "%s"
238bf215546Sopenharmony_ci                "IMM FLT32 {    %.8f,     0.0000,     0.0000,     0.0000}\n"
239bf215546Sopenharmony_ci                "%s\n", blend2fs_1, (float) val, blend2fs_2);
240bf215546Sopenharmony_ci
241bf215546Sopenharmony_ci   memset(&res, 0, sizeof(res));
242bf215546Sopenharmony_ci
243bf215546Sopenharmony_ci   res.target = PIPE_TEXTURE_2D;
244bf215546Sopenharmony_ci   res.format = PIPE_FORMAT_R8G8_UNORM;
245bf215546Sopenharmony_ci   res.width0 = res.height0 = 165;
246bf215546Sopenharmony_ci   res.bind = PIPE_BIND_SAMPLER_VIEW;
247bf215546Sopenharmony_ci   res.usage = PIPE_USAGE_DEFAULT;
248bf215546Sopenharmony_ci   res.depth0 = res.array_size = res.nr_samples = res.nr_storage_samples = 1;
249bf215546Sopenharmony_ci
250bf215546Sopenharmony_ci   if (!ppq->p->screen->is_format_supported(ppq->p->screen, res.format,
251bf215546Sopenharmony_ci                                            res.target, 1, 1, res.bind))
252bf215546Sopenharmony_ci      pp_debug("Areamap format not supported\n");
253bf215546Sopenharmony_ci
254bf215546Sopenharmony_ci   ppq->areamaptex = ppq->p->screen->resource_create(ppq->p->screen, &res);
255bf215546Sopenharmony_ci
256bf215546Sopenharmony_ci   if (ppq->areamaptex == NULL) {
257bf215546Sopenharmony_ci      pp_debug("Failed to allocate area map texture\n");
258bf215546Sopenharmony_ci      goto fail;
259bf215546Sopenharmony_ci   }
260bf215546Sopenharmony_ci
261bf215546Sopenharmony_ci   u_box_2d(0, 0, 165, 165, &box);
262bf215546Sopenharmony_ci
263bf215546Sopenharmony_ci   ppq->p->pipe->texture_subdata(ppq->p->pipe, ppq->areamaptex, 0,
264bf215546Sopenharmony_ci                                 PIPE_MAP_WRITE, &box,
265bf215546Sopenharmony_ci                                 areamap, 165 * 2, sizeof(areamap));
266bf215546Sopenharmony_ci
267bf215546Sopenharmony_ci   ppq->shaders[n][1] = pp_tgsi_to_state(ppq->p->pipe, offsetvs, true,
268bf215546Sopenharmony_ci                                         "offsetvs");
269bf215546Sopenharmony_ci   if (iscolor)
270bf215546Sopenharmony_ci      ppq->shaders[n][2] = pp_tgsi_to_state(ppq->p->pipe, color1fs,
271bf215546Sopenharmony_ci                                            false, "color1fs");
272bf215546Sopenharmony_ci   else
273bf215546Sopenharmony_ci      ppq->shaders[n][2] = pp_tgsi_to_state(ppq->p->pipe, depth1fs,
274bf215546Sopenharmony_ci                                            false, "depth1fs");
275bf215546Sopenharmony_ci   ppq->shaders[n][3] = pp_tgsi_to_state(ppq->p->pipe, tmp_text, false,
276bf215546Sopenharmony_ci                                         "blend2fs");
277bf215546Sopenharmony_ci   ppq->shaders[n][4] = pp_tgsi_to_state(ppq->p->pipe, neigh3fs, false,
278bf215546Sopenharmony_ci                                         "neigh3fs");
279bf215546Sopenharmony_ci
280bf215546Sopenharmony_ci   FREE(tmp_text);
281bf215546Sopenharmony_ci
282bf215546Sopenharmony_ci   return TRUE;
283bf215546Sopenharmony_ci
284bf215546Sopenharmony_ci fail:
285bf215546Sopenharmony_ci
286bf215546Sopenharmony_ci   FREE(tmp_text);
287bf215546Sopenharmony_ci
288bf215546Sopenharmony_ci   /*
289bf215546Sopenharmony_ci    * Call the common free function for destruction of partially initialized
290bf215546Sopenharmony_ci    * resources.
291bf215546Sopenharmony_ci    */
292bf215546Sopenharmony_ci   pp_jimenezmlaa_free(ppq, n);
293bf215546Sopenharmony_ci
294bf215546Sopenharmony_ci   return FALSE;
295bf215546Sopenharmony_ci}
296bf215546Sopenharmony_ci
297bf215546Sopenharmony_ci/** Short wrapper to init the depth version. */
298bf215546Sopenharmony_cibool
299bf215546Sopenharmony_cipp_jimenezmlaa_init(struct pp_queue_t *ppq, unsigned int n, unsigned int val)
300bf215546Sopenharmony_ci{
301bf215546Sopenharmony_ci   return pp_jimenezmlaa_init_run(ppq, n, val, false);
302bf215546Sopenharmony_ci}
303bf215546Sopenharmony_ci
304bf215546Sopenharmony_ci/** Short wrapper to init the color version. */
305bf215546Sopenharmony_cibool
306bf215546Sopenharmony_cipp_jimenezmlaa_init_color(struct pp_queue_t *ppq, unsigned int n,
307bf215546Sopenharmony_ci                          unsigned int val)
308bf215546Sopenharmony_ci{
309bf215546Sopenharmony_ci   return pp_jimenezmlaa_init_run(ppq, n, val, true);
310bf215546Sopenharmony_ci}
311bf215546Sopenharmony_ci
312bf215546Sopenharmony_ci/** Short wrapper to run the depth version. */
313bf215546Sopenharmony_civoid
314bf215546Sopenharmony_cipp_jimenezmlaa(struct pp_queue_t *ppq, struct pipe_resource *in,
315bf215546Sopenharmony_ci               struct pipe_resource *out, unsigned int n)
316bf215546Sopenharmony_ci{
317bf215546Sopenharmony_ci   if (!ppq->depth) {
318bf215546Sopenharmony_ci      return;
319bf215546Sopenharmony_ci   }
320bf215546Sopenharmony_ci   pp_jimenezmlaa_run(ppq, in, out, n, false);
321bf215546Sopenharmony_ci}
322bf215546Sopenharmony_ci
323bf215546Sopenharmony_ci/** Short wrapper to run the color version. */
324bf215546Sopenharmony_civoid
325bf215546Sopenharmony_cipp_jimenezmlaa_color(struct pp_queue_t *ppq, struct pipe_resource *in,
326bf215546Sopenharmony_ci                     struct pipe_resource *out, unsigned int n)
327bf215546Sopenharmony_ci{
328bf215546Sopenharmony_ci   pp_jimenezmlaa_run(ppq, in, out, n, true);
329bf215546Sopenharmony_ci}
330bf215546Sopenharmony_ci
331bf215546Sopenharmony_ci
332bf215546Sopenharmony_ci/**
333bf215546Sopenharmony_ci * Short wrapper to free the mlaa filter resources. Shaders are freed in
334bf215546Sopenharmony_ci * the common code in pp_free.
335bf215546Sopenharmony_ci */
336bf215546Sopenharmony_civoid
337bf215546Sopenharmony_cipp_jimenezmlaa_free(struct pp_queue_t *ppq, unsigned int n)
338bf215546Sopenharmony_ci{
339bf215546Sopenharmony_ci   pipe_resource_reference(&ppq->areamaptex, NULL);
340bf215546Sopenharmony_ci}
341bf215546Sopenharmony_ci
342