Pewarta Proxy

📋 Server Request & Proxy Logs

Loading active proxy settings...
Developed by Khairul Adha (adhexa.id)
Mengambil log server...

⚙️ Pengaturan Proxy Target

Skip to content

[SPIR-V] vk::ext_capability on a vk::SpirvType type alias is not emitted #9056

Open

Description

@Erfan-Ahmadi

Version: DXC (trunk) on godbolt
Flags: -spirv -T cs_6_8 -E main -HV 202x -fspv-target-env=vulkan1.3

[[vk::binding(0,0)]] RWStructuredBuffer<uint32_t> buf;

using UintPtr [[vk::ext_capability(/*PhysicalStorageBufferAddresses*/5347)]]
    = vk::SpirvType</*OpTypePointer*/32, 8, 8, vk::Literal<vk::integral_constant<uint32_t, /*PhysicalStorageBuffer*/5349> >, uint32_t>;

[[vk::ext_instruction(/*OpBitcast*/124)]]
UintPtr toPtr(uint32_t2 addr);

[[vk::ext_instruction(/*OpLoad*/61)]]
uint32_t load(UintPtr p, [[vk::ext_literal]] uint32_t aligned, [[vk::ext_literal]] uint32_t alignment);

struct PushData { uint32_t2 addr; };
[[vk::push_constant]] PushData pc;

[numthreads(64,1,1)]
void main(uint32_t gi : SV_GroupIndex)
{
    buf[gi] = load(toPtr(pc.addr), /*Aligned*/0x2, 4);
}

godbolt link: https://godbolt.org/z/vjW4c4s5j
Expected: OpCapability PhysicalStorageBufferAddresses (the Inline SPIR-V wiki lists type aliases of SpirvType as valid targets).
Actual: generated SPIR-V is invalid: Operand 2 of TypePointer requires one of these capabilities: PhysicalStorageBufferAddresses. Same result with a typedef. The capability is emitted only when the attribute is on a called function or the entry point.

So for now, what we can do is to emit the capabilities on functions working with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug, regression, crashneeds-triageAwaiting triagespirvWork related to SPIR-V

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions