Skip to content

[SPIRV] Use OpCopyLogical to reconstruct values#7530

Merged
s-perron merged 1 commit into
microsoft:mainfrom
s-perron:i7493
Jun 12, 2025
Merged

[SPIRV] Use OpCopyLogical to reconstruct values#7530
s-perron merged 1 commit into
microsoft:mainfrom
s-perron:i7493

Conversation

@s-perron
Copy link
Copy Markdown
Collaborator

When DXC needs to change the layout of a value, it currently has to
extract each individual scalar, and then reconstruct using the type with
the different layout.

If you have a large array or struct with many member, this generates a
lot of extra code.

Starting in SPIR-V 1.4, the OpCopyLogical instruction is available to do
the reconstruction.

This should help generate less code, which will lead to improved compile
time and maybe smaller binary sizes.

Fixes #7493

When DXC needs to change the layout of a value, it currently has to
extract each individual scalar, and then reconstruct using the type with
the different layout.

If you have a large array or struct with many member, this generates a
lot of extra code.

Starting in SPIR-V 1.4, the OpCopyLogical instruction is available to do
the reconstruction.

This should help generate less code, which will lead to improved compile
time and maybe smaller binary sizes.

Fixes microsoft#7493
@s-perron s-perron merged commit 9b5f5c9 into microsoft:main Jun 12, 2025
13 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Jun 12, 2025
@s-perron s-perron deleted the i7493 branch June 12, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[SPIR-V] Functions returning array-containing structs extract and construct them, potentially causing failures in later optimization stages

2 participants