{"action":"created","comment":{"url":"https://api.github.com/repos/UBoys/PAGE/pulls/comments/223215631","pull_request_review_id":162292040,"id":223215631,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMzIxNTYzMQ==","diff_hunk":"@@ -0,0 +1,70 @@\n+#pragma once\n+\n+namespace molten {\n+\n+enum RendererType {\n+    Null,\n+    OpenGL,\n+    Vulkan,\n+    D3D12\n+};\n+\n+enum RenderCommand {\n+    SetPipelineState,\n+    SetVertexBuffer,\n+    SetIndexBuffer,\n+    SetTextures,\n+    SetSamplers,\n+    DrawIndexed\n+};\n+\n+struct RendererCaps {\n+    RendererType type;\n+    void* allocator;\n+    bool debug;\n+    bool msaa;\n+};\n+\n+struct TextureDescription {};\n+struct SamplerDescription {};\n+// Should contain rasterizer state, depth stencil state, blend state and shader\n+struct PipelineState {};\n+// TODO: Constant buffers\n+\n+// Handle for each renderer resource.\n+// All rendering resources are owned the renderer and should not be coupled with client code\n+struct MoltenObject {\n+    MoltenObject() { objectId = ++s_objectIds;};\n+    bool IsValid() { return objectId != 0; }\n+    uint32_t objectId = 0;\n+    static uint32_t s_objectIds;\n+};\n+\n+class IRenderer {\n+public:\n+    virtual ~IRenderer() = default;\n+\n+    virtual void Initialize(const RendererCaps& caps);\n+\n+    virtual MoltenObject CreateVertexBuffer(const uint32_t count) = 0;\n+    virtual MoltenObject CreateIndexBuffer(uint32_t count) = 0;\n+    virtual MoltenObject CreatePipelineState(const PipelineState& state);\n+    virtual MoltenObject CreateTexture(const TextureDescription& description, const std::vector<void*> data);\n+    virtual MoltenObject CreateSamplerState(const SamplerDescription& description);\n+\n+    virtual void* MapVertexBuffer(const MoltenObject& handle) = 0;\n+    virtual void* MapIndexBuffer(const MoltenObject& handle) = 0;\n+    virtual void UnmapVertexBuffer(const MoltenObject& handle, const uint32_t count) = 0;\n+    virtual void UnmapIndexBuffer(const MoltenObject& handle, const uint32_t count) = 0; \n+\n+    virtual void DestroyVertexBuffer(const MoltenObject& handle) = 0;\n+    virtual void DestroyIndexBuffer(const MoltenObject& handle) = 0;\n+    virtual void DestroyTexture(const MoltenObject& handle) = 0;\n+    virtual void DestroyPipelineState(const MoltenObject& handle) = 0;\n+    virtual void DestroySamplerState(const MoltenObject& hanele) = 0;\n+\n+    /// Actual rendering commands that operate on updated and ready resources.\n+    virtual void Render(const std::vector<RenderCommand> commandBuffer) = 0;\n+};\n+\n+} ","path":"src/renderer/irenderer.h","position":70,"original_position":70,"commit_id":"d72cfb0309b6298b4689fcb889f2dae51838a44e","original_commit_id":"d72cfb0309b6298b4689fcb889f2dae51838a44e","user":{"login":"Carlbaum","id":7249663,"node_id":"MDQ6VXNlcjcyNDk2NjM=","avatar_url":"https://avatars1.githubusercontent.com/u/7249663?v=4","gravatar_id":"","url":"https://api.github.com/users/Carlbaum","html_url":"https://github.com/Carlbaum","followers_url":"https://api.github.com/users/Carlbaum/followers","following_url":"https://api.github.com/users/Carlbaum/following{/other_user}","gists_url":"https://api.github.com/users/Carlbaum/gists{/gist_id}","starred_url":"https://api.github.com/users/Carlbaum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Carlbaum/subscriptions","organizations_url":"https://api.github.com/users/Carlbaum/orgs","repos_url":"https://api.github.com/users/Carlbaum/repos","events_url":"https://api.github.com/users/Carlbaum/events{/privacy}","received_events_url":"https://api.github.com/users/Carlbaum/received_events","type":"User","site_admin":false},"body":"No newline","created_at":"2018-10-07T14:31:44Z","updated_at":"2018-10-07T14:32:28Z","html_url":"https://github.com/UBoys/PAGE/pull/4#discussion_r223215631","pull_request_url":"https://api.github.com/repos/UBoys/PAGE/pulls/4","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/UBoys/PAGE/pulls/comments/223215631"},"html":{"href":"https://github.com/UBoys/PAGE/pull/4#discussion_r223215631"},"pull_request":{"href":"https://api.github.com/repos/UBoys/PAGE/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/UBoys/PAGE/pulls/4","id":220890964,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwODkwOTY0","html_url":"https://github.com/UBoys/PAGE/pull/4","diff_url":"https://github.com/UBoys/PAGE/pull/4.diff","patch_url":"https://github.com/UBoys/PAGE/pull/4.patch","issue_url":"https://api.github.com/repos/UBoys/PAGE/issues/4","number":4,"state":"open","locked":false,"title":"[Renderer] Interface v1","user":{"login":"novalain","id":7224052,"node_id":"MDQ6VXNlcjcyMjQwNTI=","avatar_url":"https://avatars2.githubusercontent.com/u/7224052?v=4","gravatar_id":"","url":"https://api.github.com/users/novalain","html_url":"https://github.com/novalain","followers_url":"https://api.github.com/users/novalain/followers","following_url":"https://api.github.com/users/novalain/following{/other_user}","gists_url":"https://api.github.com/users/novalain/gists{/gist_id}","starred_url":"https://api.github.com/users/novalain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novalain/subscriptions","organizations_url":"https://api.github.com/users/novalain/orgs","repos_url":"https://api.github.com/users/novalain/repos","events_url":"https://api.github.com/users/novalain/events{/privacy}","received_events_url":"https://api.github.com/users/novalain/received_events","type":"User","site_admin":false},"body":"The idea is to keep all resources within the renderer and return handles to the client. \r\nThe render function takes in a bulk of rendering commands for one frame and executes them in a batch!","created_at":"2018-10-06T14:55:22Z","updated_at":"2018-10-07T14:32:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1265a5bc3ed3e037772ca1480bb01ddb0590b706","assignee":null,"assignees":[],"requested_reviewers":[{"login":"RiiQQe","id":2979068,"node_id":"MDQ6VXNlcjI5NzkwNjg=","avatar_url":"https://avatars2.githubusercontent.com/u/2979068?v=4","gravatar_id":"","url":"https://api.github.com/users/RiiQQe","html_url":"https://github.com/RiiQQe","followers_url":"https://api.github.com/users/RiiQQe/followers","following_url":"https://api.github.com/users/RiiQQe/following{/other_user}","gists_url":"https://api.github.com/users/RiiQQe/gists{/gist_id}","starred_url":"https://api.github.com/users/RiiQQe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RiiQQe/subscriptions","organizations_url":"https://api.github.com/users/RiiQQe/orgs","repos_url":"https://api.github.com/users/RiiQQe/repos","events_url":"https://api.github.com/users/RiiQQe/events{/privacy}","received_events_url":"https://api.github.com/users/RiiQQe/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/UBoys/PAGE/pulls/4/commits","review_comments_url":"https://api.github.com/repos/UBoys/PAGE/pulls/4/comments","review_comment_url":"https://api.github.com/repos/UBoys/PAGE/pulls/comments{/number}","comments_url":"https://api.github.com/repos/UBoys/PAGE/issues/4/comments","statuses_url":"https://api.github.com/repos/UBoys/PAGE/statuses/d72cfb0309b6298b4689fcb889f2dae51838a44e","head":{"label":"UBoys:nova/renderer_interface","ref":"nova/renderer_interface","sha":"d72cfb0309b6298b4689fcb889f2dae51838a44e","user":{"login":"UBoys","id":43751336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNzUxMzM2","avatar_url":"https://avatars1.githubusercontent.com/u/43751336?v=4","gravatar_id":"","url":"https://api.github.com/users/UBoys","html_url":"https://github.com/UBoys","followers_url":"https://api.github.com/users/UBoys/followers","following_url":"https://api.github.com/users/UBoys/following{/other_user}","gists_url":"https://api.github.com/users/UBoys/gists{/gist_id}","starred_url":"https://api.github.com/users/UBoys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UBoys/subscriptions","organizations_url":"https://api.github.com/users/UBoys/orgs","repos_url":"https://api.github.com/users/UBoys/repos","events_url":"https://api.github.com/users/UBoys/events{/privacy}","received_events_url":"https://api.github.com/users/UBoys/received_events","type":"Organization","site_admin":false},"repo":{"id":151098640,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEwOTg2NDA=","name":"PAGE","full_name":"UBoys/PAGE","private":false,"owner":{"login":"UBoys","id":43751336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNzUxMzM2","avatar_url":"https://avatars1.githubusercontent.com/u/43751336?v=4","gravatar_id":"","url":"https://api.github.com/users/UBoys","html_url":"https://github.com/UBoys","followers_url":"https://api.github.com/users/UBoys/followers","following_url":"https://api.github.com/users/UBoys/following{/other_user}","gists_url":"https://api.github.com/users/UBoys/gists{/gist_id}","starred_url":"https://api.github.com/users/UBoys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UBoys/subscriptions","organizations_url":"https://api.github.com/users/UBoys/orgs","repos_url":"https://api.github.com/users/UBoys/repos","events_url":"https://api.github.com/users/UBoys/events{/privacy}","received_events_url":"https://api.github.com/users/UBoys/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UBoys/PAGE","description":"Platform Agnostic Graphics Engine","fork":false,"url":"https://api.github.com/repos/UBoys/PAGE","forks_url":"https://api.github.com/repos/UBoys/PAGE/forks","keys_url":"https://api.github.com/repos/UBoys/PAGE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UBoys/PAGE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UBoys/PAGE/teams","hooks_url":"https://api.github.com/repos/UBoys/PAGE/hooks","issue_events_url":"https://api.github.com/repos/UBoys/PAGE/issues/events{/number}","events_url":"https://api.github.com/repos/UBoys/PAGE/events","assignees_url":"https://api.github.com/repos/UBoys/PAGE/assignees{/user}","branches_url":"https://api.github.com/repos/UBoys/PAGE/branches{/branch}","tags_url":"https://api.github.com/repos/UBoys/PAGE/tags","blobs_url":"https://api.github.com/repos/UBoys/PAGE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UBoys/PAGE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UBoys/PAGE/git/refs{/sha}","trees_url":"https://api.github.com/repos/UBoys/PAGE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UBoys/PAGE/statuses/{sha}","languages_url":"https://api.github.com/repos/UBoys/PAGE/languages","stargazers_url":"https://api.github.com/repos/UBoys/PAGE/stargazers","contributors_url":"https://api.github.com/repos/UBoys/PAGE/contributors","subscribers_url":"https://api.github.com/repos/UBoys/PAGE/subscribers","subscription_url":"https://api.github.com/repos/UBoys/PAGE/subscription","commits_url":"https://api.github.com/repos/UBoys/PAGE/commits{/sha}","git_commits_url":"https://api.github.com/repos/UBoys/PAGE/git/commits{/sha}","comments_url":"https://api.github.com/repos/UBoys/PAGE/comments{/number}","issue_comment_url":"https://api.github.com/repos/UBoys/PAGE/issues/comments{/number}","contents_url":"https://api.github.com/repos/UBoys/PAGE/contents/{+path}","compare_url":"https://api.github.com/repos/UBoys/PAGE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UBoys/PAGE/merges","archive_url":"https://api.github.com/repos/UBoys/PAGE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UBoys/PAGE/downloads","issues_url":"https://api.github.com/repos/UBoys/PAGE/issues{/number}","pulls_url":"https://api.github.com/repos/UBoys/PAGE/pulls{/number}","milestones_url":"https://api.github.com/repos/UBoys/PAGE/milestones{/number}","notifications_url":"https://api.github.com/repos/UBoys/PAGE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UBoys/PAGE/labels{/name}","releases_url":"https://api.github.com/repos/UBoys/PAGE/releases{/id}","deployments_url":"https://api.github.com/repos/UBoys/PAGE/deployments","created_at":"2018-10-01T14:04:51Z","updated_at":"2018-10-05T15:59:56Z","pushed_at":"2018-10-07T14:13:34Z","git_url":"git://github.com/UBoys/PAGE.git","ssh_url":"git@github.com:UBoys/PAGE.git","clone_url":"https://github.com/UBoys/PAGE.git","svn_url":"https://github.com/UBoys/PAGE","homepage":"","size":67,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"UBoys:master","ref":"master","sha":"631305c793c913cfed1aee8b7cea079288b72dae","user":{"login":"UBoys","id":43751336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNzUxMzM2","avatar_url":"https://avatars1.githubusercontent.com/u/43751336?v=4","gravatar_id":"","url":"https://api.github.com/users/UBoys","html_url":"https://github.com/UBoys","followers_url":"https://api.github.com/users/UBoys/followers","following_url":"https://api.github.com/users/UBoys/following{/other_user}","gists_url":"https://api.github.com/users/UBoys/gists{/gist_id}","starred_url":"https://api.github.com/users/UBoys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UBoys/subscriptions","organizations_url":"https://api.github.com/users/UBoys/orgs","repos_url":"https://api.github.com/users/UBoys/repos","events_url":"https://api.github.com/users/UBoys/events{/privacy}","received_events_url":"https://api.github.com/users/UBoys/received_events","type":"Organization","site_admin":false},"repo":{"id":151098640,"node_id":"MDEwOlJlcG9zaXRvcnkxNTEwOTg2NDA=","name":"PAGE","full_name":"UBoys/PAGE","private":false,"owner":{"login":"UBoys","id":43751336,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQzNzUxMzM2","avatar_url":"https://avatars1.githubusercontent.com/u/43751336?v=4","gravatar_id":"","url":"https://api.github.com/users/UBoys","html_url":"https://github.com/UBoys","followers_url":"https://api.github.com/users/UBoys/followers","following_url":"https://api.github.com/users/UBoys/following{/other_user}","gists_url":"https://api.github.com/users/UBoys/gists{/gist_id}","starred_url":"https://api.github.com/users/UBoys/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UBoys/subscriptions","organizations_url":"https://api.github.com/users/UBoys/orgs","repos_url":"https://api.github.com/users/UBoys/repos","events_url":"https://api.github.com/users/UBoys/events{/privacy}","received_events_url":"https://api.github.com/users/UBoys/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/UBoys/PAGE","description":"Platform Agnostic Graphics Engine","fork":false,"url":"https://api.github.com/repos/UBoys/PAGE","forks_url":"https://api.github.com/repos/UBoys/PAGE/forks","keys_url":"https://api.github.com/repos/UBoys/PAGE/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UBoys/PAGE/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UBoys/PAGE/teams","hooks_url":"https://api.github.com/repos/UBoys/PAGE/hooks","issue_events_url":"https://api.github.com/repos/UBoys/PAGE/issues/events{/number}","events_url":"https://api.github.com/repos/UBoys/PAGE/events","assignees_url":"https://api.github.com/repos/UBoys/PAGE/assignees{/user}","branches_url":"https://api.github.com/repos/UBoys/PAGE/branches{/branch}","tags_url":"https://api.github.com/repos/UBoys/PAGE/tags","blobs_url":"https://api.github.com/repos/UBoys/PAGE/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UBoys/PAGE/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UBoys/PAGE/git/refs{/sha}","trees_url":"https://api.github.com/repos/UBoys/PAGE/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UBoys/PAGE/statuses/{sha}","languages_url":"https://api.github.com/repos/UBoys/PAGE/languages","stargazers_url":"https://api.github.com/repos/UBoys/PAGE/stargazers","contributors_url":"https://api.github.com/repos/UBoys/PAGE/contributors","subscribers_url":"https://api.github.com/repos/UBoys/PAGE/subscribers","subscription_url":"https://api.github.com/repos/UBoys/PAGE/subscription","commits_url":"https://api.github.com/repos/UBoys/PAGE/commits{/sha}","git_commits_url":"https://api.github.com/repos/UBoys/PAGE/git/commits{/sha}","comments_url":"https://api.github.com/repos/UBoys/PAGE/comments{/number}","issue_comment_url":"https://api.github.com/repos/UBoys/PAGE/issues/comments{/number}","contents_url":"https://api.github.com/repos/UBoys/PAGE/contents/{+path}","compare_url":"https://api.github.com/repos/UBoys/PAGE/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UBoys/PAGE/merges","archive_url":"https://api.github.com/repos/UBoys/PAGE/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UBoys/PAGE/downloads","issues_url":"https://api.github.com/repos/UBoys/PAGE/issues{/number}","pulls_url":"https://api.github.com/repos/UBoys/PAGE/pulls{/number}","milestones_url":"https://api.github.com/repos/UBoys/PAGE/milestones{/number}","notifications_url":"https://api.github.com/repos/UBoys/PAGE/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UBoys/PAGE/labels{/name}","releases_url":"https://api.github.com/repos/UBoys/PAGE/releases{/id}","deployments_url":"https://api.github.com/repos/UBoys/PAGE/deployments","created_at":"2018-10-01T14:04:51Z","updated_at":"2018-10-05T15:59:56Z","pushed_at":"2018-10-07T14:13:34Z","git_url":"git://github.com/UBoys/PAGE.git","ssh_url":"git@github.com:UBoys/PAGE.git","clone_url":"https://github.com/UBoys/PAGE.git","svn_url":"https://github.com/UBoys/PAGE","homepage":"","size":67,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/UBoys/PAGE/pulls/4"},"html":{"href":"https://github.com/UBoys/PAGE/pull/4"},"issue":{"href":"https://api.github.com/repos/UBoys/PAGE/issues/4"},"comments":{"href":"https://api.github.com/repos/UBoys/PAGE/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/UBoys/PAGE/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/UBoys/PAGE/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/UBoys/PAGE/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/UBoys/PAGE/statuses/d72cfb0309b6298b4689fcb889f2dae51838a44e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Carlbaum"}}