format_conversion.effect 31 KB

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