From 69ffbbf03a2a30c6311bbfcb93cebc92975444e2 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 5 Jun 2024 22:47:06 -0700 Subject: [PATCH] shader fixup and new example structure --- .../Compiled/CalculateSquares.comp.refresh | Bin 1417 -> 0 bytes .../Compiled/CalculateSquares.comp.spv | Bin 0 -> 844 bytes .../Shaders/Compiled/FillTexture.comp.refresh | Bin 1432 -> 0 bytes .../Shaders/Compiled/FillTexture.comp.spv | Bin 0 -> 816 bytes .../Compiled/GradientTexture.comp.refresh | Bin 2331 -> 0 bytes .../Shaders/Compiled/GradientTexture.comp.spv | Bin 0 -> 1680 bytes .../Compiled/PositionColor.vert.refresh | Bin 1808 -> 0 bytes .../Shaders/Compiled/PositionColor.vert.spv | Bin 0 -> 980 bytes .../PositionColorInstanced.vert.refresh | Bin 2786 -> 0 bytes .../Compiled/PositionColorInstanced.vert.spv | Bin 0 -> 1652 bytes .../PositionColorWithMatrix.vert.refresh | Bin 2240 -> 0 bytes .../Compiled/PositionColorWithMatrix.vert.spv | Bin 0 -> 1276 bytes .../Compiled/PositionSampler.vert.refresh | Bin 2168 -> 0 bytes .../Shaders/Compiled/PositionSampler.vert.spv | Bin 0 -> 1188 bytes .../Shaders/Compiled/RawTriangle.vert.refresh | Bin 2764 -> 0 bytes .../Shaders/Compiled/RawTriangle.vert.spv | Bin 0 -> 1496 bytes .../Shaders/Compiled/Skybox.frag.refresh | Bin 1280 -> 0 bytes .../Content/Shaders/Compiled/Skybox.frag.spv | Bin 0 -> 568 bytes .../Shaders/Compiled/Skybox.vert.refresh | Bin 2037 -> 0 bytes .../Content/Shaders/Compiled/Skybox.vert.spv | Bin 0 -> 1204 bytes .../Shaders/Compiled/SolidColor.frag.refresh | Bin 921 -> 0 bytes .../Shaders/Compiled/SolidColor.frag.spv | Bin 0 -> 376 bytes ...rag.refresh => TexturedDepthQuad.frag.spv} | Bin 2634 -> 1576 bytes .../Compiled/TexturedQuad.frag.refresh | Bin 1246 -> 0 bytes .../Shaders/Compiled/TexturedQuad.frag.spv | Bin 0 -> 560 bytes .../Compiled/TexturedQuad.vert.refresh | Bin 1874 -> 0 bytes .../Shaders/Compiled/TexturedQuad.vert.spv | Bin 0 -> 1016 bytes .../Compiled/TexturedQuad2DArray.frag.refresh | Bin 1683 -> 0 bytes .../Compiled/TexturedQuad2DArray.frag.spv | Bin 0 -> 888 bytes .../Compiled/TexturedQuad3D.frag.refresh | Bin 1678 -> 0 bytes .../Shaders/Compiled/TexturedQuad3D.frag.spv | Bin 0 -> 888 bytes .../TexturedQuadWithMatrix.vert.refresh | Bin 2306 -> 0 bytes .../Compiled/TexturedQuadWithMatrix.vert.spv | Bin 0 -> 1312 bytes ...TexturedQuadWithMultiplyColor.frag.refresh | Bin 1636 -> 0 bytes .../TexturedQuadWithMultiplyColor.frag.spv | Bin 0 -> 836 bytes .../Shaders/Source/CalculateSquares.comp | 2 +- .../Shaders/Source/GradientTexture.comp | 22 +-- .../Source/PositionColorWithMatrix.vert | 2 +- .../Shaders/Source/PositionSampler.vert | 2 +- .../Content/Shaders/Source/RawTriangle.vert | 6 +- Common/Content/Shaders/Source/Skybox.frag | 2 +- Common/Content/Shaders/Source/Skybox.vert | 2 +- .../Shaders/Source/TexturedDepthQuad.frag | 5 +- .../Content/Shaders/Source/TexturedQuad.frag | 2 +- .../Shaders/Source/TexturedQuad2DArray.frag | 4 +- .../Shaders/Source/TexturedQuad3D.frag | 4 +- .../Source/TexturedQuadWithMatrix.vert | 2 +- .../Source/TexturedQuadWithMultiplyColor.frag | 4 +- Common/TestUtils.cs | 27 +-- CopyMoonlibs.targets | 18 +- ...cComputeGame.cs => BasicComputeExample.cs} | 7 +- ...cStencilGame.cs => BasicStencilExample.cs} | 48 +++--- Examples/BasicTriangleExample.cs | 111 ++++++++++++ Examples/BasicTriangleGame.cs | 86 ---------- Examples/ClearScreenExample.cs | 36 ++++ Examples/ClearScreenGame.cs | 30 ---- Examples/ClearScreen_MultiWindowExample.cs | 71 ++++++++ Examples/ClearScreen_MultiWindowGame.cs | 62 ------- Examples/CompressedTexturesExample.cs | 160 ++++++++++++++++++ Examples/CompressedTexturesGame.cs | 131 -------------- Examples/ComputeUniformsExample.cs | 84 +++++++++ Examples/ComputeUniformsGame.cs | 132 --------------- Examples/CopyTextureGame.cs | 2 +- Examples/Example.cs | 6 +- MoonWorksGraphicsTests.csproj | 19 ++- Program.cs | 21 ++- 66 files changed, 581 insertions(+), 529 deletions(-) delete mode 100644 Common/Content/Shaders/Compiled/CalculateSquares.comp.refresh create mode 100644 Common/Content/Shaders/Compiled/CalculateSquares.comp.spv delete mode 100644 Common/Content/Shaders/Compiled/FillTexture.comp.refresh create mode 100644 Common/Content/Shaders/Compiled/FillTexture.comp.spv delete mode 100644 Common/Content/Shaders/Compiled/GradientTexture.comp.refresh create mode 100644 Common/Content/Shaders/Compiled/GradientTexture.comp.spv delete mode 100644 Common/Content/Shaders/Compiled/PositionColor.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/PositionColor.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/PositionColorInstanced.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/PositionColorInstanced.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/PositionColorWithMatrix.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/PositionColorWithMatrix.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/PositionSampler.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/PositionSampler.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/RawTriangle.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/RawTriangle.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/Skybox.frag.refresh create mode 100644 Common/Content/Shaders/Compiled/Skybox.frag.spv delete mode 100644 Common/Content/Shaders/Compiled/Skybox.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/Skybox.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/SolidColor.frag.refresh create mode 100644 Common/Content/Shaders/Compiled/SolidColor.frag.spv rename Common/Content/Shaders/Compiled/{TexturedDepthQuad.frag.refresh => TexturedDepthQuad.frag.spv} (50%) delete mode 100644 Common/Content/Shaders/Compiled/TexturedQuad.frag.refresh create mode 100644 Common/Content/Shaders/Compiled/TexturedQuad.frag.spv delete mode 100644 Common/Content/Shaders/Compiled/TexturedQuad.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/TexturedQuad.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/TexturedQuad2DArray.frag.refresh create mode 100644 Common/Content/Shaders/Compiled/TexturedQuad2DArray.frag.spv delete mode 100644 Common/Content/Shaders/Compiled/TexturedQuad3D.frag.refresh create mode 100644 Common/Content/Shaders/Compiled/TexturedQuad3D.frag.spv delete mode 100644 Common/Content/Shaders/Compiled/TexturedQuadWithMatrix.vert.refresh create mode 100644 Common/Content/Shaders/Compiled/TexturedQuadWithMatrix.vert.spv delete mode 100644 Common/Content/Shaders/Compiled/TexturedQuadWithMultiplyColor.frag.refresh create mode 100644 Common/Content/Shaders/Compiled/TexturedQuadWithMultiplyColor.frag.spv rename Examples/{BasicComputeGame.cs => BasicComputeExample.cs} (97%) rename Examples/{BasicStencilGame.cs => BasicStencilExample.cs} (67%) create mode 100644 Examples/BasicTriangleExample.cs delete mode 100644 Examples/BasicTriangleGame.cs create mode 100644 Examples/ClearScreenExample.cs delete mode 100644 Examples/ClearScreenGame.cs create mode 100644 Examples/ClearScreen_MultiWindowExample.cs delete mode 100644 Examples/ClearScreen_MultiWindowGame.cs create mode 100644 Examples/CompressedTexturesExample.cs delete mode 100644 Examples/CompressedTexturesGame.cs create mode 100644 Examples/ComputeUniformsExample.cs delete mode 100644 Examples/ComputeUniformsGame.cs diff --git a/Common/Content/Shaders/Compiled/CalculateSquares.comp.refresh b/Common/Content/Shaders/Compiled/CalculateSquares.comp.refresh deleted file mode 100644 index 651c75affd3bf4c99dce4d408733dacf5a0bed10..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1417 zcmaJ>YfsZq7(QbRv05%7;te>+mvPB5A{vxn0-|Nf5)3u)!I);Y2WZ^d*>g%n!#96| zzsSGhpYV%`&(p11W%1pfyytz+dvCXcm+sz>fP5_rQ65^nB1B1C6SkNq37Hf_U^Yp7{|+#Pjd5oSh-N&`)5yVk5}-)fc#s*$ z&%nM4%`;ccJOaI(Z-5E1zL*&*IGZRd}&~?uS0)iO1MEb8!C@&in%m-%a+! z-7p{ZHdxL!25^4PyagZD9|y=kLk9ZO&hKvFOfI)){;_ZO?JvmBTzq!)A-@fVbKV2E z8_v&stV52zKQZA3Q2LHZwZTj3OFxdZk!cv2hZ67bQJlPYk~ruJjY_I%z3195^Si+19|?zW77`ua3ct)Q`sq!(GMXK@%{$WGVezejcH zuaq*vhy#DQwU3BqWsFsGO`ND|B$ws7T#@xvge}X6^IdQoZ=$qgvbwsufkolF^wzer j%30A%b4hIFM0p`+{L|6EM$llvxi-+J-)dpXUTePqMFrY; diff --git a/Common/Content/Shaders/Compiled/CalculateSquares.comp.spv b/Common/Content/Shaders/Compiled/CalculateSquares.comp.spv new file mode 100644 index 0000000000000000000000000000000000000000..ede2b14d007ded3bfa735bf1b38e29e6943d60ac GIT binary patch literal 844 zcmZ9K*-8UJ5JfwQqj5LJxErH+RDusGf+#3L4CKuZka39!F@stB0>8|!@ZF&I8H4v!9W%!NW~)H9DKB94KV z__^oCG+01aD}f@=D+>Jb#1BY>GY&6;8p$QOv?z kjIaFTtH1o6`quK>=~2Hxan23k+c>}V?4zdliwRG_Hz&j>HUIzs literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/FillTexture.comp.refresh b/Common/Content/Shaders/Compiled/FillTexture.comp.refresh deleted file mode 100644 index be505ec2f29f0b071607130a41da507b468df4c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1432 zcmaJ>?@tp!5M5e|c-R6WApTtRONmWW5DgK*4_416O=>8C4}@IK>rpOVZ=1Wlrl=(T zZT?k$G4Z|a6`MfZW^VS)yqTSu+v~x{_NSb{8s>$_=bqmZVoJ=3qIgOp)}qM4B4C>_ z+HSU+)kJry+plW$mjnW_$e9PH06h)qxj_VlOhPQcPTL}6HWTvm`0?;x0Mo(}cGIz2 zExY-_@%nuy(HEibghAvxognr-9SnT(W+!+-?%Dsc!V#E>0A}Mh?czK^|q8oM#aBK|k?2gv&->#A{|h zEuKI#mUsyrv*&fwy)gS_#LvJcA#$wlj9OS>ilY90r z#LstQ{J>x#D(H&*hY)fo^ih+`IyraFV2mGQ&-yBu5_{x~$)V8q8gF`BFQA#rZ&-Lg zSub<(UT~g!z|1iZ;fz|aay|>0jdm`c_XAwU@GjH8kIc+N%siaO3WT#DCU+HL?jSII z#O(DCGVVa8N~ko^xP+ecRFr6$29bU#aYv6;{MC+C+HVKne7QGrly}mKq->@eyG5&L z9ULF}L!HL{R{d=nskkT4Lgni1eL23y@{NrBZjfj{E~m9oRCeOkS=YY@Bu{jldRn$W zHx7=R_pwS6rxEp2U9`RzEs6D?a2(n`a_T|SceQtZcpm$1r%^}JOH=hg1s(L;>pT3j zC~sV)MDts4;DbfS1mzpQ*6Q$rjj)JunW!SN{)s7!O8X0IsOLEV diff --git a/Common/Content/Shaders/Compiled/FillTexture.comp.spv b/Common/Content/Shaders/Compiled/FillTexture.comp.spv new file mode 100644 index 0000000000000000000000000000000000000000..1cefa51edf59cc90afb1b53f4ad2620d8f819cc1 GIT binary patch literal 816 zcmYk4%}T>i5QWFKsnu$KtZl8osV*(Wg^D2RMhJm|3m-sYE2YpTpwX2JpUtOoBY3`R z0=?yA?wL9FWbQP@!pW-HidC&*NA|y(R#3*2E4vts9!JBsbTT}@I73mhq7$O2OXDe) zghe!qDQpT2<;gXLN(S^r{R)cTBAyh>=iqCqjg#bcqUh-)UeozgFi)PNc^H2r<0zda zad_|Qp0yQ|_cUBY(-&hwku%ZBoa=keoHL%?{$=OsywN&y(wK$$8;i!wnbW3W)=_F* zF!RzF=}zW*cXMa6ouq^I+PxL*XUzgzZaXKRn)nl;9M|VMVsvs~I^hff4 zC7dvI)7^BsTU*`DpB;BRc9QfU@SMO8J!jy@o}2pn9)71Petzf%*`VrBlSef_@(0S{ zMo~P_UQ;|Z?FCLZh<5uyFWisZe(FbIZzH!anh&+7QQ8k)M)BLdILgL5{_o0NQ@s~u z`}M~yooF%VC7R!ky5)YCq|bJvoL>^}MuGU6xhp=((%z`QCq!eqs*ie3i#`)Ql@B>s zH>R6>rg`ZV{$O7hRb_Ipu#*EjJuc-#`$BHNTG$?FCpYp%A%eM-PiBgLS-h@>v7#%& z)&S{3i{+Uvd!3?}oFKGQW#bw&Irx`Jw#DaZbc6x8y~S z&lfuMEY3KVFBrT9*dHk~d61tdJ2T=gGFN5?HdvpC(3kO_7P`NSxm}Ztj`@K}t?0mH zCSQuk!>quh=U<7?mp)&MC$8%Ajb!xy2#1)ah&c3R+)eRdw?rlOE%E3}pJnl2SAD*f zjK0Kfizg2KGj)kO#v@BkY}^}&^U-^31;y3J&?(Sy8 zp%+^{miB>-y*)oky|}r%(rVQIXw%#7mp*3V46!nAfA-xMc#_7Mo7$acz3msyPjQqa zPA?p1>5*ddCOvh!%xQj)P3{(P3-jty^Z%(???VXJsgc4K8nr5^XJ8{%A`+| z`ZyJv$9|dGlLOj7*NUjw57Z&VOiNq#rtP#>hV99uin6BMK^eBz%nNBx>}@*>-kvN^ z3vC}9Z$HrJm0|k7thF4=D<(a~Z@pGRrKLUGlUHFjO7oT_&5o{+09vmb^}K0$zh*{a dHPAiJ@fpuyGmmYXQdOMW$NCfvsSIdZ+W+o;U%3DP diff --git a/Common/Content/Shaders/Compiled/GradientTexture.comp.spv b/Common/Content/Shaders/Compiled/GradientTexture.comp.spv new file mode 100644 index 0000000000000000000000000000000000000000..5cb6514ee41023c19e8e4737616d8e3e91c12c4c GIT binary patch literal 1680 zcmYk5OHWfl7={Nl*~!Ipj|GI+4FHie$9cX(Y-jN#+(Mq6%a??SthS!% zQ|KQy_p%eHyPCC=yiXGDW1k(Qp~Al0$0YC!(U!|qf!Fw0rWdmP^q}7cZ|M}dqcmUL zdyvaMa<|+6xeH;7n0)dNk!9Wl90^i=1g#5M0;BLT*vvLo!uJ04i7{^Y3ex-z(7w!f z9@f~;W$sFDdq&qVb|10?t2{Mx>o$Tx~^zI@i- zMY`u$Uqbgh`e%q6n*^-&ak8dRT6a`vGvdw`rs?>m&CZx+~gG zTV^@h*^dz}%Cl6tr{};L^Nhv374#4;);-f3G<$gG#y#%_a9+{gME6eQ^{%#nIl|Zy z@5{Z);qrcd<0&FNt6ct5-c_{yf7)&Tk7$?BCvtn0dgp%?IQ!4o&UqmBrP$W_kLz2b zyS=onb-y=&bKN7;nfiwH372R4lJnd|H!hER)RxB{{!99zeFxoMKRBuJabS*q>phdc z4dT1SA+i9w30sFv-naI0|ExMBz|n(Lk%Sh`f1^r;~A2Dii zJf4Yhel0|pk380*9#?w>DDj8j@D9&wIL%_0uyye9@))1FB>Z{o_Wc@B z&WAo@%zqok-0yLNdGA^bTY=rP80$M;&0?(GMHSY$5959E8K=g#$jj%%=ggU~Z|a~= z{%>^k5;pY{nea|)HIOH9daUcx`#g55mA_-|)4LKd-`^$lnRIVG0?d@<11UU&!LZ~v>&$@P^Yb?F-M zvRo?SjRB2k-RaHYSsH08+O{8ZbVPyPOyElb(I>N z%Z7aF-3`vEfD`pcIcZZGB|dIOEb$aiqfl|&7cwVfZ1};zJx5O4Nke__e&Ap$)f<3C n{PI@T7(y~bBSz^@|)iA3++G#>} diff --git a/Common/Content/Shaders/Compiled/PositionColor.vert.spv b/Common/Content/Shaders/Compiled/PositionColor.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..828a62116d8f1e1c40de0700cb3f32ada0ef4877 GIT binary patch literal 980 zcmYk3UrPc}5XEoms%2$nYJbd(9s}v2B8ZAGum>Luq1TXFVqx12T_Jkvv-PQZ2|B;q z-mNR+%$zxQ=FHuE?x1AMf~lCY*)zYVW^zJ|u%h*Y;dt1aB~QKMlOq_bCU1#ws%Fu~ z1^vHFf`|m9B3qZWWO@B^@}IiknSy?QTu%u6c%Jm*FrF&39PT^7la4jz&*8(!pWge^ z#D9ZVOmSjr@hnJ!I1*a2eDqm7h>~&e?!$96^r+SkgV&p2mQ12YKdZ4FwRsq3HBURR z4+qWcl?_xp&{pixk#We`fgByTy2B0}aE`;MgZ<~B4-74iM-0aM4OF2YJZ7QC&8`at z-xr5F#7#v-`L3)bzCOCm>D5(UmWK;|p62WWMtw;heXdUKG&fXVu{{0h9H#lIV(zq+ zSLK-x)=`9Zr-2&AoSHl{siT9OcL!rmUA`-$FLTH@WE}Qt$TP?3ZYqWgPCs(q%H4;% zB{SyZ>Qvu|x8hAW^!O6u$zKRX@3M@&FIDAz$f?nPQ%3JQ-JtJwipgczPKq(#@!BcI h?2)E0XII93_|(yOt-gFGzB6ya-sm8Q|E;agWIv04Jv{&b literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/PositionColorInstanced.vert.refresh b/Common/Content/Shaders/Compiled/PositionColorInstanced.vert.refresh deleted file mode 100644 index 06c77f44a7bf36bae683b90eea477c804e4cfeb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2786 zcmZ{lTTdHD7=|Z+NlN0RX-++)>7+?oJAebhBx$Ij6{HRl5(HPMcNQ`xTFLcV_8Ns& zky2GvFDmsH^{T(BHL z&c9_eA)ER}v%a}m-+0k%^?J=gcGzh*J4v_Q+)MiHR+b#J(Yp}oCEZqMxECuFq!Gt0 zn1YL)4zty?llB!($b`!!00rf7MR+eANLFw;Zl!}HOH!A6!JKzFzwR{GyMt`E+iI_O z_u6lAUz4V)i)35v{!Y7}<@luf1kQsjxSNzOaQfu%q?JNE?@dONeFwTIHD;RkN zj5`=}s7r!B^sebY=UrjwaKEXWR?b+_Em>&s9FMIPe?cd@;7gvTJ}~5L8u@h zMe+C#`j@>fIQH-B#2z01@bm|4T0FMbM8>>Z4*U(rf3p(!n~pbTM%wtfB|-;6c0+zX z(rHEbCGN-m4o+Nn<`Ck7e=4F6A&%8u&kFuN*Tur=K@NYBdx`$o{c|{ohZ%cnc zC$)jy(Ty1eePj@MF6yLr$jK8ve|Ph^jxrc^QSz(U-uaE`PE||dYl>H1OH(7AlKU>`uvCV;du|h z=yfU`dh(eF{5R>q-}RW)`K>T|`#^+mdX8`Oz7T=`;_bfl81})gq@yyF#`P!d*Oos{BlE=t3U|)NTJ=xL*)JMbGqa>+_dDrsR<+URcd0n#W%}$QIQBh1l6uSVqj5^$emPE{3pRY@ zB_K|J*vf2UYkhmCx!O+$0|o01v*Ogx#VM=D#W*su&+Ydwepuby++LfLgONtnx?qub z-iwE4)gZmb&QV!w(tRsBGoQ_2b}FH&4Mj&0Pb3sIG!GXQo(DTflRbN&AHycU|E2P% z=#leUURGS`g6*XPTeGF$&OWqrmB)+wWjpJ;Rhp|jUEH4$?2ozqvUefd${RZ^bJy6? z$>G`uwpw-`J zCf2nr#@+5%E${1gGhvU8dU~qTn$>2MBHhYKmC%5EwQ8~7O4w~Sa5RbIDgpLwj0WwI qICEc7o{r|P+`U!|kz#PGMn&9N%F!Byt5@r{vthsM3mQdJoBspgFVkp>b0d|=gzoMH{#l^T2rnj#)*r)?(FRCGzaBDb7l1r z5#z4z1Bsb%=e#|n-%tBl4mc|rl}t&lO4cNG{ney@D=BhA`uiUri6N&rDz}PW(U<9C zs9{8;{0ZU1Vjy4SYj=x5R%V6YGjhXzuaCX=+xei}&p)Kw`9b=*sujBx8S-`0{=2ka zR(!1U!L#sLxmdN}IiKgVyxhyaq{Nwzv&gsA%MRaU)qW>Fri1UO*E{jiKXYJpbb8La z;8BG+E0{g;GrQA%=15FK@>b`!zTsHLkq?J9j$YyD%Q$Q}?x7Jnuc-CX*mK9B%ISDZcz8TfIES*TG%f45F4bQ${?!oqjzb0W0wof8k zt4+NdG7^v$e(;hyoOL+Eo=n%Uu}PjL0kRr}KC zGYQN3eD2Y4drfbNJLU{5>iiKCNmGlv;JahrO=0wyg!^kLntKN0W3Cq@+|4gl0ACCo z_wy}qmjcfnP=oq#)S%aS33L9bcrf1q9J4MI!%VJA;J+&dycoDd`n5P_drLxXW=?J5 zZcE_5hP*q0Bj57w%C0S;D>Yt>Cl1AIQd+ zNNoRyve}<|x4!wu3vYctmJLU~dhqXtv%d(OlrwH4aP(^2%fRtY ix_SZCTX2qi;_>sI=!5gMB)mV~9DRT{C4V)6b;&=4EMn6D literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/PositionColorWithMatrix.vert.refresh b/Common/Content/Shaders/Compiled/PositionColorWithMatrix.vert.refresh deleted file mode 100644 index 3f3df4c6a20710820610767ac64e99e35d64d560..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2240 zcmZvcYi}Dx6ow}kr^UrBrSt-nFlo3XqF62%gs2RHq;)CpLOmsYR-gA4;na%7!9_|>{cEgyZ#q~?ZESM{%Wj-xYW3HP; zAx79rx%YR6yX|Rl*zSJS!R4x1Dn0SJX5J{z%lbVY#VHEN70KI@Rmqb67PbGQfMwG( z{oSBH81#1^1>s~8OpBLE6eMvP1&47Sg++W4;dj~di_h#+FUvBF<8wmr8&7Eb%xkhVk!WM@(g- zFWI(|c(NT&i%}Xza~o5_HcOJZt)W>k7Z!YOY5ygS$60>-W0Hk0z{w5H`e{_;@#)ii zluq$c%#yiNnRITH^PLkG-dE4epSiQpxeIjq*ij5KV1ct7h8@iJqdzcuaekb^n15du z^5M55#PQarRr))9T{?>#4%3HM#*zb!9Pp*Td*}2u=`8H@;`+OxDB{+X174hO>9nHV zN^Z-aI_U7V`n{|jU+{;u&dk8DH?=QFoE_cG<)-Yd(oa8HpVj(Ror$?C{hD^_fvxJq zd>jXC2z9P&rzUoIp!02jQRjwsDoxJq5swid%M(*3%t65aJ(U~h4 z_IK+u{>Q0~UX8)q`K{L&{Px5IE+0vV#~-_u z{H?s$K9*1$ANcXDd?Mjq;0J$n{QlE~zL6|ESI6PA*?1h~*8gX=-`YGn(z6id8_znM zt>z!Crq#-`--6@O^DMXHBpVgo)2!avC1YU-EgelPo^8 zCwllb{y5z@yODYFUPZNL?`Q1U<5{v%^|Rr|bl*N`cgCCdFSjb h2-IFa)b`p_HBY<9*&Dn&)^2%J%<{BmJFli${SQK@fe!!x diff --git a/Common/Content/Shaders/Compiled/PositionColorWithMatrix.vert.spv b/Common/Content/Shaders/Compiled/PositionColorWithMatrix.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..622555ad6f02935ee53b01c64183560b04b4f22d GIT binary patch literal 1276 zcmYk4U279j5Qa~aZd$Fj*4huX#-#D%LMUFS2%@4D(u)d}T5l!PD2v-&*=(VBz^IqMVg*p^oSIo{rMoL}UrOigmFzzZU)%8Rme8s#VB zS~RJzaaY8wi~Y~@eq!Dw@{Glt|B#CPh1Ae#LE?b z*5uAi%=$(A92V>5aW3oBFV{RitOrfLOzfU*@)f-2iFJvbPt;&d^PE+@XIfW>xo<%F?{a)x5|-o#I5G3{;cT*a(kZ({k*XdAEQID=cno-3|4 z^Z16;66YJjkC#vQPwlG?mpy)i_y(SXs__!$3|~-n*5C&Qp;0^)=DOvOXj`uELY~$D4n8!T$X$y`Ao8=zg6vj>cYBd znqEKY4FO;AtcB*eiI{k-Fo=@d7)N-NX1PnV^%p-p=at%DrVD!8v3;y7d3;BlJt_TI+ z6o)&Uuj#a*-Ab;DuMe)&@nxl-*A5r_VWm?q*bPd9V z{bCXSl6L%&8~hKn;|m-2;vIoy$0 z2`gZCb+(d~2>ZOk@V#Hf{6c5$!^gfU`9*&DhQ5^0KYBzS=M+Z&amz{C-im z2YWxg%<_@nd1R~S!Tx9qcckB|E4F;+-osY2G7SC5JDXHmGGD$XF@0XrTTT7eeLA*F z$2NL4+7gB|DT z#2)JbPWV5vb+4|acD@@%)n3k`?~Yxzb#^e@bq}{~r`>tUBq=x=huy7av=zF#ZSTLE z+CCBao9J%)gp3(N-2G)+Y?*nCms7Et{gF#jCUja>n6&&y_I7})tV4olSOKnBQQImc oPNGU~8AaVx8Wk&s+EI~;7HRJyM?(q6idH!NzNS@8bu@MCU%d%{{Qv*} diff --git a/Common/Content/Shaders/Compiled/PositionSampler.vert.spv b/Common/Content/Shaders/Compiled/PositionSampler.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..adf679eb2dbd877ce8a38bf029169892e300f409 GIT binary patch literal 1188 zcmYk4O-~d-5QdvwWq9U zukvEz^9fFmY^F9&tsk0XAjkT@8%6HLt#{CAn4nD;;(etA; z*jy=i5wBMM?F8Ge+!meR#(UlxXII4AD6LJM`R+_aa^@2|FPHbP;LT@k>hIyrC9huW z{N$d4)vjT#b?`bq6|jtpH!$@(;7z<|?3*ohn`~2&ly>VSp7e;zQO(jaH>Yu literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/RawTriangle.vert.refresh b/Common/Content/Shaders/Compiled/RawTriangle.vert.refresh deleted file mode 100644 index 1d63c88b20898dd61b1a59afc8fc40472723a813..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2764 zcmZ{m`)(UW6vih>ofd;zN^e|BJE2@0>KG@a6`~3VCB=;t$tFe-|E(f>Q?0bvmc5Qr zs!BWukHAYH@lsqQB);G7j6I3niO!xg=X`Unv+Epw-+5+OcGZ}bwCw(?(-W35}(ciN8p8{Vp zWz#%}nypsz;Azwy4x@4QB8{Uo>Bmto8O7Z!IgP^XucSPQ`8rcGG0ImyEOHem9=l=o+?3noe!xm^W3nW?ngcH|BG< zr;qnUtY^xYd|6;vURTVENzQcS0*<&Ihm4N?HD$pcxEp%H*Q5i3d`l=@5o1O8wc6{l z3B-WKN^b>Z`lICY>WPxkZ@o%i{kWL8bl!M!iSA9@Jc*Yu%eYV`5foE?lm z|B+;W&U1hM6WOTOpI>)aYVhZoc^Dht%;2H86|wNgz9u4{yV`GvQ#-nQniw2yotZFjG?C42OS<+X9UN!dHuxkysg#{fpF#}5_jhJ<=lrKv29Av;-OP5{`-ex-?r1O`NBjNZ zB&(EPR?1duGVjrTZ97Lk#Gc%|dY!A*Bny3ANI-smeEQRFt97{7kO!j8msSMx-~MT^ z(?Qa+r}~wN__eF9PxH+^Y+3!*IG4$Zt)B0Q-Py4Xogm=Lf+6aN-6=BIs%~u78z(i( zbKN-t<9p|U+tmWs$kD|!JoBn>AE)DZF5cqAHeF&w3zB17B#8U^*;$Yjw)w50gm;$0%obtPlIzo5l(b0cs*v*Qbvoq z5n$^tgx)x(P^;y$QVw5|;%3|Y@`d{R<*|AhpT|+ci!{5L7cZgJn^g^v_45GVq~Maf snTPRQ9)%nAP!Sy}RN=bq{(Vw;!EO;a7=;%dY!qjcQQws}ji%=O582nmKL7v# diff --git a/Common/Content/Shaders/Compiled/RawTriangle.vert.spv b/Common/Content/Shaders/Compiled/RawTriangle.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..a4a9b48afc1a8489271be83b8afa72896d15e0da GIT binary patch literal 1496 zcmYk5Yikox5Qa|^ld9F$+MAbJH`aS&ytPFT6{!$~euxzOD#b3c5R;OmQ2f;2oH_1!P9b0Rv!1rd3L?46Uj_XGat&6QS0lgN&)tt7(!nS_e%CulkL6XvMexJ^ z5WAM=>K~1E`rZBj7^EIr<9nTSFup2YFK}&gcKX9?l=XX{(>dRMb3E&f_Oh?3ycn}b zVmsaJ@J%)x?e{*VlbEkHcGT@oV)mF1gIJqa`HmUne&PH6HN^9lj_ubY#}l#foZY~G z%wFVKH}bT_oL`%W`Q$C|U)=zcqrC*Hj!qEsCipBlx5b|qzC9b?DEMcwJ&R~cMS7h>+ldI{QNJ!99Ab;LZ{v0kIFt>@0Hm!RdzkM(Y1m+Rfe7ju`^yNmW%&)6MA z%skq$p1Y3kbH~<;JaxH#Quy)xYWwjw@ECDk@0qvzeo|nl3HG$WrqG?@yWYf>Yb<`3 XugT$WWDD^daA)?YFaIxJ*E8fFT0Ugj literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/Skybox.frag.refresh b/Common/Content/Shaders/Compiled/Skybox.frag.refresh deleted file mode 100644 index 2c3754fd7998049d39a4d65ca09d90592591be04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1280 zcmZ`&U279T6rCj9wr<^iSW!ffslK#OLcl0uZC_#=3xP;BRNsbeG7XE{-LN}bTBP7_ z^H=#Ic+P%hgL>g+=AJoo?#FCKXYQwlfc-F?&H`KD-b$%eocW z{t5Q0z$E-B_?!h})-Cb7j+N6SepJM)f!H%tV`C*hpEx#!u^!rUoNQnvk9rRY!iZ6i zF?*mf{}$F#kNj=K)FMtkWA;SsEvCnQSSyV+`~qTOJqF4gn{etgrp6;U?|%V{J?+BD zA$|e{_D1YCGQ5K~LS(=rm^9YC^iqGg3L?*RPvp{r$@enWGe0pp-Z!0tBgZaY(lwsZ zQZ12HlD~5OQj%SA>;!y&BJ(7&`cNQPKY1<7&jJTLiqnaa?&tH-h3dsolBn}=o*Kvg z?${ER$t^A+@%Z#>Z#W!%>_FiDeAnkyhfSjs^i%JB!)KA%I7c^g_N^H9kugz2_s83 lvqcL9QkO5%=J%s)P6ewDwd*}s`+^v2d{bdjLM4F){{XW40>1zN diff --git a/Common/Content/Shaders/Compiled/Skybox.frag.spv b/Common/Content/Shaders/Compiled/Skybox.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..b5ab7c561d05a31ac045f8f48cbbd2f33b913fa2 GIT binary patch literal 568 zcmYk2PfG%E5QZmh)w2APQA7}0cj-_OL|ufucr)m1C=qEJ*1^7BpQ=mH^X$6N!0gPt z`_4NvzjEoU8nF@esKtKd){YWLfK{?M9F0f)kI!lU;__TZBgz?3PBW^pNz@mUmp6ZG z;cdJHPn-c{WmF@+X-Yu<^Aiwz?w6D2K{`*D*k+q3KYuBbwQ+uC$NZ_2$y0A9hciq)Yj4n;-y{}#@>|quiOaY4Cb27C&wJce mbB7<0gm??;+y<_`wHkZ4{g1G`se{WAzeB;>#D1A@jsF2>w;k&M literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/Skybox.vert.refresh b/Common/Content/Shaders/Compiled/Skybox.vert.refresh deleted file mode 100644 index 6e9f6ef1b4692ef69227ad7debdb2142f1525d3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2037 zcmZvc{camY6vd}WoffxlD5W3Jl1>^xjwqH<1FERf3ew_KiewW*#D6PivyQfGcCGzL z8xRt&z$^7-cm@6diSwJ?b(WB^u4nGKXYQPPXLonM8*dxN-xrNpTv)qg%ms7Bbj+s? zHRifm5MqQaxp}ZN-sxreL2u*BK9p-_(J|pHo6BykROV zQ0843Il#z)erkDe#$T1sxFHt2Rqa6s>swkaX|}T4+D~45;#NLS9&7L?mCtif$J<&{ za~;R0J}~liG?R~dZ|eV=W-DWSR{6_X!@nn=n&5-2XhnbO9K?)AqK9DQzN4AmfRP)YzJd||uv)_>H+suw-`^T&HnGT2QBwy zV2m2GT7%J#8e6R}^o^thy$@vUw=&|?^@s8jTa$4%9Q0A=Co=kuKJ??m`$s1|mRszbVg>m<^n=bKYDN$^aHacQA?NJeR%VWB(j)(S(UVpm&@SLX8ZDrBcX=~!HomQ7}7%?`ix4*YDt3K{Lcz9pN zQfNn_oMrZDXYrH6a%_AaU&L4OHoq3@FUT3J|9R$ezYHfcmRNURIj(_>^H<0}jouH7 z=|M5Aif{5d4Q_00GApZcG6r3Ue04><99R40_d;H(sfF6BQTh3GIjauGN5#D6RMt*M zqj@buzjJ8D8?5hMzKMH`wS%(wI-E|9i=!wb@~(lOewc(oGh;V0L(H8q<-4$*Q4`k^ zR(}J(&Oc23^3fQtR(?SdqYSqH&a9N%ESea)@s*_ME-*A1-Rq`CSujiPr;o2toI;(xv)uoen zC}!_XR_{j4-saw`nDy&TEZ^Sht>4Ix=hknNtIht8_-5|&98LT;h~M}rsP}de_s*VC z^={2y!0??tN3?z*=uK9<=%sj25v5+LMxhXCMZ7H`jU^D1l57MK|C@O6FL@E1 z*{10Vx@EKb=FOWoFKO?pe_az;?|9Z{cISnti6zm*Z@kvU3=jcq&YW(y-)-f3&^kOi zAY(<;4UwExF)wCuazFV|!o(u>680K+#L)n^I#h-DK+&vlgxgiF=egZW6^uqI*DrCX z;wTB#Aj-l(N6#U73l=X*g18viga#OP--c+I-dCAF?4)s;p&vQ)GKpQp^tX-8#hCd? zyaAW=xnmp)bKk^$4w%H=0-y6RW^ak-0#3dW;%8;d9>kb;aANE#&zL=l9m65}QHzT; zUqBi-+d!$gj7|PIveae#jp`HZ+9yJXK70F>gK1q`PK>|NyKQ>hQkqg5H^WFwKMYmG!KS+7k=k~$HPJVdPrYDJ gBDQeZaIBn~flHPRwQTd%y(DI#F0!QTUrAuJAI*=v>;M1& diff --git a/Common/Content/Shaders/Compiled/SolidColor.frag.spv b/Common/Content/Shaders/Compiled/SolidColor.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..0e27a7473047f2fe8e82dc952a6633530ad23ff8 GIT binary patch literal 376 zcmYk1-wVNT6vZ#I8S^v6nl^5lF#^hUP_nvdl{V}IJ zu9}rBFyET?d0i_@F=<{Nckw=sZudhpolS7G%*l;-+E%rSBDf@{D}|a62p##*wLqDp zsb&u~xl;fAt`vH92kG8g_*_d<9B*_adN literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/TexturedDepthQuad.frag.refresh b/Common/Content/Shaders/Compiled/TexturedDepthQuad.frag.spv similarity index 50% rename from Common/Content/Shaders/Compiled/TexturedDepthQuad.frag.refresh rename to Common/Content/Shaders/Compiled/TexturedDepthQuad.frag.spv index b1b7821ca0ed809e7938957210c919a867451aba..1284b0e4498befd5f28a46dfb24b7aa2a3978035 100644 GIT binary patch delta 30 lcmX>lvVw=3nMs+Qfq{{Mn}K7ZMCQhmE{u#!oB5dXSpZn|1?vC+ delta 1096 zcmZva&2H2%5XT+5f+{694jf0~l0X}_t8$@*1N%j#ilE)4;%2#tvslf>k>gbTP?cxk zEx001yaD2=aO`B0?qcPT%>478@%-k;)4$K2&nEMa7E&jBjL^=b7f%qf&>nKW@3CnQ z*=Tx(r$I118{;s`a4v5WiW8Pn95F#d$*w3uJ+#}=u{2DIs3Z89k1fmk_1ogT()zQ5 zPx1T5xN|urElE-mQ zr5pCW<1N`_Tjk$Wy8C0Nv>kgvuVo?VV05CrkKV(atg=M)(`i9!=Q=T$L{h-@7tXik zxt2S2u9Pe^O%Fg-8gecoRl81{%pmCyVfFNj!D*&3ONSB!~Zw{%1^`OP&!F4&T# zB+;>!k)UdzDYyf_AH&NQmItrFbv3&R$}7NS!_k8Sa39#IA6w}`$Hdd@sySV87D22= zhgXE9ZrgzAE`oOrO5d<@H<^|DYbc(7t!CG*SVja{DTj(y6|LMhhM*-C+|1m<`V5#>PXkVE}JiO0j~F= XmKjeI^1GK>zt_T=a#yc1_m2G!l#)^L diff --git a/Common/Content/Shaders/Compiled/TexturedQuad.frag.refresh b/Common/Content/Shaders/Compiled/TexturedQuad.frag.refresh deleted file mode 100644 index f3ba937ed2d897e987efa686b4790ea3b9261f3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1246 zcmZ`&U279T6rChZTeogMtSBPLR9{+<5K0uWwl8TL3xP;BRNsarnTCaJHq1^+Mf&Ib zRlW$GGuhn?iUT(@_uMn*e(Yp;8GWt^toynUjryAnA!=evgyJbdtUXZ&B7m*Cz1NTW zt=vvpop)`5AHnuuyWkN=0-PF972+p^*F+$CebpNbdi@JE zp3hZozo%NI$xN$BV)WQ1cbdFSkC)8G>0;s&nqc^Oo1*D*Uz&K@&C<*uA2}iRD88Mi z+Q4tR+D7`mn`LH#km!NKnqSeuqR%_8VVpzhAK=VIpZ%5meRRg&4qTVQouA>n4ot$H zgU=bzXT1`?o7g!;;wOdA8i>6>H34?=ncrWf{}RkC1jwV_IRK9l??jh-gC)#lK)k50m%2t+ovTB^cR`SPp!^xVS{J$*f97J1`^B3tu7()=;B*< zFc_Yb+w2n6 zbLKxQ@hQp%FY4^Kw^7O2PwWkv^IJswxu^Oz(O&ZE#oi=$%|BA-u9`c2!=%JJSZ6eG b`-|;yfLs5B%A2~l8u@!Vc$?f06K?Qd1?C%O literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/TexturedQuad.vert.refresh b/Common/Content/Shaders/Compiled/TexturedQuad.vert.refresh deleted file mode 100644 index aa9f2967e97698750684ad81279b2c5f1088f1ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1874 zcmZ{kZBG+H6orSE0u~D*0=}RQ@e4%V0HQGxdFgOq!BeN>F2F%&-t6Y%E#J zm0HE?#tm=d^Cry-<} z=*R(SD5$3yt!GXDAm|(iojABqD725WCl__YIE-3C#}huiCV1G2YvETZcLf^ViV{eY1# zYDHg`C(bl;Ur90dqis(Ar?gs4#?v&O)}A{S72nbdAMBBK^pf2{j!E6yTG2orUBo;G zFzVdVYBjl+I>d9D40O$FrB2qzg7$F1xsMp{vh#57YZ~+89rYh;$62(!(lf*_dSrnA z5>n8*B@}ONYU0aVW$}-g9QE#LQtOjWQ0GC4Y00t06hlwOdzfO>K2R03@T@rxpFEmB z=w9?%O+3N}bP&V;tu9|{4xwDX`8cfG(`IxMZ&>H`*(?>^+`4sM&uh8tHT^5`!e;M= z65QA6)ni*b*grh>w>wd{>+iSPy|`5TRw`PJM8(x1`^Fyae%`KD4|i5|LC#pWSv`lb zCdT*wm8tgPYjp-XaxNMuHDHNIwd4HzlGi(r!iGK9=g8+Py1bIN<2Yuwa?NQcj@3%` z{a?=PdS=(W)zg*hRPR#c=gwL05*@hf+S>2eCVE^vvD@moo&|o0^;cqZOSjy-m%*u& zOrTUaw|E(xvK%u~#1)Z>>z|iLl994p$a9)hH7EKPdC+PnO39rd?sZzJ=DenS`vV%u BP=Ejc diff --git a/Common/Content/Shaders/Compiled/TexturedQuad.vert.spv b/Common/Content/Shaders/Compiled/TexturedQuad.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..87ce0bac0c2f26fd7fdc3a3f48f76c1747e98157 GIT binary patch literal 1016 zcmYk3OG_M45QT4MY#;IcPK=rsmx8!Z5ky4{OcpK-hHQgqBMp;jnQ1{>`P=+eZiIYa z+qd-&HC1)$+*_xr+pW!!5I%+RFd8<(+nEh5kN`GZ`Of*}`Szf^+1}mTkueq86;aM~ z7^~tT{{LO&Jrj{}Y##f9wfVL1&s<2t5WjbB0wTY-FMnqbXGPJ!0ZFR+4M06X%Pju3 z`}ZR2|H=Ag_CN~yh8tTe26>qmJzK#fJ(#QGCwH8|BkqZqb+L~;^@*t^@{GmYVTX$E z$+MSwV()oS@eMfMF)d(7tbfL52x_F2HEnD5%hd=c}gYYA_k zIL9)vTyftscX#o=+!ZW@rxW{sC-Sb^_W6eH%Naf5FCYp22-Mw7VD9CZs{1pyX1}kP zy?$}SKHq8#*I=tPrk==Kt1)|D&_ykNYwydquI5wTRd0&9Bln;VbNR1Kd4T-~0SrKK literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/TexturedQuad2DArray.frag.refresh b/Common/Content/Shaders/Compiled/TexturedQuad2DArray.frag.refresh deleted file mode 100644 index a8aac42494bc6999f223872744e4d44a5a8a7c24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1683 zcmZuxYflqF6rEBExL6({AmU??FC~(uA{rw?f&~gmlOjd*+h*BL>xR;8W~W4A_;2d3 z@{5V*On2KAo#gh;J@?$_?)K!MewYzB-?KtwM^?v$$cRai7m^^(tQY|zfQ?yQsn)B- z$TW(ZuS)b!2?XMhGcCr&C^Y5L3p!BZ4rCTG10Hb{z%7fcLi|L~sBlE3>Q-vCN_F4$ zyInUj*KOstgN||=fmXf=t`vC_DPGX=+r37bkOL!KHz#to_JQ_V<**%U)FUSkUH2}# zZKYx7Y;ULPYdH*c11=zAVh;LaCuoNH@_jq>FNlx9L!76fy5pe1Ax z@!UOa?n&Zz0-9XnTd~aLeO^RYMb zXP}vrIQg`>6Jk%0oBQtfKPv9y&NyP^(&j#h&BI=RmJr51kL^X=d06WKG`Y;jUY6rK zXMK&`)5pE=5c>rr2fYoH^GrcF3vKp$55it|!D8+u2>W48a#-gfg!l(=Xg`85jwit$ z<4%lyAA`ld_)d^ZA9H*{JfG212>YOa2VL@65&MnkH;~K^OyQsRnoXr;`URG6rB2ADm?JEsh*YhvJW;0Tz;Fs36^3Dw;@8AnDJ*_tOcD44d z-`Tj$9T|T}>GZ}%#g4l1jFN6_xl#YSOVcAu&pQ#Af!}XvQw}~_6i<6LWb&!nt|Fs* zzLE9gqmwhYtivdBk2>9+`Fp-$5DK5}e=gT*CwryAX#Yu4>zRMDq?$sS`k8y`>6S9X zJXc}RkWKvCxcuuY43|6@Ms6nyEA}^1xV@S6{sLYWk}=nZ4`5Q&f=!NP(d){Pd8wnq*Nzt69-k$9e?O&XI-XXc%E zZr^F4ce6jDCx&An%JC-?(F+n_#oS(8-Ck|Ke^j@3_jY8AMIk538IS(x!>Y|ny=7t$ zoj^DBzwGM2 znKR@R@|m4_XW7q}vfjAUZ;C1M*2$XJpT#R;%jg_@-^|!|D)T#ll`DSOj=e!_foq1a z@_SI_zg>bk3@*=pBa#p?`x$$);{0)}{oGA{32RSr`NqD9*ebn!@4x-~VjAB%F}cRx zFE&Fwi!GzpZnfh%e8pMwSh@Cdm!-Dvt^2&aIp0MQ`vys{N1)y_hI)&!`%a?ndIHPd z3#j`zQ;u^MQSlo%#>=R6N(WoP7jy4xSnlP2LasS`JW%g9T0`B#{4rblt;Bw)K0to~ DWPB;@ literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/TexturedQuad3D.frag.refresh b/Common/Content/Shaders/Compiled/TexturedQuad3D.frag.refresh deleted file mode 100644 index 6f6d42271900c4ec7ed697ff0dc7d99e01cfb225..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1678 zcmZuxTTc@~6rNIAaB;bafQXktUP>fQ1vEy4L<CPj+q+oo)%bwlYkyHlbu{4*bn zzseUAzi+zRj+aSJ&z$dk=eoN+J**#P1kU%Y5ZSS{2_Z6KO1MH2#F-OgKm@S7(Uoew zT8wqGxc$6D|Fl3L4mmSoLX1OGt{OoXO5B3XL1w`tjsm!4kyVHv2pSiTs8qd5tyZZX zcz&T1S6Lb!9EEq(H3UYJS zN0!Z6Paxb4{j^shJhZu&lz(L9Uo#AHvZf|?MLugWA2*)bX})=El)P1V>F0eBw>-3j zEFqq|r_DV{{7yoXOMEA>IRmj}OyfY4&s_G&B*qGuQ@E4Ie76&v81vEQ%si|=1D)n0 ze-<`#5htHEcS7tDa&zB<{>Q~#+}Q^)a%poP#1>#LLQ4o^pCQ3l7rp_%6X~y#rydZ@^;iWeEFWO>$W0K7{x?aA-e(Fpek1 z9^y`neV>5EzW7d%OCNK5Ks=w(V+i}8e-B;qSrPk%=$DYpH%#GQ^jj?zN&5wsuVkd! zL9A6&xG1f=&R5rwIIT|D(9+v{=9yO-v|hu%3|p;O>4INc-*KHAi0j}B(fvqm?Y}l5 z+j}zkhV0DR1SF2SZfGUF#PZ_7Cuh@RLwB7R%)lS?vMq<-E9%;wO__eBrlD9zeP7G^ z$?@sASB}Cs_Kv%~zW#HxQ4k8B9ega;YNz|9;Z*-gQtRt~vRF+aP5ss)7gii>r11AjGoK7c@TUK_Pm2ur73CSW)Bj( zYb!6{PDcHtxzUd0FQzaSW8R9LA; E1N$o^Jpcdz diff --git a/Common/Content/Shaders/Compiled/TexturedQuad3D.frag.spv b/Common/Content/Shaders/Compiled/TexturedQuad3D.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..5d2f91bbf1dd7575a857c0406bae49f7af42191a GIT binary patch literal 888 zcmYk4O-llC5XQ%sT`kL(OwBB_JO56k@{M!1nrse&=gB>YSdPz{p!FAi^nF#?rFrY&e;d zSd*5dMe)EjKwe5+&3;tm2#xa{A=KRY!}qQ?^?dnoHf0CH*4$KF=p_oSFhf;)?dm{dQ ztbaRTz)1x&qk3l1kC&pJIOZqI$m3fs{SSUu#Rg71*Du GFQorugemO+ literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Compiled/TexturedQuadWithMatrix.vert.refresh b/Common/Content/Shaders/Compiled/TexturedQuadWithMatrix.vert.refresh deleted file mode 100644 index e82af5a33c36975ce44bdf62a5f962b30c766da0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2306 zcmZvdZ*Ln#5XLu2-4>U$l+r&y37e*XBZ}pQ6d|gBAT3U%Ag6JNcz1Ho=Wz6LXPwU> z1tIa0w|pf&6>pGue&^fECe22Z-Faqq=9!txX7~I4mSO$eFlJ$X<&rUT=89P~t0ij8 zbu%x-2)kJB-R=H%dr}PB>yJ9PTr~@&CqCEA8|C?eejg6v6b0mp^gyV5ADPAQ}ki=;e4C6csi})zQ@3Q9?r(rT3`VI|w_&FPgxl#7GCM>+G&McF4T~FSt&iGT~2ioE6dg8txaPFfs2ge29Wr;C=enY-bbmA_2zR=9c z11}c%ze4y%HiXjWHzoA=Ygw5E`nU3c*ZUHUTT|FPSzY#trx*@*Jii_Yp|^Y_K3)ylJ9gTuiuS#C#3HYnDQ*KM%&C^+*L==OLJ zzRX6WNmR7L&g$dE<{uJ%^b!?uSY5Z?qb9p=TeIGy`I^l=o@Wf7TleCW*(OCk4GY`f zdA7SBZ06Zy5W=Qa@utyij9e)F>w90uv1At!bc|jb+ztm!$E^zu;f; zS9xRN^K5%6rX%i21cV*)?u`}0tjdZUcCOA>W6fuIb(sC=n-^nhBDOoozQ4})WY#uEClCzpEG@gMW-OHrP_9Tdmkm$V(a94kJwlW zp2wRj|6+ojnVj*9_y!i^;y4%UT?Sjv{#W^5#HX0+(F8BCx5g&e9?h5AV&}YK4P%=3 zUd5}yxVprCD{|g*4WDAx^&asm=Gp+S;jOE#ElxR8Icsm=?O)E?V&@!Za$~YL-yUz_ z)f{IMzaM$ei+zWv#oRU)!q3;wO8}ixQWS&)s$lD`M?>qY-1_rid=_%iZ#x0cP5X2a5LcBe#Qc=XL* z<%7S;7ZcB!?zV$+le>5BnKSomXZLu&evlK8A9*42BWvSAnp^SfOy(O04J!l0wPW)Lf12bYSx35yqW{IJ)w2?a3hyaiD(x%cBnyAp*_jC=+3 z;J|+B1g$8(cppaoIb5LQ2Iu-iFVsOdyc(X#i@V%_FvmP>y>ZbERSdsidOJ~HD^V0T z$*F?Fo>%BV4!~hf%39xmlQ$S=KtAI?fpU_Wzlt@5K67%PGtPW_pYzS~&0(^PyK1H^ z%z6RqF<=t9haG_CRa}Pu9;pawlOKpBTCHSwFFP_%5u3=Ah3~ ze+p{~&ridW%Xmwe)IC_%LcT4Tzl{8I*dUMR@24bU%uk>5p|H0_SjJ-x@*lu57IE_F zb6&(=;oXqOIZ)W|Zy*KOcX+ba87TW>58Gg}?pY{t`mAFC${Of1&qFA4d`1lNm!aek z|DIxxux1?Y?I1JfP3#XUdkxL~LS_D0uhmkqv@fiDBV*ML60PFmS$W-czPXNsw8E&N zH>LMt!@F^Z!S6Qw^QhHIlrH+^^)1)AhPn=}t?tEYWA|Ul~3JFw}Ap}S53X5eQ<4L(BTwRbjT_UV{{5*_z^E$bf-k59cy93_c&*y;B4%^rt` zkoaWpOQlvj-YpNhx+O@hr~iwxDF;O%O#Re5X~b=%hjA{WpebAUdwBen6^DZ!p4+}< z+E23~mikjF{yVMbgPzTs;ES*u?$;_!P8&CakQiQDc>#wqEGV0y+_v{i8H~x8`!Q@K iMeOit+J5}V%qwNtP|5Cnuuh4w!fooLB@9AbyUt&zM=C-9 diff --git a/Common/Content/Shaders/Compiled/TexturedQuadWithMultiplyColor.frag.spv b/Common/Content/Shaders/Compiled/TexturedQuadWithMultiplyColor.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..2b906c696aa2a89ad21ab974150f6d3043222995 GIT binary patch literal 836 zcmYk3UrPc}5XDEgRm<{Ere>CCJ_gc5MGyrgWDoXa(X*t5w6?Mt)CcH`^{ILZI=^+7 z9GIPZ&YU|lch*U^(`E_FTE_NlVMR-dF>$Fd_WFZ<=WRaf933B`$e9xg(c~>{D~kAZ zIC&+pDzC{4(!r~NPL8UYee04dc3JO=;m&n1eD3<5AL#6=_nPAU>*UD~rdOW-_#!Aa z9rB!S-@W-{=6(L(acrH0j2>mh!EieB#(}UK&U82a==y#zLerCmz72rvMjCoz?M0Br z2{~p*PyKy48;EgBXADeF^06MgoM$g_zminwTH$sUcPcuk#5Ltr)nj*H_SMukqeyS~ zvk3DBxQ4#WPY!KXk@|3G!ORa=7T!>7$`kT~2c+=V)`Z@6Dgb}Ih^vkWWI literal 0 HcmV?d00001 diff --git a/Common/Content/Shaders/Source/CalculateSquares.comp b/Common/Content/Shaders/Source/CalculateSquares.comp index 888772a..b8e2180 100644 --- a/Common/Content/Shaders/Source/CalculateSquares.comp +++ b/Common/Content/Shaders/Source/CalculateSquares.comp @@ -1,7 +1,7 @@ #version 450 layout (local_size_x = 8) in; -layout (set = 0, binding = 0) buffer outBuffer +layout (set = 1, binding = 0) buffer outBuffer { uint squares[]; }; diff --git a/Common/Content/Shaders/Source/GradientTexture.comp b/Common/Content/Shaders/Source/GradientTexture.comp index 5541446..bf43ea9 100644 --- a/Common/Content/Shaders/Source/GradientTexture.comp +++ b/Common/Content/Shaders/Source/GradientTexture.comp @@ -1,23 +1,19 @@ #version 450 -#define LOCAL_SIZE 8 - -layout (local_size_x = LOCAL_SIZE, local_size_y = LOCAL_SIZE, local_size_z = 1) in; +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; layout (set = 1, binding = 0, rgba8) uniform writeonly image2D outImage; -layout(set = 2, binding = 0) uniform UBO +layout (set = 2, binding = 0) uniform UBO { - uvec2 workgroupSize; + float time; } ubo; void main() { + vec2 size = imageSize(outImage); vec2 coord = gl_GlobalInvocationID.xy; - vec2 totalWorkgroupSize = vec2(ubo.workgroupSize) * vec2(LOCAL_SIZE); - vec4 col = vec4( - coord.x / totalWorkgroupSize.x, - coord.y / totalWorkgroupSize.y, - 1.0, - 1.0 - ); - imageStore(outImage, ivec2(coord), col); + vec2 uv = coord / size; + + vec3 col = 0.5 + 0.5*cos(ubo.time + uv.xyx + vec3(0, 2, 4)); + + imageStore(outImage, ivec2(coord), vec4(col, 1.0)); } diff --git a/Common/Content/Shaders/Source/PositionColorWithMatrix.vert b/Common/Content/Shaders/Source/PositionColorWithMatrix.vert index 899c06a..3cca094 100644 --- a/Common/Content/Shaders/Source/PositionColorWithMatrix.vert +++ b/Common/Content/Shaders/Source/PositionColorWithMatrix.vert @@ -5,7 +5,7 @@ layout (location = 1) in vec4 Color; layout (location = 0) out vec4 outColor; -layout (binding = 0, set = 2) uniform UniformBlock +layout (set = 1, binding = 0) uniform UniformBlock { mat4x4 MatrixTransform; }; diff --git a/Common/Content/Shaders/Source/PositionSampler.vert b/Common/Content/Shaders/Source/PositionSampler.vert index f0fa89c..ae5c530 100644 --- a/Common/Content/Shaders/Source/PositionSampler.vert +++ b/Common/Content/Shaders/Source/PositionSampler.vert @@ -5,7 +5,7 @@ layout (location = 1) in vec2 TexCoord; layout (location = 0) out vec4 outColor; -layout(binding = 0, set = 0) uniform sampler2D Sampler; +layout(set = 0, binding = 0) uniform sampler2D Sampler; void main() { diff --git a/Common/Content/Shaders/Source/RawTriangle.vert b/Common/Content/Shaders/Source/RawTriangle.vert index fba105d..d1e740e 100644 --- a/Common/Content/Shaders/Source/RawTriangle.vert +++ b/Common/Content/Shaders/Source/RawTriangle.vert @@ -8,17 +8,17 @@ void main() if (gl_VertexIndex == 0) { - pos = vec2(-1, 1); + pos = vec2(-1, -1); outColor = vec4(1, 0, 0, 1); } else if (gl_VertexIndex == 1) { - pos = vec2(1, 1); + pos = vec2(1, -1); outColor = vec4(0, 1, 0, 1); } else if (gl_VertexIndex == 2) { - pos = vec2(0, -1); + pos = vec2(0, 1); outColor = vec4(0, 0, 1, 1); } diff --git a/Common/Content/Shaders/Source/Skybox.frag b/Common/Content/Shaders/Source/Skybox.frag index 905b196..e1d156e 100644 --- a/Common/Content/Shaders/Source/Skybox.frag +++ b/Common/Content/Shaders/Source/Skybox.frag @@ -3,7 +3,7 @@ layout(location = 0) in vec3 TexCoord; layout(location = 0) out vec4 FragColor; -layout(binding = 0, set = 1) uniform samplerCube SkyboxSampler; +layout(set = 2, binding = 0) uniform samplerCube SkyboxSampler; void main() { diff --git a/Common/Content/Shaders/Source/Skybox.vert b/Common/Content/Shaders/Source/Skybox.vert index 9cd3885..8b7d4e9 100644 --- a/Common/Content/Shaders/Source/Skybox.vert +++ b/Common/Content/Shaders/Source/Skybox.vert @@ -3,7 +3,7 @@ layout(location = 0) in vec3 inPos; layout(location = 0) out vec3 vPos; -layout(set = 2, binding = 0) uniform UBO +layout(set = 1, binding = 0) uniform UBO { mat4 ViewProjection; } ubo; diff --git a/Common/Content/Shaders/Source/TexturedDepthQuad.frag b/Common/Content/Shaders/Source/TexturedDepthQuad.frag index 07feffe..fe32863 100644 --- a/Common/Content/Shaders/Source/TexturedDepthQuad.frag +++ b/Common/Content/Shaders/Source/TexturedDepthQuad.frag @@ -1,12 +1,11 @@ #version 450 layout (location = 0) in vec2 TexCoord; - layout (location = 0) out vec4 FragColor; -layout(binding = 0, set = 1) uniform sampler2D Sampler; +layout(set = 2, binding = 0) uniform sampler2D Sampler; -layout (binding = 0, set = 3) uniform UniformBlock +layout (set = 3, binding = 0) uniform UniformBlock { float zNear; float zFar; diff --git a/Common/Content/Shaders/Source/TexturedQuad.frag b/Common/Content/Shaders/Source/TexturedQuad.frag index c4237bd..f0d8a33 100644 --- a/Common/Content/Shaders/Source/TexturedQuad.frag +++ b/Common/Content/Shaders/Source/TexturedQuad.frag @@ -4,7 +4,7 @@ layout (location = 0) in vec2 TexCoord; layout (location = 0) out vec4 FragColor; -layout(binding = 0, set = 1) uniform sampler2D Sampler; +layout(set = 2, binding = 0) uniform sampler2D Sampler; void main() { diff --git a/Common/Content/Shaders/Source/TexturedQuad2DArray.frag b/Common/Content/Shaders/Source/TexturedQuad2DArray.frag index 6390b29..9ae90df 100644 --- a/Common/Content/Shaders/Source/TexturedQuad2DArray.frag +++ b/Common/Content/Shaders/Source/TexturedQuad2DArray.frag @@ -4,9 +4,9 @@ layout (location = 0) in vec2 TexCoord; layout (location = 0) out vec4 FragColor; -layout(binding = 0, set = 1) uniform sampler2DArray Sampler; +layout(set = 2, binding = 0) uniform sampler2DArray Sampler; -layout (binding = 0, set = 3) uniform UniformBlock +layout (set = 3, binding = 0) uniform UniformBlock { float depth; }; diff --git a/Common/Content/Shaders/Source/TexturedQuad3D.frag b/Common/Content/Shaders/Source/TexturedQuad3D.frag index 8a9119e..81ceb12 100644 --- a/Common/Content/Shaders/Source/TexturedQuad3D.frag +++ b/Common/Content/Shaders/Source/TexturedQuad3D.frag @@ -4,9 +4,9 @@ layout (location = 0) in vec2 TexCoord; layout (location = 0) out vec4 FragColor; -layout(binding = 0, set = 1) uniform sampler3D Sampler; +layout(set = 2, binding = 0) uniform sampler3D Sampler; -layout (binding = 0, set = 3) uniform UniformBlock +layout (set = 3, binding = 0) uniform UniformBlock { float depth; }; diff --git a/Common/Content/Shaders/Source/TexturedQuadWithMatrix.vert b/Common/Content/Shaders/Source/TexturedQuadWithMatrix.vert index 080dfb5..0efdb49 100644 --- a/Common/Content/Shaders/Source/TexturedQuadWithMatrix.vert +++ b/Common/Content/Shaders/Source/TexturedQuadWithMatrix.vert @@ -5,7 +5,7 @@ layout (location = 1) in vec2 TexCoord; layout (location = 0) out vec2 outTexCoord; -layout (binding = 0, set = 2) uniform UniformBlock +layout (set = 1, binding = 0) uniform UniformBlock { mat4x4 MatrixTransform; }; diff --git a/Common/Content/Shaders/Source/TexturedQuadWithMultiplyColor.frag b/Common/Content/Shaders/Source/TexturedQuadWithMultiplyColor.frag index 5e0db2e..7d395df 100644 --- a/Common/Content/Shaders/Source/TexturedQuadWithMultiplyColor.frag +++ b/Common/Content/Shaders/Source/TexturedQuadWithMultiplyColor.frag @@ -4,9 +4,9 @@ layout (location = 0) in vec2 TexCoord; layout (location = 0) out vec4 FragColor; -layout(binding = 0, set = 1) uniform sampler2D Sampler; +layout(set = 2, binding = 0) uniform sampler2D Sampler; -layout (binding = 0, set = 3) uniform UniformBlock +layout (set = 3, binding = 0) uniform UniformBlock { vec4 MultiplyColor; }; diff --git a/Common/TestUtils.cs b/Common/TestUtils.cs index bd378e3..f3fd896 100644 --- a/Common/TestUtils.cs +++ b/Common/TestUtils.cs @@ -53,7 +53,7 @@ public static class TestUtils public static string GetShaderPath(string shaderName) { - return SDL2.SDL.SDL_GetBasePath() + "Content/Shaders/Compiled/" + shaderName + ".refresh"; + return SDL2.SDL.SDL_GetBasePath() + "Content/Shaders/Compiled/" + shaderName + ".spv"; } public static string GetTexturePath(string textureName) @@ -73,7 +73,7 @@ public static class TestUtils Right // D/right arrow on keyboard, right face button on gamepad } - public static bool CheckButtonPressed(Input.Inputs inputs, ButtonType buttonType) + public static bool CheckButtonPressed(MoonWorks.Input.Inputs inputs, ButtonType buttonType) { bool pressed = false; @@ -81,28 +81,31 @@ public static class TestUtils { pressed = ( (inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadLeft.IsPressed) || - inputs.Keyboard.IsPressed(Input.KeyCode.Left) + inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.Left) || + inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.A) ); } else if (buttonType == ButtonType.Bottom) { pressed = ( (inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadDown.IsPressed) || - inputs.Keyboard.IsPressed(Input.KeyCode.Down) + inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.Down) || + inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.S) ); } else if (buttonType == ButtonType.Right) { pressed = ( (inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadRight.IsPressed) || - inputs.Keyboard.IsPressed(Input.KeyCode.Right) + inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.Right) || + inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.D) ); } return pressed; } - public static bool CheckButtonDown(Input.Inputs inputs, ButtonType buttonType) + public static bool CheckButtonDown(MoonWorks.Input.Inputs inputs, ButtonType buttonType) { bool down = false; @@ -110,24 +113,24 @@ public static class TestUtils { down = ( (inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadLeft.IsDown) || - inputs.Keyboard.IsDown(Input.KeyCode.A) || - inputs.Keyboard.IsDown(Input.KeyCode.Left) + inputs.Keyboard.IsDown(MoonWorks.Input.KeyCode.Left) || + inputs.Keyboard.IsDown(MoonWorks.Input.KeyCode.A) ); } else if (buttonType == ButtonType.Bottom) { down = ( (inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadDown.IsDown) || - inputs.Keyboard.IsDown(Input.KeyCode.S) || - inputs.Keyboard.IsDown(Input.KeyCode.Down) + inputs.Keyboard.IsDown(MoonWorks.Input.KeyCode.Down) || + inputs.Keyboard.IsDown(MoonWorks.Input.KeyCode.S) ); } else if (buttonType == ButtonType.Right) { down = ( (inputs.GamepadExists(0) && inputs.GetGamepad(0).DpadRight.IsDown) || - inputs.Keyboard.IsDown(Input.KeyCode.D) || - inputs.Keyboard.IsDown(Input.KeyCode.Right) + inputs.Keyboard.IsDown(MoonWorks.Input.KeyCode.Right) || + inputs.Keyboard.IsDown(MoonWorks.Input.KeyCode.D) ); } diff --git a/CopyMoonlibs.targets b/CopyMoonlibs.targets index 98312e8..3694e83 100644 --- a/CopyMoonlibs.targets +++ b/CopyMoonlibs.targets @@ -6,43 +6,43 @@ - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always - + %(RecursiveDir)%(Filename)%(Extension) Always diff --git a/Examples/BasicComputeGame.cs b/Examples/BasicComputeExample.cs similarity index 97% rename from Examples/BasicComputeGame.cs rename to Examples/BasicComputeExample.cs index a4c204b..8c7b6cf 100644 --- a/Examples/BasicComputeGame.cs +++ b/Examples/BasicComputeExample.cs @@ -1,5 +1,6 @@ using MoonWorks; using MoonWorks.Graphics; +using MoonWorks.Input; using MoonWorks.Math.Float; namespace MoonWorksGraphicsTests; @@ -11,7 +12,7 @@ class BasicComputeExample : Example private Sampler Sampler; private GpuBuffer VertexBuffer; - public override void Init(Window window, GraphicsDevice graphicsDevice) + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) { Window = window; GraphicsDevice = graphicsDevice; @@ -73,7 +74,9 @@ class BasicComputeExample : Example fragShaderModule ); drawPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding(); - drawPipelineCreateInfo.FragmentShaderResourceInfo.SamplerCount = 1; + drawPipelineCreateInfo.FragmentShaderResourceInfo = new GraphicsPipelineResourceInfo{ + SamplerCount = 1 + }; DrawPipeline = new GraphicsPipeline( GraphicsDevice, diff --git a/Examples/BasicStencilGame.cs b/Examples/BasicStencilExample.cs similarity index 67% rename from Examples/BasicStencilGame.cs rename to Examples/BasicStencilExample.cs index 0fdbdf0..2b1efd3 100644 --- a/Examples/BasicStencilGame.cs +++ b/Examples/BasicStencilExample.cs @@ -1,21 +1,24 @@ using MoonWorks; using MoonWorks.Graphics; +using MoonWorks.Input; using MoonWorks.Math.Float; namespace MoonWorksGraphicsTests { - class BasicStencilGame : Example + class BasicStencilExample : Example { - private GraphicsPipeline maskerPipeline; - private GraphicsPipeline maskeePipeline; - private GpuBuffer vertexBuffer; - private Texture depthStencilTexture; + private GraphicsPipeline MaskerPipeline; + private GraphicsPipeline MaskeePipeline; + private GpuBuffer VertexBuffer; + private Texture DepthStencilTexture; - public override void Init(Window window, GraphicsDevice graphicsDevice) + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) { Window = window; GraphicsDevice = graphicsDevice; + Window.SetTitle("BasicStencil"); + // Load the shaders Shader vertShaderModule = new Shader( GraphicsDevice, @@ -52,7 +55,7 @@ namespace MoonWorksGraphicsTests Reference = 1, WriteMask = 0xFF }; - maskerPipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); + MaskerPipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); pipelineCreateInfo.DepthStencilState = new DepthStencilState { @@ -65,10 +68,10 @@ namespace MoonWorksGraphicsTests CompareMask = 0xFF, WriteMask = 0 }; - maskeePipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); + MaskeePipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); // Create and populate the GPU resources - depthStencilTexture = Texture.CreateTexture2D( + DepthStencilTexture = Texture.CreateTexture2D( GraphicsDevice, Window.Width, Window.Height, @@ -78,15 +81,15 @@ namespace MoonWorksGraphicsTests var resourceUploader = new ResourceUploader(GraphicsDevice); - vertexBuffer = resourceUploader.CreateBuffer( + VertexBuffer = resourceUploader.CreateBuffer( [ - new PositionColorVertex(new Vector3(-0.5f, 0.5f, 0), Color.Yellow), - new PositionColorVertex(new Vector3(0.5f, 0.5f, 0), Color.Yellow), - new PositionColorVertex(new Vector3(0, -0.5f, 0), Color.Yellow), + new PositionColorVertex(new Vector3(-0.5f, -0.5f, 0), Color.Yellow), + new PositionColorVertex(new Vector3( 0.5f, -0.5f, 0), Color.Yellow), + new PositionColorVertex(new Vector3( 0, 0.5f, 0), Color.Yellow), - new PositionColorVertex(new Vector3(-1, 1, 0), Color.Red), - new PositionColorVertex(new Vector3(1, 1, 0), Color.Lime), - new PositionColorVertex(new Vector3(0, -1, 0), Color.Blue), + new PositionColorVertex(new Vector3(-1, -1, 0), Color.Red), + new PositionColorVertex(new Vector3( 1, -1, 0), Color.Lime), + new PositionColorVertex(new Vector3( 0, 1, 0), Color.Blue), ], BufferUsageFlags.Vertex ); @@ -104,13 +107,13 @@ namespace MoonWorksGraphicsTests if (swapchainTexture != null) { var renderPass = cmdbuf.BeginRenderPass( - new DepthStencilAttachmentInfo(depthStencilTexture, true, new DepthStencilValue(0, 0), StoreOp.DontCare, StoreOp.DontCare), + new DepthStencilAttachmentInfo(DepthStencilTexture, true, new DepthStencilValue(0, 0), StoreOp.DontCare, StoreOp.DontCare), new ColorAttachmentInfo(swapchainTexture, false, Color.Black) ); - renderPass.BindGraphicsPipeline(maskerPipeline); - renderPass.BindVertexBuffer(vertexBuffer); + renderPass.BindGraphicsPipeline(MaskerPipeline); + renderPass.BindVertexBuffer(VertexBuffer); renderPass.DrawPrimitives(0, 1); - renderPass.BindGraphicsPipeline(maskeePipeline); + renderPass.BindGraphicsPipeline(MaskeePipeline); renderPass.DrawPrimitives(3, 1); cmdbuf.EndRenderPass(renderPass); } @@ -119,7 +122,10 @@ namespace MoonWorksGraphicsTests public override void Destroy() { - throw new System.NotImplementedException(); + MaskerPipeline.Dispose(); + MaskeePipeline.Dispose(); + VertexBuffer.Dispose(); + DepthStencilTexture.Dispose(); } } } diff --git a/Examples/BasicTriangleExample.cs b/Examples/BasicTriangleExample.cs new file mode 100644 index 0000000..4516fea --- /dev/null +++ b/Examples/BasicTriangleExample.cs @@ -0,0 +1,111 @@ +using MoonWorks; +using MoonWorks.Graphics; +using MoonWorks.Input; + +namespace MoonWorksGraphicsTests; + +class BasicTriangleExample : Example +{ + private GraphicsPipeline FillPipeline; + private GraphicsPipeline LinePipeline; + + private Viewport SmallViewport = new Viewport(160, 120, 320, 240); + private Rect ScissorRect = new Rect(320, 240, 320, 240); + + private bool UseWireframeMode; + private bool UseSmallViewport; + private bool UseScissorRect; + + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) + { + Window = window; + GraphicsDevice = graphicsDevice; + Inputs = inputs; + + Window.SetTitle("BasicTriangle"); + + Logger.LogInfo("Press Left to toggle wireframe mode\nPress Down to toggle small viewport\nPress Right to toggle scissor rect"); + + Shader vertShaderModule = new Shader( + GraphicsDevice, + TestUtils.GetShaderPath("RawTriangle.vert"), + "main", + ShaderStage.Vertex, + ShaderFormat.SPIRV + ); + + Shader fragShaderModule = new Shader( + GraphicsDevice, + TestUtils.GetShaderPath("SolidColor.frag"), + "main", + ShaderStage.Fragment, + ShaderFormat.SPIRV + ); + + GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + Window.SwapchainFormat, + vertShaderModule, + fragShaderModule + ); + FillPipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); + + pipelineCreateInfo.RasterizerState.FillMode = FillMode.Line; + LinePipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); + } + + public override void Update(System.TimeSpan delta) + { + if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Left)) + { + UseWireframeMode = !UseWireframeMode; + Logger.LogInfo("Using wireframe mode: " + UseWireframeMode); + } + + if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Bottom)) + { + UseSmallViewport = !UseSmallViewport; + Logger.LogInfo("Using small viewport: " + UseSmallViewport); + } + + if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Right)) + { + UseScissorRect = !UseScissorRect; + Logger.LogInfo("Using scissor rect: " + UseScissorRect); + } + } + + public override void Draw(double alpha) + { + CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); + Texture swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window); + if (swapchainTexture != null) + { + var renderPass = cmdbuf.BeginRenderPass( + new ColorAttachmentInfo(swapchainTexture, false, Color.Black) + ); + + renderPass.BindGraphicsPipeline(UseWireframeMode ? LinePipeline : FillPipeline); + + if (UseSmallViewport) + { + renderPass.SetViewport(SmallViewport); + } + if (UseScissorRect) + { + renderPass.SetScissor(ScissorRect); + } + + renderPass.DrawPrimitives(0, 1); + + cmdbuf.EndRenderPass(renderPass); + } + + GraphicsDevice.Submit(cmdbuf); + } + + public override void Destroy() + { + FillPipeline.Dispose(); + LinePipeline.Dispose(); + } +} diff --git a/Examples/BasicTriangleGame.cs b/Examples/BasicTriangleGame.cs deleted file mode 100644 index dfde253..0000000 --- a/Examples/BasicTriangleGame.cs +++ /dev/null @@ -1,86 +0,0 @@ -using MoonWorks.Graphics; - -namespace MoonWorks.Test -{ - class BasicTriangleGame : Game - { - private GraphicsPipeline fillPipeline; - private GraphicsPipeline linePipeline; - - private Viewport smallViewport = new Viewport(160, 120, 320, 240); - private Rect scissorRect = new Rect(320, 240, 320, 240); - - private bool useWireframeMode; - private bool useSmallViewport; - private bool useScissorRect; - - public BasicTriangleGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) - { - Logger.LogInfo("Press Left to toggle wireframe mode\nPress Down to toggle small viewport\nPress Right to toggle scissor rect"); - - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("RawTriangle.vert")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("SolidColor.frag")); - - GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( - MainWindow.SwapchainFormat, - vertShaderModule, - fragShaderModule - ); - fillPipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); - - pipelineCreateInfo.RasterizerState.FillMode = FillMode.Line; - linePipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); - } - - protected override void Update(System.TimeSpan delta) - { - if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Left)) - { - useWireframeMode = !useWireframeMode; - Logger.LogInfo("Using wireframe mode: " + useWireframeMode); - } - - if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Bottom)) - { - useSmallViewport = !useSmallViewport; - Logger.LogInfo("Using small viewport: " + useSmallViewport); - } - - if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Right)) - { - useScissorRect = !useScissorRect; - Logger.LogInfo("Using scissor rect: " + useScissorRect); - } - } - - protected override void Draw(double alpha) - { - CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow); - if (backbuffer != null) - { - cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.Black)); - cmdbuf.BindGraphicsPipeline(useWireframeMode ? linePipeline : fillPipeline); - - if (useSmallViewport) - { - cmdbuf.SetViewport(smallViewport); - } - if (useScissorRect) - { - cmdbuf.SetScissor(scissorRect); - } - - cmdbuf.DrawPrimitives(0, 1); - cmdbuf.EndRenderPass(); - } - GraphicsDevice.Submit(cmdbuf); - } - - public static void Main(string[] args) - { - BasicTriangleGame game = new BasicTriangleGame(); - game.Run(); - } - } -} diff --git a/Examples/ClearScreenExample.cs b/Examples/ClearScreenExample.cs new file mode 100644 index 0000000..a02a3ff --- /dev/null +++ b/Examples/ClearScreenExample.cs @@ -0,0 +1,36 @@ +using MoonWorks; +using MoonWorks.Graphics; +using MoonWorks.Input; + +namespace MoonWorksGraphicsTests; + +class ClearScreenExample : Example +{ + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) + { + Window = window; + GraphicsDevice = graphicsDevice; + + Window.SetTitle("ClearScreen"); + } + + public override void Update(System.TimeSpan delta) { } + + public override void Draw(double alpha) + { + CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); + Texture swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window); + if (swapchainTexture != null) + { + var renderPass = cmdbuf.BeginRenderPass( + new ColorAttachmentInfo(swapchainTexture, false, Color.CornflowerBlue) + ); + cmdbuf.EndRenderPass(renderPass); + } + GraphicsDevice.Submit(cmdbuf); + } + + public override void Destroy() + { + } +} diff --git a/Examples/ClearScreenGame.cs b/Examples/ClearScreenGame.cs deleted file mode 100644 index a523645..0000000 --- a/Examples/ClearScreenGame.cs +++ /dev/null @@ -1,30 +0,0 @@ -using MoonWorks; -using MoonWorks.Graphics; - -namespace MoonWorks.Test -{ - class ClearScreenGame : Game - { - public ClearScreenGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) { } - - protected override void Update(System.TimeSpan delta) { } - - protected override void Draw(double alpha) - { - CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow); - if (backbuffer != null) - { - cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.CornflowerBlue)); - cmdbuf.EndRenderPass(); - } - GraphicsDevice.Submit(cmdbuf); - } - - public static void Main(string[] args) - { - ClearScreenGame game = new ClearScreenGame(); - game.Run(); - } - } -} diff --git a/Examples/ClearScreen_MultiWindowExample.cs b/Examples/ClearScreen_MultiWindowExample.cs new file mode 100644 index 0000000..df9d4d8 --- /dev/null +++ b/Examples/ClearScreen_MultiWindowExample.cs @@ -0,0 +1,71 @@ +using MoonWorks; +using MoonWorks.Graphics; +using MoonWorks.Input; + +namespace MoonWorksGraphicsTests +{ + class ClearScreen_MultiWindowExample : Example + { + private Window SecondaryWindow; + + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) + { + Window = window; + GraphicsDevice = graphicsDevice; + + var (windowX, windowY) = Window.Position; + Window.SetPosition(windowX - 360, windowY); + + SecondaryWindow = new Window( + new WindowCreateInfo("Secondary Window", 640, 480, ScreenMode.Windowed, SwapchainComposition.SDR, PresentMode.VSync, false, false), + SDL2.SDL.SDL_WindowFlags.SDL_WINDOW_VULKAN + ); + (windowX, windowY) = SecondaryWindow.Position; + SecondaryWindow.SetPosition(windowX + 360, windowY); + + GraphicsDevice.ClaimWindow(SecondaryWindow, SwapchainComposition.SDR, PresentMode.VSync); + } + + public override void Update(System.TimeSpan delta) { } + + public override void Draw(double alpha) + { + CommandBuffer cmdbuf; + Texture swapchainTexture; + + if (Window.Claimed) + { + cmdbuf = GraphicsDevice.AcquireCommandBuffer(); + swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window); + if (swapchainTexture != null) + { + var renderPass = cmdbuf.BeginRenderPass( + new ColorAttachmentInfo(swapchainTexture, false, Color.CornflowerBlue) + ); + cmdbuf.EndRenderPass(renderPass); + } + GraphicsDevice.Submit(cmdbuf); + } + + if (SecondaryWindow.Claimed) + { + cmdbuf = GraphicsDevice.AcquireCommandBuffer(); + swapchainTexture = cmdbuf.AcquireSwapchainTexture(SecondaryWindow); + if (swapchainTexture != null) + { + var renderPass = cmdbuf.BeginRenderPass( + new ColorAttachmentInfo(swapchainTexture, false, Color.Aquamarine) + ); + cmdbuf.EndRenderPass(renderPass); + } + GraphicsDevice.Submit(cmdbuf); + } + } + + public override void Destroy() + { + GraphicsDevice.UnclaimWindow(SecondaryWindow); + SecondaryWindow.Dispose(); + } + } +} diff --git a/Examples/ClearScreen_MultiWindowGame.cs b/Examples/ClearScreen_MultiWindowGame.cs deleted file mode 100644 index 70e8efe..0000000 --- a/Examples/ClearScreen_MultiWindowGame.cs +++ /dev/null @@ -1,62 +0,0 @@ -using MoonWorks; -using MoonWorks.Graphics; - -namespace MoonWorks.Test -{ - class ClearScreen_MultiWindowGame : Game - { - private Window secondaryWindow; - - public ClearScreen_MultiWindowGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) - { - var (windowX, windowY) = MainWindow.Position; - MainWindow.SetPosition(windowX - 360, windowY); - - secondaryWindow = new Window( - new WindowCreateInfo("Secondary Window", 640, 480, ScreenMode.Windowed, PresentMode.FIFO, false, false), - GraphicsDevice.WindowFlags - ); - (windowX, windowY) = secondaryWindow.Position; - secondaryWindow.SetPosition(windowX + 360, windowY); - GraphicsDevice.ClaimWindow(secondaryWindow, PresentMode.FIFO); - } - - protected override void Update(System.TimeSpan delta) { } - - protected override void Draw(double alpha) - { - CommandBuffer cmdbuf; - Texture? backbuffer; - - if (MainWindow.Claimed) - { - cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow); - if (backbuffer != null) - { - cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.CornflowerBlue)); - cmdbuf.EndRenderPass(); - } - GraphicsDevice.Submit(cmdbuf); - } - - if (secondaryWindow.Claimed) - { - cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - backbuffer = cmdbuf.AcquireSwapchainTexture(secondaryWindow); - if (backbuffer != null) - { - cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.Aquamarine)); - cmdbuf.EndRenderPass(); - } - GraphicsDevice.Submit(cmdbuf); - } - } - - public static void Main(string[] args) - { - ClearScreen_MultiWindowGame game = new ClearScreen_MultiWindowGame(); - game.Run(); - } - } -} diff --git a/Examples/CompressedTexturesExample.cs b/Examples/CompressedTexturesExample.cs new file mode 100644 index 0000000..e2b9aee --- /dev/null +++ b/Examples/CompressedTexturesExample.cs @@ -0,0 +1,160 @@ +using MoonWorks; +using MoonWorks.Graphics; +using MoonWorks.Input; +using MoonWorks.Math.Float; + +namespace MoonWorksGraphicsTests; + +class CompressedTexturesExample : Example +{ + private GraphicsPipeline Pipeline; + private GpuBuffer VertexBuffer; + private GpuBuffer IndexBuffer; + private Sampler Sampler; + private Texture[] Textures; + private string[] TextureNames = + [ + "BC1", + "BC2", + "BC3", + "BC7" + ]; + + private int CurrentTextureIndex; + + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) + { + Window = window; + GraphicsDevice = graphicsDevice; + Inputs = inputs; + + Logger.LogInfo("Press Left and Right to cycle between textures"); + Logger.LogInfo("Setting texture to: " + TextureNames[0]); + + // Load the shaders + Shader vertShaderModule = new Shader( + GraphicsDevice, + TestUtils.GetShaderPath("TexturedQuad.vert"), + "main", + ShaderStage.Vertex, + ShaderFormat.SPIRV + ); + + Shader fragShaderModule = new Shader( + GraphicsDevice, + TestUtils.GetShaderPath("TexturedQuad.frag"), + "main", + ShaderStage.Fragment, + ShaderFormat.SPIRV + ); + + // Create the graphics pipeline + GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( + Window.SwapchainFormat, + vertShaderModule, + fragShaderModule + ); + pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding(); + pipelineCreateInfo.FragmentShaderResourceInfo = new GraphicsPipelineResourceInfo + { + SamplerCount = 1 + }; + Pipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); + + // Create sampler + Sampler = new Sampler(GraphicsDevice, SamplerCreateInfo.LinearWrap); + + // Create texture array + Textures = new Texture[TextureNames.Length]; + + // Create and populate the GPU resources + var resourceUploader = new ResourceUploader(GraphicsDevice); + + VertexBuffer = resourceUploader.CreateBuffer( + [ + new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)), + new PositionTextureVertex(new Vector3(1, -1, 0), new Vector2(1, 0)), + new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)), + new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 1)) + ], + BufferUsageFlags.Vertex + ); + + IndexBuffer = resourceUploader.CreateBuffer( + [ + 0, 1, 2, + 0, 2, 3, + ], + BufferUsageFlags.Index + ); + + for (int i = 0; i < TextureNames.Length; i += 1) + { + Logger.LogInfo(TextureNames[i]); + Textures[i] = resourceUploader.CreateTextureFromDDS(TestUtils.GetTexturePath(TextureNames[i] + ".dds")); + } + + resourceUploader.Upload(); + resourceUploader.Dispose(); + } + + public override void Update(System.TimeSpan delta) + { + int prevSamplerIndex = CurrentTextureIndex; + + if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Left)) + { + CurrentTextureIndex -= 1; + if (CurrentTextureIndex < 0) + { + CurrentTextureIndex = TextureNames.Length - 1; + } + } + + if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Right)) + { + CurrentTextureIndex += 1; + if (CurrentTextureIndex >= TextureNames.Length) + { + CurrentTextureIndex = 0; + } + } + + if (prevSamplerIndex != CurrentTextureIndex) + { + Logger.LogInfo("Setting texture to: " + TextureNames[CurrentTextureIndex]); + } + } + + public override void Draw(double alpha) + { + CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); + Texture swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window); + if (swapchainTexture != null) + { + var renderPass = cmdbuf.BeginRenderPass( + new ColorAttachmentInfo(swapchainTexture, false, Color.Black) + ); + renderPass.BindGraphicsPipeline(Pipeline); + renderPass.BindVertexBuffer(VertexBuffer); + renderPass.BindIndexBuffer(IndexBuffer, IndexElementSize.Sixteen); + renderPass.BindFragmentSampler(new TextureSamplerBinding(Textures[CurrentTextureIndex], Sampler)); + renderPass.DrawIndexedPrimitives(0, 0, 2); + cmdbuf.EndRenderPass(renderPass); + } + GraphicsDevice.Submit(cmdbuf); + } + + public override void Destroy() + { + Pipeline.Dispose(); + VertexBuffer.Dispose(); + IndexBuffer.Dispose(); + Sampler.Dispose(); + + for (int i = 0; i < TextureNames.Length; i += 1) + { + Textures[i].Dispose(); + } + } +} diff --git a/Examples/CompressedTexturesGame.cs b/Examples/CompressedTexturesGame.cs deleted file mode 100644 index 729ccb6..0000000 --- a/Examples/CompressedTexturesGame.cs +++ /dev/null @@ -1,131 +0,0 @@ -using MoonWorks.Graphics; -using MoonWorks.Math.Float; -using System.IO; - -namespace MoonWorks.Test -{ - class CompressedTexturesGame : Game - { - private GraphicsPipeline pipeline; - private GpuBuffer vertexBuffer; - private GpuBuffer indexBuffer; - private Sampler sampler; - private Texture[] textures; - private string[] textureNames = new string[] - { - "BC1", - "BC2", - "BC3", - "BC7" - }; - - private int currentTextureIndex; - - public CompressedTexturesGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) - { - Logger.LogInfo("Press Left and Right to cycle between textures"); - Logger.LogInfo("Setting texture to: " + textureNames[0]); - - // Load the shaders - ShaderModule vertShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.vert")); - ShaderModule fragShaderModule = new ShaderModule(GraphicsDevice, TestUtils.GetShaderPath("TexturedQuad.frag")); - - // Create the graphics pipeline - GraphicsPipelineCreateInfo pipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( - MainWindow.SwapchainFormat, - vertShaderModule, - fragShaderModule - ); - pipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding(); - pipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1; - pipeline = new GraphicsPipeline(GraphicsDevice, pipelineCreateInfo); - - // Create sampler - sampler = new Sampler(GraphicsDevice, SamplerCreateInfo.LinearWrap); - - // Create texture array - textures = new Texture[textureNames.Length]; - - // Create and populate the GPU resources - var resourceUploader = new ResourceUploader(GraphicsDevice); - - vertexBuffer = resourceUploader.CreateBuffer( - [ - new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)), - new PositionTextureVertex(new Vector3(1, -1, 0), new Vector2(1, 0)), - new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)), - new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 1)) - ], - BufferUsageFlags.Vertex - ); - - indexBuffer = resourceUploader.CreateBuffer( - [ - 0, 1, 2, - 0, 2, 3, - ], - BufferUsageFlags.Index - ); - - for (int i = 0; i < textureNames.Length; i += 1) - { - Logger.LogInfo(textureNames[i]); - textures[i] = resourceUploader.CreateTextureFromDDS(TestUtils.GetTexturePath(textureNames[i] + ".dds")); - } - - resourceUploader.Upload(); - resourceUploader.Dispose(); - } - - protected override void Update(System.TimeSpan delta) - { - int prevSamplerIndex = currentTextureIndex; - - if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Left)) - { - currentTextureIndex -= 1; - if (currentTextureIndex < 0) - { - currentTextureIndex = textureNames.Length - 1; - } - } - - if (TestUtils.CheckButtonPressed(Inputs, TestUtils.ButtonType.Right)) - { - currentTextureIndex += 1; - if (currentTextureIndex >= textureNames.Length) - { - currentTextureIndex = 0; - } - } - - if (prevSamplerIndex != currentTextureIndex) - { - Logger.LogInfo("Setting texture to: " + textureNames[currentTextureIndex]); - } - } - - protected override void Draw(double alpha) - { - CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow); - if (backbuffer != null) - { - cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.Black)); - cmdbuf.BindGraphicsPipeline(pipeline); - cmdbuf.BindVertexBuffers(vertexBuffer); - cmdbuf.BindIndexBuffer(indexBuffer, IndexElementSize.Sixteen); - cmdbuf.BindFragmentSamplers(new TextureSamplerBinding(textures[currentTextureIndex], sampler)); - cmdbuf.DrawIndexedPrimitives(0, 0, 2); - cmdbuf.EndRenderPass(); - } - GraphicsDevice.Submit(cmdbuf); - } - - public static void Main(string[] args) - { - CompressedTexturesGame game = new CompressedTexturesGame(); - game.Run(); - } - } -} diff --git a/Examples/ComputeUniformsExample.cs b/Examples/ComputeUniformsExample.cs new file mode 100644 index 0000000..41edab6 --- /dev/null +++ b/Examples/ComputeUniformsExample.cs @@ -0,0 +1,84 @@ +using MoonWorks; +using MoonWorks.Graphics; +using MoonWorks.Input; + +namespace MoonWorksGraphicsTests; + +class ComputeUniformsExample : Example +{ + private ComputePipeline GradientPipeline; + private Texture RenderTexture; + + record struct GradientTextureComputeUniforms(float Time); + private GradientTextureComputeUniforms Uniforms; + + public override void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs) + { + Window = window; + GraphicsDevice = graphicsDevice; + + Window.SetTitle("ComputeUniforms"); + Uniforms.Time = 0; + + // Create the compute pipeline that writes texture data + Shader gradientTextureComputeShader = new Shader( + GraphicsDevice, + TestUtils.GetShaderPath("GradientTexture.comp"), + "main", + ShaderStage.Compute, + ShaderFormat.SPIRV + ); + + GradientPipeline = new ComputePipeline( + GraphicsDevice, + gradientTextureComputeShader, + new ComputePipelineResourceInfo { + ReadWriteStorageTextureCount = 1, + UniformBufferCount = 1 + } + ); + + gradientTextureComputeShader.Dispose(); + + RenderTexture = Texture.CreateTexture2D( + GraphicsDevice, + Window.Width, + Window.Height, + TextureFormat.R8G8B8A8, + TextureUsageFlags.ComputeStorageWrite | TextureUsageFlags.Sampler + ); + } + + public override void Update(System.TimeSpan delta) + { + Uniforms.Time += (float) delta.TotalSeconds; + } + + public override void Draw(double alpha) + { + CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); + Texture swapchainTexture = cmdbuf.AcquireSwapchainTexture(Window); + if (swapchainTexture != null) + { + var computePass = cmdbuf.BeginComputePass(new StorageTextureReadWriteBinding + { + TextureSlice = RenderTexture, + Cycle = true + }); + + computePass.BindComputePipeline(GradientPipeline); + computePass.PushUniformData(Uniforms); + computePass.Dispatch(RenderTexture.Width / 8, RenderTexture.Height / 8, 1); + cmdbuf.EndComputePass(computePass); + + cmdbuf.Blit(RenderTexture, swapchainTexture, Filter.Linear, false); + } + GraphicsDevice.Submit(cmdbuf); + } + + public override void Destroy() + { + GradientPipeline.Dispose(); + RenderTexture.Dispose(); + } +} diff --git a/Examples/ComputeUniformsGame.cs b/Examples/ComputeUniformsGame.cs deleted file mode 100644 index 9841b3a..0000000 --- a/Examples/ComputeUniformsGame.cs +++ /dev/null @@ -1,132 +0,0 @@ -using MoonWorks; -using MoonWorks.Graphics; -using MoonWorks.Math.Float; - -namespace MoonWorks.Test -{ - class ComputeUniformsGame : Game - { - private GraphicsPipeline drawPipeline; - private Texture texture; - private Sampler sampler; - private GpuBuffer vertexBuffer; - - struct GradientTextureComputeUniforms - { - public uint groupCountX; - public uint groupCountY; - - public GradientTextureComputeUniforms(uint w, uint h) - { - groupCountX = w; - groupCountY = h; - } - } - - public ComputeUniformsGame() : base(TestUtils.GetStandardWindowCreateInfo(), TestUtils.GetStandardFrameLimiterSettings(), TestUtils.PreferredBackends, 60, true) - { - // Create the compute pipeline that writes texture data - ShaderModule gradientTextureComputeShaderModule = new ShaderModule( - GraphicsDevice, - TestUtils.GetShaderPath("GradientTexture.comp") - ); - - ComputePipeline gradientTextureComputePipeline = new ComputePipeline( - GraphicsDevice, - ComputeShaderInfo.Create(gradientTextureComputeShaderModule, "main", 0, 1) - ); - - // Create the graphics pipeline - ShaderModule vertShaderModule = new ShaderModule( - GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuad.vert") - ); - - ShaderModule fragShaderModule = new ShaderModule( - GraphicsDevice, - TestUtils.GetShaderPath("TexturedQuad.frag") - ); - - GraphicsPipelineCreateInfo drawPipelineCreateInfo = TestUtils.GetStandardGraphicsPipelineCreateInfo( - MainWindow.SwapchainFormat, - vertShaderModule, - fragShaderModule - ); - drawPipelineCreateInfo.VertexInputState = VertexInputState.CreateSingleBinding(); - drawPipelineCreateInfo.FragmentShaderInfo.SamplerBindingCount = 1; - - drawPipeline = new GraphicsPipeline( - GraphicsDevice, - drawPipelineCreateInfo - ); - - texture = Texture.CreateTexture2D( - GraphicsDevice, - MainWindow.Width, - MainWindow.Height, - TextureFormat.R8G8B8A8, - TextureUsageFlags.Compute | TextureUsageFlags.Sampler - ); - - sampler = new Sampler(GraphicsDevice, new SamplerCreateInfo()); - - // Upload GPU resources and dispatch compute work - - var resourceUploader = new ResourceUploader(GraphicsDevice); - - vertexBuffer = resourceUploader.CreateBuffer( - [ - new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)), - new PositionTextureVertex(new Vector3(1, -1, 0), new Vector2(1, 0)), - new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)), - new PositionTextureVertex(new Vector3(-1, -1, 0), new Vector2(0, 0)), - new PositionTextureVertex(new Vector3(1, 1, 0), new Vector2(1, 1)), - new PositionTextureVertex(new Vector3(-1, 1, 0), new Vector2(0, 1)), - ], - BufferUsageFlags.Vertex - ); - - resourceUploader.Upload(); - resourceUploader.Dispose(); - CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - - GradientTextureComputeUniforms gradientUniforms = new GradientTextureComputeUniforms( - texture.Width / 8, - texture.Height / 8 - ); - - cmdbuf.BeginComputePass(); - cmdbuf.BindComputePipeline(gradientTextureComputePipeline); - cmdbuf.BindComputeTextures(new ComputeTextureBinding(texture, 0)); - cmdbuf.PushComputeShaderUniforms(gradientUniforms); - cmdbuf.DispatchCompute(gradientUniforms.groupCountX, gradientUniforms.groupCountY, 1); - cmdbuf.EndComputePass(); - - GraphicsDevice.Submit(cmdbuf); - } - - protected override void Update(System.TimeSpan delta) { } - - protected override void Draw(double alpha) - { - CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); - Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow); - if (backbuffer != null) - { - cmdbuf.BeginRenderPass(new ColorAttachmentInfo(backbuffer, WriteOptions.Cycle, Color.CornflowerBlue)); - cmdbuf.BindGraphicsPipeline(drawPipeline); - cmdbuf.BindFragmentSamplers(new TextureSamplerBinding(texture, sampler)); - cmdbuf.BindVertexBuffers(vertexBuffer); - cmdbuf.DrawPrimitives(0, 2); - cmdbuf.EndRenderPass(); - } - GraphicsDevice.Submit(cmdbuf); - } - - public static void Main(string[] args) - { - ComputeUniformsGame game = new ComputeUniformsGame(); - game.Run(); - } - } -} diff --git a/Examples/CopyTextureGame.cs b/Examples/CopyTextureGame.cs index 1c943e9..8f5a35a 100644 --- a/Examples/CopyTextureGame.cs +++ b/Examples/CopyTextureGame.cs @@ -2,7 +2,7 @@ using MoonWorks.Graphics; using MoonWorks.Math.Float; -namespace MoonWorks.Test +namespace MoonWorksGraphicsTests { class CopyTextureGame : Game { diff --git a/Examples/Example.cs b/Examples/Example.cs index 885a2e0..2539340 100644 --- a/Examples/Example.cs +++ b/Examples/Example.cs @@ -1,15 +1,17 @@ using System; using MoonWorks; using MoonWorks.Graphics; +using MoonWorks.Input; namespace MoonWorksGraphicsTests; public abstract class Example { protected Window Window; - protected GraphicsDevice GraphicsDevice; + public GraphicsDevice GraphicsDevice; + public Inputs Inputs; - public abstract void Init(Window window, GraphicsDevice graphicsDevice); + public abstract void Init(Window window, GraphicsDevice graphicsDevice, Inputs inputs); public abstract void Update(TimeSpan delta); public abstract void Draw(double alpha); public abstract void Destroy(); diff --git a/MoonWorksGraphicsTests.csproj b/MoonWorksGraphicsTests.csproj index cd114f5..272ad80 100644 --- a/MoonWorksGraphicsTests.csproj +++ b/MoonWorksGraphicsTests.csproj @@ -1,12 +1,13 @@ + Exe net8.0 true - + Content\%(RecursiveDir)%(Filename)%(Extension) Always @@ -16,6 +17,22 @@ + + + $(DefaultItemExcludes);Examples\**\* + + + + + + + + + + + + + diff --git a/Program.cs b/Program.cs index a264907..00d6fb0 100644 --- a/Program.cs +++ b/Program.cs @@ -1,7 +1,6 @@ using System; using MoonWorks; using MoonWorks.Graphics; -using MoonWorks.Test; namespace MoonWorksGraphicsTests; @@ -9,8 +8,13 @@ class Program : Game { Example[] Examples = [ + new ClearScreenExample(), + new ClearScreen_MultiWindowExample(), + new BasicStencilExample(), + new BasicTriangleExample(), + new CompressedTexturesExample(), new BasicComputeExample(), - new BasicStencilGame() + new ComputeUniformsExample() ]; int ExampleIndex = 0; @@ -23,11 +27,12 @@ class Program : Game bool debugMode = false ) : base(windowCreateInfo, frameLimiterSettings, preferredBackends, targetTimestep, debugMode) { + Examples[ExampleIndex].Init(MainWindow, GraphicsDevice, Inputs); } protected override void Update(TimeSpan delta) { - if (Inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.A)) + if (Inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.Q)) { Examples[ExampleIndex].Destroy(); @@ -37,15 +42,15 @@ class Program : Game ExampleIndex = Examples.Length - 1; } - Examples[ExampleIndex].Init(MainWindow, GraphicsDevice); + Examples[ExampleIndex].Init(MainWindow, GraphicsDevice, Inputs); } - else if (Inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.D)) + else if (Inputs.Keyboard.IsPressed(MoonWorks.Input.KeyCode.E)) { Examples[ExampleIndex].Destroy(); ExampleIndex = (ExampleIndex + 1) % Examples.Length; - Examples[ExampleIndex].Init(MainWindow, GraphicsDevice); + Examples[ExampleIndex].Init(MainWindow, GraphicsDevice, Inputs); } else { @@ -68,8 +73,8 @@ class Program : Game var windowCreateInfo = new WindowCreateInfo( "MoonWorksGraphicsTests", - 1280, - 720, + 640, + 480, ScreenMode.Windowed, SwapchainComposition.SDR, PresentMode.VSync