Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

asm_fill.h 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. /**************************************************************************
  2. *
  3. * Copyright 2009 VMware, Inc. All Rights Reserved.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a
  6. * copy of this software and associated documentation files (the
  7. * "Software"), to deal in the Software without restriction, including
  8. * without limitation the rights to use, copy, modify, merge, publish,
  9. * distribute, sub license, and/or sell copies of the Software, and to
  10. * permit persons to whom the Software is furnished to do so, subject to
  11. * the following conditions:
  12. *
  13. * The above copyright notice and this permission notice (including the
  14. * next paragraph) shall be included in all copies or substantial portions
  15. * of the Software.
  16. *
  17. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  20. * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  21. * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  22. * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  23. * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. *
  25. **************************************************************************/
  26. #ifndef ASM_FILL_H
  27. #define ASM_FILL_H
  28. #include "tgsi/tgsi_ureg.h"
  29. typedef void (* ureg_func)( struct ureg_program *ureg,
  30. struct ureg_dst *out,
  31. struct ureg_src *in,
  32. struct ureg_src *sampler,
  33. struct ureg_dst *temp,
  34. struct ureg_src *constant);
  35. static INLINE void
  36. solid_fill( struct ureg_program *ureg,
  37. struct ureg_dst *out,
  38. struct ureg_src *in,
  39. struct ureg_src *sampler,
  40. struct ureg_dst *temp,
  41. struct ureg_src *constant)
  42. {
  43. ureg_MOV(ureg, *out, constant[0]);
  44. }
  45. static INLINE void
  46. linear_grad( struct ureg_program *ureg,
  47. struct ureg_dst *out,
  48. struct ureg_src *in,
  49. struct ureg_src *sampler,
  50. struct ureg_dst *temp,
  51. struct ureg_src *constant)
  52. {
  53. ureg_MOV(ureg,
  54. ureg_writemask(temp[0], TGSI_WRITEMASK_XY),
  55. in[0]);
  56. ureg_MOV(ureg,
  57. ureg_writemask(temp[0], TGSI_WRITEMASK_Z),
  58. ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
  59. ureg_DP3(ureg, temp[1], constant[2], ureg_src(temp[0]));
  60. ureg_DP3(ureg, temp[2], constant[3], ureg_src(temp[0]));
  61. ureg_DP3(ureg, temp[3], constant[4], ureg_src(temp[0]));
  62. ureg_RCP(ureg, temp[3], ureg_src(temp[3]));
  63. ureg_MUL(ureg, temp[1], ureg_src(temp[1]), ureg_src(temp[3]));
  64. ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[3]));
  65. ureg_MOV(ureg, ureg_writemask(temp[4], TGSI_WRITEMASK_X), ureg_src(temp[1]));
  66. ureg_MOV(ureg, ureg_writemask(temp[4], TGSI_WRITEMASK_Y), ureg_src(temp[2]));
  67. ureg_MUL(ureg, temp[0],
  68. ureg_scalar(constant[0], TGSI_SWIZZLE_Y),
  69. ureg_scalar(ureg_src(temp[4]), TGSI_SWIZZLE_Y));
  70. ureg_MAD(ureg, temp[1],
  71. ureg_scalar(constant[0], TGSI_SWIZZLE_X),
  72. ureg_scalar(ureg_src(temp[4]), TGSI_SWIZZLE_X),
  73. ureg_src(temp[0]));
  74. ureg_MUL(ureg, temp[2], ureg_src(temp[1]),
  75. ureg_scalar(constant[0], TGSI_SWIZZLE_Z));
  76. ureg_TEX(ureg, *out, TGSI_TEXTURE_1D, ureg_src(temp[2]), sampler[0]);
  77. }
  78. static INLINE void
  79. radial_grad( struct ureg_program *ureg,
  80. struct ureg_dst *out,
  81. struct ureg_src *in,
  82. struct ureg_src *sampler,
  83. struct ureg_dst *temp,
  84. struct ureg_src *constant)
  85. {
  86. ureg_MOV(ureg, ureg_writemask(temp[0], TGSI_WRITEMASK_XY), in[0]);
  87. ureg_MOV(ureg,
  88. ureg_writemask(temp[0], TGSI_WRITEMASK_Z),
  89. ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
  90. ureg_DP3(ureg, temp[1], constant[2], ureg_src(temp[0]));
  91. ureg_DP3(ureg, temp[2], constant[3], ureg_src(temp[0]));
  92. ureg_DP3(ureg, temp[3], constant[4], ureg_src(temp[0]));
  93. ureg_RCP(ureg, temp[3], ureg_src(temp[3]));
  94. ureg_MUL(ureg, temp[1], ureg_src(temp[1]), ureg_src(temp[3]));
  95. ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[3]));
  96. ureg_MOV(ureg, ureg_writemask(temp[5], TGSI_WRITEMASK_X), ureg_src(temp[1]));
  97. ureg_MOV(ureg, ureg_writemask(temp[5], TGSI_WRITEMASK_Y), ureg_src(temp[2]));
  98. ureg_MUL(ureg, temp[0], ureg_scalar(constant[0], TGSI_SWIZZLE_Y),
  99. ureg_scalar(ureg_src(temp[5]), TGSI_SWIZZLE_Y));
  100. ureg_MAD(ureg, temp[1],
  101. ureg_scalar(constant[0], TGSI_SWIZZLE_X),
  102. ureg_scalar(ureg_src(temp[5]), TGSI_SWIZZLE_X), ureg_src(temp[0]));
  103. ureg_ADD(ureg, temp[1], ureg_src(temp[1]), ureg_src(temp[1]));
  104. ureg_MUL(ureg, temp[3],
  105. ureg_scalar(ureg_src(temp[5]), TGSI_SWIZZLE_Y),
  106. ureg_scalar(ureg_src(temp[5]), TGSI_SWIZZLE_Y));
  107. ureg_MAD(ureg, temp[4],
  108. ureg_scalar(ureg_src(temp[5]), TGSI_SWIZZLE_X),
  109. ureg_scalar(ureg_src(temp[5]), TGSI_SWIZZLE_X),
  110. ureg_src(temp[3]));
  111. ureg_MOV(ureg, temp[4], ureg_negate(ureg_src(temp[4])));
  112. ureg_MUL(ureg, temp[2],
  113. ureg_scalar(constant[0], TGSI_SWIZZLE_Z),
  114. ureg_src(temp[4]));
  115. ureg_MUL(ureg, temp[0],
  116. ureg_scalar(constant[1], TGSI_SWIZZLE_W),
  117. ureg_src(temp[2]));
  118. ureg_MUL(ureg, temp[3], ureg_src(temp[1]), ureg_src(temp[1]));
  119. ureg_SUB(ureg, temp[2], ureg_src(temp[3]), ureg_src(temp[0]));
  120. ureg_RSQ(ureg, temp[2], ureg_abs(ureg_src(temp[2])));
  121. ureg_RCP(ureg, temp[2], ureg_src(temp[2]));
  122. ureg_SUB(ureg, temp[1], ureg_src(temp[2]), ureg_src(temp[1]));
  123. ureg_ADD(ureg, temp[0],
  124. ureg_scalar(constant[0], TGSI_SWIZZLE_Z),
  125. ureg_scalar(constant[0], TGSI_SWIZZLE_Z));
  126. ureg_RCP(ureg, temp[0], ureg_src(temp[0]));
  127. ureg_MUL(ureg, temp[2], ureg_src(temp[1]), ureg_src(temp[0]));
  128. ureg_TEX(ureg, *out, TGSI_TEXTURE_1D, ureg_src(temp[2]), sampler[0]);
  129. }
  130. static INLINE void
  131. pattern( struct ureg_program *ureg,
  132. struct ureg_dst *out,
  133. struct ureg_src *in,
  134. struct ureg_src *sampler,
  135. struct ureg_dst *temp,
  136. struct ureg_src *constant)
  137. {
  138. ureg_MOV(ureg,
  139. ureg_writemask(temp[0], TGSI_WRITEMASK_XY),
  140. in[0]);
  141. ureg_MOV(ureg,
  142. ureg_writemask(temp[0], TGSI_WRITEMASK_Z),
  143. ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
  144. ureg_DP3(ureg, temp[1], constant[2], ureg_src(temp[0]));
  145. ureg_DP3(ureg, temp[2], constant[3], ureg_src(temp[0]));
  146. ureg_DP3(ureg, temp[3], constant[4], ureg_src(temp[0]));
  147. ureg_RCP(ureg, temp[3], ureg_src(temp[3]));
  148. ureg_MUL(ureg, temp[1], ureg_src(temp[1]), ureg_src(temp[3]));
  149. ureg_MUL(ureg, temp[2], ureg_src(temp[2]), ureg_src(temp[3]));
  150. ureg_MOV(ureg, ureg_writemask(temp[4], TGSI_WRITEMASK_X), ureg_src(temp[1]));
  151. ureg_MOV(ureg, ureg_writemask(temp[4], TGSI_WRITEMASK_Y), ureg_src(temp[2]));
  152. ureg_RCP(ureg, temp[0],
  153. ureg_swizzle(constant[1],
  154. TGSI_SWIZZLE_Z,
  155. TGSI_SWIZZLE_W,
  156. TGSI_SWIZZLE_Z,
  157. TGSI_SWIZZLE_W));
  158. ureg_MOV(ureg, temp[1], ureg_src(temp[4]));
  159. ureg_MUL(ureg,
  160. ureg_writemask(temp[1], TGSI_WRITEMASK_X),
  161. ureg_src(temp[1]),
  162. ureg_src(temp[0]));
  163. ureg_MUL(ureg,
  164. ureg_writemask(temp[1], TGSI_WRITEMASK_Y),
  165. ureg_src(temp[1]),
  166. ureg_src(temp[0]));
  167. ureg_TEX(ureg, *out, TGSI_TEXTURE_2D, ureg_src(temp[1]), sampler[0]);
  168. }
  169. static INLINE void
  170. mask( struct ureg_program *ureg,
  171. struct ureg_dst *out,
  172. struct ureg_src *in,
  173. struct ureg_src *sampler,
  174. struct ureg_dst *temp,
  175. struct ureg_src *constant)
  176. {
  177. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[1]);
  178. ureg_MUL(ureg, ureg_writemask(temp[0], TGSI_WRITEMASK_W),
  179. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  180. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  181. ureg_MOV(ureg, *out, ureg_src(temp[0]));
  182. }
  183. static INLINE void
  184. image_normal( struct ureg_program *ureg,
  185. struct ureg_dst *out,
  186. struct ureg_src *in,
  187. struct ureg_src *sampler,
  188. struct ureg_dst *temp,
  189. struct ureg_src *constant)
  190. {
  191. ureg_TEX(ureg, *out, TGSI_TEXTURE_2D, in[1], sampler[3]);
  192. }
  193. static INLINE void
  194. image_multiply( struct ureg_program *ureg,
  195. struct ureg_dst *out,
  196. struct ureg_src *in,
  197. struct ureg_src *sampler,
  198. struct ureg_dst *temp,
  199. struct ureg_src *constant)
  200. {
  201. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[1], sampler[3]);
  202. ureg_MUL(ureg, *out, ureg_src(temp[0]), ureg_src(temp[1]));
  203. }
  204. static INLINE void
  205. image_stencil( struct ureg_program *ureg,
  206. struct ureg_dst *out,
  207. struct ureg_src *in,
  208. struct ureg_src *sampler,
  209. struct ureg_dst *temp,
  210. struct ureg_src *constant)
  211. {
  212. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[1], sampler[3]);
  213. ureg_MUL(ureg, *out, ureg_src(temp[0]), ureg_src(temp[1]));
  214. }
  215. #define EXTENDED_BLENDER_OVER_FUNC \
  216. ureg_SUB(ureg, temp[3], \
  217. ureg_scalar(constant[1], TGSI_SWIZZLE_Y), \
  218. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W)); \
  219. ureg_SUB(ureg, temp[3], \
  220. ureg_scalar(constant[1], TGSI_SWIZZLE_Y), \
  221. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W)); \
  222. ureg_MUL(ureg, temp[3], ureg_src(temp[0]), ureg_src(temp[3])); \
  223. ureg_MUL(ureg, temp[4], ureg_src(temp[1]), ureg_src(temp[4])); \
  224. ureg_ADD(ureg, temp[3], ureg_src(temp[3]), ureg_src(temp[4]));
  225. static INLINE void
  226. blend_multiply( struct ureg_program *ureg,
  227. struct ureg_dst *out,
  228. struct ureg_src *in,
  229. struct ureg_src *sampler,
  230. struct ureg_dst *temp,
  231. struct ureg_src *constant)
  232. {
  233. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
  234. EXTENDED_BLENDER_OVER_FUNC
  235. ureg_MUL(ureg, temp[4], ureg_src(temp[0]), ureg_src(temp[1]));
  236. ureg_ADD(ureg, temp[1], ureg_src(temp[4]), ureg_src(temp[3]));
  237. ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  238. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  239. ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  240. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  241. ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
  242. ureg_src(temp[3]), ureg_src(temp[2]));
  243. ureg_MOV(ureg, *out, ureg_src(temp[1]));
  244. }
  245. static INLINE void
  246. blend_screen( struct ureg_program *ureg,
  247. struct ureg_dst *out,
  248. struct ureg_src *in,
  249. struct ureg_src *sampler,
  250. struct ureg_dst *temp,
  251. struct ureg_src *constant)
  252. {
  253. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
  254. ureg_ADD(ureg, temp[3], ureg_src(temp[0]), ureg_src(temp[1]));
  255. ureg_MUL(ureg, temp[2], ureg_src(temp[0]), ureg_src(temp[1]));
  256. ureg_SUB(ureg, *out, ureg_src(temp[3]), ureg_src(temp[2]));
  257. }
  258. static INLINE void
  259. blend_darken( struct ureg_program *ureg,
  260. struct ureg_dst *out,
  261. struct ureg_src *in,
  262. struct ureg_src *sampler,
  263. struct ureg_dst *temp,
  264. struct ureg_src *constant)
  265. {
  266. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
  267. EXTENDED_BLENDER_OVER_FUNC
  268. ureg_MUL(ureg, temp[4], ureg_src(temp[0]),
  269. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  270. ureg_MUL(ureg, temp[5], ureg_src(temp[1]),
  271. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
  272. ureg_MIN(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[5]));
  273. ureg_ADD(ureg, temp[1], ureg_src(temp[3]), ureg_src(temp[4]));
  274. ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  275. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  276. ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  277. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  278. ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
  279. ureg_src(temp[3]), ureg_src(temp[2]));
  280. ureg_MOV(ureg, *out, ureg_src(temp[1]));
  281. }
  282. static INLINE void
  283. blend_lighten( struct ureg_program *ureg,
  284. struct ureg_dst *out,
  285. struct ureg_src *in,
  286. struct ureg_src *sampler,
  287. struct ureg_dst *temp,
  288. struct ureg_src *constant)
  289. {
  290. ureg_TEX(ureg, temp[1], TGSI_TEXTURE_2D, in[0], sampler[2]);
  291. EXTENDED_BLENDER_OVER_FUNC
  292. ureg_MUL(ureg, temp[4], ureg_src(temp[0]),
  293. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  294. ureg_MUL(ureg, temp[5], ureg_src(temp[1]),
  295. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
  296. ureg_MAX(ureg, temp[4], ureg_src(temp[4]), ureg_src(temp[5]));
  297. ureg_ADD(ureg, temp[1], ureg_src(temp[3]), ureg_src(temp[4]));
  298. ureg_MUL(ureg, temp[2], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  299. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  300. ureg_ADD(ureg, temp[3], ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  301. ureg_scalar(ureg_src(temp[1]), TGSI_SWIZZLE_W));
  302. ureg_SUB(ureg, ureg_writemask(temp[1], TGSI_WRITEMASK_W),
  303. ureg_src(temp[3]), ureg_src(temp[2]));
  304. ureg_MOV(ureg, *out, ureg_src(temp[1]));
  305. }
  306. static INLINE void
  307. premultiply( struct ureg_program *ureg,
  308. struct ureg_dst *out,
  309. struct ureg_src *in,
  310. struct ureg_src *sampler,
  311. struct ureg_dst *temp,
  312. struct ureg_src *constant)
  313. {
  314. ureg_MUL(ureg,
  315. ureg_writemask(temp[0], TGSI_WRITEMASK_XYZ),
  316. ureg_src(temp[0]),
  317. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W));
  318. }
  319. static INLINE void
  320. unpremultiply( struct ureg_program *ureg,
  321. struct ureg_dst *out,
  322. struct ureg_src *in,
  323. struct ureg_src *sampler,
  324. struct ureg_dst *temp,
  325. struct ureg_src *constant)
  326. {
  327. ureg_TEX(ureg, temp[0], TGSI_TEXTURE_2D, in[0], sampler[1]);
  328. }
  329. static INLINE void
  330. color_bw( struct ureg_program *ureg,
  331. struct ureg_dst *out,
  332. struct ureg_src *in,
  333. struct ureg_src *sampler,
  334. struct ureg_dst *temp,
  335. struct ureg_src *constant)
  336. {
  337. ureg_ADD(ureg, temp[1],
  338. ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
  339. ureg_scalar(constant[1], TGSI_SWIZZLE_Y));
  340. ureg_RCP(ureg, temp[2], ureg_src(temp[1]));
  341. ureg_ADD(ureg, temp[1],
  342. ureg_scalar(constant[1], TGSI_SWIZZLE_Y),
  343. ureg_src(temp[2]));
  344. ureg_ADD(ureg, ureg_writemask(temp[2], TGSI_WRITEMASK_X),
  345. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_X),
  346. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_Y));
  347. ureg_ADD(ureg, ureg_writemask(temp[2], TGSI_WRITEMASK_X),
  348. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_Z),
  349. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_X));
  350. ureg_SGE(ureg,
  351. ureg_writemask(temp[0], TGSI_WRITEMASK_XYZ),
  352. ureg_scalar(ureg_src(temp[2]), TGSI_SWIZZLE_X),
  353. ureg_src(temp[1]));
  354. ureg_SGE(ureg,
  355. ureg_writemask(temp[0], TGSI_WRITEMASK_W),
  356. ureg_scalar(ureg_src(temp[0]), TGSI_SWIZZLE_W),
  357. ureg_scalar(ureg_src(temp[2]), TGSI_SWIZZLE_Y));
  358. ureg_MOV(ureg, *out, ureg_src(temp[0]));
  359. }
  360. struct shader_asm_info {
  361. VGint id;
  362. ureg_func func;
  363. VGboolean needs_position;
  364. VGint start_const;
  365. VGint num_consts;
  366. VGint start_sampler;
  367. VGint num_samplers;
  368. VGint start_temp;
  369. VGint num_temps;
  370. };
  371. static const struct shader_asm_info shaders_asm[] = {
  372. /* fills */
  373. {VEGA_SOLID_FILL_SHADER, solid_fill,
  374. VG_FALSE, 0, 1, 0, 0, 0, 0},
  375. {VEGA_LINEAR_GRADIENT_SHADER, linear_grad,
  376. VG_TRUE, 0, 5, 0, 1, 0, 5},
  377. {VEGA_RADIAL_GRADIENT_SHADER, radial_grad,
  378. VG_TRUE, 0, 5, 0, 1, 0, 6},
  379. {VEGA_PATTERN_SHADER, pattern,
  380. VG_TRUE, 1, 4, 0, 1, 0, 5},
  381. /* image draw modes */
  382. {VEGA_IMAGE_NORMAL_SHADER, image_normal,
  383. VG_TRUE, 0, 0, 3, 1, 0, 0},
  384. {VEGA_IMAGE_MULTIPLY_SHADER, image_multiply,
  385. VG_TRUE, 0, 0, 3, 1, 0, 2},
  386. {VEGA_IMAGE_STENCIL_SHADER, image_stencil,
  387. VG_TRUE, 0, 0, 3, 1, 0, 2},
  388. {VEGA_MASK_SHADER, mask,
  389. VG_TRUE, 0, 0, 1, 1, 0, 2},
  390. /* extra blend modes */
  391. {VEGA_BLEND_MULTIPLY_SHADER, blend_multiply,
  392. VG_TRUE, 1, 1, 2, 1, 0, 5},
  393. {VEGA_BLEND_SCREEN_SHADER, blend_screen,
  394. VG_TRUE, 0, 0, 2, 1, 0, 4},
  395. {VEGA_BLEND_DARKEN_SHADER, blend_darken,
  396. VG_TRUE, 1, 1, 2, 1, 0, 6},
  397. {VEGA_BLEND_LIGHTEN_SHADER, blend_lighten,
  398. VG_TRUE, 1, 1, 2, 1, 0, 6},
  399. /* premultiply */
  400. {VEGA_PREMULTIPLY_SHADER, premultiply,
  401. VG_FALSE, 0, 0, 0, 0, 0, 1},
  402. {VEGA_UNPREMULTIPLY_SHADER, unpremultiply,
  403. VG_FALSE, 0, 0, 0, 0, 0, 1},
  404. /* color transform to black and white */
  405. {VEGA_BW_SHADER, color_bw,
  406. VG_FALSE, 1, 1, 0, 0, 0, 3},
  407. };
  408. #endif