format_conversion.effect 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. /******************************************************************************
  2. Copyright (C) 2014 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #include "color.effect"
  15. uniform float width;
  16. uniform float height;
  17. uniform float width_i;
  18. uniform float height_i;
  19. uniform float width_d2;
  20. uniform float height_d2;
  21. uniform float width_x2_i;
  22. uniform float maximum_over_sdr_white_nits;
  23. uniform float sdr_white_nits_over_maximum;
  24. uniform float hlg_exponent;
  25. uniform float hdr_lw;
  26. uniform float hdr_lmax;
  27. uniform float4 color_vec0;
  28. uniform float4 color_vec1;
  29. uniform float4 color_vec2;
  30. uniform float3 color_range_min = {0.0, 0.0, 0.0};
  31. uniform float3 color_range_max = {1.0, 1.0, 1.0};
  32. uniform texture2d image;
  33. uniform texture2d image1;
  34. uniform texture2d image2;
  35. uniform texture2d image3;
  36. sampler_state def_sampler {
  37. Filter = Linear;
  38. AddressU = Clamp;
  39. AddressV = Clamp;
  40. };
  41. struct FragPos {
  42. float4 pos : POSITION;
  43. };
  44. struct VertTexPos {
  45. float2 uv : TEXCOORD0;
  46. float4 pos : POSITION;
  47. };
  48. struct VertPosWide {
  49. float3 pos_wide : TEXCOORD0;
  50. float4 pos : POSITION;
  51. };
  52. struct VertTexPosWide {
  53. float3 uuv : TEXCOORD0;
  54. float4 pos : POSITION;
  55. };
  56. struct VertTexPosWideWide {
  57. float4 uuvv : TEXCOORD0;
  58. float4 pos : POSITION;
  59. };
  60. struct FragTex {
  61. float2 uv : TEXCOORD0;
  62. };
  63. struct FragPosWide {
  64. float3 pos_wide : TEXCOORD0;
  65. };
  66. struct FragTexWide {
  67. float3 uuv : TEXCOORD0;
  68. };
  69. struct FragTexWideWide {
  70. float4 uuvv : TEXCOORD0;
  71. };
  72. FragPos VSPos(uint id : VERTEXID)
  73. {
  74. float idHigh = float(id >> 1);
  75. float idLow = float(id & uint(1));
  76. float x = idHigh * 4.0 - 1.0;
  77. float y = idLow * 4.0 - 1.0;
  78. FragPos vert_out;
  79. vert_out.pos = float4(x, y, 0.0, 1.0);
  80. return vert_out;
  81. }
  82. VertTexPosWide VSTexPos_Left(uint id : VERTEXID)
  83. {
  84. float idHigh = float(id >> 1);
  85. float idLow = float(id & uint(1));
  86. float x = idHigh * 4.0 - 1.0;
  87. float y = idLow * 4.0 - 1.0;
  88. float u_right = idHigh * 2.0;
  89. float u_left = u_right - width_i;
  90. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  91. VertTexPosWide vert_out;
  92. vert_out.uuv = float3(u_left, u_right, v);
  93. vert_out.pos = float4(x, y, 0.0, 1.0);
  94. return vert_out;
  95. }
  96. VertTexPosWideWide VSTexPos_TopLeft(uint id : VERTEXID)
  97. {
  98. float idHigh = float(id >> 1);
  99. float idLow = float(id & uint(1));
  100. float x = idHigh * 4.0 - 1.0;
  101. float y = idLow * 4.0 - 1.0;
  102. float u_right = idHigh * 2.0;
  103. float u_left = u_right - width_i;
  104. float v_bottom;
  105. float v_top;
  106. if (obs_glsl_compile) {
  107. v_bottom = idLow * 2.0;
  108. v_top = v_bottom + height_i;
  109. } else {
  110. v_bottom = 1.0 - idLow * 2.0;
  111. v_top = v_bottom - height_i;
  112. }
  113. VertTexPosWideWide vert_out;
  114. vert_out.uuvv = float4(u_left, u_right, v_top, v_bottom);
  115. vert_out.pos = float4(x, y, 0.0, 1.0);
  116. return vert_out;
  117. }
  118. VertTexPos VSTexPosHalf_Reverse(uint id : VERTEXID)
  119. {
  120. float idHigh = float(id >> 1);
  121. float idLow = float(id & uint(1));
  122. float x = idHigh * 4.0 - 1.0;
  123. float y = idLow * 4.0 - 1.0;
  124. float u = idHigh * 2.0;
  125. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  126. VertTexPos vert_out;
  127. vert_out.uv = float2(width_d2 * u, height * v);
  128. vert_out.pos = float4(x, y, 0.0, 1.0);
  129. return vert_out;
  130. }
  131. VertTexPos VSTexPosHalfHalf_Reverse(uint id : VERTEXID)
  132. {
  133. float idHigh = float(id >> 1);
  134. float idLow = float(id & uint(1));
  135. float x = idHigh * 4.0 - 1.0;
  136. float y = idLow * 4.0 - 1.0;
  137. float u = idHigh * 2.0;
  138. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  139. VertTexPos vert_out;
  140. vert_out.uv = float2(width_d2 * u, height_d2 * v);
  141. vert_out.pos = float4(x, y, 0.0, 1.0);
  142. return vert_out;
  143. }
  144. VertPosWide VSPosWide_Reverse(uint id : VERTEXID)
  145. {
  146. float idHigh = float(id >> 1);
  147. float idLow = float(id & uint(1));
  148. float x = idHigh * 4.0 - 1.0;
  149. float y = idLow * 4.0 - 1.0;
  150. float u = idHigh * 2.0;
  151. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  152. VertPosWide vert_out;
  153. vert_out.pos_wide = float3(float2(width, width_d2) * u, height * v);
  154. vert_out.pos = float4(x, y, 0.0, 1.0);
  155. return vert_out;
  156. }
  157. float PS_Y(FragPos frag_in) : TARGET
  158. {
  159. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  160. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  161. return y;
  162. }
  163. float PS_P010_PQ_Y_709_2020(FragPos frag_in) : TARGET
  164. {
  165. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  166. rgb = rec709_to_rec2020(rgb);
  167. rgb = linear_to_st2084(rgb);
  168. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  169. y = floor(saturate(y) * 1023. + 0.5) * (64. / 65535.);
  170. return y;
  171. }
  172. float PS_P010_HLG_Y_709_2020(FragPos frag_in) : TARGET
  173. {
  174. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  175. rgb = rec709_to_rec2020(rgb);
  176. rgb = linear_to_hlg(rgb, hdr_lw);
  177. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  178. y = floor(saturate(y) * 1023. + 0.5) * (64. / 65535.);
  179. return y;
  180. }
  181. float PS_P010_SRGB_Y(FragPos frag_in) : TARGET
  182. {
  183. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  184. rgb = srgb_linear_to_nonlinear(rgb);
  185. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  186. y = floor(saturate(y) * 1023. + 0.5) * (64. / 65535.);
  187. return y;
  188. }
  189. float PS_I010_PQ_Y_709_2020(FragPos frag_in) : TARGET
  190. {
  191. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  192. rgb = rec709_to_rec2020(rgb);
  193. rgb = linear_to_st2084(rgb);
  194. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  195. return y * (1023. / 65535.);
  196. }
  197. float PS_I010_HLG_Y_709_2020(FragPos frag_in) : TARGET
  198. {
  199. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  200. rgb = rec709_to_rec2020(rgb);
  201. rgb = linear_to_hlg(rgb, hdr_lw);
  202. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  203. return y * (1023. / 65535.);
  204. }
  205. float PS_I010_SRGB_Y(FragPos frag_in) : TARGET
  206. {
  207. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  208. rgb = srgb_linear_to_nonlinear(rgb);
  209. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  210. return y * (1023. / 65535.);
  211. }
  212. float2 PS_UV_Wide(FragTexWide frag_in) : TARGET
  213. {
  214. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  215. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  216. float3 rgb = (rgb_left + rgb_right) * 0.5;
  217. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  218. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  219. return float2(u, v);
  220. }
  221. float2 PS_P010_PQ_UV_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  222. {
  223. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  224. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  225. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  226. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  227. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  228. rgb = rec709_to_rec2020(rgb);
  229. rgb = linear_to_st2084(rgb);
  230. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  231. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  232. float2 uv = float2(u, v);
  233. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  234. return uv;
  235. }
  236. float2 PS_P010_HLG_UV_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  237. {
  238. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  239. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  240. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  241. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  242. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  243. rgb = rec709_to_rec2020(rgb);
  244. rgb = linear_to_hlg(rgb, hdr_lw);
  245. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  246. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  247. float2 uv = float2(u, v);
  248. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  249. return uv;
  250. }
  251. float2 PS_P010_SRGB_UV_Wide(FragTexWide frag_in) : TARGET
  252. {
  253. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  254. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  255. float3 rgb = (rgb_left + rgb_right) * 0.5;
  256. rgb = srgb_linear_to_nonlinear(rgb);
  257. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  258. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  259. float2 uv = float2(u, v);
  260. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  261. return uv;
  262. }
  263. float PS_U(FragPos frag_in) : TARGET
  264. {
  265. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  266. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  267. return u;
  268. }
  269. float PS_V(FragPos frag_in) : TARGET
  270. {
  271. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  272. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  273. return v;
  274. }
  275. float PS_U_Wide(FragTexWide frag_in) : TARGET
  276. {
  277. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  278. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  279. float3 rgb = (rgb_left + rgb_right) * 0.5;
  280. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  281. return u;
  282. }
  283. float PS_V_Wide(FragTexWide frag_in) : TARGET
  284. {
  285. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  286. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  287. float3 rgb = (rgb_left + rgb_right) * 0.5;
  288. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  289. return v;
  290. }
  291. float PS_I010_PQ_U_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  292. {
  293. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  294. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  295. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  296. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  297. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  298. rgb = rec709_to_rec2020(rgb);
  299. rgb = linear_to_st2084(rgb);
  300. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  301. return u * (1023. / 65535.);
  302. }
  303. float PS_I010_HLG_U_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  304. {
  305. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  306. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  307. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  308. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  309. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  310. rgb = rec709_to_rec2020(rgb);
  311. rgb = linear_to_hlg(rgb, hdr_lw);
  312. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  313. return u * (1023. / 65535.);
  314. }
  315. float PS_I010_SRGB_U_Wide(FragTexWide frag_in) : TARGET
  316. {
  317. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  318. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  319. float3 rgb = (rgb_left + rgb_right) * 0.5;
  320. rgb = srgb_linear_to_nonlinear(rgb);
  321. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  322. return u * (1023. / 65535.);
  323. }
  324. float PS_I010_PQ_V_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  325. {
  326. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  327. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  328. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  329. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  330. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  331. rgb = rec709_to_rec2020(rgb);
  332. rgb = linear_to_st2084(rgb);
  333. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  334. return v * (1023. / 65535.);
  335. }
  336. float PS_I010_HLG_V_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  337. {
  338. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  339. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  340. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  341. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  342. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  343. rgb = rec709_to_rec2020(rgb);
  344. rgb = linear_to_hlg(rgb, hdr_lw);
  345. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  346. return v * (1023. / 65535.);
  347. }
  348. float PS_I010_SRGB_V_Wide(FragTexWide frag_in) : TARGET
  349. {
  350. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  351. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  352. float3 rgb = (rgb_left + rgb_right) * 0.5;
  353. rgb = srgb_linear_to_nonlinear(rgb);
  354. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  355. return v * (1023. / 65535.);
  356. }
  357. float3 YUV_to_RGB(float3 yuv)
  358. {
  359. yuv = clamp(yuv, color_range_min, color_range_max);
  360. float r = dot(color_vec0.xyz, yuv) + color_vec0.w;
  361. float g = dot(color_vec1.xyz, yuv) + color_vec1.w;
  362. float b = dot(color_vec2.xyz, yuv) + color_vec2.w;
  363. return float3(r, g, b);
  364. }
  365. float3 PSUYVY_Reverse(FragTex frag_in) : TARGET
  366. {
  367. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  368. float2 y01 = y2uv.yw;
  369. float2 cbcr = y2uv.zx;
  370. float leftover = frac(frag_in.uv.x);
  371. float y = (leftover < 0.5) ? y01.x : y01.y;
  372. float3 yuv = float3(y, cbcr);
  373. float3 rgb = YUV_to_RGB(yuv);
  374. return rgb;
  375. }
  376. float3 PSYUY2_Reverse(FragTex frag_in) : TARGET
  377. {
  378. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  379. float2 y01 = y2uv.zx;
  380. float2 cbcr = y2uv.yw;
  381. float leftover = frac(frag_in.uv.x);
  382. float y = (leftover < 0.5) ? y01.x : y01.y;
  383. float3 yuv = float3(y, cbcr);
  384. float3 rgb = YUV_to_RGB(yuv);
  385. return rgb;
  386. }
  387. float4 PSYUY2_PQ_Reverse(FragTex frag_in) : TARGET
  388. {
  389. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  390. float2 y01 = y2uv.zx;
  391. float2 cbcr = y2uv.yw;
  392. float leftover = frac(frag_in.uv.x);
  393. float y = (leftover < 0.5) ? y01.x : y01.y;
  394. float3 yuv = float3(y, cbcr);
  395. float3 pq = YUV_to_RGB(yuv);
  396. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  397. float3 rgb = rec2020_to_rec709(hdr2020);
  398. return float4(rgb, 1.);
  399. }
  400. float4 PSYUY2_HLG_Reverse(FragTex frag_in) : TARGET
  401. {
  402. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  403. float2 y01 = y2uv.zx;
  404. float2 cbcr = y2uv.yw;
  405. float leftover = frac(frag_in.uv.x);
  406. float y = (leftover < 0.5) ? y01.x : y01.y;
  407. float3 yuv = float3(y, cbcr);
  408. float3 hlg = YUV_to_RGB(yuv);
  409. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  410. float3 rgb = rec2020_to_rec709(hdr2020);
  411. return float4(rgb, 1.);
  412. }
  413. float3 PSYVYU_Reverse(FragTex frag_in) : TARGET
  414. {
  415. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  416. float2 y01 = y2uv.zx;
  417. float2 cbcr = y2uv.wy;
  418. float leftover = frac(frag_in.uv.x);
  419. float y = (leftover < 0.5) ? y01.x : y01.y;
  420. float3 yuv = float3(y, cbcr);
  421. float3 rgb = YUV_to_RGB(yuv);
  422. return rgb;
  423. }
  424. float3 PSPlanar420_Reverse(VertTexPos frag_in) : TARGET
  425. {
  426. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  427. int3 xy0_chroma = int3(frag_in.uv, 0);
  428. float cb = image1.Load(xy0_chroma).x;
  429. float cr = image2.Load(xy0_chroma).x;
  430. float3 yuv = float3(y, cb, cr);
  431. float3 rgb = YUV_to_RGB(yuv);
  432. return rgb;
  433. }
  434. float4 PSPlanar420_PQ_Reverse(VertTexPos frag_in) : TARGET
  435. {
  436. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  437. int3 xy0_chroma = int3(frag_in.uv, 0);
  438. float cb = image1.Load(xy0_chroma).x;
  439. float cr = image2.Load(xy0_chroma).x;
  440. float3 yuv = float3(y, cb, cr);
  441. float3 pq = YUV_to_RGB(yuv);
  442. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  443. float3 rgb = rec2020_to_rec709(hdr2020);
  444. return float4(rgb, 1.);
  445. }
  446. float4 PSPlanar420_HLG_Reverse(VertTexPos frag_in) : TARGET
  447. {
  448. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  449. int3 xy0_chroma = int3(frag_in.uv, 0);
  450. float cb = image1.Load(xy0_chroma).x;
  451. float cr = image2.Load(xy0_chroma).x;
  452. float3 yuv = float3(y, cb, cr);
  453. float3 hlg = YUV_to_RGB(yuv);
  454. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  455. float3 rgb = rec2020_to_rec709(hdr2020);
  456. return float4(rgb, 1.);
  457. }
  458. float4 PSPlanar420A_Reverse(VertTexPos frag_in) : TARGET
  459. {
  460. int3 xy0_luma = int3(frag_in.pos.xy, 0);
  461. float y = image.Load(xy0_luma).x;
  462. int3 xy0_chroma = int3(frag_in.uv, 0);
  463. float cb = image1.Load(xy0_chroma).x;
  464. float cr = image2.Load(xy0_chroma).x;
  465. float alpha = image3.Load(xy0_luma).x;
  466. float3 yuv = float3(y, cb, cr);
  467. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  468. return rgba;
  469. }
  470. float3 PSPlanar422_Reverse(FragPosWide frag_in) : TARGET
  471. {
  472. float y = image.Load(int3(frag_in.pos_wide.xz, 0)).x;
  473. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  474. float cb = image1.Load(xy0_chroma).x;
  475. float cr = image2.Load(xy0_chroma).x;
  476. float3 yuv = float3(y, cb, cr);
  477. float3 rgb = YUV_to_RGB(yuv);
  478. return rgb;
  479. }
  480. float4 PSPlanar422_10LE_Reverse(FragPosWide frag_in) : TARGET
  481. {
  482. float y = image.Load(int3(frag_in.pos_wide.xz, 0)).x;
  483. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  484. float cb = image1.Load(xy0_chroma).x;
  485. float cr = image2.Load(xy0_chroma).x;
  486. float3 yuv = float3(y, cb, cr);
  487. yuv *= 65535. / 1023.;
  488. float3 rgb = YUV_to_RGB(yuv);
  489. rgb = srgb_nonlinear_to_linear(rgb);
  490. return float4(rgb, 1.);
  491. }
  492. float4 PSPlanar422A_Reverse(FragPosWide frag_in) : TARGET
  493. {
  494. int3 xy0_luma = int3(frag_in.pos_wide.xz, 0);
  495. float y = image.Load(xy0_luma).x;
  496. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  497. float cb = image1.Load(xy0_chroma).x;
  498. float cr = image2.Load(xy0_chroma).x;
  499. float alpha = image3.Load(xy0_luma).x;
  500. float3 yuv = float3(y, cb, cr);
  501. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  502. return rgba;
  503. }
  504. float3 PSPlanar444_Reverse(FragPos frag_in) : TARGET
  505. {
  506. int3 xy0 = int3(frag_in.pos.xy, 0);
  507. float y = image.Load(xy0).x;
  508. float cb = image1.Load(xy0).x;
  509. float cr = image2.Load(xy0).x;
  510. float3 yuv = float3(y, cb, cr);
  511. float3 rgb = YUV_to_RGB(yuv);
  512. return rgb;
  513. }
  514. float4 PSPlanar444_12LE_Reverse(FragPos frag_in) : TARGET
  515. {
  516. int3 xy0 = int3(frag_in.pos.xy, 0);
  517. float y = image.Load(xy0).x;
  518. float cb = image1.Load(xy0).x;
  519. float cr = image2.Load(xy0).x;
  520. float3 yuv = float3(y, cb, cr);
  521. yuv *= 65535. / 4095.;
  522. float3 rgb = YUV_to_RGB(yuv);
  523. rgb = srgb_nonlinear_to_linear(rgb);
  524. return float4(rgb, 1.);
  525. }
  526. float4 PSPlanar444A_Reverse(FragPos frag_in) : TARGET
  527. {
  528. int3 xy0 = int3(frag_in.pos.xy, 0);
  529. float y = image.Load(xy0).x;
  530. float cb = image1.Load(xy0).x;
  531. float cr = image2.Load(xy0).x;
  532. float alpha = image3.Load(xy0).x;
  533. float3 yuv = float3(y, cb, cr);
  534. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  535. return rgba;
  536. }
  537. float4 PSPlanar444A_12LE_Reverse(FragPos frag_in) : TARGET
  538. {
  539. int3 xy0 = int3(frag_in.pos.xy, 0);
  540. float y = image.Load(xy0).x;
  541. float cb = image1.Load(xy0).x;
  542. float cr = image2.Load(xy0).x;
  543. float alpha = image3.Load(xy0).x * 16.;
  544. float3 yuv = float3(y, cb, cr);
  545. yuv *= 65535. / 4095.;
  546. float3 rgb = YUV_to_RGB(yuv);
  547. rgb = srgb_nonlinear_to_linear(rgb);
  548. return float4(rgb, alpha);
  549. }
  550. float4 PSAYUV_Reverse(FragPos frag_in) : TARGET
  551. {
  552. float4 yuva = image.Load(int3(frag_in.pos.xy, 0));
  553. float4 rgba = float4(YUV_to_RGB(yuva.xyz), yuva.a);
  554. return rgba;
  555. }
  556. float3 PSNV12_Reverse(VertTexPos frag_in) : TARGET
  557. {
  558. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  559. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  560. float3 yuv = float3(y, cbcr);
  561. float3 rgb = YUV_to_RGB(yuv);
  562. return rgb;
  563. }
  564. float4 PSNV12_PQ_Reverse(VertTexPos frag_in) : TARGET
  565. {
  566. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  567. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  568. float3 yuv = float3(y, cbcr);
  569. float3 pq = YUV_to_RGB(yuv);
  570. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  571. float3 rgb = rec2020_to_rec709(hdr2020);
  572. return float4(rgb, 1.);
  573. }
  574. float4 PSNV12_HLG_Reverse(VertTexPos frag_in) : TARGET
  575. {
  576. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  577. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  578. float3 yuv = float3(y, cbcr);
  579. float3 hlg = YUV_to_RGB(yuv);
  580. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  581. float3 rgb = rec2020_to_rec709(hdr2020);
  582. return float4(rgb, 1.);
  583. }
  584. float4 PSI010_SRGB_Reverse(VertTexPos frag_in) : TARGET
  585. {
  586. float ratio = 65535. / 1023.;
  587. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  588. int3 xy0_chroma = int3(frag_in.uv, 0);
  589. float cb = image1.Load(xy0_chroma).x * ratio;
  590. float cr = image2.Load(xy0_chroma).x * ratio;
  591. float3 yuv = float3(y, cb, cr);
  592. float3 rgb = YUV_to_RGB(yuv);
  593. rgb = srgb_nonlinear_to_linear(rgb);
  594. return float4(rgb, 1.);
  595. }
  596. float4 PSI010_PQ_2020_709_Reverse(VertTexPos frag_in) : TARGET
  597. {
  598. float ratio = 65535. / 1023.;
  599. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  600. int3 xy0_chroma = int3(frag_in.uv, 0);
  601. float cb = image1.Load(xy0_chroma).x * ratio;
  602. float cr = image2.Load(xy0_chroma).x * ratio;
  603. float3 yuv = float3(y, cb, cr);
  604. float3 pq = YUV_to_RGB(yuv);
  605. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  606. float3 rgb = rec2020_to_rec709(hdr2020);
  607. return float4(rgb, 1.);
  608. }
  609. float4 PSI010_HLG_2020_709_Reverse(VertTexPos frag_in) : TARGET
  610. {
  611. float ratio = 65535. / 1023.;
  612. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  613. int3 xy0_chroma = int3(frag_in.uv, 0);
  614. float cb = image1.Load(xy0_chroma).x * ratio;
  615. float cr = image2.Load(xy0_chroma).x * ratio;
  616. float3 yuv = float3(y, cb, cr);
  617. float3 hlg = YUV_to_RGB(yuv);
  618. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  619. float3 rgb = rec2020_to_rec709(hdr2020);
  620. return float4(rgb, 1.);
  621. }
  622. float4 PSP010_SRGB_Reverse(VertTexPos frag_in) : TARGET
  623. {
  624. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  625. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  626. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  627. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  628. float3 yuv = yuv_1023 / 1023.;
  629. float3 rgb = YUV_to_RGB(yuv);
  630. rgb = srgb_nonlinear_to_linear(rgb);
  631. return float4(rgb, 1.);
  632. }
  633. float4 PSP010_PQ_2020_709_Reverse(VertTexPos frag_in) : TARGET
  634. {
  635. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  636. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  637. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  638. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  639. float3 yuv = yuv_1023 / 1023.;
  640. float3 pq = YUV_to_RGB(yuv);
  641. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  642. float3 rgb = rec2020_to_rec709(hdr2020);
  643. return float4(rgb, 1.);
  644. }
  645. float4 PSP010_HLG_2020_709_Reverse(VertTexPos frag_in) : TARGET
  646. {
  647. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  648. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  649. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  650. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  651. float3 yuv = yuv_1023 / 1023.;
  652. float3 hlg = YUV_to_RGB(yuv);
  653. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  654. float3 rgb = rec2020_to_rec709(hdr2020);
  655. return float4(rgb, 1.);
  656. }
  657. float3 PSY800_Limited(FragPos frag_in) : TARGET
  658. {
  659. float limited = image.Load(int3(frag_in.pos.xy, 0)).x;
  660. float full = (255.0 / 219.0) * limited - (16.0 / 219.0);
  661. return float3(full, full, full);
  662. }
  663. float3 PSY800_Full(FragPos frag_in) : TARGET
  664. {
  665. float3 full = image.Load(int3(frag_in.pos.xy, 0)).xxx;
  666. return full;
  667. }
  668. float4 PSRGB_Limited(FragPos frag_in) : TARGET
  669. {
  670. float4 rgba = image.Load(int3(frag_in.pos.xy, 0));
  671. rgba.rgb = (255.0 / 219.0) * rgba.rgb - (16.0 / 219.0);
  672. return rgba;
  673. }
  674. float3 PSBGR3_Limited(FragPos frag_in) : TARGET
  675. {
  676. float x = frag_in.pos.x * 3.0;
  677. float y = frag_in.pos.y;
  678. float b = image.Load(int3(x - 1.0, y, 0)).x;
  679. float g = image.Load(int3(x, y, 0)).x;
  680. float r = image.Load(int3(x + 1.0, y, 0)).x;
  681. float3 rgb = float3(r, g, b);
  682. rgb = (255.0 / 219.0) * rgb - (16.0 / 219.0);
  683. return rgb;
  684. }
  685. float3 PSBGR3_Full(FragPos frag_in) : TARGET
  686. {
  687. float x = frag_in.pos.x * 3.0;
  688. float y = frag_in.pos.y;
  689. float b = image.Load(int3(x - 1.0, y, 0)).x;
  690. float g = image.Load(int3(x, y, 0)).x;
  691. float r = image.Load(int3(x + 1.0, y, 0)).x;
  692. float3 rgb = float3(r, g, b);
  693. return rgb;
  694. }
  695. technique Planar_Y
  696. {
  697. pass
  698. {
  699. vertex_shader = VSPos(id);
  700. pixel_shader = PS_Y(frag_in);
  701. }
  702. }
  703. technique Planar_U
  704. {
  705. pass
  706. {
  707. vertex_shader = VSPos(id);
  708. pixel_shader = PS_U(frag_in);
  709. }
  710. }
  711. technique Planar_V
  712. {
  713. pass
  714. {
  715. vertex_shader = VSPos(id);
  716. pixel_shader = PS_V(frag_in);
  717. }
  718. }
  719. technique Planar_U_Left
  720. {
  721. pass
  722. {
  723. vertex_shader = VSTexPos_Left(id);
  724. pixel_shader = PS_U_Wide(frag_in);
  725. }
  726. }
  727. technique Planar_V_Left
  728. {
  729. pass
  730. {
  731. vertex_shader = VSTexPos_Left(id);
  732. pixel_shader = PS_V_Wide(frag_in);
  733. }
  734. }
  735. technique NV12_Y
  736. {
  737. pass
  738. {
  739. vertex_shader = VSPos(id);
  740. pixel_shader = PS_Y(frag_in);
  741. }
  742. }
  743. technique NV12_UV
  744. {
  745. pass
  746. {
  747. vertex_shader = VSTexPos_Left(id);
  748. pixel_shader = PS_UV_Wide(frag_in);
  749. }
  750. }
  751. technique I010_PQ_Y
  752. {
  753. pass
  754. {
  755. vertex_shader = VSPos(id);
  756. pixel_shader = PS_I010_PQ_Y_709_2020(frag_in);
  757. }
  758. }
  759. technique I010_HLG_Y
  760. {
  761. pass
  762. {
  763. vertex_shader = VSPos(id);
  764. pixel_shader = PS_I010_HLG_Y_709_2020(frag_in);
  765. }
  766. }
  767. technique I010_SRGB_Y
  768. {
  769. pass
  770. {
  771. vertex_shader = VSPos(id);
  772. pixel_shader = PS_I010_SRGB_Y(frag_in);
  773. }
  774. }
  775. technique I010_PQ_U
  776. {
  777. pass
  778. {
  779. vertex_shader = VSTexPos_TopLeft(id);
  780. pixel_shader = PS_I010_PQ_U_709_2020_WideWide(frag_in);
  781. }
  782. }
  783. technique I010_HLG_U
  784. {
  785. pass
  786. {
  787. vertex_shader = VSTexPos_TopLeft(id);
  788. pixel_shader = PS_I010_HLG_U_709_2020_WideWide(frag_in);
  789. }
  790. }
  791. technique I010_SRGB_U
  792. {
  793. pass
  794. {
  795. vertex_shader = VSTexPos_Left(id);
  796. pixel_shader = PS_I010_SRGB_U_Wide(frag_in);
  797. }
  798. }
  799. technique I010_PQ_V
  800. {
  801. pass
  802. {
  803. vertex_shader = VSTexPos_TopLeft(id);
  804. pixel_shader = PS_I010_PQ_V_709_2020_WideWide(frag_in);
  805. }
  806. }
  807. technique I010_HLG_V
  808. {
  809. pass
  810. {
  811. vertex_shader = VSTexPos_TopLeft(id);
  812. pixel_shader = PS_I010_HLG_V_709_2020_WideWide(frag_in);
  813. }
  814. }
  815. technique I010_SRGB_V
  816. {
  817. pass
  818. {
  819. vertex_shader = VSTexPos_Left(id);
  820. pixel_shader = PS_I010_SRGB_V_Wide(frag_in);
  821. }
  822. }
  823. technique P010_PQ_Y
  824. {
  825. pass
  826. {
  827. vertex_shader = VSPos(id);
  828. pixel_shader = PS_P010_PQ_Y_709_2020(frag_in);
  829. }
  830. }
  831. technique P010_HLG_Y
  832. {
  833. pass
  834. {
  835. vertex_shader = VSPos(id);
  836. pixel_shader = PS_P010_HLG_Y_709_2020(frag_in);
  837. }
  838. }
  839. technique P010_SRGB_Y
  840. {
  841. pass
  842. {
  843. vertex_shader = VSPos(id);
  844. pixel_shader = PS_P010_SRGB_Y(frag_in);
  845. }
  846. }
  847. technique P010_PQ_UV
  848. {
  849. pass
  850. {
  851. vertex_shader = VSTexPos_TopLeft(id);
  852. pixel_shader = PS_P010_PQ_UV_709_2020_WideWide(frag_in);
  853. }
  854. }
  855. technique P010_HLG_UV
  856. {
  857. pass
  858. {
  859. vertex_shader = VSTexPos_TopLeft(id);
  860. pixel_shader = PS_P010_HLG_UV_709_2020_WideWide(frag_in);
  861. }
  862. }
  863. technique P010_SRGB_UV
  864. {
  865. pass
  866. {
  867. vertex_shader = VSTexPos_Left(id);
  868. pixel_shader = PS_P010_SRGB_UV_Wide(frag_in);
  869. }
  870. }
  871. technique UYVY_Reverse
  872. {
  873. pass
  874. {
  875. vertex_shader = VSTexPosHalf_Reverse(id);
  876. pixel_shader = PSUYVY_Reverse(frag_in);
  877. }
  878. }
  879. technique YUY2_Reverse
  880. {
  881. pass
  882. {
  883. vertex_shader = VSTexPosHalf_Reverse(id);
  884. pixel_shader = PSYUY2_Reverse(frag_in);
  885. }
  886. }
  887. technique YUY2_PQ_Reverse
  888. {
  889. pass
  890. {
  891. vertex_shader = VSTexPosHalf_Reverse(id);
  892. pixel_shader = PSYUY2_PQ_Reverse(frag_in);
  893. }
  894. }
  895. technique YUY2_HLG_Reverse
  896. {
  897. pass
  898. {
  899. vertex_shader = VSTexPosHalf_Reverse(id);
  900. pixel_shader = PSYUY2_HLG_Reverse(frag_in);
  901. }
  902. }
  903. technique YVYU_Reverse
  904. {
  905. pass
  906. {
  907. vertex_shader = VSTexPosHalf_Reverse(id);
  908. pixel_shader = PSYVYU_Reverse(frag_in);
  909. }
  910. }
  911. technique I420_Reverse
  912. {
  913. pass
  914. {
  915. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  916. pixel_shader = PSPlanar420_Reverse(frag_in);
  917. }
  918. }
  919. technique I420_PQ_Reverse
  920. {
  921. pass
  922. {
  923. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  924. pixel_shader = PSPlanar420_PQ_Reverse(frag_in);
  925. }
  926. }
  927. technique I420_HLG_Reverse
  928. {
  929. pass
  930. {
  931. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  932. pixel_shader = PSPlanar420_HLG_Reverse(frag_in);
  933. }
  934. }
  935. technique I40A_Reverse
  936. {
  937. pass
  938. {
  939. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  940. pixel_shader = PSPlanar420A_Reverse(frag_in);
  941. }
  942. }
  943. technique I422_Reverse
  944. {
  945. pass
  946. {
  947. vertex_shader = VSPosWide_Reverse(id);
  948. pixel_shader = PSPlanar422_Reverse(frag_in);
  949. }
  950. }
  951. technique I210_Reverse
  952. {
  953. pass
  954. {
  955. vertex_shader = VSPosWide_Reverse(id);
  956. pixel_shader = PSPlanar422_10LE_Reverse(frag_in);
  957. }
  958. }
  959. technique I42A_Reverse
  960. {
  961. pass
  962. {
  963. vertex_shader = VSPosWide_Reverse(id);
  964. pixel_shader = PSPlanar422A_Reverse(frag_in);
  965. }
  966. }
  967. technique I444_Reverse
  968. {
  969. pass
  970. {
  971. vertex_shader = VSPos(id);
  972. pixel_shader = PSPlanar444_Reverse(frag_in);
  973. }
  974. }
  975. technique I412_Reverse
  976. {
  977. pass
  978. {
  979. vertex_shader = VSPos(id);
  980. pixel_shader = PSPlanar444_12LE_Reverse(frag_in);
  981. }
  982. }
  983. technique YUVA_Reverse
  984. {
  985. pass
  986. {
  987. vertex_shader = VSPos(id);
  988. pixel_shader = PSPlanar444A_Reverse(frag_in);
  989. }
  990. }
  991. technique YA2L_Reverse
  992. {
  993. pass
  994. {
  995. vertex_shader = VSPos(id);
  996. pixel_shader = PSPlanar444A_12LE_Reverse(frag_in);
  997. }
  998. }
  999. technique AYUV_Reverse
  1000. {
  1001. pass
  1002. {
  1003. vertex_shader = VSPos(id);
  1004. pixel_shader = PSAYUV_Reverse(frag_in);
  1005. }
  1006. }
  1007. technique NV12_Reverse
  1008. {
  1009. pass
  1010. {
  1011. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1012. pixel_shader = PSNV12_Reverse(frag_in);
  1013. }
  1014. }
  1015. technique NV12_PQ_Reverse
  1016. {
  1017. pass
  1018. {
  1019. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1020. pixel_shader = PSNV12_PQ_Reverse(frag_in);
  1021. }
  1022. }
  1023. technique NV12_HLG_Reverse
  1024. {
  1025. pass
  1026. {
  1027. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1028. pixel_shader = PSNV12_HLG_Reverse(frag_in);
  1029. }
  1030. }
  1031. technique I010_SRGB_Reverse
  1032. {
  1033. pass
  1034. {
  1035. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1036. pixel_shader = PSI010_SRGB_Reverse(frag_in);
  1037. }
  1038. }
  1039. technique I010_PQ_2020_709_Reverse
  1040. {
  1041. pass
  1042. {
  1043. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1044. pixel_shader = PSI010_PQ_2020_709_Reverse(frag_in);
  1045. }
  1046. }
  1047. technique I010_HLG_2020_709_Reverse
  1048. {
  1049. pass
  1050. {
  1051. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1052. pixel_shader = PSI010_HLG_2020_709_Reverse(frag_in);
  1053. }
  1054. }
  1055. technique P010_SRGB_Reverse
  1056. {
  1057. pass
  1058. {
  1059. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1060. pixel_shader = PSP010_SRGB_Reverse(frag_in);
  1061. }
  1062. }
  1063. technique P010_PQ_2020_709_Reverse
  1064. {
  1065. pass
  1066. {
  1067. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1068. pixel_shader = PSP010_PQ_2020_709_Reverse(frag_in);
  1069. }
  1070. }
  1071. technique P010_HLG_2020_709_Reverse
  1072. {
  1073. pass
  1074. {
  1075. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  1076. pixel_shader = PSP010_HLG_2020_709_Reverse(frag_in);
  1077. }
  1078. }
  1079. technique Y800_Limited
  1080. {
  1081. pass
  1082. {
  1083. vertex_shader = VSPos(id);
  1084. pixel_shader = PSY800_Limited(frag_in);
  1085. }
  1086. }
  1087. technique Y800_Full
  1088. {
  1089. pass
  1090. {
  1091. vertex_shader = VSPos(id);
  1092. pixel_shader = PSY800_Full(frag_in);
  1093. }
  1094. }
  1095. technique RGB_Limited
  1096. {
  1097. pass
  1098. {
  1099. vertex_shader = VSPos(id);
  1100. pixel_shader = PSRGB_Limited(frag_in);
  1101. }
  1102. }
  1103. technique BGR3_Limited
  1104. {
  1105. pass
  1106. {
  1107. vertex_shader = VSPos(id);
  1108. pixel_shader = PSBGR3_Limited(frag_in);
  1109. }
  1110. }
  1111. technique BGR3_Full
  1112. {
  1113. pass
  1114. {
  1115. vertex_shader = VSPos(id);
  1116. pixel_shader = PSBGR3_Full(frag_in);
  1117. }
  1118. }