Skip to content

spirv-fuzz: FuzzerPassAddCompositeTypes doesn't support BuiltIn decoration #3676

@Vasniktel

Description

@Vasniktel

According to the SPIR-V spec:

A BuiltIn Decoration can only be applied as follows:

  1. When applied to a structure-type member, all members of that structure type must also be decorated with BuiltIn. (No allowed mixing of built-in variables and non-built-in variables within a single structure.)
  2. When applied to a structure-type member, that structure type cannot be contained as a member of another structure type.
  3. There is at most one object per Storage Class that can contain a structure type containing members decorated with BuiltIn, consumed per entry-point.

Thus, we can't have a struct type, whose element is a struct that has its element decorated with BuiltIn. Turns out that fuzzerutil::MaybeGetStructType returns 0 if the struct has BuiltIn components.

However, FuzzerPassAddCompositeTypes doesn't use that function, which causes validation errors for the following shader
_scraped_shader_4.vert.spv.txt

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions