{"action":"created","issue":{"url":"https://api.github.com/repos/mono/MonoGame/issues/4438","repository_url":"https://api.github.com/repos/mono/MonoGame","labels_url":"https://api.github.com/repos/mono/MonoGame/issues/4438/labels{/name}","comments_url":"https://api.github.com/repos/mono/MonoGame/issues/4438/comments","events_url":"https://api.github.com/repos/mono/MonoGame/issues/4438/events","html_url":"https://github.com/mono/MonoGame/pull/4438","id":127312567,"number":4438,"title":"ShaderProfile Refactor","user":{"login":"tomspilman","id":103522,"avatar_url":"https://avatars.githubusercontent.com/u/103522?v=3","gravatar_id":"","url":"https://api.github.com/users/tomspilman","html_url":"https://github.com/tomspilman","followers_url":"https://api.github.com/users/tomspilman/followers","following_url":"https://api.github.com/users/tomspilman/following{/other_user}","gists_url":"https://api.github.com/users/tomspilman/gists{/gist_id}","starred_url":"https://api.github.com/users/tomspilman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomspilman/subscriptions","organizations_url":"https://api.github.com/users/tomspilman/orgs","repos_url":"https://api.github.com/users/tomspilman/repos","events_url":"https://api.github.com/users/tomspilman/events{/privacy}","received_events_url":"https://api.github.com/users/tomspilman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/mono/MonoGame/milestones/9","html_url":"https://github.com/mono/MonoGame/milestones/3.6%20Release","labels_url":"https://api.github.com/repos/mono/MonoGame/milestones/9/labels","id":1441958,"number":9,"title":"3.6 Release","description":"More unit tests, running unit tests on Mac and Linux, SDL2 replacing OpenTK.","creator":{"login":"dellis1972","id":810617,"avatar_url":"https://avatars.githubusercontent.com/u/810617?v=3","gravatar_id":"","url":"https://api.github.com/users/dellis1972","html_url":"https://github.com/dellis1972","followers_url":"https://api.github.com/users/dellis1972/followers","following_url":"https://api.github.com/users/dellis1972/following{/other_user}","gists_url":"https://api.github.com/users/dellis1972/gists{/gist_id}","starred_url":"https://api.github.com/users/dellis1972/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dellis1972/subscriptions","organizations_url":"https://api.github.com/users/dellis1972/orgs","repos_url":"https://api.github.com/users/dellis1972/repos","events_url":"https://api.github.com/users/dellis1972/events{/privacy}","received_events_url":"https://api.github.com/users/dellis1972/received_events","type":"User","site_admin":false},"open_issues":85,"closed_issues":48,"state":"open","created_at":"2015-12-03T11:17:13Z","updated_at":"2016-04-21T18:36:32Z","due_on":"2016-06-13T07:00:00Z","closed_at":null},"comments":7,"created_at":"2016-01-18T21:16:30Z","updated_at":"2016-04-22T08:37:09Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mono/MonoGame/pulls/4438","html_url":"https://github.com/mono/MonoGame/pull/4438","diff_url":"https://github.com/mono/MonoGame/pull/4438.diff","patch_url":"https://github.com/mono/MonoGame/pull/4438.patch"},"body":"This PR is the first baby step towards making the content pipeline more easily extendable for new platforms.\r\n\r\nHere I refactored the existing `enum ShaderProfile` into a class that knows how to perform various platform specific steps of the effect compiling process.\r\n\r\nThe next step here is to remove specific values like `ShaderProfile.OpenGL` and `ShaderProfile.DirectX_11' and allow for new profiles to be discovered via attribute.  This then opens up the possibility of loading extension DLLs for supporting new platforms."},"comment":{"url":"https://api.github.com/repos/mono/MonoGame/issues/comments/213326084","html_url":"https://github.com/mono/MonoGame/pull/4438#issuecomment-213326084","issue_url":"https://api.github.com/repos/mono/MonoGame/issues/4438","id":213326084,"user":{"login":"tomspilman","id":103522,"avatar_url":"https://avatars.githubusercontent.com/u/103522?v=3","gravatar_id":"","url":"https://api.github.com/users/tomspilman","html_url":"https://github.com/tomspilman","followers_url":"https://api.github.com/users/tomspilman/followers","following_url":"https://api.github.com/users/tomspilman/following{/other_user}","gists_url":"https://api.github.com/users/tomspilman/gists{/gist_id}","starred_url":"https://api.github.com/users/tomspilman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomspilman/subscriptions","organizations_url":"https://api.github.com/users/tomspilman/orgs","repos_url":"https://api.github.com/users/tomspilman/repos","events_url":"https://api.github.com/users/tomspilman/events{/privacy}","received_events_url":"https://api.github.com/users/tomspilman/received_events","type":"User","site_admin":false},"created_at":"2016-04-22T08:37:09Z","updated_at":"2016-04-22T08:37:09Z","body":"Thought about this for a while and I think I need a slightly different approach... specifically with `ShaderProfile` and the `Enumeration<>` type.  The reason with the concern being that I want to apply the same technique to the existing `TargetPlatform` enumeration and want to make it work right.\r\n\r\nI think trying to \"fake\" an enum like this is a bad idea.  It will never work correctly in 100% of the cases... especially considering if one of the values is defined in a separate assembly from the rest (something critical for extendibility).\r\n\r\n  - Partial classes don't work across assembly boundaries.\r\n  - We can't depend on it being castable to a simple integer.\r\n  - Things depend on reflection (aka property grids or command line parsers) need special cases.\r\n\r\nSo my next refactor here will give up on the fake enum approach... which might end up more of a conceptual and type naming issue more than anything else.  Instead I want to focus on supporting that these can come from separate assemblies from the start and find a common way to discover and collect them.\r\n\r\nIn the case of `enum TargetPlatform` specifically I think we will leave the old type in place, but the old public methods that use them will just forward to a new method that takes a new extenable platform identifier type.\r\n"}}