Skip to content

Vulkan pipeline creation hangs with dynamic indexing through member function #12786

Description

@Git-RoySun

Issue Description

I found a case where vkCreateComputePipelines hangs when a dynamically indexed array is accessed through a member function of a struct stored in an RWStructuredBuffer. The generated SPIR-V passes spirv-val, and vkCreateShaderModule succeeds. The hang occurs during vkCreateComputePipelines, before the shader is ever executed.

Reproducer Code

const static uint MAX_SIZE = 1 << 22;

struct Map
{
    uint values[MAX_SIZE];

    uint hash(uint k)
    {
        return k;
    }

    uint get(uint index)
    {
        uint slot = hash(index);
        return this.values[slot];
    }
}

RWStructuredBuffer<Map> hash_map;
RWStructuredBuffer<uint> output;

[shader("compute")]
[numthreads(16, 16, 1)]
void trace_ray(uint3 threadId : SV_DispatchThreadID)
{
    output[0] = hash_map[0].get(threadId.x);
}

Changing the MAX_SIZE to much smaller values like 1024 works, however, sizes like 16384 still hang. Making the hash or get free functions work as well.

Expected Behavior

  • vkCreateComputePipelines should succeed

Actual Behavior

  • Slang compilation succeeds.
  • spirv-val accepts the generated SPIR-V.
  • vkCreateShaderModule succeeds.
  • vkCreateComputePipelines hangs. - The shader is never dispatched/executed.

Environment

  • Slang Version 2026.8
  • OS: Windows 11
  • Vulkan ver: 1.4.351
  • NVIDIA driver version: 616.56.0.0

Activity

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

Metadata

Metadata

Assignees

Labels

Office-TessTo be discussed during Tess' office hours

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions