`updateBufferCounter` needs to return uint with the pre-incremented or pre-decremented counter value: See https://godbolt.org/z/rGhWbcrY5 https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/sm5-object-rwstructuredbuffer-incrementcounter