Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spirv] Fix storage class for ptr-to-ptr in Vulkan 1.2. #3344

Merged
merged 3 commits into from
Jan 25, 2021

Conversation

ehsannas
Copy link
Contributor

Also fixes #3340

@ehsannas ehsannas added the spirv Work related to SPIR-V label Jan 11, 2021
@ehsannas ehsannas requested a review from jaebaek January 11, 2021 21:23
@ehsannas ehsannas self-assigned this Jan 11, 2021
@AppVeyorBot
Copy link

@manon-traverse
Copy link

manon-traverse commented Jan 19, 2021

I was about to submit an issue about a crash during the compilation of a shader, but we found out that this PR solves our issue.
I created the following repro shader that breaks on master, but works on this branch

ByteAddressBuffer g_byteAddressBuffer[] : register(t0, space3);
[numthreads(1,1,1)]
void main() {
    ByteAddressBuffer flat_bucket_indices = g_byteAddressBuffer[0];
}

dxc -spirv -Tcs_6_5 -fspv-target-env=vulkan1.2 -Emain -fvk-use-dx-layout repro.hlsl

Specifically assigning to the flat_bucket_indices is what causes the crash during compilation. Sampling from the buffer directly without assigning it as a variable worked as a workaround for us.

EDIT: Made the repro shader smaller and added compile command

@Jasper-Bekkers
Copy link

Further reduced version of the above code sample:

ByteAddressBuffer g_byteAddressBuffer[] : register(t0, space3);
[numthreads(1,1,1)]
void main() {
    ByteAddressBuffer flat_bucket_indices = g_byteAddressBuffer[0];
}

dxc -spirv -Tcs_6_5 -fspv-target-env=vulkan1.2 -Emain -fvk-use-dx-layout code.hlsl

@ehsannas
Copy link
Contributor Author

Thanks @max-traverse @Jasper-Bekkers I've added this as an additional test case.

@jaebaek PTAL.

@AppVeyorBot
Copy link

@AppVeyorBot
Copy link

@ehsannas ehsannas merged commit f11daf7 into microsoft:master Jan 25, 2021
@ehsannas ehsannas deleted the fix-vk1p2-ptr-to-ptr branch January 25, 2021 16:04
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
5 participants