OSDN Git Service

build: meson: compile without wayland support
[android-x86/hardware-intel-common-vaapi.git] / src / shaders / post_processing / gen9 / clear_bgrx.gxa
1 /*
2  * Copyright © 2018 Intel Corporation
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sub license, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial portions
14  * of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
19  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
20  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * Authors:
25  *    Xiang Haihao <haihao.xiang@intel.com>
26  *
27  */
28
29 /*
30  * Registers
31  * g0           header
32  * g1-g3        static parameters (constant)
33  * g16-g24      payload for write message
34  */
35 define(`ORIG',          `g0.4<2,2,1>UW')
36 define(`ORIGX',         `g0.4<0,1,0>UW')
37 define(`ORIGY',         `g0.6<0,1,0>UW')
38
39 define(`ALPHA',         `g1.3<0,1,0>UB')
40 /* Red */
41 define(`R',             `g1.2<0,1,0>UB')
42 /* Green */
43 define(`G',             `g1.1<0,1,0>UB')
44 /* Blue */
45 define(`B',             `g1.0<0,1,0>UB')
46
47 define(`BGRX_BTI',      `1')
48
49 /* Thread header */
50 mov(8)  g16.0<1>UD      g0.0<8,8,1>UD   {align1};
51
52 /* RGBA/RGBX */
53 shl(1)  g16.0<1>UD      ORIGX  6:w      {align1};
54 shl(1)  g16.4<1>UD      ORIGY  4:w      {align1};
55
56 /* 16x16 block */
57 mov(1)  g16.8<1>UD      0x000f000fUD    {align1};
58
59 mov(1)  g17.3<1>UB      ALPHA           {align1};
60 mov(1)  g17.2<1>UB      B               {align1};
61 mov(1)  g17.1<1>UB      G               {align1};
62 mov(1)  g17.0<1>UB      R               {align1};
63 mov(16) g17.0<1>UD      g17.0<0,1,0>UD  {align1 compr};
64 mov(16) g19.0<1>UD      g17.0<0,1,0>UD  {align1 compr};
65 mov(16) g21.0<1>UD      g17.0<0,1,0>UD  {align1 compr};
66 mov(16) g23.0<1>UD      g17.0<0,1,0>UD  {align1 compr};
67 /*
68  * write(p0, p1, p2, p3)
69  *   p0: binding table index
70  *   p1: message control, default is 0,
71  *   p2: message type, 10 is media_block_write
72  *   p3: cache type, 12 is data cache data port 1
73  */
74 send(16) 16 acc0<1>UW null write(BGRX_BTI, 0, 10, 12) mlen 9 rlen 0 {align1};
75
76 add(1)   g16.0<1>UD g16.0<0,1,0>UD 16:w {align1};
77 send(16) 16 acc0<1>UW null write(BGRX_BTI, 0, 10, 12) mlen 9 rlen 0 {align1};
78
79 add(1)   g16.0<1>UD g16.0<0,1,0>UD 16:w {align1};
80 send(16) 16 acc0<1>UW null write(BGRX_BTI, 0, 10, 12) mlen 9 rlen 0 {align1};
81
82 add(1)   g16.0<1>UD g16.0<0,1,0>UD 16:w {align1};
83 send(16) 16 acc0<1>UW null write(BGRX_BTI, 0, 10, 12) mlen 9 rlen 0 {align1};
84
85 /* EOT */
86 mov(8)  g112.0<1>UD       g0.0<8,8,1>UD   {align1};
87 send(16) 112 null<1>UW null thread_spawner(0, 0, 1) mlen 1 rlen 0 {align1 EOT};