{"action":"created","issue":{"url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor/issues/135","repository_url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor","labels_url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor/issues/135/labels{/name}","comments_url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor/issues/135/comments","events_url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor/issues/135/events","html_url":"https://github.com/NVIDIAGameWorks/Falcor/issues/135","id":362807314,"node_id":"MDU6SXNzdWUzNjI4MDczMTQ=","number":135,"title":"InterlockedAdd failed to compile on vulkan","user":{"login":"KaChen3000","id":35852980,"node_id":"MDQ6VXNlcjM1ODUyOTgw","avatar_url":"https://avatars2.githubusercontent.com/u/35852980?v=4","gravatar_id":"","url":"https://api.github.com/users/KaChen3000","html_url":"https://github.com/KaChen3000","followers_url":"https://api.github.com/users/KaChen3000/followers","following_url":"https://api.github.com/users/KaChen3000/following{/other_user}","gists_url":"https://api.github.com/users/KaChen3000/gists{/gist_id}","starred_url":"https://api.github.com/users/KaChen3000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaChen3000/subscriptions","organizations_url":"https://api.github.com/users/KaChen3000/orgs","repos_url":"https://api.github.com/users/KaChen3000/repos","events_url":"https://api.github.com/users/KaChen3000/events{/privacy}","received_events_url":"https://api.github.com/users/KaChen3000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-09-22T00:03:39Z","updated_at":"2018-09-22T00:15:19Z","closed_at":null,"author_association":"NONE","body":"Hi,\r\nInterlockedAdd can't be compiled on linux with vulkan. Please see below.\r\n\r\n`RWTexture2D<uint> gGridSegmentationCountTex0;\r\nuint prevValue = 0;\r\nInterlockedAdd(gGridSegmentationCountTex0[mapIntCoord], 1u, prevValue);`\r\n\r\nWould appreciate for a quick fix. thanks!"},"comment":{"url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor/issues/comments/423701496","html_url":"https://github.com/NVIDIAGameWorks/Falcor/issues/135#issuecomment-423701496","issue_url":"https://api.github.com/repos/NVIDIAGameWorks/Falcor/issues/135","id":423701496,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzcwMTQ5Ng==","user":{"login":"tfoleyNV","id":10618364,"node_id":"MDQ6VXNlcjEwNjE4MzY0","avatar_url":"https://avatars2.githubusercontent.com/u/10618364?v=4","gravatar_id":"","url":"https://api.github.com/users/tfoleyNV","html_url":"https://github.com/tfoleyNV","followers_url":"https://api.github.com/users/tfoleyNV/followers","following_url":"https://api.github.com/users/tfoleyNV/following{/other_user}","gists_url":"https://api.github.com/users/tfoleyNV/gists{/gist_id}","starred_url":"https://api.github.com/users/tfoleyNV/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tfoleyNV/subscriptions","organizations_url":"https://api.github.com/users/tfoleyNV/orgs","repos_url":"https://api.github.com/users/tfoleyNV/repos","events_url":"https://api.github.com/users/tfoleyNV/events{/privacy}","received_events_url":"https://api.github.com/users/tfoleyNV/received_events","type":"User","site_admin":false},"created_at":"2018-09-22T00:15:19Z","updated_at":"2018-09-22T00:15:19Z","author_association":"COLLABORATOR","body":"This probably needs to be filed as an issue against Slang instead.\r\n\r\nI wouldn't be able to look at this until Monday at the earliest, but even then I'm concerned that it won't be a quick fix to get this working correctly with the HLSL syntax in your example. I can try to add the missing support but I'd estimate at least 2-3 days to do it right.\r\n\r\nAs a temporary workaround (please understand that I'm not promising Slang will support this in the long run), could you try defining a function like the following:\r\n\r\n```hlsl\r\n__target_intrinsic(glsl, \"imageAtomicAdd($0, $1, $2)$z\")\r\nuint imageAtomicAdd(RWTexture2D<uint> t, int2 coord, uint val)\r\n{\r\n    uint prevVal = 0;\r\n    InterlockedAdd(t[coord], val, prevVal);\r\n    return prevVal;\r\n} \r\n```\r\n\r\nI haven't tested the above, so I may have made some mistakes, but something like this should work to define a custom GLSL lowering for a function. I'll repeat that this is *not* intended to be something that Slang supports in the long term.\r\n\r\nWorst case I could add a function along the lines of the above to the Slang standard library so that you can access image atomics on both D3D and Vulkan, even if the syntax isn't the standard HLSL syntax.\r\n"}}
{"actor":{"display_login":"tfoleyNV"}}