Skip to content

[SPIR-V] DXC generates invalid SPIRV for multiple entry points #8009

@alelenv

Description

@alelenv

Description
DXC generates invalid SPIRV with following error

fatal error: generated SPIR-V is invalid: In Logical addressing, variables can only allocate a storage buffer pointer if the VariablePointersStorageBuffer capability is declared
%Foo = OpVariable %_ptr_Private__ptr_StorageBuffer_type_StructuredBuffer_v4float Private

Steps to Reproduce
https://godbolt.org/z/hhxdPoaGT

Options used : -spirv -T lib_6_6 -fspv-target-env=vulkan1.3
--->

Actual Behavior
The shader seems legal and generates DXIL

The issue seems to be spirv-opt PrivateToLocal will not handle cases like above post inlining with multiple entry points
If DXC adds "VariablePointersStorageBuffer" capability this should end up working

Erroring out such hard to support cases seems fine as well

Environment

  • DXC version libdxcompiler.so: 1.10(dev;1-948629ac); libdxil.so: 1.10
  • Host OS : Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashspirvWork related to SPIR-V

    Type

    No type

    Projects

    Status

    For Google

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions