{"action":"opened","issue":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Cross/issues/602","repository_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Cross","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Cross/issues/602/labels{/name}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Cross/issues/602/comments","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Cross/issues/602/events","html_url":"https://github.com/KhronosGroup/SPIRV-Cross/issues/602","id":330508130,"node_id":"MDU6SXNzdWUzMzA1MDgxMzA=","number":602,"title":"Discuss approach to supporting in/out matrices in MSL","user":{"login":"billhollings","id":356402,"node_id":"MDQ6VXNlcjM1NjQwMg==","avatar_url":"https://avatars3.githubusercontent.com/u/356402?v=4","gravatar_id":"","url":"https://api.github.com/users/billhollings","html_url":"https://github.com/billhollings","followers_url":"https://api.github.com/users/billhollings/followers","following_url":"https://api.github.com/users/billhollings/following{/other_user}","gists_url":"https://api.github.com/users/billhollings/gists{/gist_id}","starred_url":"https://api.github.com/users/billhollings/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billhollings/subscriptions","organizations_url":"https://api.github.com/users/billhollings/orgs","repos_url":"https://api.github.com/users/billhollings/repos","events_url":"https://api.github.com/users/billhollings/events{/privacy}","received_events_url":"https://api.github.com/users/billhollings/received_events","type":"User","site_admin":false},"labels":[{"id":352397995,"node_id":"MDU6TGFiZWwzNTIzOTc5OTU=","url":"https://api.github.com/repos/KhronosGroup/SPIRV-Cross/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-08T03:36:35Z","updated_at":"2018-06-08T03:36:35Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"@HansKristian-ARM, et al...\r\n\r\nThe GLSL `in` and `out` variable declarations get translated to vertex output structure and fragment `stage_in` structure elements.\r\n\r\nIn GLSL it is posible to define a matrix as an `in` or `out` variable.\r\n\r\nHowever...In MSL, matrices (and scalar & vector arrays) cannot be passed as between vertex and fragment shaders in the vertex shader output struct and the fragment `stage_in` struct.\r\n\r\nOne way around this might be to convert the matrices back and forth to 4 (or less depending on matrix size) vectors, each with its own element in the `in/out` struct.\r\n\r\nAssuming this makes sense...I'd like to discuss how best to do this.\r\n\r\nMy thoughts so far revolve around having `CompilerMSL` special-case matrices in the `OpLoad` and `OpStore` operations to inject code that will convert back and forth to vectors appropriately when it knows it is dealing with a matrix that is part of `StorageClassInput` or `StorageClassOutput` struct.\r\n\r\nI'm throwing this issue out here for discussion...because I'm not sure this will cover all use-cases...and I'm not sure that there are not better approaches that could be explored.\r\n\r\nFor example...could the existing flattening functions within `CompilerGLSL` be of any help here? I am not familiar with their use.\r\n\r\nOr would it be better to inject the appropriate conversion code into the SPIR-V itself...maybe by `glslang`?\r\n\r\nThoughts?\r\n\r\nThanks."}}
{"actor":{"display_login":"billhollings"}}