Skip to content
New issue

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

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

Already on GitHub? # to your account

[spirv-opt] Inlining pass generates OpVariable of PhysicalStorageBuffer pointer type without AliasedPointer decoration. #5607

Closed
csyonghe opened this issue Mar 11, 2024 · 2 comments · Fixed by #5635

Comments

@csyonghe
Copy link

csyonghe commented Mar 11, 2024

If the source spirv contains a function that takes an AliasedPointer parameter, the --inline-entry-points-exhaustive pass generates a pointer-typed OpVariable without AliasedPointer decoration, which leads to validation error.

Steps to reproduce:
test.zip

Use the test.spv in test.zip file:

spirv-val test.spv       # passes validation
spirv-opt --inline-entry-points-exhaustive -o test-out.spv
spirv-val test-out.spv       # FAILS validation

spirv-val output:

error: line 121: OpVariable 131: expected AliasedPointer or RestrictPointer for PhysicalStorageBuffer pointer.
  %131 = OpVariable %_ptr_Function__ptr_PhysicalStorageBuffer_int Function
@jeremy-lunarg
Copy link
Contributor

@dneto0 I believe @greg-lunarg worked on this. We'd be happy to look at this bug. Please assign to me if you'd like.

@jeremy-lunarg
Copy link
Contributor

FYI, I have a fix for this incoming. Just wrapping up the test.

jeremy-lunarg added a commit to jeremy-lunarg/SPIRV-Tools that referenced this issue Apr 4, 2024
Fix KhronosGroup#5607

When inlining, decorate return variable with AliasedPointer if the
storage class of the pointee type is PhysicalStorageBuffer.
jeremy-lunarg added a commit that referenced this issue Apr 5, 2024
Fix #5607

When inlining, decorate return variable with AliasedPointer if the
storage class of the pointee type is PhysicalStorageBuffer.
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants