{"action":"created","issue":{"url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/issues/168","repository_url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph","labels_url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/issues/168/labels{/name}","comments_url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/issues/168/comments","events_url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/issues/168/events","html_url":"https://github.com/openscenegraph/OpenSceneGraph/pull/168","id":191589581,"number":168,"title":"Fix IncrementalCompileOperation leaking program state","user":{"login":"scrawl","id":720642,"avatar_url":"https://avatars.githubusercontent.com/u/720642?v=3","gravatar_id":"","url":"https://api.github.com/users/scrawl","html_url":"https://github.com/scrawl","followers_url":"https://api.github.com/users/scrawl/followers","following_url":"https://api.github.com/users/scrawl/following{/other_user}","gists_url":"https://api.github.com/users/scrawl/gists{/gist_id}","starred_url":"https://api.github.com/users/scrawl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrawl/subscriptions","organizations_url":"https://api.github.com/users/scrawl/orgs","repos_url":"https://api.github.com/users/scrawl/repos","events_url":"https://api.github.com/users/scrawl/events{/privacy}","received_events_url":"https://api.github.com/users/scrawl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-11-24T20:50:09Z","updated_at":"2016-12-21T14:33:18Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/pulls/168","html_url":"https://github.com/openscenegraph/OpenSceneGraph/pull/168","diff_url":"https://github.com/openscenegraph/OpenSceneGraph/pull/168.diff","patch_url":"https://github.com/openscenegraph/OpenSceneGraph/pull/168.patch"},"body":"The IncrementalCompileOperation when compiling programs sets the GL state's current program object, but does not reset this state afterwards. A scene graph with no shaders would incorrectly render *with* a shader if you compiled some shaders in the background with the IncrementalCompileOperation.\r\n\r\nNote that prior to OSG 3.5.4, this bug wasn't visible because it was masked by another bug - no program objects were compiled at all, see commits 8f68da89d7fb75264fde742d59ea888415b489a6 & 06cb31a3d265a63c6db693120abec3c9fac591f3.\r\n\r\nSide note: is there any reason why we do\r\n\r\n<pre>\r\n    _program->apply(*compileInfo.getState());\r\n</pre>\r\nInstead of\r\n<pre>\r\n    _program->compile(*compileInfo.getState());\r\n</pre>\r\nIs that to workaround drivers that want to defer the compilation until the program is actually used? In that case, I don't think just setting the program object will do it, you'd need to draw something with it as well.\r\n\r\nAs a cleaner fix I'd propose changing apply() to compile(), unless we've got any test data that suggests using apply() would make a difference."},"comment":{"url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/issues/comments/268536682","html_url":"https://github.com/openscenegraph/OpenSceneGraph/pull/168#issuecomment-268536682","issue_url":"https://api.github.com/repos/openscenegraph/OpenSceneGraph/issues/168","id":268536682,"user":{"login":"scrawl","id":720642,"avatar_url":"https://avatars.githubusercontent.com/u/720642?v=3","gravatar_id":"","url":"https://api.github.com/users/scrawl","html_url":"https://github.com/scrawl","followers_url":"https://api.github.com/users/scrawl/followers","following_url":"https://api.github.com/users/scrawl/following{/other_user}","gists_url":"https://api.github.com/users/scrawl/gists{/gist_id}","starred_url":"https://api.github.com/users/scrawl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scrawl/subscriptions","organizations_url":"https://api.github.com/users/scrawl/orgs","repos_url":"https://api.github.com/users/scrawl/repos","events_url":"https://api.github.com/users/scrawl/events{/privacy}","received_events_url":"https://api.github.com/users/scrawl/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T14:33:18Z","updated_at":"2016-12-21T14:33:18Z","body":"Unfortunately I don't remember where I saw the issue, it wasn't a particular database but rather my entire program in a specific state.\r\n\r\nMerging back to 3.2/3.4 doesn't seem super important, because of this bit:\r\n> Note that prior to OSG 3.5.4, this bug wasn't visible because it was masked by another bug - no program objects were compiled at all, see commits 8f68da8 & 06cb31a.\r\n\r\nBut you can do it anyway if you feel like it, shouldn't cause any harm."}}
{"actor":{"display_login":"scrawl"}}