From 0d093331592ebe521f2fc0a1cf9b65c5f81f626a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Jul 2024 21:57:15 -0700 Subject: [PATCH 01/22] Add draft CoreWindow sample for D2D --- ComputeSharp.sln | 15 ++++++ .../Assets/LockScreenLogo.scale-200.png | Bin 0 -> 432 bytes .../Assets/SplashScreen.scale-200.png | Bin 0 -> 8537 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 0 -> 3760 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 0 -> 1723 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 0 -> 796 bytes .../Assets/StoreLogo.scale-200.png | Bin 0 -> 2077 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 0 -> 4291 bytes ...puteSharp.SwapChain.D2D1.CoreWindow.csproj | 10 ++++ .../Package.appxmanifest | 47 ++++++++++++++++++ .../PublishProfiles/win-arm64.pubxml | 14 ++++++ .../Properties/PublishProfiles/win-x64.pubxml | 14 ++++++ .../Properties/PublishProfiles/win-x86.pubxml | 14 ++++++ .../Properties/launchSettings.json | 7 +++ .../Package.appxmanifest | 4 +- 15 files changed, 123 insertions(+), 2 deletions(-) create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/LockScreenLogo.scale-200.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/SplashScreen.scale-200.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square150x150Logo.scale-200.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.scale-200.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.targetsize-24_altform-unplated.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/StoreLogo.scale-200.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Wide310x150Logo.scale-200.png create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 7bc0c050..6f8af70e 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -176,6 +176,8 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Uwp", "src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj", "{716DF19E-69BA-4A9C-9CA4-BFD196152F46}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SwapChain.D2D1.CoreWindow", "samples\ComputeSharp.SwapChain.D2D1.CoreWindow\ComputeSharp.SwapChain.D2D1.CoreWindow.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -488,6 +490,18 @@ Global {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|ARM64.Build.0 = Release|ARM64 {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|x64.ActiveCfg = Release|x64 {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|x64.Build.0 = Release|x64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.ActiveCfg = Debug|ARM64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.Build.0 = Debug|ARM64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.Deploy.0 = Debug|ARM64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.ActiveCfg = Debug|x64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.Build.0 = Debug|x64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.Deploy.0 = Debug|x64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.ActiveCfg = Release|ARM64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.Build.0 = Release|ARM64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.Deploy.0 = Release|ARM64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.ActiveCfg = Release|x64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.Build.0 = Release|x64 + {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -527,6 +541,7 @@ Global {B4F6A41C-AA9A-4302-92B3-AC64CF2E30F5} = {A5013F9B-92EC-419F-B0B3-3D6B721E7104} {1A3E20B3-F711-41C0-82EA-3B53A575955C} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {551EF4FB-F34F-412A-B3E6-E345797560ED} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} + {9FBE070E-A210-4CEF-9F04-61C2B269C600} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC} diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/LockScreenLogo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..7440f0d4bf7c7e26e4e36328738c68e624ee851e GIT binary patch literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(FqV6|IEGZ*x-#9g>~Mkr+x6^F zy~CDX2QIMs&Gcs3RnRBoxBA!*(Mfw0KTCYuYk0WlEIV>qBmPl! zq4ukrvfADX@#p8fbLY(H47N+k`FZ(FZh?cDro7>{8mkBO3>^oaIx`3!Jl)Qq)HI!+ z(S=1{o~eT)&W^=Ea8C`-17(Jv5(nHFJ{dOjGdxLVkY_y6&S1whfuFI4MM0kF0f&cO zPDVpV%nz;Id$>+0Ga5e9625-JcI)oq=#Pa3p^>8BB}21BUw@eN!-6@w%X+^`+Vn?! zryu|3T>kVWNBYyBc=7Y6H#s1Ah!OI_nezW zXTqOdkv2Az6KKBV=$yHdF^R3Fqw(TZEoNSZX>reXJ#bwX42%f|Pgg&ebxsLQ010xn AssI20 literal 0 HcmV?d00001 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..1df2cb624fb4a39fb64691083bf756821241572b GIT binary patch literal 8537 zcmeHMiC0rsx4%$@qC$!kr3Qi%IDryW~YKvL{Yj=q)BFYCJz*?5V4lkK&z4*q~~Sl)$*h$j>eT3e*O zQ>3ZmZ=Sx+OM)@e(@uSn9uirSi*&qdF|)akqSjU+{1rjS?B4C(dPWKK)uvTv{`WE$ zc^>@Fkc-VtwWRs&TR803G6=J4k)p*^lk5%YVC;*HQvn< zE2N+EIT;~8U|CZqT0CPsSNCDjc*+tk#+(U!mb~F{Al>h`w*+&yI3)_DmNR$3b5yH)aEV1 z1T5p078F7h)Ct&N$9eVOGIyJZg{+&^G?f7zt@ZsT3SuIF6TUK%I+P%Zx(ly(tWe^IW_cE zAm2fy*M`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x zbvP3E{qiudjGxoseL!Agb`gx5fw4Ql67i9M$L`Zn%{VFKK_e8PN(W!2cp{fQU|vJr zye1EfeM#j&9xo?Gq=L#*f$|=M*`0>vto*aH`gzZRH7`z}`?z?uBZ*z9kD==7M>ZZhQ zfFoBS$lgwSDUEd^G~_Z+js!v8uscTg4$kJY2|zpf7&QJ&a;y?2P38F3EAU_y)1P8W=jnLTwn__f!pP{CaGhiLyV z^^CT515ip;fG;6V7W6OljAQOS==upn$khm1|KdY*A+RZcvKzR(1(dQ*+98P-wkE_f z{SriB8)RzLM21+h+t{VU22)O0;3mPP2-==LQFKW+?T$tL3HHn@A5dPn^3V*sVRBUU)2=vwLnYJ<48$2zb5{XzdEH_9?Jm9IgB*7LC9h zn3I2dY&6R(MlCtA^KHX<5bj>sz8p_2bxw{=$Sg703?j(`;GRnI$sW#%0z(E^BT-GD zN>|gQYK6(M8~g!i<$#H#OP~O|X&Yi+n5cml;ov&R%}pE3B&Tsed-#C2CVO%0nR~0} zTsQ6uz&9DN`tnqEH_Aa1fBP+fP3Y&7gXNvk{t@rdoKgh5;rg^)PJKH35GXPN(dk#! zf?OWY{d3`iK44paArw>qPNpTMP{X1jGddM!3?CZcgl7601p`44xlUUF2uo}6g7BU# z-9%nemU`8!9XS1#V6EcG<-zV=+JB3n0dTG#40B7H9csExqeT#Y&j<{8h9L&79XJUf zDE)Reqyx4Vb3ZAw))4jsDLZZHqsiv@ZsE^1pa+gSRGE9iop|u?T>my2>>^(j0%xvJ1RyJAf}{6Ryz-NgQJG*PCp3C;vu;8VBO3+2n!44TqtM?1kW92 zrHB7C+Apsm0NkRME_Q=(3ecaxn=sVJn{{s}7b$0*& literal 0 HcmV?d00001 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..84faf5ffbb50e0625c3147ef67806471572af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= zxc&TG^_(Hc76IT&k}RPRCp~H=0YM zNaYEqy zR9NBw>)%Uw^*Z=Y-{4*mC+9wRlWKW*xQ$)k5Fg&cA}|zF^0tSS;lx7&m6Wp%w^WzY zfFT}oE@ZgvL`5psuLp2T^DV;s)D&{Zzlozj4mO)ZyQbaNrZ{UL4fGuvxJ^6j;4RO3 z_o2J+Mb`5XOzh{|>2iH)O=6sWxPz={sOsL&fU`Bo!We{Db02S~e|@xjybkZM1w^zP z1eQYGxUF_07+CYJ_AzSCRk7cd5x*28ZiEt|$Q0V{a1IY=#<*uA*mNrxl+{)yu)rrZ VZ|5IS#5#fkrkAV?%Pzp<{{g+2zOeuR literal 0 HcmV?d00001 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..f02661b2f4cabfe8fbf2580a4724f40155ed4b94 GIT binary patch literal 1723 zcmZWqX*e5*7L5oJs&*=|rlv+|hN@*mi8a)cDQU+#6b-3_SgIOpN@AO7(|%f1o0-;< z>a^Bcqo^|4($O%8grumY(Ns{>Qbyl<-~5>OHQve)AYnXKuB)>2>^ilH(yJ_-N!%-07w(vogJ{rcSLswV_`0;eVx%Y zW1XcvPlOT&KXJ9_K5MGw>T1@CAV*TBQ|x0!pAnT)Ti+Rw^0Pr3IxQps)}V)i1wyL8 zY$uFEuB6sOAEY;-CgTxt?zIh`P;=?SfSodO^|}^v{ljO`*i6X=zr&Nz-rV|&U#bLA zfd~{e0!DmEq0D zIT>$vV>2XLZ50c)F-gejQEirj7p2tCzb*5cAYe#1SH9x@d-k>Wsyf=QV+8<_gW0+LijnmESbfnaQ)H`Dfm@Z z4yR>Xg^tPT9A^|XE`ArjCi3`Vi50f&Oi7>WJ=rKvwbet+J(;)2vL}u~;bTOG6+$1k7&7SO}j{lY%EYtA9?BAE4 zK|k-TPrF#R_o~U5A=nY3TN-Ixnx}HJAkD?(R{n+!&;&Tv^K!Cv+g$tvXswS>4#uV; za$sYKgOF5A?)Ljgdq6@y^*q=LsTNJP%Zg`dAn234xH z(=qql9J0G*Dv})RqHcNL>N#1~@ro|5=*l%M5{)Y|NX#VPSs57P-2WS-R*j*$A%ufT zHz}^{t1^`q=SM2R@WNb62Q|hJEnbZ??kf!~+h1LsV&1(R(%EsK=xB_qD%H&q zo=&$aLg-yuyr^{4*prZa9II2WKO6d`?2>Z}U+nP%nv0qu`!vmGx`fK6$VB%ZnSC|A zx{?$D>&a=_diHyOr8A`@>wngz)c^t;K9{VtBEIAmAMGEhpblxCve>nk;#^3Utv&p0 zdS%3>^lZX>{Z#CcpgN1GV+RmXeLk7mfDnl$+;T$2C~DbV^U&$ycvKaf7tc|YN|oZ= z?j4M48<=@;jcK{8RFv&0v2N7$uY?e*g+{B}H}kX~PM_V-=e}q{*FRe+=sM%VhyItE zKklyj=j*D&-y;z`8n0H@bxB5Lw4pEJxnoS5Eav{cu7J8yk+IKkP5va6VO6QA)!T=3q3gQu(X%W8D@l9Dz?UCD;Oer#8;-pb$qMgVsgZ|7>q H&?|ofVWB5h literal 0 HcmV?d00001 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000000000000000000000000000000000..3e58e5b69c586ea4dc65a98937d11e6a5ed4d83e GIT binary patch literal 796 zcmV+%1LOROP)m|9I&p(x5G zaBxbphz>-lIc{~RmY{55D0LabS9+jpDrcnT!L(g4RRLqFaC2w@$MwjE$xV6O$HD5S z4dm9o17~9-5fkG90uwh z65^d5$UnV z(BjtiE=raD?!Jj4^$%^~vu(iowS$rp$UsGv61l-M@S%rxZqP4}fFnkSm*|RBZQ;`u zhe0~W>9-l`2o5Y+a9kEY(&H)7{NS?qVOsUsS4Y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EJv|HA^jye)JSt8WK+>g_gStJq&KGDX+whnj2<@KPt1@EUGC= zuJHZgh#M^|we0e!9-b|+uyQ+qLdMu{WVeH;=wOIkSMvih&XR=_IrmzBeZD;qnjG2J z>)U=+q~;!$iNuXsPqRZ5NOCVW1`0i(uZ@*OFfpnO@QN%-A_iK<+-Lp!vTG3K_p7)Z zSOOU{Xuqit&_pId#-(Iue`(qZQ%teOxuE| zO(>*7&6@)lk)2Yd2PqyhWh2(Rdcpr7k}Pp?z+w>rK?C zVIGjfuvSPI_clbdjFLaXw;T{&^PagQb|)Vb2gST*(k6J}I-6-g_sH#@O6jheXuvq> ziIH?FRqpU9YD+FK0(g;u39He0Ok}Lz!TWTp;f|W1(sO9{{R30 literal 0 HcmV?d00001 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000000000000000000000000000000000..d800c4a0e04442dc27233e5cc36973bae2be3bcd GIT binary patch literal 4291 zcmds5`8!*A+dqn+8cL_?m0G&czAe=%u@yDiQB}cI6tR^WN)pi`N{I5#plazDOD$3D zRE7vqTP+D0G__M(ED2@oq}3v|M4prR8=kqY=XrlP*E!cY-}^rI{kcE){r#Mi--~bu`#I&U$;GG!FPeb5I26w~tApj_8iViWGA5VV3a>-5cz zBFbMEpJ_?r7cYhy`ZN!3Tmi6U9&}{tJ9;sh*`dV_a0xoR`znVEd{NOi6GOn65FkC@ zTO7E7posye&#(dD*CQYh9Wrnr_Adz-aP>hP6womKf4Iz>q-AFhq&iZTWLgSrY0N87 zYlYp?lp`-VsV+-MqD=|uQ-+|}UmSm&3Hj=vLVZ%>wbOBCc1@mOHCXkyes>|8p<*Ej zDtzK%;X$v`?mK{037%`8*44o|#X;x&h>B_SO-97V1P>FbbrHX^X4&?0#r2Io>(DzV zBgsG2J!pRT+4;6JS8E0;XGLQk$9#h3kq#VB?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QVC3Bcw$;#&Fl-f{l|=(d;C literal 0 HcmV?d00001 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj new file mode 100644 index 00000000..91b464af --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -0,0 +1,10 @@ + + + + Exe + net8.0 + enable + enable + + + diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest new file mode 100644 index 00000000..ca71a27d --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest @@ -0,0 +1,47 @@ + + + + + + + + + + ComputeSharp Sample App (Core) + Sergio Pedri + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml new file mode 100644 index 00000000..eeb8cf16 --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + ARM64 + win-arm64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + true + + \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml new file mode 100644 index 00000000..cda40ef3 --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x64 + win-x64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + true + + \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml new file mode 100644 index 00000000..3293f82c --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x86 + win-x86 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + true + + \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json new file mode 100644 index 00000000..48c8a361 --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "ComputeSharp.SwapChain.D2D1.CoreWindow": { + "commandName": "MsixPackage" + } + } +} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest index c6ec9a28..6cca81e4 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest +++ b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest @@ -35,8 +35,8 @@ BackgroundColor="#005491" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png"> - - + + From 8978fb82991032baf97985eba996d429ea48cfbc Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Jul 2024 22:14:03 -0700 Subject: [PATCH 02/22] Implement blank 'CoreWindow' startup --- ComputeSharp.sln | 3 +- .../App.cs | 63 +++++++++++++++++++ ...puteSharp.SwapChain.D2D1.CoreWindow.csproj | 61 ++++++++++++++++-- .../Package.appxmanifest | 4 +- .../Properties/PublishProfiles/win-x64.pubxml | 4 +- 5 files changed, 124 insertions(+), 11 deletions(-) create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 6f8af70e..4239da81 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -176,7 +176,7 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Uwp", "src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj", "{716DF19E-69BA-4A9C-9CA4-BFD196152F46}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SwapChain.D2D1.CoreWindow", "samples\ComputeSharp.SwapChain.D2D1.CoreWindow\ComputeSharp.SwapChain.D2D1.CoreWindow.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.CoreWindow", "samples\ComputeSharp.SwapChain.D2D1.CoreWindow\ComputeSharp.SwapChain.D2D1.CoreWindow.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -565,6 +565,7 @@ Global src\ComputeSharp.CodeFixing\ComputeSharp.CodeFixing.projitems*{9b4448b1-200f-4966-8a13-a508691b3003}*SharedItemsImports = 5 src\ComputeSharp.Win32.D2D1\ComputeSharp.Win32.D2D1.projitems*{9da1da9f-f8b2-4b25-be80-c21f773029e3}*SharedItemsImports = 13 samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.projitems*{9ea5ae9d-c39a-4f43-b03e-0a848ea2558a}*SharedItemsImports = 5 + samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.projitems*{9fbe070e-a210-4cef-9f04-61c2b269c600}*SharedItemsImports = 5 src\ComputeSharp.D2D1.UI\ComputeSharp.D2D1.UI.projitems*{a2a2171b-0baf-4a2a-bfb3-3357ef714bf0}*SharedItemsImports = 13 src\ComputeSharp.D2D1.UI\ComputeSharp.D2D1.UI.projitems*{bd9e6556-357e-4c20-bfcd-fb131f9372fa}*SharedItemsImports = 5 samples\ComputeSharp.SwapChain.Shaders\ComputeSharp.SwapChain.Shaders.projitems*{c12d7ace-98ed-4813-8118-6667c34f484f}*SharedItemsImports = 5 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs new file mode 100644 index 00000000..e8bcd28a --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs @@ -0,0 +1,63 @@ +using System.Diagnostics.CodeAnalysis; +using Windows.ApplicationModel.Core; + +#pragma warning disable IDE0052 + +namespace ComputeSharp.SwapChain.D2D1.CoreWindow; + +using Windows.UI.Core; + +/// +/// A sample app rendering D2D shaders into a instance. +/// +public sealed partial class App : IFrameworkViewSource, IFrameworkView +{ + private CoreApplicationView? applicationView; + private CoreWindow? window; + + /// + /// The entry point for the application. + /// + public static void Main() + { + CoreApplication.Run(new App()); + } + + /// + public IFrameworkView CreateView() + { + return this; + } + + /// + [MemberNotNull(nameof(applicationView))] + public void Initialize(CoreApplicationView applicationView) + { + this.applicationView = applicationView; + } + + /// + [MemberNotNull(nameof(window))] + public void SetWindow(CoreWindow window) + { + this.window = window; + } + + /// + public void Load(string entryPoint) + { + } + + /// + public void Run() + { + this.window!.Activate(); + + this.window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit); + } + + /// + public void Uninitialize() + { + } +} diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index 91b464af..4c58db12 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -1,10 +1,59 @@ - - Exe - net8.0 - enable - enable + WinExe + net8.0-windows10.0.22621.0 + 10.0.22621.37-preview + 10.0.17763.0 + true + true + x86;x64;arm64 + win-x86;win-x64;win-arm64 + en-US + 10.0.22621.0 + win-$(Platform).pubxml + true + true + false + $(WinDir)\System32\WinMetadata - + + + + full + + + $(NoWarn);IDE0065 + + + + + false + true + true + false + Speed + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest index ca71a27d..63a45d93 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest @@ -1,4 +1,4 @@ - + + EntryPoint="ComputeSharp.SwapChain.D2D1.CoreWindow.App"> x64 win-x64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true + false + false \ No newline at end of file From 0e9c3db8918029a2f16698327000acf38de8b2bf Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Jul 2024 22:54:14 -0700 Subject: [PATCH 03/22] Exclude all 'Microsoft.Web.WebView2' assets --- .../ComputeSharp.SwapChain.D2D1.CoreWindow.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index 4c58db12..2f23622f 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -43,6 +43,7 @@ + From f84bbdc20a2195071ff27ef359fe02c5af145b84 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Jul 2024 22:54:22 -0700 Subject: [PATCH 04/22] Add 'ApplicationViewTitleBarExtensions' type --- .../ApplicationViewTitleBarExtensions.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs new file mode 100644 index 00000000..cc9365ca --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs @@ -0,0 +1,33 @@ +using Windows.UI; +using Windows.UI.ViewManagement; + +namespace ComputeSharp.SwapChain.D2D1.CoreWindow.Extensions; + +/// +/// Extensions for . +/// +internal static class ApplicationViewTitleBarExtensions +{ + /// + /// Styles the title bar to look correctly when the view is expanded into it. + /// + /// The input title bar. + public static void StyleTitleBarForExtendedIntoViewMode(this ApplicationViewTitleBar titleBar) + { + // Transparent colors + titleBar.ForegroundColor = Colors.Transparent; + titleBar.BackgroundColor = Colors.Transparent; + titleBar.ButtonBackgroundColor = Colors.Transparent; + titleBar.InactiveBackgroundColor = Colors.Transparent; + titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; + + // Theme aware colors + titleBar.ButtonForegroundColor = Colors.White; + titleBar.ButtonHoverForegroundColor = Colors.White; + titleBar.ButtonPressedForegroundColor = Colors.White; + titleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF); + titleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF); + titleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF); + titleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0); + } +} From 081aacd4fdd6f0ead094c817fc12ecf5fc9ab259 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Jul 2024 23:05:57 -0700 Subject: [PATCH 05/22] Implement initial simplified render loop --- .../App.cs | 52 ++++++++++++++++++- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs index e8bcd28a..4ad3d4a6 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs @@ -1,7 +1,15 @@ +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; +using System.Threading; +using ComputeSharp.D2D1.Uwp; +using ComputeSharp.SwapChain.D2D1.CoreWindow.Extensions; +using ComputeSharp.SwapChain.Shaders.D2D1; +using Microsoft.Graphics.Canvas; +using Microsoft.Graphics.Canvas.Effects; using Windows.ApplicationModel.Core; - -#pragma warning disable IDE0052 +using Windows.Graphics.Display; +using Windows.UI; +using Windows.UI.ViewManagement; namespace ComputeSharp.SwapChain.D2D1.CoreWindow; @@ -12,7 +20,14 @@ using Windows.UI.Core; /// public sealed partial class App : IFrameworkViewSource, IFrameworkView { + /// + /// The for the current app instance. + /// private CoreApplicationView? applicationView; + + /// + /// The used to display the app content. + /// private CoreWindow? window; /// @@ -51,6 +66,39 @@ public sealed partial class App : IFrameworkViewSource, IFrameworkView /// public void Run() { + this.applicationView!.TitleBar.ExtendViewIntoTitleBar = true; + + ApplicationView.GetForCurrentView().TitleBar.StyleTitleBarForExtendedIntoViewMode(); + + CanvasSwapChain swapChain = CanvasSwapChain.CreateForCoreWindow( + CanvasDevice.GetSharedDevice(), + this.window, + DisplayInformation.GetForCurrentView().LogicalDpi); + + int2 sizeInPixels = new((int)swapChain.SizeInPixels.Width, (int)swapChain.SizeInPixels.Height); + CancellationTokenSource cancellationTokenSource = new(); + Stopwatch stopwatch = Stopwatch.StartNew(); + + Thread thread = new(() => + { + PixelShaderEffect shader = new(); + PremultiplyEffect premultiply = new() { Source = shader }; + + while (!cancellationTokenSource.IsCancellationRequested) + { + using (CanvasDrawingSession session = swapChain.CreateDrawingSession(Colors.Transparent)) + { + shader.ConstantBuffer = new ColorfulInfinity((float)stopwatch.Elapsed.TotalSeconds, sizeInPixels); + + session.DrawImage(premultiply); + } + + swapChain.Present(syncInterval: 1); + } + }); + + thread.Start(); + this.window!.Activate(); this.window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit); From 63da3e961dd8522e9ecb355a7aa6e4de4e269c4a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 25 Jul 2024 23:14:31 -0700 Subject: [PATCH 06/22] Enable some CsWinRT size saving options --- .../ComputeSharp.SwapChain.D2D1.CoreWindow.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index 2f23622f..73603eda 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -36,6 +36,10 @@ true false Speed + false + true + false + false From 29b40293efdefd0f086ac48d2cfd5f59f7f57014 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 29 Jul 2024 23:40:40 -0700 Subject: [PATCH 07/22] Simplify .appxmanifest files --- .../Package.appxmanifest | 3 +-- samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest index 63a45d93..f1b60b1d 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest @@ -21,8 +21,7 @@ - - + diff --git a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest index 6cca81e4..a5b965f7 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest +++ b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest @@ -17,8 +17,7 @@ - - + From d3bc4b9bec72f235f2e56933cf759392ef52212e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 29 Jul 2024 23:41:09 -0700 Subject: [PATCH 08/22] Enable final NativeAOT configuration --- .../ComputeSharp.SwapChain.D2D1.CoreWindow.csproj | 2 +- .../Properties/PublishProfiles/win-x64.pubxml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index 73603eda..085e244d 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -31,7 +31,7 @@ - false + true true true false diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml index b4d09dd2..cda40ef3 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. x64 win-x64 bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - false - false + true + true \ No newline at end of file From ca24b6044cad169d440f4b5f43a32e9288e4c32e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 29 Jul 2024 23:43:35 -0700 Subject: [PATCH 09/22] Use new GUID for CoreWindow .appxmanifest --- .../Package.appxmanifest | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest index f1b60b1d..4e3fa371 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest @@ -1,4 +1,4 @@ - + - + ComputeSharp Sample App (Core) From c011d531e0033f3d13d1427db6d5f12f4d4f4a88 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 30 Jul 2024 22:45:18 -0700 Subject: [PATCH 10/22] Simplify namespaces in 'CoreWindow' sample --- samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs | 7 +++---- .../ComputeSharp.SwapChain.D2D1.CoreWindow.csproj | 3 --- .../Extensions/ApplicationViewTitleBarExtensions.cs | 2 +- .../Package.appxmanifest | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs index 4ad3d4a6..d1af0c69 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs @@ -2,18 +2,17 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Threading; using ComputeSharp.D2D1.Uwp; -using ComputeSharp.SwapChain.D2D1.CoreWindow.Extensions; +using ComputeSharp.SwapChain.D2D1.Extensions; using ComputeSharp.SwapChain.Shaders.D2D1; using Microsoft.Graphics.Canvas; using Microsoft.Graphics.Canvas.Effects; using Windows.ApplicationModel.Core; using Windows.Graphics.Display; using Windows.UI; +using Windows.UI.Core; using Windows.UI.ViewManagement; -namespace ComputeSharp.SwapChain.D2D1.CoreWindow; - -using Windows.UI.Core; +namespace ComputeSharp.SwapChain.D2D1; /// /// A sample app rendering D2D shaders into a instance. diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index 085e244d..e25b166e 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -24,9 +24,6 @@ See: https://github.com/microsoft/CsWinRT/issues/1478. --> full - - - $(NoWarn);IDE0065 diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs index cc9365ca..5e8325b1 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs @@ -1,7 +1,7 @@ using Windows.UI; using Windows.UI.ViewManagement; -namespace ComputeSharp.SwapChain.D2D1.CoreWindow.Extensions; +namespace ComputeSharp.SwapChain.D2D1.Extensions; /// /// Extensions for . diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest index 4e3fa371..71dd299a 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest @@ -31,7 +31,7 @@ + EntryPoint="ComputeSharp.SwapChain.D2D1.App"> Date: Tue, 30 Jul 2024 23:07:04 -0700 Subject: [PATCH 11/22] Refactor render code into 'CoreApplication' helpers --- .../Program.cs | 6 +- .../App.cs | 46 ++---- .../Backend/CoreWindowApplication.cs | 145 ++++++++++++++++++ .../Backend/CoreWindowApplicationRunner.cs | 53 +++++++ .../Backend/PixelShaderEffect.cs | 89 +++++++++++ 5 files changed, 302 insertions(+), 37 deletions(-) create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs create mode 100644 samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/PixelShaderEffect.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs index fddaba8f..629eea49 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs @@ -33,9 +33,9 @@ if (args is [] or [_]) // If a shader is found, run it if (effect is not null) { - Win32Application win32Application = new(); + Win32Application application = new(); - win32Application.Draw += (_, e) => + application.Draw += (_, e) => { // Set the effect properties effect.ElapsedTime = e.TotalTime; @@ -46,7 +46,7 @@ if (args is [] or [_]) e.DrawingSession.DrawImage(effect); }; - Win32ApplicationRunner.Run(win32Application, "ComputeSharp.D2D1"); + Win32ApplicationRunner.Run(application, "ComputeSharp.D2D1"); return S.S_OK; } diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs index d1af0c69..c6b7d5d0 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs @@ -1,14 +1,8 @@ -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; -using System.Threading; -using ComputeSharp.D2D1.Uwp; +using ComputeSharp.SwapChain.D2D1.Backend; using ComputeSharp.SwapChain.D2D1.Extensions; using ComputeSharp.SwapChain.Shaders.D2D1; -using Microsoft.Graphics.Canvas; -using Microsoft.Graphics.Canvas.Effects; using Windows.ApplicationModel.Core; -using Windows.Graphics.Display; -using Windows.UI; using Windows.UI.Core; using Windows.UI.ViewManagement; @@ -69,38 +63,22 @@ public sealed partial class App : IFrameworkViewSource, IFrameworkView ApplicationView.GetForCurrentView().TitleBar.StyleTitleBarForExtendedIntoViewMode(); - CanvasSwapChain swapChain = CanvasSwapChain.CreateForCoreWindow( - CanvasDevice.GetSharedDevice(), - this.window, - DisplayInformation.GetForCurrentView().LogicalDpi); + PixelShaderEffect effect = new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))); - int2 sizeInPixels = new((int)swapChain.SizeInPixels.Width, (int)swapChain.SizeInPixels.Height); - CancellationTokenSource cancellationTokenSource = new(); - Stopwatch stopwatch = Stopwatch.StartNew(); + CoreWindowApplication application = new(); - Thread thread = new(() => + application.Draw += (s, e) => { - PixelShaderEffect shader = new(); - PremultiplyEffect premultiply = new() { Source = shader }; + // Set the effect properties + effect.ElapsedTime = e.TotalTime; + effect.ScreenWidth = (int)e.ScreenWidth; + effect.ScreenHeight = (int)e.ScreenHeight; - while (!cancellationTokenSource.IsCancellationRequested) - { - using (CanvasDrawingSession session = swapChain.CreateDrawingSession(Colors.Transparent)) - { - shader.ConstantBuffer = new ColorfulInfinity((float)stopwatch.Elapsed.TotalSeconds, sizeInPixels); + // Draw the effect + e.DrawingSession.DrawImage(effect); + }; - session.DrawImage(premultiply); - } - - swapChain.Present(syncInterval: 1); - } - }); - - thread.Start(); - - this.window!.Activate(); - - this.window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit); + CoreWindowApplicationRunner.Run(application, this.window!); } /// diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs new file mode 100644 index 00000000..725c97bb --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs @@ -0,0 +1,145 @@ +using System; +using System.Diagnostics.CodeAnalysis; +using Microsoft.Graphics.Canvas; +using Windows.Graphics.Display; +using Windows.Graphics.Imaging; +using Windows.UI.Core; + +namespace ComputeSharp.SwapChain.D2D1.Backend; + +/// +/// A simple application handling a D2D swapchain. +/// +internal sealed class CoreWindowApplication +{ + /// + /// The instance to use. + /// + private CanvasDevice? canvasDevice; + + /// + /// The instance to use to render frames. + /// + private CanvasSwapChain? canvasSwapChain; + + /// + /// Whether or not the window has been resized and requires the buffers to be updated. + /// + private volatile bool isResizePending; + + /// + /// The current screen width in raw pixels. + /// + private uint screenWidth; + + /// + /// The current screen height in raw pixels. + /// + private uint screenHeight; + + /// + /// Raised whenever a draw operation can be performed. + /// + public event EventHandler? Draw; + + /// + /// Initializes the current application. + /// + /// The instance. + [MemberNotNull(nameof(canvasDevice))] + [MemberNotNull(nameof(canvasSwapChain))] + public unsafe void OnInitialize(CoreWindow window) + { + // Create a new canvas device, which will handle DX11/D2D initialization + CanvasDevice canvasDevice = new(); + + // Create the swapchain for rendering (it is automatically tied to the window) + CanvasSwapChain canvasSwapChain = CanvasSwapChain.CreateForCoreWindow( + resourceCreator: canvasDevice, + coreWindow: window, + dpi: DisplayInformation.GetForCurrentView().LogicalDpi); + + // Save the Win2D objects for later use + this.canvasDevice = canvasDevice; + this.canvasSwapChain = canvasSwapChain; + + // Store the initial size of the screen + this.screenWidth = canvasSwapChain.SizeInPixels.Width; + this.screenHeight = canvasSwapChain.SizeInPixels.Height; + } + + /// + /// Resizes the current application. + /// + public void OnResize() + { + this.isResizePending = true; + } + + /// + /// Updates the current application. + /// + /// The current time since the start of the application. + public void OnUpdate(TimeSpan time) + { + if (this.isResizePending) + { + // Resize the swapchain if needed (the size is calculated automatically) + this.canvasSwapChain!.ResizeBuffers( + newWidth: 0, + newHeight: 0, + newDpi: DisplayInformation.GetForCurrentView().LogicalDpi); + + BitmapSize bitmapSize = this.canvasSwapChain!.SizeInPixels; + + this.screenWidth = bitmapSize.Width; + this.screenHeight = bitmapSize.Height; + + this.isResizePending = false; + } + + // Create the drawing session and invoke all registered draw handler + using (CanvasDrawingSession canvasDrawingSession = this.canvasSwapChain!.CreateDrawingSession(default)) + { + Draw?.Invoke(this, new DrawEventArgs + { + ScreenWidth = this.screenWidth, + ScreenHeight = this.screenHeight, + TotalTime = time, + DrawingSession = canvasDrawingSession + }); + } + + // Wait for v-sync + this.canvasSwapChain.WaitForVerticalBlank(); + + // Present the new frame + this.canvasSwapChain.Present(syncInterval: 1); + } + + /// + /// Arguments for . + /// + public sealed class DrawEventArgs : EventArgs + { + /// + /// Gets the screen width in raw pixels. + /// + public required uint ScreenWidth { get; init; } + + /// + /// Gets the screen height in raw pixels. + /// + public required uint ScreenHeight { get; init; } + + /// + /// Gets the total time for the rendering loop. + /// + public required TimeSpan TotalTime { get; init; } + + /// + /// Gets the instance to use. + /// + public required CanvasDrawingSession DrawingSession { get; init; } + } +} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs new file mode 100644 index 00000000..20772756 --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs @@ -0,0 +1,53 @@ +using System.Diagnostics; +using System.Threading; +using Windows.UI.Core; + +namespace ComputeSharp.SwapChain.D2D1.Backend; + +/// +/// A helper class to manage the creation and execution of applications. +/// +internal static class CoreWindowApplicationRunner +{ + /// + /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application, + /// and it should be called as soon as the process is launched, excluding any other additional initialization needed. + /// + /// The input application instance to run. + /// The instance. + public static void Run(CoreWindowApplication application, CoreWindow window) + { + // Initialize the application + application.OnInitialize(window); + + // Setup the render thread that enables smooth resizing of the window + Thread renderThread = new(static args => + { + (CoreWindowApplication application, CancellationToken token) = ((CoreWindowApplication, CancellationToken))args!; + + Stopwatch stopwatch = Stopwatch.StartNew(); + + while (!token.IsCancellationRequested) + { + application.OnUpdate(stopwatch.Elapsed); + } + }); + + CancellationTokenSource tokenSource = new(); + + // Start the render thread before activating the window. + // This allows the app to show up while already drawing. + renderThread.Start((application, tokenSource.Token)); + + // Activate the window + window.Activate(); + + // Process any messages in the queue + window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit); + + tokenSource.Cancel(); + + // Wait for the render thread to stop before terminating + renderThread.Join(); + } +} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/PixelShaderEffect.cs new file mode 100644 index 00000000..dd97480f --- /dev/null +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/PixelShaderEffect.cs @@ -0,0 +1,89 @@ +using System; +using ComputeSharp.D2D1; +using ComputeSharp.D2D1.Descriptors; +using ComputeSharp.D2D1.Uwp; + +namespace ComputeSharp.SwapChain.D2D1.Backend; + +/// +/// An base effect for an animated pixel shader. +/// +internal abstract partial class PixelShaderEffect : CanvasEffect +{ + /// + /// The current elapsed time. + /// + private TimeSpan elapsedTime; + + /// + /// The current screen width in raw pixels. + /// + private int screenWidth; + + /// + /// The current screen height in raw pixels. + /// + private int screenHeight; + + /// + /// Gets or sets the total elapsed time. + /// + public TimeSpan ElapsedTime + { + get => this.elapsedTime; + set => SetAndInvalidateEffectGraph(ref this.elapsedTime, value); + } + + /// + /// Gets or sets the screen width in raw pixels. + /// + public int ScreenWidth + { + get => this.screenWidth; + set => SetAndInvalidateEffectGraph(ref this.screenWidth, value); + } + + /// + /// Gets or sets the screen height in raw pixels. + /// + public int ScreenHeight + { + get => this.screenHeight; + set => SetAndInvalidateEffectGraph(ref this.screenHeight, value); + } + + /// + /// An effect for an animated pixel shader. + /// + /// The type of pixel shader to render. + /// The input factory. + public sealed partial class For(For.Factory factory) : PixelShaderEffect + where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor + { + /// + /// The node in use. + /// + private static readonly CanvasEffectNode> Effect = new(); + + /// + protected override void BuildEffectGraph(CanvasEffectGraph effectGraph) + { + effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect()); + } + + /// + protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph) + { + effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight); + } + + /// + /// A factory of a given shader instance. + /// + /// The total elapsed time. + /// The screen width in raw pixels. + /// The screen height in raw pixels. + /// A shader instance to render. + public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight); + } +} \ No newline at end of file From d71bd17bb922f9df5d245593a969ad722572eef3 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 30 Jul 2024 23:17:57 -0700 Subject: [PATCH 12/22] Select shader by pressing number keys --- .../App.cs | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs index c6b7d5d0..1b3ffd11 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs @@ -13,6 +13,22 @@ namespace ComputeSharp.SwapChain.D2D1; /// public sealed partial class App : IFrameworkViewSource, IFrameworkView { + /// + /// The collection of available pixel shader effects. + /// + private static readonly PixelShaderEffect[] Effects = + [ + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), + new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))) + ]; + /// /// The for the current app instance. /// @@ -23,6 +39,11 @@ public sealed partial class App : IFrameworkViewSource, IFrameworkView /// private CoreWindow? window; + /// + /// The currently selected effect (one of the items in ). + /// + private PixelShaderEffect selectedEffect = Effects[0]; + /// /// The entry point for the application. /// @@ -63,12 +84,23 @@ public sealed partial class App : IFrameworkViewSource, IFrameworkView ApplicationView.GetForCurrentView().TitleBar.StyleTitleBarForExtendedIntoViewMode(); - PixelShaderEffect effect = new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))); + // Switch the shader to use when pressing the number keys + this.window!.CharacterReceived += (s, e) => + { + if (e.KeyCode is >= '1' and <= '9') + { + this.selectedEffect = Effects[(int)(e.KeyCode - '1')]; + + e.Handled = true; + } + }; CoreWindowApplication application = new(); application.Draw += (s, e) => { + PixelShaderEffect effect = this.selectedEffect; + // Set the effect properties effect.ElapsedTime = e.TotalTime; effect.ScreenWidth = (int)e.ScreenWidth; @@ -78,7 +110,7 @@ public sealed partial class App : IFrameworkViewSource, IFrameworkView e.DrawingSession.DrawImage(effect); }; - CoreWindowApplicationRunner.Run(application, this.window!); + CoreWindowApplicationRunner.Run(application, this.window); } /// From 4dd76fda4ebe5a600b334710f4dbdd5d24430615 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 30 Jul 2024 23:18:09 -0700 Subject: [PATCH 13/22] Enable resizing when resizing the window --- .../Backend/CoreWindowApplicationRunner.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs index 20772756..4d1a868d 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs @@ -39,6 +39,9 @@ internal static class CoreWindowApplicationRunner // This allows the app to show up while already drawing. renderThread.Start((application, tokenSource.Token)); + // Register a callback to monitor resize operations + window.ResizeCompleted += (s, e) => application.OnResize(); + // Activate the window window.Activate(); From b726b2306ef3a8191df50b4b9964a278ded65808 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 30 Jul 2024 23:41:43 -0700 Subject: [PATCH 14/22] Fix crash when resizing the window --- .../Backend/CoreWindowApplication.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs index 725c97bb..4640c165 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs @@ -85,10 +85,7 @@ internal sealed class CoreWindowApplication if (this.isResizePending) { // Resize the swapchain if needed (the size is calculated automatically) - this.canvasSwapChain!.ResizeBuffers( - newWidth: 0, - newHeight: 0, - newDpi: DisplayInformation.GetForCurrentView().LogicalDpi); + this.canvasSwapChain!.ResizeBuffers(0, 0); BitmapSize bitmapSize = this.canvasSwapChain!.SizeInPixels; From c6b1757081ccab2240b1e4076c9a41a9ed41c784 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 13 Aug 2024 22:46:09 -0700 Subject: [PATCH 15/22] Update dependencies in CoreWindow sample --- ...ComputeSharp.SwapChain.D2D1.CoreWindow.csproj | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index e25b166e..ab260b62 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -2,7 +2,7 @@ WinExe net8.0-windows10.0.22621.0 - 10.0.22621.37-preview + 10.0.22621.39 10.0.17763.0 true true @@ -13,12 +13,17 @@ win-$(Platform).pubxml true true - false - $(WinDir)\System32\WinMetadata + + true + true + true true - - - full @@ -46,12 +39,7 @@ - - - - - - + diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml index eeb8cf16..5de0b991 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml @@ -1,7 +1,4 @@ - - + FileSystem diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml index cda40ef3..89844a87 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml @@ -1,7 +1,4 @@ - FileSystem diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml index 3293f82c..2a99a762 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml @@ -1,7 +1,4 @@ - - + FileSystem diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml index 0593a12d..1c02b7f7 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml +++ b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml @@ -1,5 +1,4 @@ - FileSystem diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml index bb66783c..89844a87 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml +++ b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml @@ -1,5 +1,4 @@ - FileSystem From b773aaeddbfa6912bf4ddb1610e0fd5e19018191 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 12 Sep 2024 01:01:33 +0200 Subject: [PATCH 18/22] Add experimental Xbox support --- .../ComputeSharp.SwapChain.D2D1.CoreWindow.csproj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj index c2955584..b80fcad8 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj @@ -38,6 +38,14 @@ false + + + + + From c3d37b97e5061db19018b1f24b1f14ba40e131b9 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 12 Sep 2024 02:14:11 +0200 Subject: [PATCH 19/22] Publish the CoreWindow sample in CI --- .github/workflows/dotnet.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 8d463907..6015c619 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -334,6 +334,13 @@ jobs: msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj /restore -t:publish /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + # Publish the UWP CoreWindow sample app with NativeAOT + - if: matrix.platform == 'x64' + name: Publish ComputeSharp.SwapChain.D2D1.CoreWindow + run: > + msbuild samples\ComputeSharp.SwapChain.D2D1.CoreWindow\ComputeSharp.SwapChain.D2D1.CoreWindow.csproj /restore + -t:publish /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + # Download the NuGet packages generated in the previous job and use them # to build and run the sample project referencing them. This is used as # a test to ensure the NuGet packages work in a consuming project. From 66c12a8e474a76c885d955845a63997d3d36bc27 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 19 Sep 2024 01:08:04 +0200 Subject: [PATCH 20/22] Rename CoreWindow sample --- .github/workflows/dotnet.yml | 8 ++++---- ComputeSharp.sln | 2 +- .../App.cs | 0 .../Assets/LockScreenLogo.scale-200.png | Bin .../Assets/SplashScreen.scale-200.png | Bin .../Assets/Square150x150Logo.scale-200.png | Bin .../Assets/Square44x44Logo.scale-200.png | Bin ...uare44x44Logo.targetsize-24_altform-unplated.png | Bin .../Assets/StoreLogo.scale-200.png | Bin .../Assets/Wide310x150Logo.scale-200.png | Bin .../Backend/CoreWindowApplication.cs | 0 .../Backend/CoreWindowApplicationRunner.cs | 0 .../Backend/PixelShaderEffect.cs | 0 .../ComputeSharp.SwapChain.D2D1.Uwp.csproj} | 0 .../Extensions/ApplicationViewTitleBarExtensions.cs | 0 .../Package.appxmanifest | 0 .../Properties/PublishProfiles/win-arm64.pubxml | 0 .../Properties/PublishProfiles/win-x64.pubxml | 0 .../Properties/PublishProfiles/win-x86.pubxml | 0 .../Properties/launchSettings.json | 2 +- 20 files changed, 6 insertions(+), 6 deletions(-) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/App.cs (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/LockScreenLogo.scale-200.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/SplashScreen.scale-200.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/Square150x150Logo.scale-200.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/Square44x44Logo.scale-200.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/Square44x44Logo.targetsize-24_altform-unplated.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/StoreLogo.scale-200.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Assets/Wide310x150Logo.scale-200.png (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Backend/CoreWindowApplication.cs (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Backend/CoreWindowApplicationRunner.cs (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Backend/PixelShaderEffect.cs (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj => ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj} (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Extensions/ApplicationViewTitleBarExtensions.cs (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Package.appxmanifest (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Properties/PublishProfiles/win-arm64.pubxml (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Properties/PublishProfiles/win-x64.pubxml (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Properties/PublishProfiles/win-x86.pubxml (100%) rename samples/{ComputeSharp.SwapChain.D2D1.CoreWindow => ComputeSharp.SwapChain.D2D1.Uwp}/Properties/launchSettings.json (57%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6015c619..3638c724 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -334,12 +334,12 @@ jobs: msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj /restore -t:publish /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - # Publish the UWP CoreWindow sample app with NativeAOT + # Publish the D2D1 UWP (CoreApplication) sample app with NativeAOT - if: matrix.platform == 'x64' - name: Publish ComputeSharp.SwapChain.D2D1.CoreWindow + name: Publish ComputeSharp.SwapChain.D2D1.Uwp run: > - msbuild samples\ComputeSharp.SwapChain.D2D1.CoreWindow\ComputeSharp.SwapChain.D2D1.CoreWindow.csproj /restore - -t:publish /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish + /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} # Download the NuGet packages generated in the previous job and use them # to build and run the sample project referencing them. This is used as diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 4239da81..ecce3d87 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -176,7 +176,7 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI", "src EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Uwp", "src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj", "{716DF19E-69BA-4A9C-9CA4-BFD196152F46}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.CoreWindow", "samples\ComputeSharp.SwapChain.D2D1.CoreWindow\ComputeSharp.SwapChain.D2D1.CoreWindow.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.Uwp", "samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/App.cs rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/LockScreenLogo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/LockScreenLogo.scale-200.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/SplashScreen.scale-200.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square150x150Logo.scale-200.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.scale-200.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Square44x44Logo.targetsize-24_altform-unplated.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/StoreLogo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/StoreLogo.scale-200.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/StoreLogo.scale-200.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/StoreLogo.scale-200.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Assets/Wide310x150Logo.scale-200.png rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplication.cs rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/CoreWindowApplicationRunner.cs rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Backend/PixelShaderEffect.cs rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/ComputeSharp.SwapChain.D2D1.CoreWindow.csproj rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Extensions/ApplicationViewTitleBarExtensions.cs rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Package.appxmanifest rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-arm64.pubxml rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x64.pubxml rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x86.pubxml similarity index 100% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/PublishProfiles/win-x86.pubxml rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x86.pubxml diff --git a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json similarity index 57% rename from samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json rename to samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json index 48c8a361..2dcd9bf6 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.CoreWindow/Properties/launchSettings.json +++ b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json @@ -1,6 +1,6 @@ { "profiles": { - "ComputeSharp.SwapChain.D2D1.CoreWindow": { + "ComputeSharp.SwapChain.D2D1.Uwp": { "commandName": "MsixPackage" } } From 46d4161d314fea8c81af9bf479713a647b594e9d Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 19 Sep 2024 12:16:18 +0200 Subject: [PATCH 21/22] Correctly remove WebView2 references --- .../ComputeSharp.SwapChain.D2D1.Uwp.csproj | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj index b80fcad8..71cbf95e 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj @@ -14,16 +14,6 @@ false - - - - true - true - - true @@ -48,6 +38,13 @@ + + + From 23a711e7c6d94d958e3b2d3f6581496413152042 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 19 Sep 2024 12:16:32 +0200 Subject: [PATCH 22/22] Publish Xbox flavor of UWP sample in CI script --- .github/workflows/dotnet.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3638c724..488d14e1 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -341,6 +341,14 @@ jobs: msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + # Publish the D2D1 UWP sample app again with NativeAOT, with Xbox support + - if: matrix.platform == 'x64' + name: Publish ComputeSharp.SwapChain.D2D1.Uwp (Xbox) + run: > + $env:EXPERIMENTAL_XBOX_SUPPORT='true'; + msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish + /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + # Download the NuGet packages generated in the previous job and use them # to build and run the sample project referencing them. This is used as # a test to ensure the NuGet packages work in a consuming project.