Update glam and re-export glam from spirv_std (#220)

This commit is contained in:
XAMPPRocky 2020-11-11 09:13:37 +01:00 committed by GitHub
parent bfa0f50f9b
commit c2ccdbe6ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 87 additions and 91 deletions

154
Cargo.lock generated
View File

@ -8,9 +8,9 @@ checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff"
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.14" version = "0.7.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b476ce7103678b0c6d3d395dbbae31d48ff910bd28be979ba5d48c6351131d0d" checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@ -63,8 +63,9 @@ dependencies = [
[[package]] [[package]]
name = "ash-molten" name = "ash-molten"
version = "0.6.0+43" version = "0.7.1+1.1.0"
source = "git+https://github.com/EmbarkStudios/ash-molten?branch=moltenvk-1.1.0#9b3010469c46e59b1ded6cb81873e80c4fe7c2f6" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7556e4ed2a803184f745f6bdf632de0408c88c796d60249a67033c2b48a1c586"
dependencies = [ dependencies = [
"ash", "ash",
] ]
@ -105,9 +106,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]] [[package]]
name = "bimap" name = "bimap"
version = "0.5.2" version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43806ad6cd3dec8ef84ac19f35a7b0075aee8c8a913ffc3a09191e6d7131e781" checksum = "3528c4b6f81eb2aadd3504da4ddc5bf5caec1b4aaf0d9dccfb8aaf2850f5b39c"
[[package]] [[package]]
name = "bit-set" name = "bit-set"
@ -160,9 +161,9 @@ dependencies = [
[[package]] [[package]]
name = "cc" name = "cc"
version = "1.0.61" version = "1.0.62"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed67cbde08356238e75fc4656be4749481eeffb09e19f320a25237d5221c985d" checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40"
dependencies = [ dependencies = [
"jobserver", "jobserver",
] ]
@ -300,9 +301,9 @@ dependencies = [
[[package]] [[package]]
name = "const_fn" name = "const_fn"
version = "0.4.2" version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab"
[[package]] [[package]]
name = "copyless" name = "copyless"
@ -570,10 +571,10 @@ dependencies = [
name = "example-runner-cpu" name = "example-runner-cpu"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"glam",
"minifb", "minifb",
"rayon", "rayon",
"sky-shader", "sky-shader",
"spirv-std",
] ]
[[package]] [[package]]
@ -604,11 +605,11 @@ dependencies = [
[[package]] [[package]]
name = "filetime" name = "filetime"
version = "0.2.12" version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e" checksum = "0c122a393ea57648015bf06fbd3d372378992e86b9ff5a7a497b076a28c79efe"
dependencies = [ dependencies = [
"cfg-if 0.1.10", "cfg-if 1.0.0",
"libc", "libc",
"redox_syscall", "redox_syscall",
"winapi 0.3.9", "winapi 0.3.9",
@ -659,9 +660,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
[[package]] [[package]]
name = "futures" name = "futures"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95314d38584ffbfda215621d723e0a3906f032e03ae5551e650058dac83d4797" checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@ -674,9 +675,9 @@ dependencies = [
[[package]] [[package]]
name = "futures-channel" name = "futures-channel"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0448174b01148032eed37ac4aed28963aaaa8cfa93569a08e5b479bbc6c2c151" checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-sink", "futures-sink",
@ -684,15 +685,15 @@ dependencies = [
[[package]] [[package]]
name = "futures-core" name = "futures-core"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "18eaa56102984bed2c88ea39026cff3ce3b4c7f508ca970cedf2450ea10d4e46" checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748"
[[package]] [[package]]
name = "futures-executor" name = "futures-executor"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5f8e0c9258abaea85e78ebdda17ef9666d390e987f006be6080dfe354b708cb" checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65"
dependencies = [ dependencies = [
"futures-core", "futures-core",
"futures-task", "futures-task",
@ -701,15 +702,15 @@ dependencies = [
[[package]] [[package]]
name = "futures-io" name = "futures-io"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e1798854a4727ff944a7b12aa999f58ce7aa81db80d2dfaaf2ba06f065ddd2b" checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb"
[[package]] [[package]]
name = "futures-macro" name = "futures-macro"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e36fccf3fc58563b4a14d265027c627c3b665d7fed489427e88e7cc929559efe" checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556"
dependencies = [ dependencies = [
"proc-macro-hack", "proc-macro-hack",
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
@ -719,24 +720,24 @@ dependencies = [
[[package]] [[package]]
name = "futures-sink" name = "futures-sink"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e3ca3f17d6e8804ae5d3df7a7d35b2b3a6fe89dac84b31872720fc3060a0b11" checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d"
[[package]] [[package]]
name = "futures-task" name = "futures-task"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96d502af37186c4fef99453df03e374683f8a1eec9dcc1e66b3b82dc8278ce3c" checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d"
dependencies = [ dependencies = [
"once_cell", "once_cell",
] ]
[[package]] [[package]]
name = "futures-util" name = "futures-util"
version = "0.3.7" version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abcb44342f62e6f3e8ac427b8aa815f724fd705dfad060b18ac7866c15bb8e34" checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@ -798,9 +799,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx11" name = "gfx-backend-dx11"
version = "0.6.11" version = "0.6.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0105746c65b502f6629b7e1acc3610a7726a2f8b37229119fb774d48af174dd" checksum = "52b0c3b8b2e0a60c1380a7c27652cd86b791e5d8312fb9592a7a59bd437e9532"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bitflags", "bitflags",
@ -820,9 +821,9 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-dx12" name = "gfx-backend-dx12"
version = "0.6.11" version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "018a08a0703ef8765ed25ecd48ec77b4d728233364d85b22b8ce24bcd5f71dda" checksum = "375014deed24d76b03604736dd899f0925158a1a96db90cbefb9cce070f71af7"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"bit-set", "bit-set",
@ -933,8 +934,8 @@ dependencies = [
[[package]] [[package]]
name = "glam" name = "glam"
version = "0.9.5" version = "0.10.0"
source = "git+https://github.com/EmbarkStudios/glam-rs?rev=d55ff75e91aab01c4fd9808e3ca9c079dfa7315c#d55ff75e91aab01c4fd9808e3ca9c079dfa7315c" source = "git+https://github.com/EmbarkStudios/glam-rs?rev=c9561e4dfd55fa5a9d6838cae3c9e90c8edafaf9#c9561e4dfd55fa5a9d6838cae3c9e90c8edafaf9"
dependencies = [ dependencies = [
"version_check", "version_check",
] ]
@ -1517,9 +1518,9 @@ checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
[[package]] [[package]]
name = "ppv-lite86" name = "ppv-lite86"
version = "0.2.9" version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
[[package]] [[package]]
name = "pretty_assertions" name = "pretty_assertions"
@ -1836,9 +1837,9 @@ checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.4.1" version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8963b85b8ce3074fecffde43b4b0dded83ce2f367dc8d363afc56679f3ee820b" checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@ -1858,9 +1859,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.20" version = "0.6.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8cab7a364d15cde1e505267766a2d3c4e22a843e1a601f0fa7564c0f82ced11c" checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189"
[[package]] [[package]]
name = "remove_dir_all" name = "remove_dir_all"
@ -2038,7 +2039,6 @@ dependencies = [
name = "simplest-shader" name = "simplest-shader"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"glam",
"spirv-std", "spirv-std",
] ]
@ -2046,7 +2046,6 @@ dependencies = [
name = "sky-shader" name = "sky-shader"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"glam",
"spirv-std", "spirv-std",
] ]
@ -2077,9 +2076,9 @@ dependencies = [
"log", "log",
"memmap", "memmap",
"nix 0.18.0", "nix 0.18.0",
"wayland-client 0.28.1", "wayland-client 0.28.2",
"wayland-cursor 0.28.1", "wayland-cursor 0.28.2",
"wayland-protocols 0.28.1", "wayland-protocols 0.28.2",
] ]
[[package]] [[package]]
@ -2098,6 +2097,9 @@ dependencies = [
[[package]] [[package]]
name = "spirv-std" name = "spirv-std"
version = "0.1.0" version = "0.1.0"
dependencies = [
"glam",
]
[[package]] [[package]]
name = "spirv-tools" name = "spirv-tools"
@ -2250,18 +2252,18 @@ dependencies = [
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.21" version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.21" version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56"
dependencies = [ dependencies = [
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
"quote 1.0.7", "quote 1.0.7",
@ -2375,9 +2377,9 @@ dependencies = [
[[package]] [[package]]
name = "tracing-subscriber" name = "tracing-subscriber"
version = "0.2.14" version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2810660b9d5b18895d140caba6401765749a6a162e5d0736cfc44ea50db9d79d" checksum = "a1fa8f0c8f4c594e4fc9debc1990deab13238077271ba84dd853d54902ee3401"
dependencies = [ dependencies = [
"ansi_term 0.12.1", "ansi_term 0.12.1",
"chrono", "chrono",
@ -2555,18 +2557,18 @@ dependencies = [
[[package]] [[package]]
name = "wayland-client" name = "wayland-client"
version = "0.28.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80c54f9b90b2c044784f91fe22c5619a8a9c681db38492f2fd78ff968cf3f184" checksum = "222b227f47871e47d657c1c5e5360b4af9a877aa9c892716787be1c192c78c42"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"downcast-rs", "downcast-rs",
"libc", "libc",
"nix 0.18.0", "nix 0.18.0",
"scoped-tls", "scoped-tls",
"wayland-commons 0.28.1", "wayland-commons 0.28.2",
"wayland-scanner 0.28.1", "wayland-scanner 0.28.2",
"wayland-sys 0.28.1", "wayland-sys 0.28.2",
] ]
[[package]] [[package]]
@ -2583,14 +2585,14 @@ dependencies = [
[[package]] [[package]]
name = "wayland-commons" name = "wayland-commons"
version = "0.28.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7602d75560fe6f02cac723609cce658042fe60541b5107999818d29d4dab7cfa" checksum = "230b3ffeda101f877ff8ecb8573f5d26e7beb345b197807c4df34ec06879a3e6"
dependencies = [ dependencies = [
"nix 0.18.0", "nix 0.18.0",
"once_cell", "once_cell",
"smallvec", "smallvec",
"wayland-sys 0.28.1", "wayland-sys 0.28.2",
] ]
[[package]] [[package]]
@ -2606,12 +2608,12 @@ dependencies = [
[[package]] [[package]]
name = "wayland-cursor" name = "wayland-cursor"
version = "0.28.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0446b959c5b5b4b2c11f63112fc7cbeb50ecd9f2c340d2b0ea632875685baf04" checksum = "0aad1b4301cdccfb5f64056a4736e8155a5f4734bac41fdbca80b1fdbe1ab3e1"
dependencies = [ dependencies = [
"nix 0.18.0", "nix 0.18.0",
"wayland-client 0.28.1", "wayland-client 0.28.2",
"xcursor", "xcursor",
] ]
@ -2629,14 +2631,14 @@ dependencies = [
[[package]] [[package]]
name = "wayland-protocols" name = "wayland-protocols"
version = "0.28.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d419585bbdb150fb541579cff205c6095a86cd874530e41838d1f18a9569a08" checksum = "dc16a9db803cae58b45f9a84a6cf364434cc49a95c8b1ef98ffeb467d228bdc9"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"wayland-client 0.28.1", "wayland-client 0.28.2",
"wayland-commons 0.28.1", "wayland-commons 0.28.2",
"wayland-scanner 0.28.1", "wayland-scanner 0.28.2",
] ]
[[package]] [[package]]
@ -2652,9 +2654,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-scanner" name = "wayland-scanner"
version = "0.28.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1cc091af4b05a435312f7cefe3a26824d2017966a58362ca913f72c3d68e5e2" checksum = "5ee5bd43a1d746efc486515fec561e47205f328b74802b959f10f5500f7e56cc"
dependencies = [ dependencies = [
"proc-macro2 1.0.24", "proc-macro2 1.0.24",
"quote 1.0.7", "quote 1.0.7",
@ -2672,9 +2674,9 @@ dependencies = [
[[package]] [[package]]
name = "wayland-sys" name = "wayland-sys"
version = "0.28.1" version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5640f53d1fe6eaaa2e77b9ff015fe9a556173ce8388607f941aecfd9b05c73e" checksum = "0814adbecc7ea97869971e1d1c1b657e31863dda6fd768f119ad3dc408a01e58"
dependencies = [ dependencies = [
"dlib", "dlib",
"lazy_static", "lazy_static",
@ -2833,7 +2835,7 @@ dependencies = [
"raw-window-handle", "raw-window-handle",
"smithay-client-toolkit", "smithay-client-toolkit",
"wasm-bindgen", "wasm-bindgen",
"wayland-client 0.28.1", "wayland-client 0.28.2",
"web-sys", "web-sys",
"winapi 0.3.9", "winapi 0.3.9",
"x11-dl", "x11-dl",

View File

@ -13,7 +13,3 @@ members = [
"crates/spirv-tools", "crates/spirv-tools",
"crates/spirv-tools-sys", "crates/spirv-tools-sys",
] ]
[patch.crates-io]
# https://github.com/bitshifter/glam-rs/pull/85
glam = { git = "https://github.com/EmbarkStudios/glam-rs", rev = "d55ff75e91aab01c4fd9808e3ca9c079dfa7315c" }

View File

@ -7,3 +7,5 @@ license = "MIT OR Apache-2.0"
repository = "https://github.com/EmbarkStudios/rust-gpu" repository = "https://github.com/EmbarkStudios/rust-gpu"
[dependencies] [dependencies]
# https://github.com/bitshifter/glam-rs/pull/85
glam = { git = "https://github.com/EmbarkStudios/glam-rs", rev = "c9561e4dfd55fa5a9d6838cae3c9e90c8edafaf9" }

View File

@ -39,6 +39,8 @@
mod math_ext; mod math_ext;
pub use math_ext::MathExt; pub use math_ext::MathExt;
pub use glam;
macro_rules! pointer_addrspace_write { macro_rules! pointer_addrspace_write {
(false) => {}; (false) => {};
(true) => { (true) => {

View File

@ -10,7 +10,7 @@ publish = false
minifb = "0.19.1" minifb = "0.19.1"
# bring in the shader as natively compiled code # bring in the shader as natively compiled code
sky-shader = { path = "../../shaders/sky-shader" } sky-shader = { path = "../../shaders/sky-shader" }
glam = "0.9" spirv-std = { path = "../../../crates/spirv-std" }
# for parallelism, not really needed though # for parallelism, not really needed though
rayon = "1.5" rayon = "1.5"

View File

@ -1,6 +1,6 @@
use glam::{vec2, Vec4};
use minifb::{Key, Window, WindowOptions}; use minifb::{Key, Window, WindowOptions};
use rayon::prelude::*; use rayon::prelude::*;
use spirv_std::glam::{vec2, Vec4};
use std::time::Instant; use std::time::Instant;
// apply the srgb OETF (i.e. do "linear to sRGB") // apply the srgb OETF (i.e. do "linear to sRGB")

View File

@ -11,4 +11,3 @@ crate-type = ["dylib"]
[dependencies] [dependencies]
spirv-std = { path = "../../../crates/spirv-std" } spirv-std = { path = "../../../crates/spirv-std" }
glam = "0.9"

View File

@ -3,7 +3,7 @@
#![feature(register_attr)] #![feature(register_attr)]
#![register_attr(spirv)] #![register_attr(spirv)]
use glam::Vec4; use spirv_std::glam::Vec4;
use spirv_std::{Input, Output}; use spirv_std::{Input, Output};
#[allow(unused_attributes)] #[allow(unused_attributes)]

View File

@ -11,4 +11,3 @@ crate-type = ["dylib"]
[dependencies] [dependencies]
spirv-std = { path = "../../../crates/spirv-std" } spirv-std = { path = "../../../crates/spirv-std" }
glam = "0.9"

View File

@ -6,7 +6,7 @@
#![register_attr(spirv)] #![register_attr(spirv)]
use core::f32::consts::PI; use core::f32::consts::PI;
use glam::{const_vec3, Mat4, Vec2, Vec3, Vec4}; use spirv_std::glam::{const_vec3, Mat4, Vec2, Vec3, Vec4};
use spirv_std::{Input, MathExt, Output}; use spirv_std::{Input, MathExt, Output};
const DEPOLARIZATION_FACTOR: f32 = 0.035; const DEPOLARIZATION_FACTOR: f32 = 0.035;
@ -160,11 +160,7 @@ pub fn fs(screen_pos: Vec2) -> Vec4 {
Vec4::new(0.0, -0.14834046, -0.98893654, 0.0), Vec4::new(0.0, -0.14834046, -0.98893654, 0.0),
); );
let clip_pos = screen_pos.extend(1.0).extend(1.0); let world_pos = clip_to_world.transform_point3(screen_pos.extend(1.0));
let world_pos = {
let p = clip_to_world.mul_vec4(clip_pos);
p.truncate() / p.w()
};
let dir = (world_pos - eye_pos).normalize(); let dir = (world_pos - eye_pos).normalize();
// evaluate Preetham sky model // evaluate Preetham sky model