Skip to content

[spirv] Treat matrix load/stores as column major in raw buffers#4526

Merged
kuhar merged 1 commit intomicrosoft:mainfrom
kuhar:bab-matrix-load
Jun 24, 2022
Merged

[spirv] Treat matrix load/stores as column major in raw buffers#4526
kuhar merged 1 commit intomicrosoft:mainfrom
kuhar:bab-matrix-load

Conversation

@kuhar
Copy link
Copy Markdown
Collaborator

@kuhar kuhar commented Jun 21, 2022

Assume that matrices are stored in the column major order in raw buffers, e.g., ByteAddressBuffer and RWByteAddressBuffer.

Add a new flag,-fspv-use-legacy-buffer-matrix-order, so that shaders that depend on the previous matrix order (row major) can opt-out of this change.

Fixes: #3370

@kuhar kuhar marked this pull request as draft June 21, 2022 02:41
@kuhar kuhar changed the title Support column_major byte address buffer accesses [spirv] Support column_major byte address buffer accesses Jun 21, 2022
@kuhar kuhar added the spirv Work related to SPIR-V label Jun 21, 2022
@AppVeyorBot
Copy link
Copy Markdown

@kuhar kuhar force-pushed the bab-matrix-load branch from 73be90c to 4a230b8 Compare June 22, 2022 18:13
@kuhar kuhar marked this pull request as ready for review June 22, 2022 18:14
Copy link
Copy Markdown
Collaborator

@sudonatalie sudonatalie left a comment

Choose a reason for hiding this comment

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

@kuhar kuhar force-pushed the bab-matrix-load branch from 4a230b8 to a897bed Compare June 22, 2022 18:46
@kuhar
Copy link
Copy Markdown
Collaborator Author

kuhar commented Jun 22, 2022

@sudonatalie

Can you also add this flag to the documentation here: https://github.com/microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst#vulkan-specific-options

Done, thanks!

@AppVeyorBot
Copy link
Copy Markdown

@kuhar kuhar force-pushed the bab-matrix-load branch 4 times, most recently from a447cc0 to 97aabc7 Compare June 22, 2022 19:52
@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

@kuhar kuhar force-pushed the bab-matrix-load branch from 97aabc7 to 448357b Compare June 24, 2022 19:28
@kuhar kuhar requested a review from sudonatalie June 24, 2022 19:30
@kuhar kuhar changed the title [spirv] Support column_major byte address buffer accesses [spirv] Treat matrix load/stores as column major in raw buffers Jun 24, 2022
Comment thread tools/clang/lib/SPIRV/RawBufferMethods.cpp Outdated
Assume that matrices are stored in the column major order in raw
buffers, e.g., `ByteAddressBuffer` and `RWByteAddressBuffer`.

Add a new flag,`-fspv-use-legacy-buffer-matrix-order`, so that shaders
that depend on the previous matrix order (row major) can opt-out of this
change.

Fixes: microsoft#3370
@kuhar kuhar force-pushed the bab-matrix-load branch from 448357b to 4a2f990 Compare June 24, 2022 19:39
Copy link
Copy Markdown
Collaborator

@sudonatalie sudonatalie left a comment

Choose a reason for hiding this comment

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

LGTM!

@AppVeyorBot
Copy link
Copy Markdown

@kuhar kuhar enabled auto-merge (squash) June 24, 2022 20:50
@AppVeyorBot
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spirv Work related to SPIR-V

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SPIR-V] ByteAddressBuffer doesn't emit RowMaj or ColMaj decorations for templated loads

4 participants