From ae3ee344b322d7d1adf511a3d1eae02c578266ea Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Mon, 6 Apr 2020 22:12:13 -0230 Subject: [PATCH] wip --- examples/shadow/bake.frag.spv | Bin 0 -> 180 bytes examples/shadow/bake.vert.spv | Bin 0 -> 1312 bytes examples/shadow/forward.frag.spv | Bin 0 -> 4612 bytes examples/shadow/forward.vert.spv | Bin 0 -> 1948 bytes examples/shadow/main.rs | 30 ++++++++++++------------------ 5 files changed, 12 insertions(+), 18 deletions(-) create mode 100644 examples/shadow/bake.frag.spv create mode 100644 examples/shadow/bake.vert.spv create mode 100644 examples/shadow/forward.frag.spv create mode 100644 examples/shadow/forward.vert.spv diff --git a/examples/shadow/bake.frag.spv b/examples/shadow/bake.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..dbd293829162151b6ac404866890ba941bf278c9 GIT binary patch literal 180 zcmZQ(Qf6mhU}Rut;9y{5fB-=TCZGrd12<3vM7#S0`{)&yr0AKL8h}*rF))KDupB=F zD+3FV4Z^vJnRy^_0iZmH4>TCaVg{PVz;Fm?5J)AmI$@v;NKO%~iUG_v1F8avfz*Kj S$fh4a5mq4m7igme5CZ_i&0=pd zq1_PWtW&96M!$@+LjO8?A8qs3!v2BSfw9c#(0i5Kr+jppR_AF|r{4)dXSlw(a+1|q zS%CH$zB3y9^CW{4B2>HU$xDcChb?I;(%UN2iI+O-Jv`D!*7@?mZnHm3dh;J#I@v z?BT7(J{5Zm;$4(zBW4dVZNz-DnD2|2zL@tOlF^rUJbxoDQ)YbMtQ^ct(<5Sj*&C=m z#OyJohwtARhon*PA(4j&qIUTx0LpN0m*g ztQ*k7d+2ZDb+HM$1K-)k-f4^fE7$~89?jz`_|DrSzKWGE*2nX%v4=S|fp-n-O!F`1 zvA;7h=d589)V|I!UPqN(VsCC=_v%yS?ZxbU6YE>V>}~A#5Ho*k?#u5Jd%xJv{O&w2 zZoRR0wBDQC!@7^N<$F)}6qj%8oyE-it$dgJKI0qO$67`FFNnW`H~e?EE!2H|?@O5O zwvCEM&K-PrTISp(7XM8jYxYp<#O>pL3F>YovHJ|r1pP&g@jhyuxU<~-0qVDL)+;tP LmiLbrK1crphS^Qc literal 0 HcmV?d00001 diff --git a/examples/shadow/forward.frag.spv b/examples/shadow/forward.frag.spv new file mode 100644 index 0000000000000000000000000000000000000000..bc571bb9bcf4478d82df32a94a8ad2ad9b28cdd0 GIT binary patch literal 4612 zcmZ9O`*T&*6~_-IH&8$X1yqVL5g%9)wFMCo!4VT;d|fWd4Y~FvC(XS9-x42) z+A3P#wbl42#oEsF_s(?2pY`AIHKXI_bM9XDkUjHdt@T}xz4qGs+|YH-n)z8aFPon& z$o`#m*0Sszm@HeA^%Qc~;NHRYt@gQ=^i(LF+88JKG62 zkxz}2R^)l6qt)Gs>GXdWTy6Ytqdw6lraRk>J)Af5DP)DS4j~(b-ksfx+||qv*P1P+ z+Edt2*>v?lqke2?Dt{>ZiFdBk)!ozMgC4e3)Vkkbmivq$3m38nM%y)6RFUh%SZ6YK zzfO#^|9^ko8C!PdiL~zTk>$GDu5w+ua$W7Yb$tY>_2Nv$qkx;P2HTm>B%I5=pFnnQ zUAt1epQF{GywzwoatavpEHRU{soHqTIdPU<$xdQ7i}x|o=-fefb_#B!F*-Wksuy)< zvGeM_+SHMH8?~r=8hOV=yU~86Gf!>TboHKmsyR~3Pp)$>w--0;{hleJxL11fU0pWE z?#FgE`h8<%zqWqAB>ldxUf>$Q_Pw|&V1R$aUQ@7VbADS(OL6vT+;*^w9n6hBd`IOz zwC%&?zH#TVZ`kF1gDdYVSKim2<=od?zXi|f-SvP&z?gU&QQv;$qF>)gxnFJjbua79 zAe~#-v&lvj=ZU+F^MoDy*+X#U^T=7#xb48c~C>ub@}Y z-3QF+!*)L*zmmuW1)pUX;`HF%2VB=Adl|YtSmS)8 z@#g7Qt^ls(bh#24{HlUIzRg}PK{wWOguf4+wJq%aj{U!N^k%%X=>zh{*xNc_jf*+O zMx-_8m4I5D_e$`#6YnCfdFH z>o;nQynWnn#Z}o|iZTzz(+xed;+3tU`WSf5~*<0yv2l}tU z09c&f?Vae(&Rl)Baw^XtuWtXo?a1GQE~n44Xsde;-}<-A_EN*^ISk zc`ns{3*8v`nBCjx&d&ReS-gWTAG3HDT~4@S7B8n+`~}V!>&H3YL-)I%Nily#mowJh z^~w32???LWD9!Id{tfs(j+3wbe&W1i^YzJ+zRB^>~k^F z!*98uy-`v~K&6VE{yni|0>W^Zecl-bV literal 0 HcmV?d00001 diff --git a/examples/shadow/forward.vert.spv b/examples/shadow/forward.vert.spv new file mode 100644 index 0000000000000000000000000000000000000000..9bd02dfae3d0d07909d3d1c8ba557d06fb346247 GIT binary patch literal 1948 zcmZ9MX-^YT6oxO|Kv5Bq#jQ@MJ6bnDlxQSq%7+GPNbuvNN`qsj9W$Nc@-O^L{wlwi z_&zgpO64|Z&N=Tr+kNkaVxd0i+=QESQ*P5`Yt|KnI5+JoscyFRT8%++&{$o2M8r8) zOaqCTai>$eq;Ibi^l?r}s*;x44Xm^0FE z`$>@eaGIp-@L5CuLllPxBaAtQ{&o~bv7(BaFI&`Qj?RB|%jsN4emfcjNf2pb=3&kb zm~>f{A4(sFe!Cm*cjKh{U9Qj!$7at8RKyug{nn17FWG$H86UgDUMo2KoD7s- zbZcp}YN(do573T$s8NlGyFl;d19k z^Mc`5_2qsHquyEh^aZCLKKBMTFMmeblT1ifa-aKWkv}U1f$LF1}Z~43vYBKMAX-~ppUi=4=tY^tJWWx_wRTgi+ zIAafCPX5u+gMIqoXaC1Co}b94w(-iH!vQ$?tJ3fSPCh<&54Ntij3$>wpFcu)dt3U# z=>-Y*0M{=SN$oia_yf@vm_fFVV%smB#a#D zSk7hH;0Vid+TxTqa7Dr_)FzfQaOa+c`=${)@peo0N#1S?1GgFO%I3|`10L^5!03U$A|VHy9=ta&>#;7IyBxopXY#@6L5&Rw cc~(); - let temp_buf_data = device.create_buffer_mapped(&wgpu::BufferDescriptor { + let mut temp_buf_data = device.create_buffer_mapped(&wgpu::BufferDescriptor { size: (self.entities.len() * size) as u64, usage: wgpu::BufferUsage::COPY_SRC, label: None, @@ -716,7 +710,7 @@ impl framework::Example for Example { for (entity, slot) in self .entities .iter_mut() - .zip(temp_buf_data.data.chunks_exact_mut(size)) + .zip(temp_buf_data.data().chunks_exact_mut(size)) { if entity.rotation_speed != 0.0 { let rotation = @@ -754,7 +748,7 @@ impl framework::Example for Example { self.lights_are_dirty = false; let size = mem::size_of::(); let total_size = size * self.lights.len(); - let temp_buf_data = device.create_buffer_mapped(&wgpu::BufferDescriptor { + let mut temp_buf_data = device.create_buffer_mapped(&wgpu::BufferDescriptor { size: total_size as u64, usage: wgpu::BufferUsage::COPY_SRC, label: None @@ -763,7 +757,7 @@ impl framework::Example for Example { for (light, slot) in self .lights .iter() - .zip(temp_buf_data.data.chunks_exact_mut(size)) + .zip(temp_buf_data.data().chunks_exact_mut(size)) { slot.copy_from_slice(light.to_raw().as_bytes()); }