Skip to content

[SPIR-V] Bitfield members are broken #4295

Closed
@DBouma

Description

@DBouma

Given the following struct:

struct ResourceHandleData {
    uint index : 23;
    uint tag : 3;
    uint version : 6;
};

It should be represented as a 32 bit uint. When ResourceHandleData is read from a push constant slot, a validation layer error is given by the Vulkan validation layer that the specific push constant (which should contain the RenderHandleData in my case) is out of range, following with a device removal.

However this behavior works perfectly fine when using DXIL, my assumption is that bitfield members are not properly represented when used in combination with push constants. I have yet to test this with non-pushconstants however, but that may also be broken.

EDIT: Simple casting from uint to ResourceHandleData from a different location other then push constants also causes the same broken behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    spirvWork related to SPIR-V

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions