MircoWerner / VkRadixSort

GPU Radix Sort implemented in Vulkan and GLSL.
MIT License
40 stars 4 forks source link

multi_radixsort.comp fails to compile on AMD graphics #5

Open pavelsevecek opened 4 months ago

pavelsevecek commented 4 months ago

The compilation of the compute shader fails on AMD Radeon 780M Graphics. The error is on the line 74: https://github.com/MircoWerner/VkRadixSort/blob/96178e0515292f96de112fea0c1b469416388c7e/multiradixsort/resources/shaders/multi_radixsort.comp#L74C16-L74C75

subgroupBroadcast is using gl_SubgroupID which isn't a compile-time constant.

The compiler further complains about using atomicAdd on the bin_flags variable, but that can be easily fixed by flattening the array.

lhog commented 1 month ago

Try to replace subgroupBroadcast with subgroupShuffle and GL_KHR_shader_subgroup_ballot with GL_KHR_shader_subgroup_shuffle respectively