Skip to content

spirv-fuzz: Invalidation when indexing into a structure #3671

@andreperezmaselco

Description

@andreperezmaselco

spirv-val invalidated a fuzzed shader because the result id of an OpConstantNull instruction was being used to index into a structure. According to SPIR-V specification, when indexing into a structure, each index must be the result id of an OpConstant instruction.

error: line 79: The <id> passed to OpInBoundsAccessChain to index into a structure must be an OpConstant.
  %399 = OpConstantNull %uint

Debugging spirv-fuzz, I found that TransformationReplaceIdWithSynonym checks only if the index instruction is OpAccessChain, while the same is true for OpInBoundsAccessChain and OpPtrAccessChain.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions