gecko-dev/third_party/rust/spirv-cross-internal/tests/glsl_tests.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

222 строки
5.9 KiB
Rust
Исходник Обычный вид История

Bug 1611296 - Replace spirv_cross by a wrapper crate with a different name r=jrmuizel This works around a check in rustc that skips object files that start with the rust crate name when linking with LTO. See upstream https://github.com/rust-lang/rust/issues/66285#issuecomment-578163265 Also, re-enables LTO for macOS fuzzy builds, since it was disabled previously in bug 1595805 as a workaround. Differential Revision: https://phabricator.services.mozilla.com/D60911 --HG-- rename : third_party/rust/spirv_cross/.cargo-checksum.json => third_party/rust/spirv-cross-internal/.cargo-checksum.json rename : third_party/rust/spirv_cross/Cargo.toml => third_party/rust/spirv-cross-internal/Cargo.toml rename : third_party/rust/spirv_cross/build.rs => third_party/rust/spirv-cross-internal/build.rs rename : third_party/rust/spirv_cross/src/bindings_native.rs => third_party/rust/spirv-cross-internal/src/bindings_native.rs rename : third_party/rust/spirv_cross/src/bindings_wasm.rs => third_party/rust/spirv-cross-internal/src/bindings_wasm.rs rename : third_party/rust/spirv_cross/src/bindings_wasm_functions.rs => third_party/rust/spirv-cross-internal/src/bindings_wasm_functions.rs rename : third_party/rust/spirv_cross/src/compiler.rs => third_party/rust/spirv-cross-internal/src/compiler.rs rename : third_party/rust/spirv_cross/src/emscripten.rs => third_party/rust/spirv-cross-internal/src/emscripten.rs rename : third_party/rust/spirv_cross/src/glsl.rs => third_party/rust/spirv-cross-internal/src/glsl.rs rename : third_party/rust/spirv_cross/src/hlsl.rs => third_party/rust/spirv-cross-internal/src/hlsl.rs rename : third_party/rust/spirv_cross/src/lib.rs => third_party/rust/spirv-cross-internal/src/lib.rs rename : third_party/rust/spirv_cross/src/msl.rs => third_party/rust/spirv-cross-internal/src/msl.rs rename : third_party/rust/spirv_cross/src/ptr_util.rs => third_party/rust/spirv-cross-internal/src/ptr_util.rs rename : third_party/rust/spirv_cross/src/spirv.rs => third_party/rust/spirv-cross-internal/src/spirv.rs rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/.clang-format => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/.clang-format rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/.gitignore => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/.gitignore rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/CMakeLists.txt => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/CMakeLists.txt rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/GLSL.std.450.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/GLSL.std.450.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/LICENSE => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/LICENSE rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/Makefile => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/Makefile rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/cmake/gitversion.in.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/cmake/gitversion.in.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/format_all.sh => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/format_all.sh rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/gn/BUILD.gn => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/gn/BUILD.gn rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/barrier.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/barrier.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/external_interface.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/external_interface.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/image.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/image.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/internal_interface.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/internal_interface.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/sampler.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/sampler.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/thread_group.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/thread_group.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/main.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/main.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/pkg-config/spirv-cross-c-shared.pc.in => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/pkg-config/spirv-cross-c-shared.pc.in rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cfg.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cfg.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cfg.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cfg.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_common.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_common.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cpp.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cpp.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cpp.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cpp.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_c.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_c.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_c.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_c.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_containers.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_containers.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_error_handling.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_error_handling.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_util.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_util.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_util.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_util.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_glsl.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_glsl.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_glsl.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_glsl.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_hlsl.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_hlsl.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_hlsl.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_hlsl.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_msl.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_msl.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_msl.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_msl.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_parser.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_parser.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_parser.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_parser.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_reflect.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_reflect.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_reflect.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_reflect.hpp rename : third_party/rust/spirv_cross/src/wrapper.cpp => third_party/rust/spirv-cross-internal/src/wrapper.cpp rename : third_party/rust/spirv_cross/src/wrapper.hpp => third_party/rust/spirv-cross-internal/src/wrapper.hpp rename : third_party/rust/spirv_cross/tests/common/mod.rs => third_party/rust/spirv-cross-internal/tests/common/mod.rs rename : third_party/rust/spirv_cross/tests/glsl_tests.rs => third_party/rust/spirv-cross-internal/tests/glsl_tests.rs rename : third_party/rust/spirv_cross/tests/hlsl_tests.rs => third_party/rust/spirv-cross-internal/tests/hlsl_tests.rs rename : third_party/rust/spirv_cross/tests/msl_tests.rs => third_party/rust/spirv-cross-internal/tests/msl_tests.rs rename : third_party/rust/spirv_cross/tests/shaders/array.vert => third_party/rust/spirv-cross-internal/tests/shaders/array.vert rename : third_party/rust/spirv_cross/tests/shaders/array.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/array.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/rasterize_disabled.vert => third_party/rust/spirv-cross-internal/tests/shaders/rasterize_disabled.vert rename : third_party/rust/spirv_cross/tests/shaders/rasterize_disabled.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/rasterize_disabled.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/sampler.frag => third_party/rust/spirv-cross-internal/tests/shaders/sampler.frag rename : third_party/rust/spirv_cross/tests/shaders/sampler.frag.spv => third_party/rust/spirv-cross-internal/tests/shaders/sampler.frag.spv rename : third_party/rust/spirv_cross/tests/shaders/simple.vert => third_party/rust/spirv-cross-internal/tests/shaders/simple.vert rename : third_party/rust/spirv_cross/tests/shaders/simple.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/simple.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/specialization.comp => third_party/rust/spirv-cross-internal/tests/shaders/specialization.comp rename : third_party/rust/spirv_cross/tests/shaders/specialization.comp.spv => third_party/rust/spirv-cross-internal/tests/shaders/specialization.comp.spv rename : third_party/rust/spirv_cross/tests/shaders/struct.frag => third_party/rust/spirv-cross-internal/tests/shaders/struct.frag rename : third_party/rust/spirv_cross/tests/shaders/struct.frag.spv => third_party/rust/spirv-cross-internal/tests/shaders/struct.frag.spv rename : third_party/rust/spirv_cross/tests/shaders/struct.vert => third_party/rust/spirv-cross-internal/tests/shaders/struct.vert rename : third_party/rust/spirv_cross/tests/shaders/struct.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/struct.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/workgroup.comp => third_party/rust/spirv-cross-internal/tests/shaders/workgroup.comp rename : third_party/rust/spirv_cross/tests/shaders/workgroup.comp.spv => third_party/rust/spirv-cross-internal/tests/shaders/workgroup.comp.spv rename : third_party/rust/spirv_cross/tests/spirv_tests.rs => third_party/rust/spirv-cross-internal/tests/spirv_tests.rs extra : moz-landing-system : lando
2020-01-24 17:55:41 +03:00
use spirv_cross_internal::{glsl, spirv};
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
mod common;
use crate::common::words_from_bytes;
#[test]
fn glsl_compiler_options_has_default() {
let compiler_options = glsl::CompilerOptions::default();
assert_eq!(compiler_options.vertex.invert_y, false);
assert_eq!(compiler_options.vertex.transform_clip_space, false);
}
#[test]
fn ast_compiles_to_glsl() {
let mut ast = spirv::Ast::<glsl::Target>::parse(&spirv::Module::from_words(words_from_bytes(
include_bytes!("shaders/simple.vert.spv"),
)))
.unwrap();
ast.set_compiler_options(&glsl::CompilerOptions {
version: glsl::Version::V4_60,
enable_420_pack_extension: true,
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
vertex: glsl::CompilerVertexOptions::default(),
})
.unwrap();
assert_eq!(
ast.compile().unwrap(),
"\
#version 460
layout(std140) uniform uniform_buffer_object
{
mat4 u_model_view_projection;
float u_scale;
} _22;
layout(location = 0) out vec3 v_normal;
layout(location = 1) in vec3 a_normal;
layout(location = 0) in vec4 a_position;
void main()
{
v_normal = a_normal;
gl_Position = (_22.u_model_view_projection * a_position) * _22.u_scale;
}
"
);
}
#[test]
fn ast_compiles_all_versions_to_glsl() {
Bug 1611296 - Replace spirv_cross by a wrapper crate with a different name r=jrmuizel This works around a check in rustc that skips object files that start with the rust crate name when linking with LTO. See upstream https://github.com/rust-lang/rust/issues/66285#issuecomment-578163265 Also, re-enables LTO for macOS fuzzy builds, since it was disabled previously in bug 1595805 as a workaround. Differential Revision: https://phabricator.services.mozilla.com/D60911 --HG-- rename : third_party/rust/spirv_cross/.cargo-checksum.json => third_party/rust/spirv-cross-internal/.cargo-checksum.json rename : third_party/rust/spirv_cross/Cargo.toml => third_party/rust/spirv-cross-internal/Cargo.toml rename : third_party/rust/spirv_cross/build.rs => third_party/rust/spirv-cross-internal/build.rs rename : third_party/rust/spirv_cross/src/bindings_native.rs => third_party/rust/spirv-cross-internal/src/bindings_native.rs rename : third_party/rust/spirv_cross/src/bindings_wasm.rs => third_party/rust/spirv-cross-internal/src/bindings_wasm.rs rename : third_party/rust/spirv_cross/src/bindings_wasm_functions.rs => third_party/rust/spirv-cross-internal/src/bindings_wasm_functions.rs rename : third_party/rust/spirv_cross/src/compiler.rs => third_party/rust/spirv-cross-internal/src/compiler.rs rename : third_party/rust/spirv_cross/src/emscripten.rs => third_party/rust/spirv-cross-internal/src/emscripten.rs rename : third_party/rust/spirv_cross/src/glsl.rs => third_party/rust/spirv-cross-internal/src/glsl.rs rename : third_party/rust/spirv_cross/src/hlsl.rs => third_party/rust/spirv-cross-internal/src/hlsl.rs rename : third_party/rust/spirv_cross/src/lib.rs => third_party/rust/spirv-cross-internal/src/lib.rs rename : third_party/rust/spirv_cross/src/msl.rs => third_party/rust/spirv-cross-internal/src/msl.rs rename : third_party/rust/spirv_cross/src/ptr_util.rs => third_party/rust/spirv-cross-internal/src/ptr_util.rs rename : third_party/rust/spirv_cross/src/spirv.rs => third_party/rust/spirv-cross-internal/src/spirv.rs rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/.clang-format => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/.clang-format rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/.gitignore => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/.gitignore rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/CMakeLists.txt => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/CMakeLists.txt rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/GLSL.std.450.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/GLSL.std.450.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/LICENSE => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/LICENSE rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/Makefile => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/Makefile rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/cmake/gitversion.in.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/cmake/gitversion.in.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/format_all.sh => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/format_all.sh rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/gn/BUILD.gn => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/gn/BUILD.gn rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/barrier.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/barrier.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/external_interface.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/external_interface.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/image.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/image.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/internal_interface.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/internal_interface.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/sampler.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/sampler.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/include/spirv_cross/thread_group.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/include/spirv_cross/thread_group.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/main.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/main.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/pkg-config/spirv-cross-c-shared.pc.in => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/pkg-config/spirv-cross-c-shared.pc.in rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cfg.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cfg.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cfg.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cfg.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_common.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_common.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cpp.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cpp.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cpp.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cpp.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_c.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_c.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_c.h => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_c.h rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_containers.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_containers.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_error_handling.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_error_handling.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_parsed_ir.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_util.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_util.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_cross_util.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_cross_util.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_glsl.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_glsl.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_glsl.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_glsl.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_hlsl.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_hlsl.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_hlsl.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_hlsl.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_msl.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_msl.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_msl.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_msl.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_parser.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_parser.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_parser.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_parser.hpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_reflect.cpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_reflect.cpp rename : third_party/rust/spirv_cross/src/vendor/SPIRV-Cross/spirv_reflect.hpp => third_party/rust/spirv-cross-internal/src/vendor/SPIRV-Cross/spirv_reflect.hpp rename : third_party/rust/spirv_cross/src/wrapper.cpp => third_party/rust/spirv-cross-internal/src/wrapper.cpp rename : third_party/rust/spirv_cross/src/wrapper.hpp => third_party/rust/spirv-cross-internal/src/wrapper.hpp rename : third_party/rust/spirv_cross/tests/common/mod.rs => third_party/rust/spirv-cross-internal/tests/common/mod.rs rename : third_party/rust/spirv_cross/tests/glsl_tests.rs => third_party/rust/spirv-cross-internal/tests/glsl_tests.rs rename : third_party/rust/spirv_cross/tests/hlsl_tests.rs => third_party/rust/spirv-cross-internal/tests/hlsl_tests.rs rename : third_party/rust/spirv_cross/tests/msl_tests.rs => third_party/rust/spirv-cross-internal/tests/msl_tests.rs rename : third_party/rust/spirv_cross/tests/shaders/array.vert => third_party/rust/spirv-cross-internal/tests/shaders/array.vert rename : third_party/rust/spirv_cross/tests/shaders/array.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/array.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/rasterize_disabled.vert => third_party/rust/spirv-cross-internal/tests/shaders/rasterize_disabled.vert rename : third_party/rust/spirv_cross/tests/shaders/rasterize_disabled.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/rasterize_disabled.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/sampler.frag => third_party/rust/spirv-cross-internal/tests/shaders/sampler.frag rename : third_party/rust/spirv_cross/tests/shaders/sampler.frag.spv => third_party/rust/spirv-cross-internal/tests/shaders/sampler.frag.spv rename : third_party/rust/spirv_cross/tests/shaders/simple.vert => third_party/rust/spirv-cross-internal/tests/shaders/simple.vert rename : third_party/rust/spirv_cross/tests/shaders/simple.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/simple.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/specialization.comp => third_party/rust/spirv-cross-internal/tests/shaders/specialization.comp rename : third_party/rust/spirv_cross/tests/shaders/specialization.comp.spv => third_party/rust/spirv-cross-internal/tests/shaders/specialization.comp.spv rename : third_party/rust/spirv_cross/tests/shaders/struct.frag => third_party/rust/spirv-cross-internal/tests/shaders/struct.frag rename : third_party/rust/spirv_cross/tests/shaders/struct.frag.spv => third_party/rust/spirv-cross-internal/tests/shaders/struct.frag.spv rename : third_party/rust/spirv_cross/tests/shaders/struct.vert => third_party/rust/spirv-cross-internal/tests/shaders/struct.vert rename : third_party/rust/spirv_cross/tests/shaders/struct.vert.spv => third_party/rust/spirv-cross-internal/tests/shaders/struct.vert.spv rename : third_party/rust/spirv_cross/tests/shaders/workgroup.comp => third_party/rust/spirv-cross-internal/tests/shaders/workgroup.comp rename : third_party/rust/spirv_cross/tests/shaders/workgroup.comp.spv => third_party/rust/spirv-cross-internal/tests/shaders/workgroup.comp.spv rename : third_party/rust/spirv_cross/tests/spirv_tests.rs => third_party/rust/spirv-cross-internal/tests/spirv_tests.rs extra : moz-landing-system : lando
2020-01-24 17:55:41 +03:00
use spirv_cross_internal::glsl::Version::*;
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
let module =
spirv::Module::from_words(words_from_bytes(include_bytes!("shaders/simple.vert.spv")));
let mut ast = spirv::Ast::<glsl::Target>::parse(&module).unwrap();
let versions = [
V1_10, V1_20, V1_30, V1_40, V1_50, V3_30, V4_00, V4_10, V4_20, V4_30, V4_40, V4_50, V4_60,
V1_00Es, V3_00Es,
];
for &version in versions.iter() {
if ast
.set_compiler_options(&glsl::CompilerOptions {
version,
enable_420_pack_extension: true,
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
vertex: glsl::CompilerVertexOptions::default(),
})
.is_err()
{
panic!("Did not compile");
}
}
}
#[test]
fn ast_renames_interface_variables() {
let vert =
spirv::Module::from_words(words_from_bytes(include_bytes!("shaders/struct.vert.spv")));
let mut vert_ast = spirv::Ast::<glsl::Target>::parse(&vert).unwrap();
vert_ast
.set_compiler_options(&glsl::CompilerOptions {
version: glsl::Version::V1_00Es,
enable_420_pack_extension: true,
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
vertex: glsl::CompilerVertexOptions::default(),
})
.unwrap();
let vert_stage_outputs = vert_ast.get_shader_resources().unwrap().stage_outputs;
vert_ast
.rename_interface_variable(&vert_stage_outputs, 0, "renamed")
.unwrap();
let vert_output = vert_ast.compile().unwrap();
let frag =
spirv::Module::from_words(words_from_bytes(include_bytes!("shaders/struct.frag.spv")));
let mut frag_ast = spirv::Ast::<glsl::Target>::parse(&frag).unwrap();
frag_ast
.set_compiler_options(&glsl::CompilerOptions {
version: glsl::Version::V1_00Es,
enable_420_pack_extension: true,
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
vertex: glsl::CompilerVertexOptions::default(),
})
.unwrap();
let frag_stage_inputs = frag_ast.get_shader_resources().unwrap().stage_inputs;
frag_ast
.rename_interface_variable(&frag_stage_inputs, 0, "renamed")
.unwrap();
let frag_output = frag_ast.compile().unwrap();
assert_eq!(
vert_output,
"\
#version 100
struct SPIRV_Cross_Interface_Location0
{
vec4 InterfaceMember0;
vec4 InterfaceMember1;
vec4 InterfaceMember2;
vec4 InterfaceMember3;
};
varying vec4 renamed_InterfaceMember0;
varying vec4 renamed_InterfaceMember1;
varying vec4 renamed_InterfaceMember2;
varying vec4 renamed_InterfaceMember3;
attribute vec4 a;
attribute vec4 b;
attribute vec4 c;
attribute vec4 d;
void main()
{
{
SPIRV_Cross_Interface_Location0 renamed = SPIRV_Cross_Interface_Location0(a, b, c, d);
renamed_InterfaceMember0 = renamed.InterfaceMember0;
renamed_InterfaceMember1 = renamed.InterfaceMember1;
renamed_InterfaceMember2 = renamed.InterfaceMember2;
renamed_InterfaceMember3 = renamed.InterfaceMember3;
}
}
"
);
assert_eq!(
frag_output,
"\
#version 100
precision mediump float;
precision highp int;
struct SPIRV_Cross_Interface_Location0
{
vec4 InterfaceMember0;
vec4 InterfaceMember1;
vec4 InterfaceMember2;
vec4 InterfaceMember3;
};
varying vec4 renamed_InterfaceMember0;
varying vec4 renamed_InterfaceMember1;
varying vec4 renamed_InterfaceMember2;
varying vec4 renamed_InterfaceMember3;
void main()
{
gl_FragData[0] = vec4(renamed_InterfaceMember0.x, renamed_InterfaceMember1.y, renamed_InterfaceMember2.z, renamed_InterfaceMember3.w);
}
"
);
}
#[test]
fn ast_can_rename_combined_image_samplers() {
let mut ast = spirv::Ast::<glsl::Target>::parse(&spirv::Module::from_words(words_from_bytes(
include_bytes!("shaders/sampler.frag.spv"),
)))
.unwrap();
ast.set_compiler_options(&glsl::CompilerOptions {
version: glsl::Version::V4_10,
enable_420_pack_extension: true,
Bug 1575008 - WebGPU implementation basis r=baku,bzbarsky This change vendors `wgpu` library in-tree and hooks up the initialization bits. It implements adapter and device initialization and adds a simple test. Complementary ecosystem tracker - https://github.com/gfx-rs/wgpu/issues/374 Current status: - [x] General - [x] figure out the IPC story - [ ] move wgpu crates into a dedicated folder (postponed as https://bugzilla.mozilla.org/show_bug.cgi?id=1594182) - [x] neko rebasing disaster - [x] Linux - [x] avoid depending on spirv_cross - [x] macOS - [x] due to cross-compiling shaders - [x] need the dependency update - [x] stop using gcc - [x] unexpected SSL header collision - https://phabricator.services.mozilla.com/D51148 - [x] undefined Metal symbols - [x] missing webrtc headers for IPDL magic - https://phabricator.services.mozilla.com/D51558 - [x] spirv-cross linking failure in ASAN - https://phabricator.services.mozilla.com/D52688 - [x] Windows - [x] due to "ipc-channel" not supporting Windows yet - [x] due to some exceptional stuff - [x] undefined symbol: `D3D12CreateDevice` - [x] d3d12.dll is not found, dxgi1_4 doesn't present - [x] d3d11.dll and dxgi.dll need to be explicitly loaded on win32 mingw - [x] libbacktrace fails to link on win32 mingw - [x] cc mislinking C++ standard library - [x] Android - [x] spirv-cross fails to build due to exceptions Update-1: We decided to go with IPDL mechanism instead of Rust based ipc-channel (or any alternatives), which unblocks Windows build. Update-2: It appears that WebGPUThreading isn't needed any more as the child thread (and its event loop) is now managed by IPDL infrastructure. This PR removes it 🎉 . Update-3: InstanceProvider is also removed. Update-4: All set, the try is green, waiting for dependent changes to go in. Differential Revision: https://phabricator.services.mozilla.com/D49458 --HG-- rename : dom/webgpu/Adapter.cpp => dom/webgpu/ipc/WebGPUTypes.h rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/ash/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/atom/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/cocoa/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/cocoa/LICENSE-MIT rename : third_party/rust/core-graphics/src/lib.rs => third_party/rust/cocoa/src/lib.rs rename : third_party/rust/uluru/Cargo.toml => third_party/rust/colorful/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/copyless/Cargo.toml rename : third_party/rust/crossbeam-utils/.cargo-checksum.json => third_party/rust/crossbeam-utils-0.6.5/.cargo-checksum.json rename : third_party/rust/crossbeam-utils/CHANGELOG.md => third_party/rust/crossbeam-utils-0.6.5/CHANGELOG.md rename : third_party/rust/crossbeam-utils/Cargo.toml => third_party/rust/crossbeam-utils-0.6.5/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/crossbeam-utils-0.6.5/LICENSE-MIT rename : third_party/rust/crossbeam-utils/README.md => third_party/rust/crossbeam-utils-0.6.5/README.md rename : third_party/rust/crossbeam-utils/benches/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/benches/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/atomic_cell.rs rename : third_party/rust/crossbeam-utils/src/atomic/mod.rs => third_party/rust/crossbeam-utils-0.6.5/src/atomic/mod.rs rename : third_party/rust/crossbeam-utils/src/backoff.rs => third_party/rust/crossbeam-utils-0.6.5/src/backoff.rs rename : third_party/rust/crossbeam-utils/src/cache_padded.rs => third_party/rust/crossbeam-utils-0.6.5/src/cache_padded.rs rename : third_party/rust/crossbeam-utils/src/lib.rs => third_party/rust/crossbeam-utils-0.6.5/src/lib.rs rename : third_party/rust/crossbeam-utils/src/thread.rs => third_party/rust/crossbeam-utils-0.6.5/src/thread.rs rename : third_party/rust/crossbeam-utils/tests/atomic_cell.rs => third_party/rust/crossbeam-utils-0.6.5/tests/atomic_cell.rs rename : third_party/rust/crossbeam-utils/tests/parker.rs => third_party/rust/crossbeam-utils-0.6.5/tests/parker.rs rename : third_party/rust/crossbeam-utils/tests/sharded_lock.rs => third_party/rust/crossbeam-utils-0.6.5/tests/sharded_lock.rs rename : third_party/rust/crossbeam-utils/tests/thread.rs => third_party/rust/crossbeam-utils-0.6.5/tests/thread.rs rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-auxil/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/gfx-backend-empty/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/hibitset/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/hibitset/LICENSE-MIT rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/metal/LICENSE-MIT rename : third_party/rust/uluru/Cargo.toml => third_party/rust/range-alloc/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/raw-window-handle/Cargo.toml rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/relevant/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/relevant/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/rendy-descriptor/Cargo.toml rename : third_party/rust/uluru/Cargo.toml => third_party/rust/shared_library/Cargo.toml rename : third_party/rust/crossbeam-deque/LICENSE-MIT => third_party/rust/shared_library/LICENSE-MIT rename : third_party/rust/blake2b_simd/Cargo.toml => third_party/rust/storage-map/Cargo.toml rename : third_party/rust/core-graphics/Cargo.toml => third_party/rust/x11/Cargo.toml extra : moz-landing-system : lando
2019-11-14 07:59:56 +03:00
vertex: glsl::CompilerVertexOptions::default(),
})
.unwrap();
for cis in ast.get_combined_image_samplers().unwrap() {
let new_name = "combined_sampler".to_string()
+ "_"
+ &cis.sampler_id.to_string()
+ "_"
+ &cis.image_id.to_string()
+ "_"
+ &cis.combined_id.to_string();
ast.set_name(cis.combined_id, &new_name).unwrap();
assert_eq!(new_name, ast.get_name(cis.combined_id).unwrap());
}
assert_eq!(
ast.compile().unwrap(),
"\
#version 410
#ifdef GL_ARB_shading_language_420pack
#extension GL_ARB_shading_language_420pack : require
#endif
uniform sampler2D combined_sampler_16_12_26;
layout(location = 0) out vec4 target0;
layout(location = 0) in vec2 v_uv;
void main()
{
target0 = texture(combined_sampler_16_12_26, v_uv);
}
"
);
}