Desktop: Update CEF (#4048)
* Update CEF to version 147 * Fix fmt * Move CEF package * Fix nix package * Improve * Cleanup * Fix
This commit is contained in:
parent
824d1162eb
commit
324b9e664c
|
|
@ -31,7 +31,6 @@ let
|
||||||
|
|
||||||
deps = {
|
deps = {
|
||||||
crane = lib.call ./deps/crane.nix;
|
crane = lib.call ./deps/crane.nix;
|
||||||
cef = lib.call ./deps/cef.nix;
|
|
||||||
rustGPU = lib.call ./deps/rust-gpu.nix;
|
rustGPU = lib.call ./deps/rust-gpu.nix;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -63,12 +62,9 @@ in
|
||||||
graphite-bundle-dev = (lib.call ./pkgs/graphite-bundle.nix) { graphite = graphite-dev; };
|
graphite-bundle-dev = (lib.call ./pkgs/graphite-bundle.nix) { graphite = graphite-dev; };
|
||||||
graphite-flatpak-manifest = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { };
|
graphite-flatpak-manifest = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { };
|
||||||
graphite-flatpak-manifest-dev = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { graphite-bundle = graphite-bundle-dev; };
|
graphite-flatpak-manifest-dev = (lib.call ./pkgs/graphite-flatpak-manifest.nix) { graphite-bundle = graphite-bundle-dev; };
|
||||||
|
graphite-cef = lib.call ./pkgs/graphite-cef.nix;
|
||||||
|
|
||||||
# TODO: graphene-cli = lib.call ./pkgs/graphene-cli.nix;
|
# TODO: graphene-cli = lib.call ./pkgs/graphene-cli.nix;
|
||||||
|
|
||||||
tools = {
|
|
||||||
third-party-licenses = lib.call ./pkgs/tools/third-party-licenses.nix;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
let
|
|
||||||
cefPath = pkgs.cef-binary.overrideAttrs (finalAttrs: {
|
|
||||||
postInstall = ''
|
|
||||||
rm -r $out/* $out/.* || true
|
|
||||||
strip ./Release/*.so*
|
|
||||||
mv ./Release/* $out/
|
|
||||||
find "./Resources/locales" -maxdepth 1 -type f ! -name 'en-US.pak' -delete
|
|
||||||
mv ./Resources/* $out/
|
|
||||||
mv ./include $out/
|
|
||||||
|
|
||||||
cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz
|
|
||||||
|
|
||||||
echo '${
|
|
||||||
builtins.toJSON {
|
|
||||||
type = "minimal";
|
|
||||||
name = builtins.baseNameOf finalAttrs.src.url;
|
|
||||||
sha1 = "";
|
|
||||||
}
|
|
||||||
}' > $out/archive.json
|
|
||||||
'';
|
|
||||||
});
|
|
||||||
in
|
|
||||||
{
|
|
||||||
env.CEF_PATH = cefPath;
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +1,15 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
extensions = [
|
|
||||||
"rust-src"
|
|
||||||
"rust-analyzer"
|
|
||||||
"clippy"
|
|
||||||
"cargo"
|
|
||||||
"rustc-dev"
|
|
||||||
"llvm-tools"
|
|
||||||
];
|
|
||||||
toolchain = pkgs.rust-bin.nightly."2026-04-11".default.override {
|
toolchain = pkgs.rust-bin.nightly."2026-04-11".default.override {
|
||||||
inherit extensions;
|
extensions = [
|
||||||
|
"rust-src"
|
||||||
|
"rust-analyzer"
|
||||||
|
"clippy"
|
||||||
|
"cargo"
|
||||||
|
"rustc-dev"
|
||||||
|
"llvm-tools"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
cargo = pkgs.writeShellScriptBin "cargo" ''
|
cargo = pkgs.writeShellScriptBin "cargo" ''
|
||||||
#!${pkgs.lib.getExe pkgs.bash}
|
#!${pkgs.lib.getExe pkgs.bash}
|
||||||
|
|
|
||||||
15
.nix/dev.nix
15
.nix/dev.nix
|
|
@ -1,4 +1,10 @@
|
||||||
{ pkgs, deps, ... }:
|
{
|
||||||
|
pkgs,
|
||||||
|
deps,
|
||||||
|
self,
|
||||||
|
system,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
libs = [
|
libs = [
|
||||||
|
|
@ -51,13 +57,10 @@ pkgs.mkShell (
|
||||||
pkgs.graphviz
|
pkgs.graphviz
|
||||||
];
|
];
|
||||||
|
|
||||||
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}";
|
CEF_PATH = self.packages.${system}.graphite-cef;
|
||||||
|
LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}";
|
||||||
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS";
|
XDG_DATA_DIRS = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS";
|
||||||
|
|
||||||
# shellHook = ''
|
|
||||||
# alias cargo='mold --run cargo'
|
|
||||||
# '';
|
|
||||||
}
|
}
|
||||||
// deps.cef.env
|
|
||||||
// deps.rustGPU.env
|
// deps.rustGPU.env
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
|
deps,
|
||||||
self,
|
self,
|
||||||
system,
|
system,
|
||||||
...
|
...
|
||||||
|
|
@ -33,7 +34,7 @@ let
|
||||||
cp -r ${graphite}/share out/share
|
cp -r ${graphite}/share out/share
|
||||||
mkdir -p out/lib/cef
|
mkdir -p out/lib/cef
|
||||||
mkdir -p ./cef
|
mkdir -p ./cef
|
||||||
tar -xvf ${pkgs.cef-binary.src} -C ./cef --strip-components=1
|
tar -xvf ${self.packages.${system}.graphite-cef.src} -C ./cef --strip-components=1
|
||||||
cp -r ./cef/Release/* out/lib/cef/
|
cp -r ./cef/Release/* out/lib/cef/
|
||||||
cp -r ./cef/Resources/* out/lib/cef/
|
cp -r ./cef/Resources/* out/lib/cef/
|
||||||
find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete
|
find "out/lib/cef/locales" -type f ! -name 'en-US*' -delete
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,46 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
version = "147.0.10+gd58e84d+chromium-147.0.7727.118";
|
||||||
|
hashes = {
|
||||||
|
aarch64-linux = "sha256-kaRijMDacPcoeCcS31zmRSNOvgozx+uq2M34mD28bu4=";
|
||||||
|
x86_64-linux = "sha256-CHzPofBDhCniDZEpOxXK4I7p57SYjMAY1HVo3Vna0e8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
selectSystem =
|
||||||
|
attrs:
|
||||||
|
attrs.${pkgs.stdenv.hostPlatform.system}
|
||||||
|
or (throw "Unsupported system ${pkgs.stdenv.hostPlatform.system}");
|
||||||
|
|
||||||
|
src = pkgs.fetchurl {
|
||||||
|
url = "https://cef-builds.spotifycdn.com/cef_binary_${version}_${
|
||||||
|
selectSystem {
|
||||||
|
aarch64-linux = "linuxarm64";
|
||||||
|
x86_64-linux = "linux64";
|
||||||
|
}
|
||||||
|
}_minimal.tar.bz2";
|
||||||
|
hash = selectSystem hashes;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.cef-binary.overrideAttrs (finalAttrs: {
|
||||||
|
version = builtins.head (builtins.split "\\+" version);
|
||||||
|
inherit src;
|
||||||
|
postInstall = ''
|
||||||
|
rm -r $out/* $out/.* || true
|
||||||
|
strip ./Release/*.so*
|
||||||
|
mv ./Release/* $out/
|
||||||
|
find "./Resources/locales" -maxdepth 1 -type f ! -name 'en-US.pak' -delete
|
||||||
|
mv ./Resources/* $out/
|
||||||
|
mv ./include $out/
|
||||||
|
|
||||||
|
cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz
|
||||||
|
|
||||||
|
echo '${
|
||||||
|
builtins.toJSON {
|
||||||
|
type = "minimal";
|
||||||
|
name = builtins.baseNameOf finalAttrs.src.url;
|
||||||
|
sha1 = "";
|
||||||
|
}
|
||||||
|
}' > $out/archive.json
|
||||||
|
'';
|
||||||
|
})
|
||||||
|
|
@ -50,7 +50,7 @@ let
|
||||||
pkgs.pkg-config
|
pkgs.pkg-config
|
||||||
pkgs.lld
|
pkgs.lld
|
||||||
];
|
];
|
||||||
env = deps.cef.env;
|
env.CEF_PATH = self.packages.${system}.graphite-cef;
|
||||||
buildPhase =
|
buildPhase =
|
||||||
let
|
let
|
||||||
profile = if dev then "dev" else "release";
|
profile = if dev then "dev" else "release";
|
||||||
|
|
@ -97,10 +97,11 @@ deps.crane.lib.buildPackage (
|
||||||
npmConfigScript = "setup";
|
npmConfigScript = "setup";
|
||||||
makeCacheWritable = true;
|
makeCacheWritable = true;
|
||||||
|
|
||||||
env = deps.cef.env // {
|
env = {
|
||||||
RASTER_NODES_SHADER_PATH = self.packages.${system}.graphite-raster-nodes-shaders;
|
RASTER_NODES_SHADER_PATH = self.packages.${system}.graphite-raster-nodes-shaders;
|
||||||
GRAPHITE_GIT_COMMIT_HASH = self.rev or "unknown";
|
GRAPHITE_GIT_COMMIT_HASH = self.rev or "unknown";
|
||||||
GRAPHITE_GIT_COMMIT_DATE = self.lastModified or "unknown";
|
GRAPHITE_GIT_COMMIT_DATE = self.lastModified or "unknown";
|
||||||
|
CEF_PATH = self.packages.${system}.graphite-cef;
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
|
@ -149,8 +150,9 @@ deps.crane.lib.buildPackage (
|
||||||
remove-references-to -t "${common.cargoVendorDir}" $out/bin/graphite
|
remove-references-to -t "${common.cargoVendorDir}" $out/bin/graphite
|
||||||
|
|
||||||
patchelf \
|
patchelf \
|
||||||
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${deps.cef.env.CEF_PATH}" \
|
--set-rpath "${pkgs.lib.makeLibraryPath libs}:${self.packages.${system}.graphite-cef}" \
|
||||||
--add-needed libGL.so \
|
--add-needed libGL.so \
|
||||||
|
--add-needed libEGL.so \
|
||||||
$out/bin/graphite
|
$out/bin/graphite
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
info,
|
|
||||||
deps,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
|
||||||
cargoVendorDir = deps.crane.lib.vendorCargoDeps { inherit (info) src; };
|
|
||||||
common = {
|
|
||||||
pname = "third-party-licenses";
|
|
||||||
inherit (info) version src;
|
|
||||||
inherit cargoVendorDir;
|
|
||||||
nativeBuildInputs = [ pkgs.pkg-config ];
|
|
||||||
buildInputs = [ pkgs.openssl ];
|
|
||||||
strictDeps = true;
|
|
||||||
env = deps.cef.env // {
|
|
||||||
CARGO_PROFILE = "dev";
|
|
||||||
};
|
|
||||||
cargoExtraArgs = "-p third-party-licenses --features desktop";
|
|
||||||
doCheck = false;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
deps.crane.lib.buildPackage (
|
|
||||||
common
|
|
||||||
// {
|
|
||||||
inherit cargoVendorDir;
|
|
||||||
cargoArtifacts = deps.crane.lib.buildDepsOnly common;
|
|
||||||
meta.mainProgram = "third-party-licenses";
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
@ -452,7 +452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "82bad075de69e455c338955b4a7d58c0ced253185ef7703a3c6a3846e2d5ee66"
|
checksum = "82bad075de69e455c338955b4a7d58c0ced253185ef7703a3c6a3846e2d5ee66"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cargo_metadata",
|
"cargo_metadata 0.21.0",
|
||||||
"directories",
|
"directories",
|
||||||
"log",
|
"log",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
@ -468,6 +468,16 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cargo-platform"
|
||||||
|
version = "0.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd0061da739915fae12ea00e16397555ed4371a6bb285431aab930f61b0aa4ba"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"serde_core",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cargo-run"
|
name = "cargo-run"
|
||||||
version = "0.0.0"
|
version = "0.0.0"
|
||||||
|
|
@ -498,7 +508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5cfca2aaa699835ba88faf58a06342a314a950d2b9686165e038286c30316868"
|
checksum = "5cfca2aaa699835ba88faf58a06342a314a950d2b9686165e038286c30316868"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"camino",
|
"camino",
|
||||||
"cargo-platform",
|
"cargo-platform 0.2.0",
|
||||||
"cargo-util-schemas",
|
"cargo-util-schemas",
|
||||||
"semver",
|
"semver",
|
||||||
"serde",
|
"serde",
|
||||||
|
|
@ -506,6 +516,20 @@ dependencies = [
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cargo_metadata"
|
||||||
|
version = "0.23.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ef987d17b0a113becdd19d3d0022d04d7ef41f9efe4f3fb63ac44ba61df3ade9"
|
||||||
|
dependencies = [
|
||||||
|
"camino",
|
||||||
|
"cargo-platform 0.3.3",
|
||||||
|
"semver",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"thiserror 2.0.18",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cast"
|
name = "cast"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
|
@ -525,30 +549,37 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cef"
|
name = "cef"
|
||||||
version = "142.5.0+142.0.17"
|
version = "147.1.0+147.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32eab60854609591d365051497b1fb78b77b129d9e39ba69b1f71ee3f4ae9345"
|
checksum = "58474836fdb2fe169b7c8a588d6565c0311a570cf5c79c45af666cf56c4f646f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
"ash",
|
"ash",
|
||||||
|
"cargo_metadata 0.23.1",
|
||||||
"cef-dll-sys",
|
"cef-dll-sys",
|
||||||
|
"clap",
|
||||||
"libc",
|
"libc",
|
||||||
"libloading 0.9.0",
|
"libloading 0.9.0",
|
||||||
"metal",
|
"metal",
|
||||||
"objc",
|
"objc",
|
||||||
"objc2 0.6.3",
|
"objc2 0.6.3",
|
||||||
"objc2-io-surface",
|
"objc2-io-surface",
|
||||||
|
"plist",
|
||||||
|
"semver",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"tracing",
|
"tracing",
|
||||||
"wgpu",
|
"wgpu",
|
||||||
"windows",
|
"windows 0.62.2",
|
||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cef-dll-sys"
|
name = "cef-dll-sys"
|
||||||
version = "142.5.0+142.0.17"
|
version = "147.1.0+147.0.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5a8c418c8eb6abff55f52668dbb8cba3cd5fcf057cf3eed46c04013a08ad9004"
|
checksum = "d01681cee57f7580edbe010c5d218662f612f81065100bb8431e9089a4cfd4ae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"cmake",
|
"cmake",
|
||||||
|
|
@ -1196,8 +1227,9 @@ checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "download-cef"
|
name = "download-cef"
|
||||||
version = "2.2.0"
|
version = "2.3.1"
|
||||||
source = "git+https://github.com/timon-schelling/cef-rs.git?branch=graphite#8efeb241d1837447eccaee5d713a7c1ce331cd52"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d7471a7d5d3bd8df1b3b75871f0317d8a6dd73270ab861cc97ae7907ee63e554"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bzip2",
|
"bzip2",
|
||||||
"clap",
|
"clap",
|
||||||
|
|
@ -1351,9 +1383,9 @@ checksum = "dea2df4cf52843e0452895c455a1a2cfbb842a1e7329671acf418fdc53ed4c59"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "euclid"
|
name = "euclid"
|
||||||
version = "0.22.11"
|
version = "0.22.14"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48"
|
checksum = "f1a05365e3b1c6d1650318537c7460c6923f1abdd272ad6842baa2b509957a06"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
@ -1525,7 +1557,7 @@ dependencies = [
|
||||||
"read-fonts 0.35.0",
|
"read-fonts 0.35.0",
|
||||||
"roxmltree 0.20.0",
|
"roxmltree 0.20.0",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"windows",
|
"windows 0.58.0",
|
||||||
"windows-core 0.58.0",
|
"windows-core 0.58.0",
|
||||||
"yeslogic-fontconfig-sys",
|
"yeslogic-fontconfig-sys",
|
||||||
]
|
]
|
||||||
|
|
@ -1803,35 +1835,18 @@ dependencies = [
|
||||||
"gl_generator",
|
"gl_generator",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gpu-alloc"
|
|
||||||
version = "0.6.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 2.11.0",
|
|
||||||
"gpu-alloc-types",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "gpu-alloc-types"
|
|
||||||
version = "0.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4"
|
|
||||||
dependencies = [
|
|
||||||
"bitflags 2.11.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gpu-allocator"
|
name = "gpu-allocator"
|
||||||
version = "0.27.0"
|
version = "0.28.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd"
|
checksum = "51255ea7cfaadb6c5f1528d43e92a82acb2b96c43365989a28b2d44ee38f8795"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"ash",
|
||||||
|
"hashbrown 0.16.0",
|
||||||
"log",
|
"log",
|
||||||
"presser",
|
"presser",
|
||||||
"thiserror 1.0.69",
|
"thiserror 2.0.18",
|
||||||
"windows",
|
"windows 0.62.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -2077,7 +2092,7 @@ dependencies = [
|
||||||
"vello",
|
"vello",
|
||||||
"wgpu",
|
"wgpu",
|
||||||
"window_clipboard",
|
"window_clipboard",
|
||||||
"windows",
|
"windows 0.58.0",
|
||||||
"winit",
|
"winit",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -2212,9 +2227,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "guillotiere"
|
name = "guillotiere"
|
||||||
version = "0.6.2"
|
version = "0.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b62d5865c036cb1393e23c50693df631d3f5d7bcca4c04fe4cc0fd592e74a782"
|
checksum = "6b17e70c989c36bad147b27a58d148c0741c51448aa5653436547323e524d0ab"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"euclid",
|
"euclid",
|
||||||
"svg_fmt",
|
"svg_fmt",
|
||||||
|
|
@ -2282,6 +2297,8 @@ version = "0.16.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
|
checksum = "5419bdc4f6a9207fbeba6d11b604d481addf78ecd10c11ad51e76c2f6482748d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"allocator-api2",
|
||||||
|
"equivalent",
|
||||||
"foldhash 0.2.0",
|
"foldhash 0.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -2595,7 +2612,7 @@ dependencies = [
|
||||||
"color_quant",
|
"color_quant",
|
||||||
"gif",
|
"gif",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"png",
|
"png 0.17.16",
|
||||||
"zune-core",
|
"zune-core",
|
||||||
"zune-jpeg",
|
"zune-jpeg",
|
||||||
]
|
]
|
||||||
|
|
@ -3071,9 +3088,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "metal"
|
name = "metal"
|
||||||
version = "0.32.0"
|
version = "0.33.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605"
|
checksum = "c7047791b5bc903b8cd963014b355f71dc9864a9a0b727057676c1dcae5cbc15"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"block",
|
"block",
|
||||||
|
|
@ -3124,16 +3141,16 @@ dependencies = [
|
||||||
"objc2-core-foundation",
|
"objc2-core-foundation",
|
||||||
"objc2-foundation 0.3.2",
|
"objc2-foundation 0.3.2",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"png",
|
"png 0.17.16",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"windows-sys 0.60.2",
|
"windows-sys 0.60.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "naga"
|
name = "naga"
|
||||||
version = "27.0.3"
|
version = "28.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "066cf25f0e8b11ee0df221219010f213ad429855f57c494f995590c861a9a7d8"
|
checksum = "618f667225063219ddfc61251087db8a9aec3c3f0950c916b614e403486f1135"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
|
|
@ -3938,6 +3955,19 @@ dependencies = [
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "png"
|
||||||
|
version = "0.18.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.11.0",
|
||||||
|
"crc32fast",
|
||||||
|
"fdeflate",
|
||||||
|
"flate2",
|
||||||
|
"miniz_oxide",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "polling"
|
name = "polling"
|
||||||
version = "3.10.0"
|
version = "3.10.0"
|
||||||
|
|
@ -5127,7 +5157,7 @@ version = "0.10.0-alpha.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b721e6d7d7bc999126e838d16b070c8beada89ff8251c3f8a9e5292102827d86"
|
checksum = "b721e6d7d7bc999126e838d16b070c8beada89ff8251c3f8a9e5292102827d86"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cargo_metadata",
|
"cargo_metadata 0.21.0",
|
||||||
"log",
|
"log",
|
||||||
"memchr",
|
"memchr",
|
||||||
"raw-string",
|
"raw-string",
|
||||||
|
|
@ -6067,14 +6097,15 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vello"
|
name = "vello"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "git+https://github.com/Keavon/vello.git?branch=0.7.0-fix-images-rendering-blurry#9a2591c80470789eb82681203c21b7d9002bedcb"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7484a935acbced16ca6b2a7e6c8d6aa2b32ca0aff269c1b95f62be9b8f672c41"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"futures-intrusive",
|
"futures-intrusive",
|
||||||
"log",
|
"log",
|
||||||
"peniko",
|
"peniko",
|
||||||
"png",
|
"png 0.18.1",
|
||||||
"skrifa 0.40.0",
|
"skrifa 0.40.0",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
|
|
@ -6085,8 +6116,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vello_encoding"
|
name = "vello_encoding"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "git+https://github.com/Keavon/vello.git?branch=0.7.0-fix-images-rendering-blurry#9a2591c80470789eb82681203c21b7d9002bedcb"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d53d864987821f40431e62608bf0f58342db57f2f2860628c8cfc28e16a1cc39"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"guillotiere",
|
"guillotiere",
|
||||||
|
|
@ -6097,8 +6129,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "vello_shaders"
|
name = "vello_shaders"
|
||||||
version = "0.7.0"
|
version = "0.8.0"
|
||||||
source = "git+https://github.com/Keavon/vello.git?branch=0.7.0-fix-images-rendering-blurry#9a2591c80470789eb82681203c21b7d9002bedcb"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c455e04d570129212ecc4c0fdaa051ad66e5be15781a75b38c519d08120db374"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -6411,12 +6444,13 @@ checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu"
|
name = "wgpu"
|
||||||
version = "27.0.1"
|
version = "28.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "bfe68bac7cde125de7a731c3400723cadaaf1703795ad3f4805f187459cd7a77"
|
checksum = "f9cb534d5ffd109c7d1135f34cdae29e60eab94855a625dcfe1705f8bc7ad79f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
|
"bytemuck",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"document-features",
|
"document-features",
|
||||||
|
|
@ -6440,9 +6474,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core"
|
name = "wgpu-core"
|
||||||
version = "27.0.3"
|
version = "28.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "27a75de515543b1897b26119f93731b385a19aea165a1ec5f0e3acecc229cae7"
|
checksum = "d23f4642f53f666adcfd2d3218ab174d1e6681101aef18696b90cbe64d1c10f9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"bit-set",
|
"bit-set",
|
||||||
|
|
@ -6472,27 +6506,27 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core-deps-apple"
|
name = "wgpu-core-deps-apple"
|
||||||
version = "27.0.0"
|
version = "28.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0772ae958e9be0c729561d5e3fd9a19679bcdfb945b8b1a1969d9bfe8056d233"
|
checksum = "87b7b696b918f337c486bf93142454080a32a37832ba8a31e4f48221890047da"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wgpu-hal",
|
"wgpu-hal",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core-deps-emscripten"
|
name = "wgpu-core-deps-emscripten"
|
||||||
version = "27.0.0"
|
version = "28.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b06ac3444a95b0813ecfd81ddb2774b66220b264b3e2031152a4a29fda4da6b5"
|
checksum = "34b251c331f84feac147de3c4aa3aa45112622a95dd7ee1b74384fa0458dbd79"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wgpu-hal",
|
"wgpu-hal",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core-deps-windows-linux-android"
|
name = "wgpu-core-deps-windows-linux-android"
|
||||||
version = "27.0.0"
|
version = "28.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "71197027d61a71748e4120f05a9242b2ad142e3c01f8c1b47707945a879a03c3"
|
checksum = "68ca976e72b2c9964eb243e281f6ce7f14a514e409920920dcda12ae40febaae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"wgpu-hal",
|
"wgpu-hal",
|
||||||
]
|
]
|
||||||
|
|
@ -6518,9 +6552,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-hal"
|
name = "wgpu-hal"
|
||||||
version = "27.0.4"
|
version = "28.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce"
|
checksum = "44d6cb474beb218824dcc9e1ce679d973f719262789bfb27407da560cac20eeb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_system_properties",
|
"android_system_properties",
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
|
|
@ -6534,7 +6568,6 @@ dependencies = [
|
||||||
"core-graphics-types",
|
"core-graphics-types",
|
||||||
"glow",
|
"glow",
|
||||||
"glutin_wgl_sys",
|
"glutin_wgl_sys",
|
||||||
"gpu-alloc",
|
|
||||||
"gpu-allocator",
|
"gpu-allocator",
|
||||||
"gpu-descriptor",
|
"gpu-descriptor",
|
||||||
"hashbrown 0.16.0",
|
"hashbrown 0.16.0",
|
||||||
|
|
@ -6561,21 +6594,20 @@ dependencies = [
|
||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
"wgpu-types",
|
"wgpu-types",
|
||||||
"windows",
|
"windows 0.62.2",
|
||||||
"windows-core 0.58.0",
|
"windows-core 0.62.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-types"
|
name = "wgpu-types"
|
||||||
version = "27.0.1"
|
version = "28.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "afdcf84c395990db737f2dd91628706cb31e86d72e53482320d368e52b5da5eb"
|
checksum = "e18308757e594ed2cd27dddbb16a139c42a683819d32a2e0b1b0167552f5840c"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.11.0",
|
"bitflags 2.11.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
"thiserror 2.0.18",
|
|
||||||
"web-sys",
|
"web-sys",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -6634,6 +6666,27 @@ dependencies = [
|
||||||
"windows-targets 0.52.6",
|
"windows-targets 0.52.6",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows"
|
||||||
|
version = "0.62.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
|
||||||
|
dependencies = [
|
||||||
|
"windows-collections",
|
||||||
|
"windows-core 0.62.2",
|
||||||
|
"windows-future",
|
||||||
|
"windows-numerics",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-collections"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
|
||||||
|
dependencies = [
|
||||||
|
"windows-core 0.62.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-core"
|
name = "windows-core"
|
||||||
version = "0.58.0"
|
version = "0.58.0"
|
||||||
|
|
@ -6660,6 +6713,30 @@ dependencies = [
|
||||||
"windows-strings 0.4.2",
|
"windows-strings 0.4.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-core"
|
||||||
|
version = "0.62.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
|
||||||
|
dependencies = [
|
||||||
|
"windows-implement 0.60.2",
|
||||||
|
"windows-interface 0.59.3",
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
"windows-result 0.4.1",
|
||||||
|
"windows-strings 0.5.1",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-future"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
|
||||||
|
dependencies = [
|
||||||
|
"windows-core 0.62.2",
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
"windows-threading",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-implement"
|
name = "windows-implement"
|
||||||
version = "0.58.0"
|
version = "0.58.0"
|
||||||
|
|
@ -6716,6 +6793,16 @@ version = "0.2.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-numerics"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
|
||||||
|
dependencies = [
|
||||||
|
"windows-core 0.62.2",
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-registry"
|
name = "windows-registry"
|
||||||
version = "0.5.3"
|
version = "0.5.3"
|
||||||
|
|
@ -6745,6 +6832,15 @@ dependencies = [
|
||||||
"windows-link 0.1.3",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-result"
|
||||||
|
version = "0.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-strings"
|
name = "windows-strings"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
@ -6764,6 +6860,15 @@ dependencies = [
|
||||||
"windows-link 0.1.3",
|
"windows-link 0.1.3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-strings"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-sys"
|
name = "windows-sys"
|
||||||
version = "0.45.0"
|
version = "0.45.0"
|
||||||
|
|
@ -6857,6 +6962,15 @@ dependencies = [
|
||||||
"windows_x86_64_msvc 0.53.0",
|
"windows_x86_64_msvc 0.53.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-threading"
|
||||||
|
version = "0.2.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37"
|
||||||
|
dependencies = [
|
||||||
|
"windows-link 0.2.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows_aarch64_gnullvm"
|
name = "windows_aarch64_gnullvm"
|
||||||
version = "0.42.2"
|
version = "0.42.2"
|
||||||
|
|
|
||||||
13
Cargo.toml
13
Cargo.toml
|
|
@ -120,7 +120,7 @@ quote = "1.0"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
ron = "0.12"
|
ron = "0.12"
|
||||||
fastnoise-lite = "1.1"
|
fastnoise-lite = "1.1"
|
||||||
wgpu = { version = "27.0", features = [
|
wgpu = { version = "28.0", features = [
|
||||||
# We don't have wgpu on multiple threads (yet) https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#wgpu-types-now-send-sync-on-wasm
|
# We don't have wgpu on multiple threads (yet) https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#wgpu-types-now-send-sync-on-wasm
|
||||||
"fragile-send-sync-non-atomic-wasm",
|
"fragile-send-sync-non-atomic-wasm",
|
||||||
"spirv",
|
"spirv",
|
||||||
|
|
@ -154,8 +154,8 @@ url = "2.5"
|
||||||
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt", "rt-multi-thread"] }
|
tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt", "rt-multi-thread"] }
|
||||||
# Linebender ecosystem (BEGIN)
|
# Linebender ecosystem (BEGIN)
|
||||||
kurbo = { version = "0.13", features = ["serde"] }
|
kurbo = { version = "0.13", features = ["serde"] }
|
||||||
vello = "0.7"
|
vello = "0.8"
|
||||||
vello_encoding = "0.7"
|
vello_encoding = "0.8"
|
||||||
resvg = "0.47"
|
resvg = "0.47"
|
||||||
usvg = "0.47"
|
usvg = "0.47"
|
||||||
parley = "0.6"
|
parley = "0.6"
|
||||||
|
|
@ -202,8 +202,8 @@ iai-callgrind = { version = "0.16" }
|
||||||
ndarray = "0.16"
|
ndarray = "0.16"
|
||||||
strum = { version = "0.27", features = ["derive"] }
|
strum = { version = "0.27", features = ["derive"] }
|
||||||
dirs = "6.0"
|
dirs = "6.0"
|
||||||
cef = "142"
|
cef = "147"
|
||||||
cef-dll-sys = "142"
|
cef-dll-sys = "147"
|
||||||
include_dir = "0.7"
|
include_dir = "0.7"
|
||||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
|
|
@ -243,7 +243,4 @@ debug = true
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
# Force cargo to use only one version of the dpi crate (vendoring breaks without this)
|
# Force cargo to use only one version of the dpi crate (vendoring breaks without this)
|
||||||
dpi = { git = "https://github.com/rust-windowing/winit.git" }
|
dpi = { git = "https://github.com/rust-windowing/winit.git" }
|
||||||
download-cef = { git = "https://github.com/timon-schelling/cef-rs.git", branch = "graphite" }
|
|
||||||
rfd = { git = "https://github.com/timon-schelling/rfd.git", branch = "graphite" } # TODO: Remove this once https://github.com/PolyMeilex/rfd/pull/317 is merged and released
|
rfd = { git = "https://github.com/timon-schelling/rfd.git", branch = "graphite" } # TODO: Remove this once https://github.com/PolyMeilex/rfd/pull/317 is merged and released
|
||||||
vello = { git = "https://github.com/Keavon/vello.git", branch = "0.7.0-fix-images-rendering-blurry" }
|
|
||||||
vello_encoding = { git = "https://github.com/Keavon/vello.git", branch = "0.7.0-fix-images-rendering-blurry" }
|
|
||||||
|
|
|
||||||
|
|
@ -24,14 +24,13 @@ unsafe impl<H: CefEventHandler> Send for CefContextBuilder<H> {}
|
||||||
|
|
||||||
impl<H: CefEventHandler> CefContextBuilder<H> {
|
impl<H: CefEventHandler> CefContextBuilder<H> {
|
||||||
pub(crate) fn new() -> Self {
|
pub(crate) fn new() -> Self {
|
||||||
Self::new_inner(false)
|
Self::new_impl(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn new_helper() -> Self {
|
pub(crate) fn new_helper() -> Self {
|
||||||
Self::new_inner(true)
|
Self::new_impl(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_inner(helper: bool) -> Self {
|
fn new_impl(helper: bool) -> Self {
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
let _loader = {
|
let _loader = {
|
||||||
let loader = cef::library_loader::LibraryLoader::new(&std::env::current_exe().unwrap(), helper);
|
let loader = cef::library_loader::LibraryLoader::new(&std::env::current_exe().unwrap(), helper);
|
||||||
|
|
@ -42,12 +41,8 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
|
||||||
let _ = helper;
|
let _ = helper;
|
||||||
|
|
||||||
let _ = api_hash(CEF_API_VERSION_LAST, 0);
|
let _ = api_hash(CEF_API_VERSION_LAST, 0);
|
||||||
|
|
||||||
let args = Args::new();
|
let args = Args::new();
|
||||||
let cmd = args.as_cmd_line().unwrap();
|
let is_sub_process = args.as_cmd_line().unwrap().has_switch(Some(&"type".into())) == 1;
|
||||||
let switch = CefString::from("type");
|
|
||||||
let is_sub_process = cmd.has_switch(Some(&switch)) == 1;
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
args,
|
args,
|
||||||
is_sub_process,
|
is_sub_process,
|
||||||
|
|
@ -61,8 +56,7 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
|
||||||
|
|
||||||
pub(crate) fn execute_sub_process(&self) -> SetupError {
|
pub(crate) fn execute_sub_process(&self) -> SetupError {
|
||||||
let cmd = self.args.as_cmd_line().unwrap();
|
let cmd = self.args.as_cmd_line().unwrap();
|
||||||
let switch = CefString::from("type");
|
let process_type = CefString::from(&cmd.switch_value(Some(&"type".into())));
|
||||||
let process_type = CefString::from(&cmd.switch_value(Some(&switch)));
|
|
||||||
let mut app = RenderProcessAppImpl::<H>::app();
|
let mut app = RenderProcessAppImpl::<H>::app();
|
||||||
let ret = execute_process(Some(self.args.as_main_args()), Some(&mut app), std::ptr::null_mut());
|
let ret = execute_process(Some(self.args.as_main_args()), Some(&mut app), std::ptr::null_mut());
|
||||||
if ret >= 0 {
|
if ret >= 0 {
|
||||||
|
|
@ -72,103 +66,96 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn common_settings(instance_dir: &Path) -> Settings {
|
|
||||||
let log_severity = match std::env::var("GRAPHITE_BROWSER_LOG") {
|
|
||||||
Ok(level) => match level.to_lowercase().as_str() {
|
|
||||||
"debug" => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_VERBOSE),
|
|
||||||
"info" => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_INFO),
|
|
||||||
"warn" => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_WARNING),
|
|
||||||
"error" => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_ERROR),
|
|
||||||
"none" => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_DISABLE),
|
|
||||||
_ => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_FATAL),
|
|
||||||
},
|
|
||||||
Err(_) => LogSeverity::from(cef_log_severity_t::LOGSEVERITY_FATAL),
|
|
||||||
};
|
|
||||||
|
|
||||||
Settings {
|
|
||||||
windowless_rendering_enabled: 1,
|
|
||||||
root_cache_path: instance_dir.to_str().map(CefString::from).unwrap(),
|
|
||||||
cache_path: CefString::from(""),
|
|
||||||
disable_signal_handlers: 1,
|
|
||||||
log_severity,
|
|
||||||
..Default::default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
|
pub(crate) fn create(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
|
||||||
let instance_dir = TempDir::new().expect("Failed to create temporary directory for CEF instance");
|
let instance_dir = TempDir::new().expect("Failed to create temporary directory for CEF instance");
|
||||||
|
let accelerated_paint = accelerated_paint(disable_gpu_acceleration);
|
||||||
let exe = std::env::current_exe().expect("cannot get current exe path");
|
self.build_inner(&event_handler, instance_dir.as_ref(), accelerated_paint)?;
|
||||||
let app_root = exe.parent().and_then(|p| p.parent()).expect("bad path structure").parent().expect("bad path structure");
|
create_browser(event_handler, instance_dir, accelerated_paint)
|
||||||
|
|
||||||
let settings = Settings {
|
|
||||||
main_bundle_path: CefString::from(app_root.to_str().unwrap()),
|
|
||||||
multi_threaded_message_loop: 0,
|
|
||||||
external_message_pump: 1,
|
|
||||||
no_sandbox: 1, // GPU helper crashes when running with sandbox
|
|
||||||
..Self::common_settings(instance_dir.as_ref())
|
|
||||||
};
|
|
||||||
|
|
||||||
self.initialize_inner(&event_handler, settings)?;
|
|
||||||
|
|
||||||
create_browser(event_handler, instance_dir, disable_gpu_acceleration)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(not(target_os = "macos"))]
|
||||||
pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
|
pub(crate) fn create(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
|
||||||
let instance_dir = TempDir::new().expect("Failed to create temporary directory for CEF instance");
|
let instance_dir = TempDir::new().expect("Failed to create temporary directory for CEF instance");
|
||||||
|
let accelerated_paint = accelerated_paint(disable_gpu_acceleration);
|
||||||
let settings = Settings {
|
self.build_inner(&event_handler, instance_dir.as_ref(), accelerated_paint)?;
|
||||||
multi_threaded_message_loop: 1,
|
super::multithreaded::run_on_ui_thread(move || match create_browser(event_handler, instance_dir, accelerated_paint) {
|
||||||
#[cfg(target_os = "linux")]
|
Ok(context) => super::multithreaded::CONTEXT.with(|b| *b.borrow_mut() = Some(context)),
|
||||||
no_sandbox: 1,
|
Err(e) => panic!("Failed to initialize CEF context: {:?}", e),
|
||||||
..Self::common_settings(instance_dir.as_ref())
|
|
||||||
};
|
|
||||||
|
|
||||||
self.initialize_inner(&event_handler, settings)?;
|
|
||||||
|
|
||||||
super::multithreaded::run_on_ui_thread(move || match create_browser(event_handler, instance_dir, disable_gpu_acceleration) {
|
|
||||||
Ok(context) => {
|
|
||||||
super::multithreaded::CONTEXT.with(|b| {
|
|
||||||
*b.borrow_mut() = Some(context);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
Err(e) => {
|
|
||||||
panic!("Failed to initialize CEF context: {:?}", e);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Ok(super::multithreaded::MultiThreadedCefContextProxy)
|
Ok(super::multithreaded::MultiThreadedCefContextProxy)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn initialize_inner(self, event_handler: &H, settings: Settings) -> Result<(), InitError> {
|
fn build_inner(self, event_handler: &H, instance_dir: &Path, accelerated_paint: bool) -> Result<(), InitError> {
|
||||||
// Attention! Wrapping this in an extra App is necessary, otherwise the program still compiles but segfaults
|
let mut cef_app = App::new(BrowserProcessAppImpl::new(event_handler.duplicate(), accelerated_paint));
|
||||||
let mut cef_app = App::new(BrowserProcessAppImpl::new(event_handler.duplicate()));
|
let result = cef::initialize(Some(self.args.as_main_args()), Some(&platform_settings(instance_dir)), Some(&mut cef_app), std::ptr::null_mut());
|
||||||
|
|
||||||
let result = cef::initialize(Some(self.args.as_main_args()), Some(&settings), Some(&mut cef_app), std::ptr::null_mut());
|
|
||||||
if result != 1 {
|
if result != 1 {
|
||||||
let cef_exit_code = cef::get_exit_code() as u32;
|
return Err(InitError::InitializationFailureCode(cef::get_exit_code() as u32));
|
||||||
return Err(InitError::InitializationFailureCode(cef_exit_code));
|
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_browser<H: CefEventHandler>(event_handler: H, instance_dir: TempDir, disable_gpu_acceleration: bool) -> Result<SingleThreadedCefContext, InitError> {
|
fn accelerated_paint(disable_gpu_acceleration: bool) -> bool {
|
||||||
let mut client = Client::new(BrowserProcessClientImpl::new(&event_handler));
|
|
||||||
|
|
||||||
#[cfg(feature = "accelerated_paint")]
|
#[cfg(feature = "accelerated_paint")]
|
||||||
let use_accelerated_paint = if disable_gpu_acceleration {
|
{
|
||||||
|
!disable_gpu_acceleration && crate::cef::platform::should_enable_hardware_acceleration()
|
||||||
|
}
|
||||||
|
#[cfg(not(feature = "accelerated_paint"))]
|
||||||
|
{
|
||||||
|
let _ = disable_gpu_acceleration;
|
||||||
false
|
false
|
||||||
} else {
|
}
|
||||||
crate::cef::platform::should_enable_hardware_acceleration()
|
}
|
||||||
|
|
||||||
|
fn platform_settings(instance_dir: &Path) -> Settings {
|
||||||
|
let log_severity = match std::env::var("GRAPHITE_BROWSER_LOG").unwrap_or_default().to_lowercase().as_str() {
|
||||||
|
"debug" => cef_log_severity_t::LOGSEVERITY_VERBOSE,
|
||||||
|
"info" => cef_log_severity_t::LOGSEVERITY_INFO,
|
||||||
|
"warn" => cef_log_severity_t::LOGSEVERITY_WARNING,
|
||||||
|
"error" => cef_log_severity_t::LOGSEVERITY_ERROR,
|
||||||
|
"none" => cef_log_severity_t::LOGSEVERITY_DISABLE,
|
||||||
|
_ => cef_log_severity_t::LOGSEVERITY_FATAL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let base = Settings {
|
||||||
|
windowless_rendering_enabled: 1,
|
||||||
|
root_cache_path: instance_dir.to_str().map(CefString::from).unwrap(),
|
||||||
|
cache_path: "".into(),
|
||||||
|
disable_signal_handlers: 1,
|
||||||
|
log_severity: LogSeverity::from(log_severity),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
let exe = std::env::current_exe().expect("cannot get current exe path");
|
||||||
|
let app_root = exe.parent().and_then(|p| p.parent()).expect("bad path structure").parent().expect("bad path structure");
|
||||||
|
return Settings {
|
||||||
|
main_bundle_path: app_root.to_str().map(CefString::from).unwrap(),
|
||||||
|
multi_threaded_message_loop: 0,
|
||||||
|
external_message_pump: 1,
|
||||||
|
no_sandbox: 1, // GPU helper crashes when running with sandbox
|
||||||
|
..base
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "macos"))]
|
||||||
|
Settings {
|
||||||
|
multi_threaded_message_loop: 1,
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
no_sandbox: 1,
|
||||||
|
..base
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn create_browser<H: CefEventHandler>(event_handler: H, instance_dir: TempDir, accelerated_paint: bool) -> Result<SingleThreadedCefContext, InitError> {
|
||||||
|
let mut client = Client::new(BrowserProcessClientImpl::new(&event_handler));
|
||||||
|
|
||||||
let window_info = WindowInfo {
|
let window_info = WindowInfo {
|
||||||
windowless_rendering_enabled: 1,
|
windowless_rendering_enabled: 1,
|
||||||
#[cfg(feature = "accelerated_paint")]
|
#[cfg(feature = "accelerated_paint")]
|
||||||
shared_texture_enabled: use_accelerated_paint as i32,
|
shared_texture_enabled: accelerated_paint as i32,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -181,7 +168,7 @@ fn create_browser<H: CefEventHandler>(event_handler: H, instance_dir: TempDir, d
|
||||||
let Some(mut incognito_request_context) = cef::request_context_create_context(
|
let Some(mut incognito_request_context) = cef::request_context_create_context(
|
||||||
Some(&RequestContextSettings {
|
Some(&RequestContextSettings {
|
||||||
persist_session_cookies: 0,
|
persist_session_cookies: 0,
|
||||||
cache_path: CefString::from(""),
|
cache_path: "".into(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}),
|
}),
|
||||||
Option::<&mut cef::RequestContextHandler>::None,
|
Option::<&mut cef::RequestContextHandler>::None,
|
||||||
|
|
@ -191,30 +178,27 @@ fn create_browser<H: CefEventHandler>(event_handler: H, instance_dir: TempDir, d
|
||||||
|
|
||||||
let mut scheme_handler_factory = SchemeHandlerFactory::new(SchemeHandlerFactoryImpl::new(event_handler.duplicate()));
|
let mut scheme_handler_factory = SchemeHandlerFactory::new(SchemeHandlerFactoryImpl::new(event_handler.duplicate()));
|
||||||
incognito_request_context.clear_scheme_handler_factories();
|
incognito_request_context.clear_scheme_handler_factories();
|
||||||
incognito_request_context.register_scheme_handler_factory(Some(&CefString::from(RESOURCE_SCHEME)), Some(&CefString::from(RESOURCE_DOMAIN)), Some(&mut scheme_handler_factory));
|
incognito_request_context.register_scheme_handler_factory(Some(&RESOURCE_SCHEME.into()), Some(&RESOURCE_DOMAIN.into()), Some(&mut scheme_handler_factory));
|
||||||
|
|
||||||
let url = CefString::from(format!("{RESOURCE_SCHEME}://{RESOURCE_DOMAIN}/").as_str());
|
let url = format!("{RESOURCE_SCHEME}://{RESOURCE_DOMAIN}/");
|
||||||
|
browser_host_create_browser_sync(
|
||||||
let browser = browser_host_create_browser_sync(
|
|
||||||
Some(&window_info),
|
Some(&window_info),
|
||||||
Some(&mut client),
|
Some(&mut client),
|
||||||
Some(&url),
|
Some(&url.as_str().into()),
|
||||||
Some(&settings),
|
Some(&settings),
|
||||||
Option::<&mut DictionaryValue>::None,
|
Option::<&mut DictionaryValue>::None,
|
||||||
Some(&mut incognito_request_context),
|
Some(&mut incognito_request_context),
|
||||||
);
|
)
|
||||||
|
.map(|browser| SingleThreadedCefContext {
|
||||||
if let Some(browser) = browser {
|
event_handler: Box::new(event_handler),
|
||||||
Ok(SingleThreadedCefContext {
|
browser,
|
||||||
event_handler: Box::new(event_handler),
|
input_state: InputState::default(),
|
||||||
browser,
|
_instance_dir: instance_dir,
|
||||||
input_state: InputState::default(),
|
})
|
||||||
_instance_dir: instance_dir,
|
.ok_or_else(|| {
|
||||||
})
|
|
||||||
} else {
|
|
||||||
tracing::error!("Failed to create browser");
|
tracing::error!("Failed to create browser");
|
||||||
Err(InitError::BrowserCreationFailed)
|
InitError::BrowserCreationFailed
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
#[cfg(target_os = "linux")]
|
|
||||||
use std::env;
|
|
||||||
|
|
||||||
use cef::rc::{Rc, RcImpl};
|
use cef::rc::{Rc, RcImpl};
|
||||||
use cef::sys::{_cef_app_t, cef_base_ref_counted_t};
|
use cef::sys::{_cef_app_t, cef_base_ref_counted_t};
|
||||||
use cef::{BrowserProcessHandler, CefString, ImplApp, ImplCommandLine, SchemeRegistrar, WrapApp};
|
use cef::{BrowserProcessHandler, CefString, ImplApp, ImplCommandLine, SchemeRegistrar, WrapApp};
|
||||||
|
|
@ -12,12 +9,14 @@ use crate::cef::CefEventHandler;
|
||||||
pub(crate) struct BrowserProcessAppImpl<H: CefEventHandler> {
|
pub(crate) struct BrowserProcessAppImpl<H: CefEventHandler> {
|
||||||
object: *mut RcImpl<_cef_app_t, Self>,
|
object: *mut RcImpl<_cef_app_t, Self>,
|
||||||
event_handler: H,
|
event_handler: H,
|
||||||
|
accelerated_paint: bool,
|
||||||
}
|
}
|
||||||
impl<H: CefEventHandler> BrowserProcessAppImpl<H> {
|
impl<H: CefEventHandler> BrowserProcessAppImpl<H> {
|
||||||
pub(crate) fn new(event_handler: H) -> Self {
|
pub(crate) fn new(event_handler: H, accelerated_paint: bool) -> Self {
|
||||||
Self {
|
Self {
|
||||||
object: std::ptr::null_mut(),
|
object: std::ptr::null_mut(),
|
||||||
event_handler,
|
event_handler,
|
||||||
|
accelerated_paint,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -33,81 +32,75 @@ impl<H: CefEventHandler> ImplApp for BrowserProcessAppImpl<H> {
|
||||||
|
|
||||||
fn on_before_command_line_processing(&self, _process_type: Option<&cef::CefString>, command_line: Option<&mut cef::CommandLine>) {
|
fn on_before_command_line_processing(&self, _process_type: Option<&cef::CefString>, command_line: Option<&mut cef::CommandLine>) {
|
||||||
if let Some(cmd) = command_line {
|
if let Some(cmd) = command_line {
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("renderer-process-limit")), Some(&CefString::from("1")));
|
cmd.append_switch_with_value(Some(&"renderer-process-limit".into()), Some(&"1".into()));
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("password-store")), Some(&CefString::from("basic")));
|
cmd.append_switch_with_value(Some(&"password-store".into()), Some(&"basic".into()));
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("disk-cache-size")), Some(&CefString::from("0")));
|
cmd.append_switch_with_value(Some(&"disk-cache-size".into()), Some(&"0".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("incognito")));
|
cmd.append_switch(Some(&"no-sandbox".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("no-first-run")));
|
cmd.append_switch(Some(&"no-first-run".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("no-default-browser-check")));
|
cmd.append_switch(Some(&"noerrdialogs".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-component-update")));
|
cmd.append_switch(Some(&"no-default-browser-check".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-geolocation")));
|
cmd.append_switch(Some(&"mute-audio".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-notifications")));
|
cmd.append_switch(Some(&"use-fake-device-for-media-stream".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-audio-input")));
|
cmd.append_switch(Some(&"incognito".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-audio-output")));
|
cmd.append_switch(Some(&"disable-sync".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-sync")));
|
cmd.append_switch(Some(&"disable-file-system".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-file-system")));
|
cmd.append_switch(Some(&"disable-component-update".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-local-storage")));
|
cmd.append_switch(Some(&"disable-geolocation".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-background-networking")));
|
cmd.append_switch(Some(&"disable-notifications".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-default-apps")));
|
cmd.append_switch(Some(&"disable-background-networking".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-breakpad")));
|
cmd.append_switch(Some(&"disable-default-apps".into()));
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("disable-blink-features")), Some(&CefString::from("WebBluetooth,WebUSB,Serial")));
|
cmd.append_switch(Some(&"disable-breakpad".into()));
|
||||||
|
cmd.append_switch_with_value(Some(&"disable-blink-features".into()), Some(&"WebBluetooth,WebUSB,Serial".into()));
|
||||||
|
|
||||||
let extra_disabled_features = ["OptimizationHints", "OnDeviceModelService", "TranslateUI"];
|
let extra_disabled_features = ["OptimizationHints", "OnDeviceModelService", "TranslateUI"];
|
||||||
let disabled_features_switch = Some(&CefString::from("disable-features"));
|
let disabled_features_switch = Some(&"disable-features".into());
|
||||||
let disabled_features: String = CefString::from(&cmd.switch_value(disabled_features_switch))
|
let mut disabled_features: Vec<String> = CefString::from(&cmd.switch_value(disabled_features_switch))
|
||||||
.to_string()
|
.to_string()
|
||||||
.split(',')
|
.split(',')
|
||||||
.chain(extra_disabled_features)
|
.filter(|feature| !feature.is_empty())
|
||||||
.collect::<Vec<_>>()
|
.map(ToOwned::to_owned)
|
||||||
.join(",");
|
.collect();
|
||||||
cmd.append_switch_with_value(disabled_features_switch, Some(&CefString::from(disabled_features.as_str())));
|
disabled_features.extend(extra_disabled_features.into_iter().map(ToOwned::to_owned));
|
||||||
|
cmd.append_switch_with_value(disabled_features_switch, Some(&disabled_features.join(",").as_str().into()));
|
||||||
|
|
||||||
#[cfg(not(feature = "accelerated_paint"))]
|
if self.accelerated_paint {
|
||||||
{
|
cmd.append_switch(Some(&"enable-gpu".into()));
|
||||||
// Disable GPU acceleration when accelerated_paint feature is not enabled
|
cmd.append_switch(Some(&"enable-gpu-compositing".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-gpu")));
|
cmd.append_switch(Some(&"enable-begin-frame-scheduling".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("disable-gpu-compositing")));
|
cmd.append_switch(Some(&"off-screen-rendering-enabled".into()));
|
||||||
}
|
cmd.append_switch(Some(&"enable-accelerated-2d-canvas".into()));
|
||||||
|
|
||||||
#[cfg(feature = "accelerated_paint")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
// Enable GPU acceleration switches for better performance
|
cmd.append_switch_with_value(Some(&"use-angle".into()), Some(&"gl-egl".into()));
|
||||||
cmd.append_switch(Some(&CefString::from("enable-gpu-rasterization")));
|
|
||||||
cmd.append_switch(Some(&CefString::from("enable-accelerated-2d-canvas")));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(all(feature = "accelerated_paint", target_os = "linux"))]
|
let use_wayland = std::env::var("WAYLAND_DISPLAY")
|
||||||
{
|
.ok()
|
||||||
// Use Vulkan for accelerated painting
|
.filter(|var| !var.is_empty())
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("use-angle")), Some(&CefString::from("vulkan")));
|
.or_else(|| std::env::var("WAYLAND_SOCKET").ok())
|
||||||
}
|
.filter(|var| !var.is_empty())
|
||||||
|
.is_some();
|
||||||
// Tell CEF to use Wayland if available
|
if use_wayland {
|
||||||
#[cfg(target_os = "linux")]
|
cmd.append_switch_with_value(Some(&"ozone-platform".into()), Some(&"wayland".into()));
|
||||||
{
|
}
|
||||||
let use_wayland = env::var("WAYLAND_DISPLAY")
|
|
||||||
.ok()
|
|
||||||
.filter(|var| !var.is_empty())
|
|
||||||
.or_else(|| env::var("WAYLAND_SOCKET").ok())
|
|
||||||
.filter(|var| !var.is_empty())
|
|
||||||
.is_some();
|
|
||||||
if use_wayland {
|
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("ozone-platform")), Some(&CefString::from("wayland")));
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
cmd.append_switch(Some(&"disable-gpu".into()));
|
||||||
|
cmd.append_switch(Some(&"disable-gpu-compositing".into()));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
{
|
{
|
||||||
// Hide user prompt asking for keychain access
|
// Hide user prompt asking for keychain access
|
||||||
cmd.append_switch(Some(&CefString::from("use-mock-keychain")));
|
cmd.append_switch(Some(&"use-mock-keychain".into()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Enable browser debugging via environment variable
|
// Enable browser debugging via environment variable
|
||||||
if let Some(env) = std::env::var("GRAPHITE_BROWSER_DEBUG_PORT").ok()
|
if let Some(env) = std::env::var("GRAPHITE_BROWSER_DEBUG_PORT").ok()
|
||||||
&& let Some(port) = env.parse::<u16>().ok()
|
&& let Some(port) = env.parse::<u16>().ok()
|
||||||
{
|
{
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("remote-debugging-port")), Some(&CefString::from(port.to_string().as_str())));
|
cmd.append_switch_with_value(Some(&"remote-debugging-port".into()), Some(&port.to_string().as_str().into()));
|
||||||
cmd.append_switch_with_value(Some(&CefString::from("remote-allow-origins")), Some(&CefString::from("*")));
|
cmd.append_switch_with_value(Some(&"remote-allow-origins".into()), Some(&"*".into()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,6 +119,7 @@ impl<H: CefEventHandler> Clone for BrowserProcessAppImpl<H> {
|
||||||
Self {
|
Self {
|
||||||
object: self.object,
|
object: self.object,
|
||||||
event_handler: self.event_handler.duplicate(),
|
event_handler: self.event_handler.duplicate(),
|
||||||
|
accelerated_paint: self.accelerated_paint,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
use cef::rc::{ConvertReturnValue, Rc, RcImpl};
|
use cef::rc::{ConvertReturnValue, Rc, RcImpl};
|
||||||
use cef::sys::{_cef_render_process_handler_t, cef_base_ref_counted_t, cef_render_process_handler_t, cef_v8_propertyattribute_t, cef_v8_value_create_array_buffer_with_copy};
|
use cef::sys::{_cef_render_process_handler_t, cef_base_ref_counted_t, cef_render_process_handler_t, cef_v8_propertyattribute_t, cef_v8_value_create_array_buffer_with_copy};
|
||||||
use cef::{CefString, ImplFrame, ImplRenderProcessHandler, ImplV8Context, ImplV8Value, V8Handler, V8Propertyattribute, V8Value, WrapRenderProcessHandler, v8_value_create_function};
|
use cef::{ImplFrame, ImplRenderProcessHandler, ImplV8Context, ImplV8Value, V8Handler, V8Propertyattribute, V8Value, WrapRenderProcessHandler, v8_value_create_function};
|
||||||
|
|
||||||
use crate::cef::ipc::{MessageType, UnpackMessage, UnpackedMessage};
|
use crate::cef::ipc::{MessageType, UnpackMessage, UnpackedMessage};
|
||||||
|
|
||||||
|
|
@ -52,14 +52,10 @@ impl ImplRenderProcessHandler for RenderProcessHandlerImpl {
|
||||||
|
|
||||||
let function_call = format!("window.{function_name}(window.{property_name})");
|
let function_call = format!("window.{function_name}(window.{property_name})");
|
||||||
|
|
||||||
global.set_value_bykey(
|
global.set_value_bykey(Some(&property_name.into()), Some(&mut value), cef_v8_propertyattribute_t::V8_PROPERTY_ATTRIBUTE_READONLY.wrap_result());
|
||||||
Some(&CefString::from(property_name)),
|
|
||||||
Some(&mut value),
|
|
||||||
cef_v8_propertyattribute_t::V8_PROPERTY_ATTRIBUTE_READONLY.wrap_result(),
|
|
||||||
);
|
|
||||||
|
|
||||||
if global.value_bykey(Some(&CefString::from(function_name))).is_some() {
|
if global.value_bykey(Some(&function_name.into())).is_some() {
|
||||||
frame.execute_java_script(Some(&CefString::from(function_call.as_str())), None, 0);
|
frame.execute_java_script(Some(&function_call.as_str().into()), None, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if context.exit() == 0 {
|
if context.exit() == 0 {
|
||||||
|
|
@ -78,7 +74,7 @@ impl ImplRenderProcessHandler for RenderProcessHandlerImpl {
|
||||||
fn on_context_created(&self, _browser: Option<&mut cef::Browser>, _frame: Option<&mut cef::Frame>, context: Option<&mut cef::V8Context>) {
|
fn on_context_created(&self, _browser: Option<&mut cef::Browser>, _frame: Option<&mut cef::Frame>, context: Option<&mut cef::V8Context>) {
|
||||||
let register_js_function = |context: &mut cef::V8Context, name: &'static str| {
|
let register_js_function = |context: &mut cef::V8Context, name: &'static str| {
|
||||||
let mut v8_handler = V8Handler::new(RenderProcessV8HandlerImpl::new());
|
let mut v8_handler = V8Handler::new(RenderProcessV8HandlerImpl::new());
|
||||||
let Some(mut function) = v8_value_create_function(Some(&CefString::from(name)), Some(&mut v8_handler)) else {
|
let Some(mut function) = v8_value_create_function(Some(&name.into()), Some(&mut v8_handler)) else {
|
||||||
tracing::error!("Failed to create V8 function {name}");
|
tracing::error!("Failed to create V8 function {name}");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
@ -87,7 +83,7 @@ impl ImplRenderProcessHandler for RenderProcessHandlerImpl {
|
||||||
tracing::error!("Global object is not available in V8 context");
|
tracing::error!("Global object is not available in V8 context");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
global.set_value_bykey(Some(&CefString::from(name)), Some(&mut function), V8Propertyattribute::default());
|
global.set_value_bykey(Some(&name.into()), Some(&mut function), V8Propertyattribute::default());
|
||||||
};
|
};
|
||||||
|
|
||||||
let Some(context) = context else {
|
let Some(context) = context else {
|
||||||
|
|
|
||||||
|
|
@ -46,15 +46,14 @@ impl ImplResourceHandler for ResourceHandlerImpl {
|
||||||
if let Some(response) = response {
|
if let Some(response) = response {
|
||||||
if self.reader.is_some() {
|
if self.reader.is_some() {
|
||||||
if let Some(mimetype) = &self.mimetype {
|
if let Some(mimetype) = &self.mimetype {
|
||||||
let cef_mime = CefString::from(mimetype.as_str());
|
response.set_mime_type(Some(&mimetype.as_str().into()));
|
||||||
response.set_mime_type(Some(&cef_mime));
|
|
||||||
} else {
|
} else {
|
||||||
response.set_mime_type(None);
|
response.set_mime_type(None);
|
||||||
}
|
}
|
||||||
response.set_status(200);
|
response.set_status(200);
|
||||||
} else {
|
} else {
|
||||||
response.set_status(404);
|
response.set_status(404);
|
||||||
response.set_mime_type(Some(&CefString::from("text/plain")));
|
response.set_mime_type(Some(&"text/plain".into()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ impl<H: CefEventHandler> SchemeHandlerFactoryImpl<H> {
|
||||||
scheme_options |= cef_scheme_options_t::CEF_SCHEME_OPTION_FETCH_ENABLED as i32;
|
scheme_options |= cef_scheme_options_t::CEF_SCHEME_OPTION_FETCH_ENABLED as i32;
|
||||||
scheme_options |= cef_scheme_options_t::CEF_SCHEME_OPTION_SECURE as i32;
|
scheme_options |= cef_scheme_options_t::CEF_SCHEME_OPTION_SECURE as i32;
|
||||||
scheme_options |= cef_scheme_options_t::CEF_SCHEME_OPTION_CORS_ENABLED as i32;
|
scheme_options |= cef_scheme_options_t::CEF_SCHEME_OPTION_CORS_ENABLED as i32;
|
||||||
registrar.add_custom_scheme(Some(&CefString::from(RESOURCE_SCHEME)), scheme_options);
|
registrar.add_custom_scheme(Some(&RESOURCE_SCHEME.into()), scheme_options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
use cef::{CefString, Frame, ImplBinaryValue, ImplFrame, ImplListValue, ImplProcessMessage, ImplV8Context, ProcessId, V8Context, sys::cef_process_id_t};
|
use cef::{Frame, ImplBinaryValue, ImplFrame, ImplListValue, ImplProcessMessage, ImplV8Context, ProcessId, V8Context, sys::cef_process_id_t};
|
||||||
|
|
||||||
pub(crate) enum MessageType {
|
pub(crate) enum MessageType {
|
||||||
Initialized,
|
Initialized,
|
||||||
|
|
@ -67,7 +67,7 @@ impl SendMessage for Frame {
|
||||||
fn send_message(&self, message_type: MessageType, message: &[u8]) {
|
fn send_message(&self, message_type: MessageType, message: &[u8]) {
|
||||||
let MessageInfo { name, target } = message_type.into();
|
let MessageInfo { name, target } = message_type.into();
|
||||||
|
|
||||||
let Some(mut process_message) = cef::process_message_create(Some(&CefString::from(name.as_str()))) else {
|
let Some(mut process_message) = cef::process_message_create(Some(&name.as_str().into())) else {
|
||||||
tracing::error!("Failed to create process message: {}", name);
|
tracing::error!("Failed to create process message: {}", name);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::wrapper::{WgpuContext, WgpuContextBuilder, WgpuFeatures};
|
use crate::wrapper::{WgpuContext, WgpuContextBuilder, WgpuFeatures};
|
||||||
|
|
||||||
pub(super) async fn create_wgpu_context() -> WgpuContext {
|
pub(super) async fn create_wgpu_context() -> WgpuContext {
|
||||||
let wgpu_context_builder = WgpuContextBuilder::new().with_features(WgpuFeatures::PUSH_CONSTANTS);
|
let wgpu_context_builder = WgpuContextBuilder::new().with_features(WgpuFeatures::IMMEDIATES);
|
||||||
|
|
||||||
// TODO: add a cli flag to list adapters and exit instead of always printing
|
// TODO: add a cli flag to list adapters and exit instead of always printing
|
||||||
println!("\nAvailable WGPU adapters:\n{}", wgpu_context_builder.available_adapters_fmt().await);
|
println!("\nAvailable WGPU adapters:\n{}", wgpu_context_builder.available_adapters_fmt().await);
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ pub fn start() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let cef_handler = cef::CefHandler::new(wgpu_context.clone(), app_event_scheduler.clone(), cef_view_info_receiver);
|
let cef_handler = cef::CefHandler::new(wgpu_context.clone(), app_event_scheduler.clone(), cef_view_info_receiver);
|
||||||
let cef_context = match cef_context_builder.initialize(cef_handler, disable_ui_acceleration) {
|
let cef_context = match cef_context_builder.create(cef_handler, disable_ui_acceleration) {
|
||||||
Ok(context) => {
|
Ok(context) => {
|
||||||
tracing::info!("CEF initialized successfully");
|
tracing::info!("CEF initialized successfully");
|
||||||
context
|
context
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ pub(crate) fn write_state(state: PersistedState) {
|
||||||
if let Err(e) = std::fs::write(state_file_path(), data) {
|
if let Err(e) = std::fs::write(state_file_path(), data) {
|
||||||
tracing::error!("Failed to write persistent data to disk: {e}");
|
tracing::error!("Failed to write persistent data to disk: {e}");
|
||||||
}
|
}
|
||||||
garbage_collect_document_files(&state);
|
garbage_collect_document_files(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn write_document_content(id: DocumentId, document_content: String) {
|
pub(crate) fn write_document_content(id: DocumentId, document_content: String) {
|
||||||
|
|
|
||||||
|
|
@ -26,14 +26,14 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32) -> VertexOutput {
|
||||||
// FRAGMENT SHADER
|
// FRAGMENT SHADER
|
||||||
// ===============
|
// ===============
|
||||||
|
|
||||||
struct Constants {
|
struct Immediates {
|
||||||
viewport_scale: vec2<f32>,
|
viewport_scale: vec2<f32>,
|
||||||
viewport_offset: vec2<f32>,
|
viewport_offset: vec2<f32>,
|
||||||
ui_scale: vec2<f32>,
|
ui_scale: vec2<f32>,
|
||||||
background_color: vec4<f32>,
|
background_color: vec4<f32>,
|
||||||
};
|
};
|
||||||
|
|
||||||
var<push_constant> constants: Constants;
|
var<immediate> immediates: Immediates;
|
||||||
|
|
||||||
@group(0) @binding(0)
|
@group(0) @binding(0)
|
||||||
var t_viewport: texture_2d<f32>;
|
var t_viewport: texture_2d<f32>;
|
||||||
|
|
@ -46,10 +46,10 @@ var s_diffuse: sampler;
|
||||||
|
|
||||||
@fragment
|
@fragment
|
||||||
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||||
let ui_coordinate = in.tex_coords * constants.ui_scale;
|
let ui_coordinate = in.tex_coords * immediates.ui_scale;
|
||||||
if (ui_coordinate.x < 0.0 || ui_coordinate.x > 1.0 ||
|
if (ui_coordinate.x < 0.0 || ui_coordinate.x > 1.0 ||
|
||||||
ui_coordinate.y < 0.0 || ui_coordinate.y > 1.0) {
|
ui_coordinate.y < 0.0 || ui_coordinate.y > 1.0) {
|
||||||
return srgb_to_linear(constants.background_color);
|
return srgb_to_linear(immediates.background_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
let ui_linear = srgb_to_linear(textureSample(t_ui, s_diffuse, ui_coordinate));
|
let ui_linear = srgb_to_linear(textureSample(t_ui, s_diffuse, ui_coordinate));
|
||||||
|
|
@ -60,19 +60,19 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
|
||||||
// UI texture is premultiplied, we need to unpremultiply before blending
|
// UI texture is premultiplied, we need to unpremultiply before blending
|
||||||
let ui_srgb = linear_to_srgb(unpremultiply(ui_linear));
|
let ui_srgb = linear_to_srgb(unpremultiply(ui_linear));
|
||||||
|
|
||||||
let viewport_coordinate = (in.tex_coords - constants.viewport_offset) * constants.viewport_scale;
|
let viewport_coordinate = (in.tex_coords - immediates.viewport_offset) * immediates.viewport_scale;
|
||||||
if (viewport_coordinate.x < 0.0 || viewport_coordinate.x > 1.0 ||
|
if (viewport_coordinate.x < 0.0 || viewport_coordinate.x > 1.0 ||
|
||||||
viewport_coordinate.y < 0.0 || viewport_coordinate.y > 1.0) {
|
viewport_coordinate.y < 0.0 || viewport_coordinate.y > 1.0) {
|
||||||
return srgb_to_linear(constants.background_color);
|
return srgb_to_linear(immediates.background_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
let overlay_srgb = textureSample(t_overlays, s_diffuse, viewport_coordinate);
|
let overlay_srgb = textureSample(t_overlays, s_diffuse, viewport_coordinate);
|
||||||
var viewport_srgb = textureSample(t_viewport, s_diffuse, viewport_coordinate);
|
var viewport_srgb = textureSample(t_viewport, s_diffuse, viewport_coordinate);
|
||||||
|
|
||||||
if (viewport_srgb.a < 0.001) {
|
if (viewport_srgb.a < 0.001) {
|
||||||
viewport_srgb = constants.background_color;
|
viewport_srgb = immediates.background_color;
|
||||||
} else if (viewport_srgb.a < 0.999) {
|
} else if (viewport_srgb.a < 0.999) {
|
||||||
viewport_srgb = blend(viewport_srgb, constants.background_color);
|
viewport_srgb = blend(viewport_srgb, immediates.background_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (overlay_srgb.a < 0.001) {
|
if (overlay_srgb.a < 0.001) {
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ impl RenderState {
|
||||||
address_mode_w: wgpu::AddressMode::ClampToEdge,
|
address_mode_w: wgpu::AddressMode::ClampToEdge,
|
||||||
mag_filter: wgpu::FilterMode::Linear,
|
mag_filter: wgpu::FilterMode::Linear,
|
||||||
min_filter: wgpu::FilterMode::Nearest,
|
min_filter: wgpu::FilterMode::Nearest,
|
||||||
mipmap_filter: wgpu::FilterMode::Nearest,
|
mipmap_filter: wgpu::MipmapFilterMode::Nearest,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -122,10 +122,7 @@ impl RenderState {
|
||||||
let render_pipeline_layout = context.device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
let render_pipeline_layout = context.device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||||
label: Some("Render Pipeline Layout"),
|
label: Some("Render Pipeline Layout"),
|
||||||
bind_group_layouts: &[&texture_bind_group_layout],
|
bind_group_layouts: &[&texture_bind_group_layout],
|
||||||
push_constant_ranges: &[wgpu::PushConstantRange {
|
immediate_size: size_of::<Immediates>() as u32,
|
||||||
stages: wgpu::ShaderStages::FRAGMENT,
|
|
||||||
range: 0..size_of::<Constants>() as u32,
|
|
||||||
}],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let render_pipeline = context.device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
let render_pipeline = context.device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||||
|
|
@ -162,7 +159,7 @@ impl RenderState {
|
||||||
mask: !0,
|
mask: !0,
|
||||||
alpha_to_coverage_enabled: false,
|
alpha_to_coverage_enabled: false,
|
||||||
},
|
},
|
||||||
multiview: None,
|
multiview_mask: None,
|
||||||
cache: None,
|
cache: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -281,13 +278,13 @@ impl RenderState {
|
||||||
depth_stencil_attachment: None,
|
depth_stencil_attachment: None,
|
||||||
occlusion_query_set: None,
|
occlusion_query_set: None,
|
||||||
timestamp_writes: None,
|
timestamp_writes: None,
|
||||||
|
multiview_mask: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
render_pass.set_pipeline(&self.render_pipeline);
|
render_pass.set_pipeline(&self.render_pipeline);
|
||||||
render_pass.set_push_constants(
|
render_pass.set_immediates(
|
||||||
wgpu::ShaderStages::FRAGMENT,
|
|
||||||
0,
|
0,
|
||||||
bytemuck::bytes_of(&Constants {
|
bytemuck::bytes_of(&Immediates {
|
||||||
viewport_scale: self.viewport_scale,
|
viewport_scale: self.viewport_scale,
|
||||||
viewport_offset: self.viewport_offset,
|
viewport_offset: self.viewport_offset,
|
||||||
ui_scale: ui_scale.unwrap_or([1., 1.]),
|
ui_scale: ui_scale.unwrap_or([1., 1.]),
|
||||||
|
|
@ -358,7 +355,7 @@ pub(crate) enum RenderError {
|
||||||
|
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
#[derive(Copy, Clone, bytemuck::Pod, bytemuck::Zeroable)]
|
||||||
struct Constants {
|
struct Immediates {
|
||||||
viewport_scale: [f32; 2],
|
viewport_scale: [f32; 2],
|
||||||
viewport_offset: [f32; 2],
|
viewport_offset: [f32; 2],
|
||||||
ui_scale: [f32; 2],
|
ui_scale: [f32; 2],
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ impl ContextBuilder {
|
||||||
}
|
}
|
||||||
pub async fn available_adapters_fmt(&self) -> impl std::fmt::Display {
|
pub async fn available_adapters_fmt(&self) -> impl std::fmt::Display {
|
||||||
let instance = self.build_instance();
|
let instance = self.build_instance();
|
||||||
fmt::AvailableAdaptersFormatter(instance.enumerate_adapters(self.backends))
|
fmt::AvailableAdaptersFormatter(instance.enumerate_adapters(self.backends).await)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(target_family = "wasm")]
|
#[cfg(target_family = "wasm")]
|
||||||
|
|
@ -102,9 +102,10 @@ impl ContextBuilder {
|
||||||
let instance = self.build_instance();
|
let instance = self.build_instance();
|
||||||
|
|
||||||
let selected_adapter = if let Some(select) = select {
|
let selected_adapter = if let Some(select) = select {
|
||||||
self.select_adapter(&instance, select)
|
self.select_adapter(&instance, select).await
|
||||||
} else if cfg!(target_os = "windows") {
|
} else if cfg!(target_os = "windows") {
|
||||||
self.select_adapter(&instance, |adapters: &[Adapter]| adapters.iter().position(|a| a.get_info().backend == wgpu::Backend::Dx12))
|
self.select_adapter(&instance, |adapters: &[Adapter]| adapters.iter().position(|a| a.get_info().backend == wgpu::Backend::Dx12))
|
||||||
|
.await
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
@ -119,11 +120,11 @@ impl ContextBuilder {
|
||||||
instance: Arc::new(instance),
|
instance: Arc::new(instance),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fn select_adapter<S>(&self, instance: &Instance, select: S) -> Option<Adapter>
|
async fn select_adapter<S>(&self, instance: &Instance, select: S) -> Option<Adapter>
|
||||||
where
|
where
|
||||||
S: Fn(&[Adapter]) -> Option<usize>,
|
S: Fn(&[Adapter]) -> Option<usize>,
|
||||||
{
|
{
|
||||||
let mut adapters = instance.enumerate_adapters(self.backends);
|
let mut adapters = instance.enumerate_adapters(self.backends).await;
|
||||||
let selected_index = select(&adapters)?;
|
let selected_index = select(&adapters)?;
|
||||||
if selected_index >= adapters.len() {
|
if selected_index >= adapters.len() {
|
||||||
return None;
|
return None;
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ impl Resampler {
|
||||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||||
label: Some("resample_pipeline_layout"),
|
label: Some("resample_pipeline_layout"),
|
||||||
bind_group_layouts: &[&bind_group_layout],
|
bind_group_layouts: &[&bind_group_layout],
|
||||||
push_constant_ranges: &[],
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||||
|
|
@ -67,7 +67,7 @@ impl Resampler {
|
||||||
},
|
},
|
||||||
depth_stencil: None,
|
depth_stencil: None,
|
||||||
multisample: wgpu::MultisampleState::default(),
|
multisample: wgpu::MultisampleState::default(),
|
||||||
multiview: None,
|
multiview_mask: None,
|
||||||
cache: None,
|
cache: None,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -135,9 +135,7 @@ impl Resampler {
|
||||||
},
|
},
|
||||||
depth_slice: None,
|
depth_slice: None,
|
||||||
})],
|
})],
|
||||||
depth_stencil_attachment: None,
|
..Default::default()
|
||||||
timestamp_writes: None,
|
|
||||||
occlusion_query_set: None,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
render_pass.set_pipeline(&self.pipeline);
|
render_pass.set_pipeline(&self.pipeline);
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||||
label: Some(&format!("PerPixelAdjust {name} BindGroupLayout 0")),
|
label: Some(&format!("PerPixelAdjust {name} BindGroupLayout 0")),
|
||||||
entries,
|
entries,
|
||||||
})],
|
})],
|
||||||
push_constant_ranges: &[],
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
|
||||||
let pipeline = device.create_render_pipeline(&RenderPipelineDescriptor {
|
let pipeline = device.create_render_pipeline(&RenderPipelineDescriptor {
|
||||||
|
|
@ -140,6 +140,7 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||||
},
|
},
|
||||||
depth_stencil: None,
|
depth_stencil: None,
|
||||||
multisample: Default::default(),
|
multisample: Default::default(),
|
||||||
|
multiview_mask: None,
|
||||||
fragment: Some(FragmentState {
|
fragment: Some(FragmentState {
|
||||||
module: &shader_module,
|
module: &shader_module,
|
||||||
entry_point: Some(&fragment_name),
|
entry_point: Some(&fragment_name),
|
||||||
|
|
@ -150,7 +151,6 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||||
write_mask: Default::default(),
|
write_mask: Default::default(),
|
||||||
})],
|
})],
|
||||||
}),
|
}),
|
||||||
multiview: None,
|
|
||||||
cache: None,
|
cache: None,
|
||||||
});
|
});
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -227,9 +227,7 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||||
},
|
},
|
||||||
depth_slice: None,
|
depth_slice: None,
|
||||||
})],
|
})],
|
||||||
depth_stencil_attachment: None,
|
..Default::default()
|
||||||
timestamp_writes: None,
|
|
||||||
occlusion_query_set: None,
|
|
||||||
});
|
});
|
||||||
rp.set_pipeline(&self.pipeline);
|
rp.set_pipeline(&self.pipeline);
|
||||||
rp.set_bind_group(0, Some(&bind_group), &[]);
|
rp.set_bind_group(0, Some(&bind_group), &[]);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue