Skip to content

[SPIR-V] RawBufferStore still trips up on missing member offsets #6554

Closed

Description

Description
The usage of such a struct with vk::RawBufferStore

struct emul_float64_t
{
    using storage_t = float32_t;

    emul_float64_t operator*(const emul_float64_t rhs)
    {
        emul_float64_t retval;
        retval.data = data*rhs.data;
        return retval;
    }

    storage_t data;
};

generates the following error

fatal error: generated SPIR-V is invalid: Structure id 3 decorated as Block for variable in PhysicalStorageBuffer storage class must follow relaxed storage buffer layout rules: member 0 is missing an Offset decoration
  %emul_float64_t = OpTypeStruct %float

Steps to Reproduce
This Godbolt: https://godbolt.org/z/de8xeaTeq

Environment

  • DXC version: Latest Godbolt trunk
  • Host Operating System: Linux I guess?

Activity

  1. added
    bug
    needs-triage
    spirv
    on Apr 22, 2024
  2. changed the title [-][SPIR-V][/-] [+][SPIR-V] RawBufferStore still trips up on missing member offsets[/+] on Apr 22, 2024
  3. sudonatalie commented on May 1, 2024

    @sudonatalie
    Collaborator

    Mateusz Kielan (@devshgraphicsprogramming) Thanks for reporting, we'll take a look.

  4. moved this from For Google to Triaged in HLSL Triageon May 1, 2024
  5. devshgraphicsprogramming commented on May 2, 2024

    @devshgraphicsprogramming
    Author

    I tried to fix this with inline SPIR-V
    https://godbolt.org/z/7sGojeEnK
    but:

    1. I need to guess the %result_id% of the type declaration of my struct (in this case is appears to be 20), ties back to [Feature Request] [SPIR-V] [Proposal 0011] vk::addrof(v) to obtain an OpTypePointer to a variable and deprecate [vk::ext_reference] #6578
    2. I can't call an intrinsic from outside of a function (global scope) but some Opcodes can only live there
  6. added a commit that references this issue on Jun 18, 2024
    b08ad2e
  7. added a commit that references this issue on Jun 25, 2024
    e5183a0
  8. added a commit that references this issue on Jul 24, 2025
    9307b4d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugspirv

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions