Skip to content

[SPIR-V] Memory access violation when trying to use inline SPIR-V for floating point atomics extension #7698

Open

Description

@BalkoBalkho

Description

I was trying to use the vulkan extension SPV_EXT_shader_atomic_float_add for my compute shader. I believe the code I wrote is correct. However trying to compile this segfaults the compiler without a helpful error.
Steps to Reproduce

try to compile this code.
& "path\to\dxc.exe" .\atomicfloat.hlsl -spirv -T cs_6_6 -E main
[Ive also provided a link to compiler explorer]

[[vk::ext_extension("SPV_EXT_shader_atomic_float_add")]]
[[vk::ext_capability(6033)]] 

[[vk::ext_instruction(/* OpAtomicFAddEXT */ 6035)]]
float AtomicFAdd(
    [[vk::ext_reference]] in out float target,
    float value,
    [[vk::ext_literal]] uint scope,
    [[vk::ext_literal]] uint semantics
);

// Example usage within a compute shader entry point.
[shader("compute")]
[numthreads(8, 8, 1)]
void main(uint3 DTid : SV_DispatchThreadID)
{
    RWStructuredBuffer<float> myBuffer;
    uint index = DTid.x;

    AtomicFAdd(myBuffer[index], 1.5f, 1, 64);
}

Actual Behavior

compiler gives error:
Internal compiler error: access violation. Attempted to read from address 0x0000000000000030
Environment

  • DXC version dxcompiler.dll: 1.9 - 1.8.2505.32 (b106a96); dxil.dll: 1.9(1.8.2505.32)

  • Host Operating System Windows 11 Pro 10.0.26100 Build 26100

Metadata

Metadata

Labels

bugspirv

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions