Skip to content

Try to map spirv-val output to Rust code #323

Open
@nazar-pc

Description

@nazar-pc

I just got an error that looks like this:

error: error:0:0 - OpInBoundsAccessChain result type (OpTypeStruct) does not match the type that results from indexing into the base <id> (OpTypeArray).
         %2764 = OpInBoundsAccessChain %_ptr_Function__struct_33 %2763 %uint_0
  |
  = note: spirv-val failed
  = note: module `.../spirv-unknown-vulkan1.2/debug/deps/....spv`

Unfortunately, the output isn't all that helpful, don't know how to debug it except commenting-out pieces of code until the error goes away. However, I do have a suspicion that _ptr_Function__struct_33 might be something that codegen controls, which in turn might mean ability to translate it back to something like the name of the data structure or file and line of code.

Also maybe debug builds could use something more descriptive than struct_33 to help with debugging, like a mangling scheme.

I'm compiling with these options:

let backend = cargo_gpu::Install::from_shader_crate(shader_crate.clone()).run()?;

let spirv_builder = backend
    .to_spirv_builder(shader_crate, "spirv-unknown-vulkan1.2")
    .print_metadata(MetadataPrintout::DependencyOnly)
    .spirv_metadata(SpirvMetadata::NameVariables)
    .release(false);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions