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
timeout-minutes: 60
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Install CI Libraries
run: sudo ./ci/install-ci-libraries.sh 10

View file

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

1
.gitignore vendored
View file

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

45
Cargo.lock generated
View file

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

View file

@ -1239,5 +1239,8 @@ fn gather_tags(
}
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_macros = "0.8"
[build-dependencies]
anyhow = "1.0"
fs_extra = "1.1"
glob = "0.3"
shaderc = "0.6"
# uncomment everything below if you have made changes to any shaders and
# want to compile them to .spv
#[build-dependencies]
#rayon = "1.5.0"
#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 std::fs::{read_to_string, write};
use std::path::PathBuf;
use rayon::prelude::*;
// Build script for shaders used from:
// https://sotrh.github.io/learn-wgpu/beginner/tutorial3-pipeline/#compiling-shaders-and-include-spirv
// Adapted from https://github.com/sotrh/learn-wgpu
// 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 {
src: String,
@ -41,17 +46,16 @@ impl ShaderData {
fn main() -> Result<()> {
// Collect all shaders recursively within /src/
let mut shader_paths = [
glob("./src/**/*.vert")?,
glob("./src/**/*.frag")?,
glob("./src/**/*.comp")?,
];
let mut shader_paths = Vec::new();
shader_paths.extend(glob("./src/**/*.vert")?);
shader_paths.extend(glob("./src/**/*.frag")?);
shader_paths.extend(glob("./src/**/*.comp")?);
// This could be parallelized
let shaders = shader_paths
.iter_mut()
.flatten()
.map(|glob_result| ShaderData::load(glob_result?))
let shaders = shader_paths.into_par_iter()
.map(|glob_result| {
ShaderData::load(glob_result?)
})
.collect::<Vec<Result<_>>>()
.into_iter()
.collect::<Result<Vec<_>>>()?;

View file

@ -2,6 +2,8 @@
// Taken from https://github.com/sotrh/learn-wgpu
// 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) 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/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 {
// orthographic projection is used to transform pixel coords to the coordinate system used by wgpu
mat4 ortho;

Binary file not shown.