Skip to content

Conversation

@Firestar99
Copy link
Member

Allows spec constants to be declared as arrays:

// single spec constants currently
#[spirv(spec_constant(id = 12, default = 34))] single: u32,
// spec constant arrays start at `id` and occupy consecutive ids, this uses id 42..46
// the default is the same for all values
#[spirv(spec_constant(id = 42, default = 69))] array: [u32; 4],

Copy link
Collaborator

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit.

format!(
"unsupported `#[spirv(spec_constant)]` type `{}` (expected `{}`)",
ref_or_value_layout.ty, self.tcx.types.u32
"unsupported `#[spirv(spec_constant)]` type `{}` (expected `u32` pr `[u32; N]`)",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"unsupported `#[spirv(spec_constant)]` type `{}` (expected `u32` pr `[u32; N]`)",
"unsupported `#[spirv(spec_constant)]` type `{}` (expected `u32` or `[u32; N]`)",

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, squashed

@Firestar99 Firestar99 enabled auto-merge October 22, 2025 08:10
@Firestar99 Firestar99 added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit a28bd3a Oct 22, 2025
13 checks passed
@Firestar99 Firestar99 deleted the spec-constant-array branch October 22, 2025 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants