{"action":"created","issue":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1993","repository_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1993/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1993/comments","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1993/events","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/issues/1993","id":371993092,"node_id":"MDU6SXNzdWUzNzE5OTMwOTI=","number":1993,"title":"Tool to extract single entry point from spirv file","user":{"login":"jodavis42","id":22943955,"node_id":"MDQ6VXNlcjIyOTQzOTU1","avatar_url":"https://avatars3.githubusercontent.com/u/22943955?v=4","gravatar_id":"","url":"https://api.github.com/users/jodavis42","html_url":"https://github.com/jodavis42","followers_url":"https://api.github.com/users/jodavis42/followers","following_url":"https://api.github.com/users/jodavis42/following{/other_user}","gists_url":"https://api.github.com/users/jodavis42/gists{/gist_id}","starred_url":"https://api.github.com/users/jodavis42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jodavis42/subscriptions","organizations_url":"https://api.github.com/users/jodavis42/orgs","repos_url":"https://api.github.com/users/jodavis42/repos","events_url":"https://api.github.com/users/jodavis42/events{/privacy}","received_events_url":"https://api.github.com/users/jodavis42/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-19T14:53:53Z","updated_at":"2018-10-22T12:57:06Z","closed_at":"2018-10-22T12:57:06Z","author_association":"NONE","body":"I'm trying figure out the quickest way to deal with optimizing a large amount of shaders. Currently I emit each shader as a separate spirv file and optimize each and output to glsl. This can take a lot of time in my applications since we have a permutation problem of shaders. The idea I had to address this (which could be wrong) was to put all of the shaders together in one spirv file with different entry points for each. This would in theory make the optimizer quicker (might not be true to the aggressive inlining) and then I would output each individual entry point using spirv-cross to glsl.\r\n\r\nThe problem is that spirv-cross doesn't have a way to identify what types/structs are actually used in an entry point's static call graph, causing large bloat in the output file which can take a large amount of time to write out. See https://github.com/KhronosGroup/SPIRV-Cross/issues/727 for my conversation with spirv-cross.\r\n\r\nIf I can prune a spirv file in advance so it only contains the code relevant to one entry point then this might be a good compromise but I don't see any options in the optimizer or any other tool that does this.\r\n"},"comment":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/comments/431827646","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/issues/1993#issuecomment-431827646","issue_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1993","id":431827646,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMTgyNzY0Ng==","user":{"login":"s-perron","id":31666470,"node_id":"MDQ6VXNlcjMxNjY2NDcw","avatar_url":"https://avatars1.githubusercontent.com/u/31666470?v=4","gravatar_id":"","url":"https://api.github.com/users/s-perron","html_url":"https://github.com/s-perron","followers_url":"https://api.github.com/users/s-perron/followers","following_url":"https://api.github.com/users/s-perron/following{/other_user}","gists_url":"https://api.github.com/users/s-perron/gists{/gist_id}","starred_url":"https://api.github.com/users/s-perron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s-perron/subscriptions","organizations_url":"https://api.github.com/users/s-perron/orgs","repos_url":"https://api.github.com/users/s-perron/repos","events_url":"https://api.github.com/users/s-perron/events{/privacy}","received_events_url":"https://api.github.com/users/s-perron/received_events","type":"User","site_admin":false},"created_at":"2018-10-22T12:57:06Z","updated_at":"2018-10-22T12:57:06Z","author_association":"CONTRIBUTOR","body":"There are not options to do this at the moment.  One way of doing this might be to write a small script that disassembles the file, and removes the OpEntryPoint instructions of the entry points you are not interested in and then run through the optimizer.  You could also write your own pass to remove the entry points you are not interested in.  However, since we do not expect this to be commonly used or needed, we would probably not accept a PR for this."}}
{"actor":{"display_login":"s-perron"}}