{"action":"opened","issue":{"url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/910","repository_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com","labels_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/910/labels{/name}","comments_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/910/comments","events_url":"https://api.github.com/repos/scp-fs2open/fs2open.github.com/issues/910/events","html_url":"https://github.com/scp-fs2open/fs2open.github.com/issues/910","id":173743983,"number":910,"title":"Use Uniform blocks instead of uniform variables","user":{"login":"asarium","id":1013983,"avatar_url":"https://avatars.githubusercontent.com/u/1013983?v=3","gravatar_id":"","url":"https://api.github.com/users/asarium","html_url":"https://github.com/asarium","followers_url":"https://api.github.com/users/asarium/followers","following_url":"https://api.github.com/users/asarium/following{/other_user}","gists_url":"https://api.github.com/users/asarium/gists{/gist_id}","starred_url":"https://api.github.com/users/asarium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asarium/subscriptions","organizations_url":"https://api.github.com/users/asarium/orgs","repos_url":"https://api.github.com/users/asarium/repos","events_url":"https://api.github.com/users/asarium/events{/privacy}","received_events_url":"https://api.github.com/users/asarium/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-29T10:26:58Z","updated_at":"2016-08-29T10:26:58Z","closed_at":null,"body":"I want to discuss the advantages and disadvantages of using uniform blocks instead of standard uniforms for passing data to the shaders. This does not mean that is must happen but instead I want to have an open discussion about if and how it could be implemented.\r\n\r\nI had some good experiences with uniform blocks in a testing project where it allowed me to decouple the rendering backend from the code that is using the rendering functions since the rendering backend only gets a uniform buffer handle for the data instead of somehow getting that data down to the rendering functions. It also allows to but data that is often changed together into the same buffer and change it at the same time.\r\nUniform buffers are also the way shader data is passed to the shaders in Vulkan but that's just a minor point here since we are not in a position to consider adding Vulkan support yet.\r\n\r\nThe disadvantages I currently see are that it's harder to properly optimize this concept since the drivers are usually pretty good at figuring out when the updated uniform data needs to be sent to the GPU. There is also the issue that the buffer data needs to be properly aligned before the GPU can use it. I have developed a helper class for that but it makes uniform block usage a little bit more complicated. There are probably other issues I haven't encountered yet so I would like your opinion on that.\r\n\r\nWhat do you think? Especially @SamuelCho since you probably already have experience with passing data to the GPU this way."}}
{"actor":{"display_login":"asarium"}}