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

[SPIR-V] Bitfield members are broken #4295

Closed
DBouma opened this issue Feb 23, 2022 · 1 comment
Closed

[SPIR-V] Bitfield members are broken #4295

DBouma opened this issue Feb 23, 2022 · 1 comment
Labels
spirv Work related to SPIR-V

Comments

@DBouma
Copy link

DBouma commented Feb 23, 2022

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.

@DBouma DBouma changed the title [SPIR-V] Bitfield members are broken when used in push constants [SPIR-V] Bitfield members are broken when used in combination with push constants Feb 23, 2022
@DBouma DBouma changed the title [SPIR-V] Bitfield members are broken when used in combination with push constants [SPIR-V] Bitfield members are broken Feb 24, 2022
@sudonatalie
Copy link
Collaborator

SPIR-V codegen does not yet support bitfield members, however we plan to implement it in the near future as part of our HLSL 2021 support.

Duplicate of #4140

@sudonatalie sudonatalie added the spirv Work related to SPIR-V label Feb 24, 2022
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
Development

No branches or pull requests

2 participants