Skip to content
This repository was archived by the owner on Aug 22, 2020. It is now read-only.
This repository was archived by the owner on Aug 22, 2020. It is now read-only.

Attempting to run the 'hello-cube' example on OS X v10.11 El Capitan gives error: "[ERROR gfx_backend_metal::device] Error compiling the shader" #60

Description

@A-R-M
  • Harmony version: commit bd4300ffbc651aeea8e625606645d90021cad83a
  • Active Rust Toolchain:
    stable-x86_64-apple-darwin (default)
    rustc 1.44.1 (c7087fe00 2020-06-17)
  • OS: OS X v10.11.6 El Capitan
  • GPU: Intel HD Graphics 4000
  • Computer: Mac mini (Late 2012)

When attempting to run the hello-cube example, I get the following output:

$ METAL_DEVICE_WRAPPER_TYPE=1 RUST_BACKTRACE=full cargo run --example hello-cube
warning: unused import: `PointLightData`
  --> examples/hello-cube.rs:12:80
   |
12 |     components::{CameraData, DirectionalLightData, LightType, Mesh, Transform, PointLightData},
   |                                                                                ^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: 1 warning emitted

    Finished dev [unoptimized + debuginfo] target(s) in 0.19s
     Running `target/debug/examples/hello-cube`
2020-07-17 06:25:10.883 hello-cube[59451:227586] Metal API Validation Enabled
[2020-07-17T10:25:10Z WARN  wgpu_core::instance] Missing features: INDEPENDENT_BLENDING
[2020-07-17T10:25:10Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:10Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:10Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:10Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:10Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Function, FMul)
[2020-07-17T10:25:10Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  metal::device] Shader warnings: Compilation succeeded with: 
    
    <program source>:197:20: warning: unused variable 'Lunnormalized'
                float3 Lunnormalized = L_1;
                       ^
    
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Function, Variable)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Function, ImageSampleExplicitLod)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration Flat
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Type, TypeBool)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration ColMajor
[2020-07-17T10:25:11Z WARN  naga::front::spv] Unknown decoration MatrixStride
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: UnsupportedInstruction(Function, Variable)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Failed to parse shader SPIR-V code: MissingDecoration(Offset)
[2020-07-17T10:25:11Z WARN  wgpu_core::device] Shader module will not be validated
[2020-07-17T10:25:11Z ERROR gfx_backend_metal::device] Error compiling the shader CompilationFailed("Compilation failed: \n\n<program source>:47:43: error: no matching conversion for functional-style cast from \'void\' to \'spvUnsafeArray<float3, 36>\'\nconstant spvUnsafeArray<float3, 36> _29 = spvUnsafeArray<float3, 36>({ float3(1.0), float3(1.0, 1.0, -1.0), float3(1.0, -1.0, 1.0), float3(1.0, -1.0, 1.0), float3(1.0, 1.0, -1.0), float3(1.0, -1.0, -1.0), float3(-1.0, 1.0, -1.0), float3(-1.0, 1.0, 1.0), float3(-1.0), float3(-1.0), float3(-1.0, 1.0, 1.0), float3(-1.0, -1.0, 1.0), float3(-1.0, 1.0, -1.0), float3(1.0, 1.0, -1.0), float3(-1.0, 1.0, 1.0), float3(-1.0, 1.0, 1.0), float3(1.0, 1.0, -1.0), float3(1.0), float3(-1.0, -1.0, 1.0), float3(1.0, -1.0, 1.0), float3(-1.0), float3(-1.0), float3(1.0, -1.0, 1.0), float3(1.0, -1.0, -1.0), float3(-1.0, 1.0, 1.0), float3(1.0), float3(-1.0, -1.0, 1.0), float3(-1.0, -1.0, 1.0), float3(1.0), float3(1.0, -1.0, 1.0), float3(1.0, 1.0, -1.0), float3(-1.0, 1.0, -1.0), float3(1.0, -1.0, -1.0), float3(1.0, -1.0, -1.0), float3(-1.0, 1.0, -1.0), float3(-1.0) });\n                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const spvUnsafeArray<float __attribute__((ext_vector_type(3))), 36>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const device spvUnsafeArray<float __attribute__((ext_vector_type(3))), 36>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const threadgroup spvUnsafeArray<float __attribute__((ext_vector_type(3))), 36>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const constant spvUnsafeArray<float __attribute__((ext_vector_type(3))), 36>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit move constructor) not viable: cannot convert initializer list argument to \'spvUnsafeArray<float __attribute__((ext_vector_type(3))), 36>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided\n<program source>:48:42: error: no matching conversion for functional-style cast from \'void\' to \'spvUnsafeArray<float2, 6>\'\nconstant spvUnsafeArray<float2, 6> _53 = spvUnsafeArray<float2, 6>({ float2(-1.0), float2(1.0, -1.0), float2(-1.0, 1.0), float2(-1.0, 1.0), float2(1.0, -1.0), float2(1.0) });\n                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const spvUnsafeArray<float __attribute__((ext_vector_type(2))), 6>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const device spvUnsafeArray<float __attribute__((ext_vector_type(2))), 6>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const threadgroup spvUnsafeArray<float __attribute__((ext_vector_type(2))), 6>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert initializer list argument to \'const constant spvUnsafeArray<float __attribute__((ext_vector_type(2))), 6>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit move constructor) not viable: cannot convert initializer list argument to \'spvUnsafeArray<float __attribute__((ext_vector_type(2))), 6>\'\nstruct spvUnsafeArray\n       ^\n<program source>:10:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided\n")
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other', /Users/username/.cargo/git/checkouts/wgpu-53e70f8674b08dd4/43c67ac/wgpu-core/src/device/mod.rs:2315:17
stack backtrace:
   0:        0x10a190e4f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h8ad47541fb823094
   1:        0x10a1b4e7e - core::fmt::write::he23e9bd6497f06c3
   2:        0x10a18d797 - std::io::Write::write_fmt::h91528f1131e6004e
   3:        0x10a192efa - std::panicking::default_hook::{{closure}}::h1983f014a45a477e
   4:        0x10a192c3c - std::panicking::default_hook::hb0d9b93b5be8b120
   5:        0x10a1935a8 - std::panicking::rust_panic_with_hook::h9f3faafe0983de5c
   6:        0x10a193142 - rust_begin_unwind
   7:        0x10a1b2bbf - core::panicking::panic_fmt::h0a2d1b3ca0b14316
   8:        0x10a1b2a05 - core::option::expect_none_failed::haea18d6ed867f4e9
   9:        0x10945cc76 - core::result::Result<T,E>::unwrap::hae914ba7279b340a
  10:        0x10929fe88 - wgpu_core::device::<impl wgpu_core::hub::Global<G>>::device_create_render_pipeline::h460451028d4887b4
  11:        0x1092b74d2 - wgpu::backend::direct::<impl wgpu::Context for wgpu_core::hub::Global<wgpu_core::hub::IdentityManagerFactory>>::device_create_render_pipeline::h0db6e69f9b79edcd
  12:        0x10932eb2b - wgpu::Device::create_render_pipeline::h91929ef614a5bc31
  13:        0x108a445e0 - harmony::graphics::pipeline::SimplePipelineDesc::pipeline::h4d997a24c885e5ea
  14:        0x108a49087 - harmony::graphics::render_graph::RenderGraph::add::hc2e17c529793e2dc
  15:        0x108a35221 - harmony::graphics::material::skybox::Skybox::new_hdr::h9491772f8bc67b8c
  16:        0x108a306f6 - <hello_cube::AppState as harmony::application::AppState>::load::h75584cd4d604e419
  17:        0x108a914c1 - harmony::application::Application::load::hd6500b94167dba21
  18:        0x108a3123f - hello_cube::main::hf82171171da901f6
  19:        0x108a617be - std::rt::lang_start::{{closure}}::hfc682bbfb4c1749f
  20:        0x10a1939d9 - std::rt::lang_start_internal::h795af50241e12334
  21:        0x108a617a1 - std::rt::lang_start::he936ede608aba919
  22:        0x108a31382 - main

I’m guessing that error is related to me using OS X v10.11 El Capitan (the very first version of macOS to support Metal, and thus is using Metal 1).

Sidenote: The other examples run on this computer (with warnings), except for benchmark which gives a compile time error.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions