TextureFunctions.glsl 27 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. // Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. // WARNING: THIS FILE IS AUTO-GENERATED. DON'T CHANGE IT BY HAND.
  6. // This file contains some convenience texture functions.
  7. #pragma once
  8. #if defined(ANKI_FRAGMENT_SHADER)
  9. vec4 texture(texture1D tex, sampler sampl, float P, float bias)
  10. {
  11. return texture(sampler1D(tex, sampl), P, bias);
  12. }
  13. #endif
  14. #if defined(ANKI_FRAGMENT_SHADER)
  15. uvec4 texture(utexture1D tex, sampler sampl, float P, float bias)
  16. {
  17. return texture(usampler1D(tex, sampl), P, bias);
  18. }
  19. #endif
  20. #if defined(ANKI_FRAGMENT_SHADER)
  21. ivec4 texture(itexture1D tex, sampler sampl, float P, float bias)
  22. {
  23. return texture(isampler1D(tex, sampl), P, bias);
  24. }
  25. #endif
  26. #if defined(ANKI_FRAGMENT_SHADER)
  27. vec4 texture(texture1D tex, sampler sampl, float P)
  28. {
  29. return texture(sampler1D(tex, sampl), P);
  30. }
  31. #endif
  32. #if defined(ANKI_FRAGMENT_SHADER)
  33. uvec4 texture(utexture1D tex, sampler sampl, float P)
  34. {
  35. return texture(usampler1D(tex, sampl), P);
  36. }
  37. #endif
  38. #if defined(ANKI_FRAGMENT_SHADER)
  39. ivec4 texture(itexture1D tex, sampler sampl, float P)
  40. {
  41. return texture(isampler1D(tex, sampl), P);
  42. }
  43. #endif
  44. #if defined(ANKI_FRAGMENT_SHADER)
  45. vec4 texture(texture2D tex, sampler sampl, vec2 P, float bias)
  46. {
  47. return texture(sampler2D(tex, sampl), P, bias);
  48. }
  49. #endif
  50. #if defined(ANKI_FRAGMENT_SHADER)
  51. uvec4 texture(utexture2D tex, sampler sampl, vec2 P, float bias)
  52. {
  53. return texture(usampler2D(tex, sampl), P, bias);
  54. }
  55. #endif
  56. #if defined(ANKI_FRAGMENT_SHADER)
  57. ivec4 texture(itexture2D tex, sampler sampl, vec2 P, float bias)
  58. {
  59. return texture(isampler2D(tex, sampl), P, bias);
  60. }
  61. #endif
  62. #if defined(ANKI_FRAGMENT_SHADER)
  63. vec4 texture(texture2D tex, sampler sampl, vec2 P)
  64. {
  65. return texture(sampler2D(tex, sampl), P);
  66. }
  67. #endif
  68. #if defined(ANKI_FRAGMENT_SHADER)
  69. uvec4 texture(utexture2D tex, sampler sampl, vec2 P)
  70. {
  71. return texture(usampler2D(tex, sampl), P);
  72. }
  73. #endif
  74. #if defined(ANKI_FRAGMENT_SHADER)
  75. ivec4 texture(itexture2D tex, sampler sampl, vec2 P)
  76. {
  77. return texture(isampler2D(tex, sampl), P);
  78. }
  79. #endif
  80. #if defined(ANKI_FRAGMENT_SHADER)
  81. vec4 texture(texture3D tex, sampler sampl, vec3 P, float bias)
  82. {
  83. return texture(sampler3D(tex, sampl), P, bias);
  84. }
  85. #endif
  86. #if defined(ANKI_FRAGMENT_SHADER)
  87. uvec4 texture(utexture3D tex, sampler sampl, vec3 P, float bias)
  88. {
  89. return texture(usampler3D(tex, sampl), P, bias);
  90. }
  91. #endif
  92. #if defined(ANKI_FRAGMENT_SHADER)
  93. ivec4 texture(itexture3D tex, sampler sampl, vec3 P, float bias)
  94. {
  95. return texture(isampler3D(tex, sampl), P, bias);
  96. }
  97. #endif
  98. #if defined(ANKI_FRAGMENT_SHADER)
  99. vec4 texture(texture3D tex, sampler sampl, vec3 P)
  100. {
  101. return texture(sampler3D(tex, sampl), P);
  102. }
  103. #endif
  104. #if defined(ANKI_FRAGMENT_SHADER)
  105. uvec4 texture(utexture3D tex, sampler sampl, vec3 P)
  106. {
  107. return texture(usampler3D(tex, sampl), P);
  108. }
  109. #endif
  110. #if defined(ANKI_FRAGMENT_SHADER)
  111. ivec4 texture(itexture3D tex, sampler sampl, vec3 P)
  112. {
  113. return texture(isampler3D(tex, sampl), P);
  114. }
  115. #endif
  116. #if defined(ANKI_FRAGMENT_SHADER)
  117. vec4 texture(textureCube tex, sampler sampl, vec3 P, float bias)
  118. {
  119. return texture(samplerCube(tex, sampl), P, bias);
  120. }
  121. #endif
  122. #if defined(ANKI_FRAGMENT_SHADER)
  123. uvec4 texture(utextureCube tex, sampler sampl, vec3 P, float bias)
  124. {
  125. return texture(usamplerCube(tex, sampl), P, bias);
  126. }
  127. #endif
  128. #if defined(ANKI_FRAGMENT_SHADER)
  129. ivec4 texture(itextureCube tex, sampler sampl, vec3 P, float bias)
  130. {
  131. return texture(isamplerCube(tex, sampl), P, bias);
  132. }
  133. #endif
  134. #if defined(ANKI_FRAGMENT_SHADER)
  135. vec4 texture(textureCube tex, sampler sampl, vec3 P)
  136. {
  137. return texture(samplerCube(tex, sampl), P);
  138. }
  139. #endif
  140. #if defined(ANKI_FRAGMENT_SHADER)
  141. uvec4 texture(utextureCube tex, sampler sampl, vec3 P)
  142. {
  143. return texture(usamplerCube(tex, sampl), P);
  144. }
  145. #endif
  146. #if defined(ANKI_FRAGMENT_SHADER)
  147. ivec4 texture(itextureCube tex, sampler sampl, vec3 P)
  148. {
  149. return texture(isamplerCube(tex, sampl), P);
  150. }
  151. #endif
  152. #if defined(ANKI_FRAGMENT_SHADER)
  153. float texture(texture1D tex, samplerShadow sampl, vec3 P, float bias)
  154. {
  155. return texture(sampler1DShadow(tex, sampl), P, bias);
  156. }
  157. #endif
  158. #if defined(ANKI_FRAGMENT_SHADER)
  159. float texture(texture1D tex, samplerShadow sampl, vec3 P)
  160. {
  161. return texture(sampler1DShadow(tex, sampl), P);
  162. }
  163. #endif
  164. #if defined(ANKI_FRAGMENT_SHADER)
  165. float texture(texture2D tex, samplerShadow sampl, vec3 P, float bias)
  166. {
  167. return texture(sampler2DShadow(tex, sampl), P, bias);
  168. }
  169. #endif
  170. #if defined(ANKI_FRAGMENT_SHADER)
  171. float texture(texture2D tex, samplerShadow sampl, vec3 P)
  172. {
  173. return texture(sampler2DShadow(tex, sampl), P);
  174. }
  175. #endif
  176. #if defined(ANKI_FRAGMENT_SHADER)
  177. float texture(textureCube tex, samplerShadow sampl, vec4 P, float bias)
  178. {
  179. return texture(samplerCubeShadow(tex, sampl), P, bias);
  180. }
  181. #endif
  182. #if defined(ANKI_FRAGMENT_SHADER)
  183. float texture(textureCube tex, samplerShadow sampl, vec4 P)
  184. {
  185. return texture(samplerCubeShadow(tex, sampl), P);
  186. }
  187. #endif
  188. #if defined(ANKI_FRAGMENT_SHADER)
  189. vec4 texture(texture2DArray tex, sampler sampl, vec3 P, float bias)
  190. {
  191. return texture(sampler2DArray(tex, sampl), P, bias);
  192. }
  193. #endif
  194. #if defined(ANKI_FRAGMENT_SHADER)
  195. uvec4 texture(utexture2DArray tex, sampler sampl, vec3 P, float bias)
  196. {
  197. return texture(usampler2DArray(tex, sampl), P, bias);
  198. }
  199. #endif
  200. #if defined(ANKI_FRAGMENT_SHADER)
  201. ivec4 texture(itexture2DArray tex, sampler sampl, vec3 P, float bias)
  202. {
  203. return texture(isampler2DArray(tex, sampl), P, bias);
  204. }
  205. #endif
  206. #if defined(ANKI_FRAGMENT_SHADER)
  207. vec4 texture(texture2DArray tex, sampler sampl, vec3 P)
  208. {
  209. return texture(sampler2DArray(tex, sampl), P);
  210. }
  211. #endif
  212. #if defined(ANKI_FRAGMENT_SHADER)
  213. uvec4 texture(utexture2DArray tex, sampler sampl, vec3 P)
  214. {
  215. return texture(usampler2DArray(tex, sampl), P);
  216. }
  217. #endif
  218. #if defined(ANKI_FRAGMENT_SHADER)
  219. ivec4 texture(itexture2DArray tex, sampler sampl, vec3 P)
  220. {
  221. return texture(isampler2DArray(tex, sampl), P);
  222. }
  223. #endif
  224. #if defined(ANKI_FRAGMENT_SHADER)
  225. vec4 texture(textureCubeArray tex, sampler sampl, vec4 P, float bias)
  226. {
  227. return texture(samplerCubeArray(tex, sampl), P, bias);
  228. }
  229. #endif
  230. #if defined(ANKI_FRAGMENT_SHADER)
  231. uvec4 texture(utextureCubeArray tex, sampler sampl, vec4 P, float bias)
  232. {
  233. return texture(usamplerCubeArray(tex, sampl), P, bias);
  234. }
  235. #endif
  236. #if defined(ANKI_FRAGMENT_SHADER)
  237. ivec4 texture(itextureCubeArray tex, sampler sampl, vec4 P, float bias)
  238. {
  239. return texture(isamplerCubeArray(tex, sampl), P, bias);
  240. }
  241. #endif
  242. #if defined(ANKI_FRAGMENT_SHADER)
  243. vec4 texture(textureCubeArray tex, sampler sampl, vec4 P)
  244. {
  245. return texture(samplerCubeArray(tex, sampl), P);
  246. }
  247. #endif
  248. #if defined(ANKI_FRAGMENT_SHADER)
  249. uvec4 texture(utextureCubeArray tex, sampler sampl, vec4 P)
  250. {
  251. return texture(usamplerCubeArray(tex, sampl), P);
  252. }
  253. #endif
  254. #if defined(ANKI_FRAGMENT_SHADER)
  255. ivec4 texture(itextureCubeArray tex, sampler sampl, vec4 P)
  256. {
  257. return texture(isamplerCubeArray(tex, sampl), P);
  258. }
  259. #endif
  260. #if defined(ANKI_FRAGMENT_SHADER)
  261. vec4 texture(texture1DArray tex, sampler sampl, vec2 P, float bias)
  262. {
  263. return texture(sampler1DArray(tex, sampl), P, bias);
  264. }
  265. #endif
  266. #if defined(ANKI_FRAGMENT_SHADER)
  267. uvec4 texture(utexture1DArray tex, sampler sampl, vec2 P, float bias)
  268. {
  269. return texture(usampler1DArray(tex, sampl), P, bias);
  270. }
  271. #endif
  272. #if defined(ANKI_FRAGMENT_SHADER)
  273. ivec4 texture(itexture1DArray tex, sampler sampl, vec2 P, float bias)
  274. {
  275. return texture(isampler1DArray(tex, sampl), P, bias);
  276. }
  277. #endif
  278. #if defined(ANKI_FRAGMENT_SHADER)
  279. vec4 texture(texture1DArray tex, sampler sampl, vec2 P)
  280. {
  281. return texture(sampler1DArray(tex, sampl), P);
  282. }
  283. #endif
  284. #if defined(ANKI_FRAGMENT_SHADER)
  285. uvec4 texture(utexture1DArray tex, sampler sampl, vec2 P)
  286. {
  287. return texture(usampler1DArray(tex, sampl), P);
  288. }
  289. #endif
  290. #if defined(ANKI_FRAGMENT_SHADER)
  291. ivec4 texture(itexture1DArray tex, sampler sampl, vec2 P)
  292. {
  293. return texture(isampler1DArray(tex, sampl), P);
  294. }
  295. #endif
  296. #if defined(ANKI_FRAGMENT_SHADER)
  297. float texture(texture1DArray tex, samplerShadow sampl, vec3 P, float bias)
  298. {
  299. return texture(sampler1DArrayShadow(tex, sampl), P, bias);
  300. }
  301. #endif
  302. #if defined(ANKI_FRAGMENT_SHADER)
  303. float texture(texture1DArray tex, samplerShadow sampl, vec3 P)
  304. {
  305. return texture(sampler1DArrayShadow(tex, sampl), P);
  306. }
  307. #endif
  308. #if defined(ANKI_FRAGMENT_SHADER)
  309. float texture(texture2DArray tex, samplerShadow sampl, vec4 P)
  310. {
  311. return texture(sampler2DArrayShadow(tex, sampl), P);
  312. }
  313. #endif
  314. #if defined(ANKI_FRAGMENT_SHADER)
  315. float texture(textureCubeArray tex, samplerShadow sampl, vec4 P, float compare)
  316. {
  317. return texture(samplerCubeArrayShadow(tex, sampl), P, compare);
  318. }
  319. #endif
  320. #if defined(ANKI_FRAGMENT_SHADER)
  321. vec4 textureProj(texture1D tex, sampler sampl, vec2 P, float bias)
  322. {
  323. return textureProj(sampler1D(tex, sampl), P, bias);
  324. }
  325. #endif
  326. #if defined(ANKI_FRAGMENT_SHADER)
  327. uvec4 textureProj(utexture1D tex, sampler sampl, vec2 P, float bias)
  328. {
  329. return textureProj(usampler1D(tex, sampl), P, bias);
  330. }
  331. #endif
  332. #if defined(ANKI_FRAGMENT_SHADER)
  333. ivec4 textureProj(itexture1D tex, sampler sampl, vec2 P, float bias)
  334. {
  335. return textureProj(isampler1D(tex, sampl), P, bias);
  336. }
  337. #endif
  338. #if defined(ANKI_FRAGMENT_SHADER)
  339. vec4 textureProj(texture1D tex, sampler sampl, vec2 P)
  340. {
  341. return textureProj(sampler1D(tex, sampl), P);
  342. }
  343. #endif
  344. #if defined(ANKI_FRAGMENT_SHADER)
  345. uvec4 textureProj(utexture1D tex, sampler sampl, vec2 P)
  346. {
  347. return textureProj(usampler1D(tex, sampl), P);
  348. }
  349. #endif
  350. #if defined(ANKI_FRAGMENT_SHADER)
  351. ivec4 textureProj(itexture1D tex, sampler sampl, vec2 P)
  352. {
  353. return textureProj(isampler1D(tex, sampl), P);
  354. }
  355. #endif
  356. #if defined(ANKI_FRAGMENT_SHADER)
  357. vec4 textureProj(texture1D tex, sampler sampl, vec4 P, float bias)
  358. {
  359. return textureProj(sampler1D(tex, sampl), P, bias);
  360. }
  361. #endif
  362. #if defined(ANKI_FRAGMENT_SHADER)
  363. uvec4 textureProj(utexture1D tex, sampler sampl, vec4 P, float bias)
  364. {
  365. return textureProj(usampler1D(tex, sampl), P, bias);
  366. }
  367. #endif
  368. #if defined(ANKI_FRAGMENT_SHADER)
  369. ivec4 textureProj(itexture1D tex, sampler sampl, vec4 P, float bias)
  370. {
  371. return textureProj(isampler1D(tex, sampl), P, bias);
  372. }
  373. #endif
  374. #if defined(ANKI_FRAGMENT_SHADER)
  375. vec4 textureProj(texture1D tex, sampler sampl, vec4 P)
  376. {
  377. return textureProj(sampler1D(tex, sampl), P);
  378. }
  379. #endif
  380. #if defined(ANKI_FRAGMENT_SHADER)
  381. uvec4 textureProj(utexture1D tex, sampler sampl, vec4 P)
  382. {
  383. return textureProj(usampler1D(tex, sampl), P);
  384. }
  385. #endif
  386. #if defined(ANKI_FRAGMENT_SHADER)
  387. ivec4 textureProj(itexture1D tex, sampler sampl, vec4 P)
  388. {
  389. return textureProj(isampler1D(tex, sampl), P);
  390. }
  391. #endif
  392. #if defined(ANKI_FRAGMENT_SHADER)
  393. vec4 textureProj(texture2D tex, sampler sampl, vec3 P, float bias)
  394. {
  395. return textureProj(sampler2D(tex, sampl), P, bias);
  396. }
  397. #endif
  398. #if defined(ANKI_FRAGMENT_SHADER)
  399. uvec4 textureProj(utexture2D tex, sampler sampl, vec3 P, float bias)
  400. {
  401. return textureProj(usampler2D(tex, sampl), P, bias);
  402. }
  403. #endif
  404. #if defined(ANKI_FRAGMENT_SHADER)
  405. ivec4 textureProj(itexture2D tex, sampler sampl, vec3 P, float bias)
  406. {
  407. return textureProj(isampler2D(tex, sampl), P, bias);
  408. }
  409. #endif
  410. #if defined(ANKI_FRAGMENT_SHADER)
  411. vec4 textureProj(texture2D tex, sampler sampl, vec3 P)
  412. {
  413. return textureProj(sampler2D(tex, sampl), P);
  414. }
  415. #endif
  416. #if defined(ANKI_FRAGMENT_SHADER)
  417. uvec4 textureProj(utexture2D tex, sampler sampl, vec3 P)
  418. {
  419. return textureProj(usampler2D(tex, sampl), P);
  420. }
  421. #endif
  422. #if defined(ANKI_FRAGMENT_SHADER)
  423. ivec4 textureProj(itexture2D tex, sampler sampl, vec3 P)
  424. {
  425. return textureProj(isampler2D(tex, sampl), P);
  426. }
  427. #endif
  428. #if defined(ANKI_FRAGMENT_SHADER)
  429. vec4 textureProj(texture2D tex, sampler sampl, vec4 P, float bias)
  430. {
  431. return textureProj(sampler2D(tex, sampl), P, bias);
  432. }
  433. #endif
  434. #if defined(ANKI_FRAGMENT_SHADER)
  435. uvec4 textureProj(utexture2D tex, sampler sampl, vec4 P, float bias)
  436. {
  437. return textureProj(usampler2D(tex, sampl), P, bias);
  438. }
  439. #endif
  440. #if defined(ANKI_FRAGMENT_SHADER)
  441. ivec4 textureProj(itexture2D tex, sampler sampl, vec4 P, float bias)
  442. {
  443. return textureProj(isampler2D(tex, sampl), P, bias);
  444. }
  445. #endif
  446. #if defined(ANKI_FRAGMENT_SHADER)
  447. vec4 textureProj(texture2D tex, sampler sampl, vec4 P)
  448. {
  449. return textureProj(sampler2D(tex, sampl), P);
  450. }
  451. #endif
  452. #if defined(ANKI_FRAGMENT_SHADER)
  453. uvec4 textureProj(utexture2D tex, sampler sampl, vec4 P)
  454. {
  455. return textureProj(usampler2D(tex, sampl), P);
  456. }
  457. #endif
  458. #if defined(ANKI_FRAGMENT_SHADER)
  459. ivec4 textureProj(itexture2D tex, sampler sampl, vec4 P)
  460. {
  461. return textureProj(isampler2D(tex, sampl), P);
  462. }
  463. #endif
  464. #if defined(ANKI_FRAGMENT_SHADER)
  465. vec4 textureProj(texture3D tex, sampler sampl, vec4 P, float bias)
  466. {
  467. return textureProj(sampler3D(tex, sampl), P, bias);
  468. }
  469. #endif
  470. #if defined(ANKI_FRAGMENT_SHADER)
  471. uvec4 textureProj(utexture3D tex, sampler sampl, vec4 P, float bias)
  472. {
  473. return textureProj(usampler3D(tex, sampl), P, bias);
  474. }
  475. #endif
  476. #if defined(ANKI_FRAGMENT_SHADER)
  477. ivec4 textureProj(itexture3D tex, sampler sampl, vec4 P, float bias)
  478. {
  479. return textureProj(isampler3D(tex, sampl), P, bias);
  480. }
  481. #endif
  482. #if defined(ANKI_FRAGMENT_SHADER)
  483. vec4 textureProj(texture3D tex, sampler sampl, vec4 P)
  484. {
  485. return textureProj(sampler3D(tex, sampl), P);
  486. }
  487. #endif
  488. #if defined(ANKI_FRAGMENT_SHADER)
  489. uvec4 textureProj(utexture3D tex, sampler sampl, vec4 P)
  490. {
  491. return textureProj(usampler3D(tex, sampl), P);
  492. }
  493. #endif
  494. #if defined(ANKI_FRAGMENT_SHADER)
  495. ivec4 textureProj(itexture3D tex, sampler sampl, vec4 P)
  496. {
  497. return textureProj(isampler3D(tex, sampl), P);
  498. }
  499. #endif
  500. #if defined(ANKI_FRAGMENT_SHADER)
  501. float textureProj(texture1D tex, samplerShadow sampl, vec4 P, float bias)
  502. {
  503. return textureProj(sampler1DShadow(tex, sampl), P, bias);
  504. }
  505. #endif
  506. #if defined(ANKI_FRAGMENT_SHADER)
  507. float textureProj(texture1D tex, samplerShadow sampl, vec4 P)
  508. {
  509. return textureProj(sampler1DShadow(tex, sampl), P);
  510. }
  511. #endif
  512. #if defined(ANKI_FRAGMENT_SHADER)
  513. float textureProj(texture2D tex, samplerShadow sampl, vec4 P, float bias)
  514. {
  515. return textureProj(sampler2DShadow(tex, sampl), P, bias);
  516. }
  517. #endif
  518. #if defined(ANKI_FRAGMENT_SHADER)
  519. float textureProj(texture2D tex, samplerShadow sampl, vec4 P)
  520. {
  521. return textureProj(sampler2DShadow(tex, sampl), P);
  522. }
  523. #endif
  524. vec4 textureLod(texture1D tex, sampler sampl, float P, float lod)
  525. {
  526. return textureLod(sampler1D(tex, sampl), P, lod);
  527. }
  528. uvec4 textureLod(utexture1D tex, sampler sampl, float P, float lod)
  529. {
  530. return textureLod(usampler1D(tex, sampl), P, lod);
  531. }
  532. ivec4 textureLod(itexture1D tex, sampler sampl, float P, float lod)
  533. {
  534. return textureLod(isampler1D(tex, sampl), P, lod);
  535. }
  536. vec4 textureLod(texture2D tex, sampler sampl, vec2 P, float lod)
  537. {
  538. return textureLod(sampler2D(tex, sampl), P, lod);
  539. }
  540. uvec4 textureLod(utexture2D tex, sampler sampl, vec2 P, float lod)
  541. {
  542. return textureLod(usampler2D(tex, sampl), P, lod);
  543. }
  544. ivec4 textureLod(itexture2D tex, sampler sampl, vec2 P, float lod)
  545. {
  546. return textureLod(isampler2D(tex, sampl), P, lod);
  547. }
  548. vec4 textureLod(texture3D tex, sampler sampl, vec3 P, float lod)
  549. {
  550. return textureLod(sampler3D(tex, sampl), P, lod);
  551. }
  552. uvec4 textureLod(utexture3D tex, sampler sampl, vec3 P, float lod)
  553. {
  554. return textureLod(usampler3D(tex, sampl), P, lod);
  555. }
  556. ivec4 textureLod(itexture3D tex, sampler sampl, vec3 P, float lod)
  557. {
  558. return textureLod(isampler3D(tex, sampl), P, lod);
  559. }
  560. vec4 textureLod(textureCube tex, sampler sampl, vec3 P, float lod)
  561. {
  562. return textureLod(samplerCube(tex, sampl), P, lod);
  563. }
  564. uvec4 textureLod(utextureCube tex, sampler sampl, vec3 P, float lod)
  565. {
  566. return textureLod(usamplerCube(tex, sampl), P, lod);
  567. }
  568. ivec4 textureLod(itextureCube tex, sampler sampl, vec3 P, float lod)
  569. {
  570. return textureLod(isamplerCube(tex, sampl), P, lod);
  571. }
  572. float textureLod(texture2D tex, samplerShadow sampl, vec3 P, float lod)
  573. {
  574. return textureLod(sampler2DShadow(tex, sampl), P, lod);
  575. }
  576. float textureLod(texture1D tex, samplerShadow sampl, vec3 P, float lod)
  577. {
  578. return textureLod(sampler1DShadow(tex, sampl), P, lod);
  579. }
  580. vec4 textureLod(texture1DArray tex, sampler sampl, vec2 P, float lod)
  581. {
  582. return textureLod(sampler1DArray(tex, sampl), P, lod);
  583. }
  584. uvec4 textureLod(utexture1DArray tex, sampler sampl, vec2 P, float lod)
  585. {
  586. return textureLod(usampler1DArray(tex, sampl), P, lod);
  587. }
  588. ivec4 textureLod(itexture1DArray tex, sampler sampl, vec2 P, float lod)
  589. {
  590. return textureLod(isampler1DArray(tex, sampl), P, lod);
  591. }
  592. float textureLod(texture1DArray tex, samplerShadow sampl, vec3 P, float lod)
  593. {
  594. return textureLod(sampler1DArrayShadow(tex, sampl), P, lod);
  595. }
  596. vec4 textureLod(texture2DArray tex, sampler sampl, vec3 P, float lod)
  597. {
  598. return textureLod(sampler2DArray(tex, sampl), P, lod);
  599. }
  600. uvec4 textureLod(utexture2DArray tex, sampler sampl, vec3 P, float lod)
  601. {
  602. return textureLod(usampler2DArray(tex, sampl), P, lod);
  603. }
  604. ivec4 textureLod(itexture2DArray tex, sampler sampl, vec3 P, float lod)
  605. {
  606. return textureLod(isampler2DArray(tex, sampl), P, lod);
  607. }
  608. vec4 textureLod(textureCubeArray tex, sampler sampl, vec4 P, float lod)
  609. {
  610. return textureLod(samplerCubeArray(tex, sampl), P, lod);
  611. }
  612. uvec4 textureLod(utextureCubeArray tex, sampler sampl, vec4 P, float lod)
  613. {
  614. return textureLod(usamplerCubeArray(tex, sampl), P, lod);
  615. }
  616. ivec4 textureLod(itextureCubeArray tex, sampler sampl, vec4 P, float lod)
  617. {
  618. return textureLod(isamplerCubeArray(tex, sampl), P, lod);
  619. }
  620. vec4 textureProjLod(texture1D tex, sampler sampl, vec2 P, float lod)
  621. {
  622. return textureProjLod(sampler1D(tex, sampl), P, lod);
  623. }
  624. uvec4 textureProjLod(utexture1D tex, sampler sampl, vec2 P, float lod)
  625. {
  626. return textureProjLod(usampler1D(tex, sampl), P, lod);
  627. }
  628. ivec4 textureProjLod(itexture1D tex, sampler sampl, vec2 P, float lod)
  629. {
  630. return textureProjLod(isampler1D(tex, sampl), P, lod);
  631. }
  632. vec4 textureProjLod(texture1D tex, sampler sampl, vec4 P, float lod)
  633. {
  634. return textureProjLod(sampler1D(tex, sampl), P, lod);
  635. }
  636. uvec4 textureProjLod(utexture1D tex, sampler sampl, vec4 P, float lod)
  637. {
  638. return textureProjLod(usampler1D(tex, sampl), P, lod);
  639. }
  640. ivec4 textureProjLod(itexture1D tex, sampler sampl, vec4 P, float lod)
  641. {
  642. return textureProjLod(isampler1D(tex, sampl), P, lod);
  643. }
  644. vec4 textureProjLod(texture2D tex, sampler sampl, vec3 P, float lod)
  645. {
  646. return textureProjLod(sampler2D(tex, sampl), P, lod);
  647. }
  648. uvec4 textureProjLod(utexture2D tex, sampler sampl, vec3 P, float lod)
  649. {
  650. return textureProjLod(usampler2D(tex, sampl), P, lod);
  651. }
  652. ivec4 textureProjLod(itexture2D tex, sampler sampl, vec3 P, float lod)
  653. {
  654. return textureProjLod(isampler2D(tex, sampl), P, lod);
  655. }
  656. vec4 textureProjLod(texture2D tex, sampler sampl, vec4 P, float lod)
  657. {
  658. return textureProjLod(sampler2D(tex, sampl), P, lod);
  659. }
  660. uvec4 textureProjLod(utexture2D tex, sampler sampl, vec4 P, float lod)
  661. {
  662. return textureProjLod(usampler2D(tex, sampl), P, lod);
  663. }
  664. ivec4 textureProjLod(itexture2D tex, sampler sampl, vec4 P, float lod)
  665. {
  666. return textureProjLod(isampler2D(tex, sampl), P, lod);
  667. }
  668. vec4 textureProjLod(texture3D tex, sampler sampl, vec4 P, float lod)
  669. {
  670. return textureProjLod(sampler3D(tex, sampl), P, lod);
  671. }
  672. uvec4 textureProjLod(utexture3D tex, sampler sampl, vec4 P, float lod)
  673. {
  674. return textureProjLod(usampler3D(tex, sampl), P, lod);
  675. }
  676. ivec4 textureProjLod(itexture3D tex, sampler sampl, vec4 P, float lod)
  677. {
  678. return textureProjLod(isampler3D(tex, sampl), P, lod);
  679. }
  680. float textureProjLod(texture1D tex, samplerShadow sampl, vec4 P, float lod)
  681. {
  682. return textureProjLod(sampler1DShadow(tex, sampl), P, lod);
  683. }
  684. float textureProjLod(texture2D tex, samplerShadow sampl, vec4 P, float lod)
  685. {
  686. return textureProjLod(sampler2DShadow(tex, sampl), P, lod);
  687. }
  688. #if defined(ANKI_FRAGMENT_SHADER)
  689. vec4 textureGrad(texture1D tex, sampler sampl, float P, float dPdx, float dPdy)
  690. {
  691. return textureGrad(sampler1D(tex, sampl), P, dPdx, dPdy);
  692. }
  693. #endif
  694. #if defined(ANKI_FRAGMENT_SHADER)
  695. uvec4 textureGrad(utexture1D tex, sampler sampl, float P, float dPdx, float dPdy)
  696. {
  697. return textureGrad(usampler1D(tex, sampl), P, dPdx, dPdy);
  698. }
  699. #endif
  700. #if defined(ANKI_FRAGMENT_SHADER)
  701. ivec4 textureGrad(itexture1D tex, sampler sampl, float P, float dPdx, float dPdy)
  702. {
  703. return textureGrad(isampler1D(tex, sampl), P, dPdx, dPdy);
  704. }
  705. #endif
  706. #if defined(ANKI_FRAGMENT_SHADER)
  707. vec4 textureGrad(texture2D tex, sampler sampl, vec2 P, vec2 dPdx, vec2 dPdy)
  708. {
  709. return textureGrad(sampler2D(tex, sampl), P, dPdx, dPdy);
  710. }
  711. #endif
  712. #if defined(ANKI_FRAGMENT_SHADER)
  713. uvec4 textureGrad(utexture2D tex, sampler sampl, vec2 P, vec2 dPdx, vec2 dPdy)
  714. {
  715. return textureGrad(usampler2D(tex, sampl), P, dPdx, dPdy);
  716. }
  717. #endif
  718. #if defined(ANKI_FRAGMENT_SHADER)
  719. ivec4 textureGrad(itexture2D tex, sampler sampl, vec2 P, vec2 dPdx, vec2 dPdy)
  720. {
  721. return textureGrad(isampler2D(tex, sampl), P, dPdx, dPdy);
  722. }
  723. #endif
  724. #if defined(ANKI_FRAGMENT_SHADER)
  725. vec4 textureGrad(texture3D tex, sampler sampl, vec3 P, vec3 dPdx, vec3 dPdy)
  726. {
  727. return textureGrad(sampler3D(tex, sampl), P, dPdx, dPdy);
  728. }
  729. #endif
  730. #if defined(ANKI_FRAGMENT_SHADER)
  731. uvec4 textureGrad(utexture3D tex, sampler sampl, vec3 P, vec3 dPdx, vec3 dPdy)
  732. {
  733. return textureGrad(usampler3D(tex, sampl), P, dPdx, dPdy);
  734. }
  735. #endif
  736. #if defined(ANKI_FRAGMENT_SHADER)
  737. ivec4 textureGrad(itexture3D tex, sampler sampl, vec3 P, vec3 dPdx, vec3 dPdy)
  738. {
  739. return textureGrad(isampler3D(tex, sampl), P, dPdx, dPdy);
  740. }
  741. #endif
  742. #if defined(ANKI_FRAGMENT_SHADER)
  743. vec4 textureGrad(textureCube tex, sampler sampl, vec3 P, vec3 dPdx, vec3 dPdy)
  744. {
  745. return textureGrad(samplerCube(tex, sampl), P, dPdx, dPdy);
  746. }
  747. #endif
  748. #if defined(ANKI_FRAGMENT_SHADER)
  749. uvec4 textureGrad(utextureCube tex, sampler sampl, vec3 P, vec3 dPdx, vec3 dPdy)
  750. {
  751. return textureGrad(usamplerCube(tex, sampl), P, dPdx, dPdy);
  752. }
  753. #endif
  754. #if defined(ANKI_FRAGMENT_SHADER)
  755. ivec4 textureGrad(itextureCube tex, sampler sampl, vec3 P, vec3 dPdx, vec3 dPdy)
  756. {
  757. return textureGrad(isamplerCube(tex, sampl), P, dPdx, dPdy);
  758. }
  759. #endif
  760. #if defined(ANKI_FRAGMENT_SHADER)
  761. float textureGrad(texture1D tex, samplerShadow sampl, vec3 P, float dPdx, float dPdy)
  762. {
  763. return textureGrad(sampler1DShadow(tex, sampl), P, dPdx, dPdy);
  764. }
  765. #endif
  766. #if defined(ANKI_FRAGMENT_SHADER)
  767. vec4 textureGrad(texture1DArray tex, sampler sampl, vec2 P, float dPdx, float dPdy)
  768. {
  769. return textureGrad(sampler1DArray(tex, sampl), P, dPdx, dPdy);
  770. }
  771. #endif
  772. #if defined(ANKI_FRAGMENT_SHADER)
  773. uvec4 textureGrad(utexture1DArray tex, sampler sampl, vec2 P, float dPdx, float dPdy)
  774. {
  775. return textureGrad(usampler1DArray(tex, sampl), P, dPdx, dPdy);
  776. }
  777. #endif
  778. #if defined(ANKI_FRAGMENT_SHADER)
  779. ivec4 textureGrad(itexture1DArray tex, sampler sampl, vec2 P, float dPdx, float dPdy)
  780. {
  781. return textureGrad(isampler1DArray(tex, sampl), P, dPdx, dPdy);
  782. }
  783. #endif
  784. #if defined(ANKI_FRAGMENT_SHADER)
  785. vec4 textureGrad(texture2DArray tex, sampler sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  786. {
  787. return textureGrad(sampler2DArray(tex, sampl), P, dPdx, dPdy);
  788. }
  789. #endif
  790. #if defined(ANKI_FRAGMENT_SHADER)
  791. uvec4 textureGrad(utexture2DArray tex, sampler sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  792. {
  793. return textureGrad(usampler2DArray(tex, sampl), P, dPdx, dPdy);
  794. }
  795. #endif
  796. #if defined(ANKI_FRAGMENT_SHADER)
  797. ivec4 textureGrad(itexture2DArray tex, sampler sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  798. {
  799. return textureGrad(isampler2DArray(tex, sampl), P, dPdx, dPdy);
  800. }
  801. #endif
  802. #if defined(ANKI_FRAGMENT_SHADER)
  803. float textureGrad(texture1DArray tex, samplerShadow sampl, vec3 P, float dPdx, float dPdy)
  804. {
  805. return textureGrad(sampler1DArrayShadow(tex, sampl), P, dPdx, dPdy);
  806. }
  807. #endif
  808. #if defined(ANKI_FRAGMENT_SHADER)
  809. float textureGrad(texture2D tex, samplerShadow sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  810. {
  811. return textureGrad(sampler2DShadow(tex, sampl), P, dPdx, dPdy);
  812. }
  813. #endif
  814. #if defined(ANKI_FRAGMENT_SHADER)
  815. float textureGrad(textureCube tex, samplerShadow sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  816. {
  817. return textureGrad(samplerCubeShadow(tex, sampl), P, dPdx, dPdy);
  818. }
  819. #endif
  820. #if defined(ANKI_FRAGMENT_SHADER)
  821. float textureGrad(texture2DArray tex, samplerShadow sampl, vec4 P, vec2 dPdx, vec2 dPdy)
  822. {
  823. return textureGrad(sampler2DArrayShadow(tex, sampl), P, dPdx, dPdy);
  824. }
  825. #endif
  826. #if defined(ANKI_FRAGMENT_SHADER)
  827. vec4 textureGrad(textureCubeArray tex, sampler sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  828. {
  829. return textureGrad(samplerCubeArray(tex, sampl), P, dPdx, dPdy);
  830. }
  831. #endif
  832. #if defined(ANKI_FRAGMENT_SHADER)
  833. uvec4 textureGrad(utextureCubeArray tex, sampler sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  834. {
  835. return textureGrad(usamplerCubeArray(tex, sampl), P, dPdx, dPdy);
  836. }
  837. #endif
  838. #if defined(ANKI_FRAGMENT_SHADER)
  839. ivec4 textureGrad(itextureCubeArray tex, sampler sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  840. {
  841. return textureGrad(isamplerCubeArray(tex, sampl), P, dPdx, dPdy);
  842. }
  843. #endif
  844. #if defined(ANKI_FRAGMENT_SHADER)
  845. vec4 textureProjGrad(texture1D tex, sampler sampl, vec2 P, float dPdx, float dPdy)
  846. {
  847. return textureProjGrad(sampler1D(tex, sampl), P, dPdx, dPdy);
  848. }
  849. #endif
  850. #if defined(ANKI_FRAGMENT_SHADER)
  851. uvec4 textureProjGrad(utexture1D tex, sampler sampl, vec2 P, float dPdx, float dPdy)
  852. {
  853. return textureProjGrad(usampler1D(tex, sampl), P, dPdx, dPdy);
  854. }
  855. #endif
  856. #if defined(ANKI_FRAGMENT_SHADER)
  857. ivec4 textureProjGrad(itexture1D tex, sampler sampl, vec2 P, float dPdx, float dPdy)
  858. {
  859. return textureProjGrad(isampler1D(tex, sampl), P, dPdx, dPdy);
  860. }
  861. #endif
  862. #if defined(ANKI_FRAGMENT_SHADER)
  863. vec4 textureProjGrad(texture1D tex, sampler sampl, vec4 P, float dPdx, float dPdy)
  864. {
  865. return textureProjGrad(sampler1D(tex, sampl), P, dPdx, dPdy);
  866. }
  867. #endif
  868. #if defined(ANKI_FRAGMENT_SHADER)
  869. uvec4 textureProjGrad(utexture1D tex, sampler sampl, vec4 P, float dPdx, float dPdy)
  870. {
  871. return textureProjGrad(usampler1D(tex, sampl), P, dPdx, dPdy);
  872. }
  873. #endif
  874. #if defined(ANKI_FRAGMENT_SHADER)
  875. ivec4 textureProjGrad(itexture1D tex, sampler sampl, vec4 P, float dPdx, float dPdy)
  876. {
  877. return textureProjGrad(isampler1D(tex, sampl), P, dPdx, dPdy);
  878. }
  879. #endif
  880. #if defined(ANKI_FRAGMENT_SHADER)
  881. vec4 textureProjGrad(texture2D tex, sampler sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  882. {
  883. return textureProjGrad(sampler2D(tex, sampl), P, dPdx, dPdy);
  884. }
  885. #endif
  886. #if defined(ANKI_FRAGMENT_SHADER)
  887. uvec4 textureProjGrad(utexture2D tex, sampler sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  888. {
  889. return textureProjGrad(usampler2D(tex, sampl), P, dPdx, dPdy);
  890. }
  891. #endif
  892. #if defined(ANKI_FRAGMENT_SHADER)
  893. ivec4 textureProjGrad(itexture2D tex, sampler sampl, vec3 P, vec2 dPdx, vec2 dPdy)
  894. {
  895. return textureProjGrad(isampler2D(tex, sampl), P, dPdx, dPdy);
  896. }
  897. #endif
  898. #if defined(ANKI_FRAGMENT_SHADER)
  899. vec4 textureProjGrad(texture2D tex, sampler sampl, vec4 P, vec2 dPdx, vec2 dPdy)
  900. {
  901. return textureProjGrad(sampler2D(tex, sampl), P, dPdx, dPdy);
  902. }
  903. #endif
  904. #if defined(ANKI_FRAGMENT_SHADER)
  905. uvec4 textureProjGrad(utexture2D tex, sampler sampl, vec4 P, vec2 dPdx, vec2 dPdy)
  906. {
  907. return textureProjGrad(usampler2D(tex, sampl), P, dPdx, dPdy);
  908. }
  909. #endif
  910. #if defined(ANKI_FRAGMENT_SHADER)
  911. ivec4 textureProjGrad(itexture2D tex, sampler sampl, vec4 P, vec2 dPdx, vec2 dPdy)
  912. {
  913. return textureProjGrad(isampler2D(tex, sampl), P, dPdx, dPdy);
  914. }
  915. #endif
  916. #if defined(ANKI_FRAGMENT_SHADER)
  917. vec4 textureProjGrad(texture3D tex, sampler sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  918. {
  919. return textureProjGrad(sampler3D(tex, sampl), P, dPdx, dPdy);
  920. }
  921. #endif
  922. #if defined(ANKI_FRAGMENT_SHADER)
  923. uvec4 textureProjGrad(utexture3D tex, sampler sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  924. {
  925. return textureProjGrad(usampler3D(tex, sampl), P, dPdx, dPdy);
  926. }
  927. #endif
  928. #if defined(ANKI_FRAGMENT_SHADER)
  929. ivec4 textureProjGrad(itexture3D tex, sampler sampl, vec4 P, vec3 dPdx, vec3 dPdy)
  930. {
  931. return textureProjGrad(isampler3D(tex, sampl), P, dPdx, dPdy);
  932. }
  933. #endif
  934. #if defined(ANKI_FRAGMENT_SHADER)
  935. float textureProjGrad(texture1D tex, samplerShadow sampl, vec4 P, float dPdx, float dPdy)
  936. {
  937. return textureProjGrad(sampler1DShadow(tex, sampl), P, dPdx, dPdy);
  938. }
  939. #endif
  940. #if defined(ANKI_FRAGMENT_SHADER)
  941. float textureProjGrad(texture2D tex, samplerShadow sampl, vec4 P, vec2 dPdx, vec2 dPdy)
  942. {
  943. return textureProjGrad(sampler2DShadow(tex, sampl), P, dPdx, dPdy);
  944. }
  945. #endif