Merge pull request #804 from rtfeldman/ci_speedup

CI speedups
This commit is contained in:
Richard Feldman 2020-12-15 19:00:41 -05:00 committed by GitHub
commit e5a8570a68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 36 additions and 66 deletions

View file

@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 60 timeout-minutes: 60
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- name: Install CI Libraries - name: Install CI Libraries
run: sudo ./ci/install-ci-libraries.sh 10 run: sudo ./ci/install-ci-libraries.sh 10

View file

@ -9,7 +9,7 @@ jobs:
name: Test and Build name: Test and Build
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1 - uses: actions-rs/toolchain@v1
with: with:
profile: minimal profile: minimal

1
.gitignore vendored
View file

@ -11,4 +11,5 @@ vgcore.*
#editors #editors
.idea/ .idea/
.vscode/

45
Cargo.lock generated
View file

@ -69,12 +69,6 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "anyhow"
version = "1.0.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf8dcb5b4bbaa28653b647d8c77bd4ed40183b48882e130c1f1ffb73de069fd7"
[[package]] [[package]]
name = "approx" name = "approx"
version = "0.3.2" version = "0.3.2"
@ -407,15 +401,6 @@ dependencies = [
"bitflags", "bitflags",
] ]
[[package]]
name = "cmake"
version = "0.1.45"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "cocoa" name = "cocoa"
version = "0.20.2" version = "0.20.2"
@ -1234,12 +1219,6 @@ version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce"
[[package]]
name = "glob"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
[[package]] [[package]]
name = "glyph_brush" name = "glyph_brush"
version = "0.7.0" version = "0.7.0"
@ -2658,15 +2637,12 @@ dependencies = [
name = "roc_editor" name = "roc_editor"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow",
"arraystring", "arraystring",
"bumpalo", "bumpalo",
"bytemuck", "bytemuck",
"cgmath", "cgmath",
"env_logger 0.7.1", "env_logger 0.7.1",
"fs_extra",
"futures", "futures",
"glob",
"glyph_brush", "glyph_brush",
"im", "im",
"im-rc", "im-rc",
@ -2697,7 +2673,6 @@ dependencies = [
"roc_types", "roc_types",
"roc_unify", "roc_unify",
"roc_uniq", "roc_uniq",
"shaderc",
"target-lexicon", "target-lexicon",
"wgpu", "wgpu",
"wgpu_glyph", "wgpu_glyph",
@ -3232,26 +3207,6 @@ dependencies = [
"opaque-debug", "opaque-debug",
] ]
[[package]]
name = "shaderc"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50b8aeaae10b9bda5cba66736a7e265f67698e912e1cc6a4678acba286e22be9"
dependencies = [
"libc",
"shaderc-sys",
]
[[package]]
name = "shaderc-sys"
version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b12d7c62d6732884c9dfab587503fa3a795b108df152415a89da23812d4737e"
dependencies = [
"cmake",
"libc",
]
[[package]] [[package]]
name = "signal-hook-registry" name = "signal-hook-registry"
version = "1.2.2" version = "1.2.2"

View file

@ -1239,5 +1239,8 @@ fn gather_tags(
} }
fn is_recursion_var(subs: &Subs, var: Variable) -> bool { fn is_recursion_var(subs: &Subs, var: Variable) -> bool {
matches!(subs.get_without_compacting(var).content, Content::RecursionVar { .. }) matches!(
subs.get_without_compacting(var).content,
Content::RecursionVar { .. }
)
} }

2
editor/.gitignore vendored
View file

@ -1 +1 @@
*.spv

View file

@ -74,8 +74,11 @@ indoc = "0.3.3"
quickcheck = "0.8" quickcheck = "0.8"
quickcheck_macros = "0.8" quickcheck_macros = "0.8"
[build-dependencies] # uncomment everything below if you have made changes to any shaders and
anyhow = "1.0" # want to compile them to .spv
fs_extra = "1.1" #[build-dependencies]
glob = "0.3" #rayon = "1.5.0"
shaderc = "0.6" #anyhow = "1.0"
#fs_extra = "1.1"
#glob = "0.3"
#shaderc = "0.6"

View file

@ -2,9 +2,14 @@ use anyhow::*;
use glob::glob; use glob::glob;
use std::fs::{read_to_string, write}; use std::fs::{read_to_string, write};
use std::path::PathBuf; use std::path::PathBuf;
use rayon::prelude::*;
// Build script for shaders used from: // Adapted from https://github.com/sotrh/learn-wgpu
// https://sotrh.github.io/learn-wgpu/beginner/tutorial3-pipeline/#compiling-shaders-and-include-spirv // by Benjamin Hansen, licensed under the MIT license
// Rename this file to build.rs and uncomment the build-dependencies in Cargo.toml to compile
// the shaders into .spv files
struct ShaderData { struct ShaderData {
src: String, src: String,
@ -41,17 +46,16 @@ impl ShaderData {
fn main() -> Result<()> { fn main() -> Result<()> {
// Collect all shaders recursively within /src/ // Collect all shaders recursively within /src/
let mut shader_paths = [ let mut shader_paths = Vec::new();
glob("./src/**/*.vert")?, shader_paths.extend(glob("./src/**/*.vert")?);
glob("./src/**/*.frag")?, shader_paths.extend(glob("./src/**/*.frag")?);
glob("./src/**/*.comp")?, shader_paths.extend(glob("./src/**/*.comp")?);
];
// This could be parallelized
let shaders = shader_paths let shaders = shader_paths.into_par_iter()
.iter_mut() .map(|glob_result| {
.flatten() ShaderData::load(glob_result?)
.map(|glob_result| ShaderData::load(glob_result?)) })
.collect::<Vec<Result<_>>>() .collect::<Vec<Result<_>>>()
.into_iter() .into_iter()
.collect::<Result<Vec<_>>>()?; .collect::<Result<Vec<_>>>()?;

View file

@ -2,6 +2,8 @@
// Taken from https://github.com/sotrh/learn-wgpu // Taken from https://github.com/sotrh/learn-wgpu
// by Benjamin Hansen, licensed under the MIT license // by Benjamin Hansen, licensed under the MIT license
// Check build_shaders.rs on how to recompile shaders if you have made changes to this file
layout(location=0) in vec3 color; layout(location=0) in vec3 color;
layout(location=0) out vec4 fColor; layout(location=0) out vec4 fColor;

Binary file not shown.

View file

@ -3,6 +3,8 @@
// https://github.com/sotrh/learn-wgpu by Benjamin Hansen, licensed under the MIT license // https://github.com/sotrh/learn-wgpu by Benjamin Hansen, licensed under the MIT license
// https://github.com/cloudhead/rgx by Alexis Sellier, licensed under the MIT license // https://github.com/cloudhead/rgx by Alexis Sellier, licensed under the MIT license
// Check build_shaders.rs on how to recompile shaders if you have made changes to this file
layout(set = 0, binding = 0) uniform Globals { layout(set = 0, binding = 0) uniform Globals {
// orthographic projection is used to transform pixel coords to the coordinate system used by wgpu // orthographic projection is used to transform pixel coords to the coordinate system used by wgpu
mat4 ortho; mat4 ortho;

Binary file not shown.