{"action":"created","comment":{"url":"https://api.github.com/repos/google/nxt-standalone/pulls/comments/204047291","pull_request_review_id":139060484,"id":204047291,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDA0NzI5MQ==","diff_hunk":"@@ -15,69 +15,124 @@\n #include \"backend/CommandBufferStateTracker.h\"\n \n #include \"backend/BindGroup.h\"\n-#include \"backend/BindGroupLayout.h\"\n-#include \"backend/Buffer.h\"\n #include \"backend/ComputePipeline.h\"\n #include \"backend/Forward.h\"\n #include \"backend/InputState.h\"\n #include \"backend/PipelineLayout.h\"\n-#include \"backend/RenderPassDescriptor.h\"\n #include \"backend/RenderPipeline.h\"\n-#include \"backend/Texture.h\"\n #include \"common/Assert.h\"\n #include \"common/BitSetIterator.h\"\n \n namespace backend {\n \n+    enum ValidationAspect {\n+        VALIDATION_ASPECT_PIPELINE,\n+        VALIDATION_ASPECT_BIND_GROUPS,\n+        VALIDATION_ASPECT_VERTEX_BUFFERS,\n+        VALIDATION_ASPECT_INDEX_BUFFER,\n+\n+        VALIDATION_ASPECT_COUNT\n+    };\n+    static_assert(VALIDATION_ASPECT_COUNT == CommandBufferStateTracker::kNumAspects, \"\");\n+\n+    static constexpr CommandBufferStateTracker::ValidationAspects kDispatchAspects =\n+        1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS;\n+\n+    static constexpr CommandBufferStateTracker::ValidationAspects kDrawArraysAspects =\n+        1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS |\n+        1 << VALIDATION_ASPECT_VERTEX_BUFFERS;\n+\n+    static constexpr CommandBufferStateTracker::ValidationAspects kDrawElementsAspects =\n+        1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS |\n+        1 << VALIDATION_ASPECT_VERTEX_BUFFERS | 1 << VALIDATION_ASPECT_INDEX_BUFFER;\n+\n+    static constexpr CommandBufferStateTracker::ValidationAspects kLazyAspects =\n+        1 << VALIDATION_ASPECT_BIND_GROUPS | 1 << VALIDATION_ASPECT_VERTEX_BUFFERS;\n+\n     MaybeError CommandBufferStateTracker::ValidateCanDispatch() {\n-        constexpr ValidationAspects requiredAspects =\n-            1 << VALIDATION_ASPECT_PIPELINE | 1 << VALIDATION_ASPECT_BIND_GROUPS;\n-        if ((requiredAspects & ~mAspects).none()) {\n-            // Fast return-true path if everything is good\n+        return ValidateOperation(kDispatchAspects);\n+    }\n+\n+    MaybeError CommandBufferStateTracker::ValidateCanDrawArrays() {\n+        return ValidateOperation(kDrawArraysAspects);\n+    }\n+\n+    MaybeError CommandBufferStateTracker::ValidateCanDrawElements() {\n+        return ValidateOperation(kDrawElementsAspects);\n+    }\n+\n+    MaybeError CommandBufferStateTracker::ValidateOperation(ValidationAspects requiredAspects) {\n+        // Fast return-true path if everything is good\n+        ValidationAspects missingAspects = requiredAspects & ~mAspects;\n+        if (missingAspects.none()) {\n             return {};\n         }\n \n-        if (!mAspects[VALIDATION_ASPECT_PIPELINE]) {\n-            DAWN_RETURN_ERROR(\"No active compute pipeline\");\n+        // Generate an error immediatly if a non-lazy aspect is missing as computing lazy aspects","path":"src/backend/CommandBufferStateTracker.cpp","position":null,"original_position":67,"commit_id":"15584824d791cf270f58d875e2167e895d46bc4d","original_commit_id":"a6862a76bed4949943b423a9952041277b5e4d59","user":{"login":"Kangz","id":472810,"node_id":"MDQ6VXNlcjQ3MjgxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/472810?v=4","gravatar_id":"","url":"https://api.github.com/users/Kangz","html_url":"https://github.com/Kangz","followers_url":"https://api.github.com/users/Kangz/followers","following_url":"https://api.github.com/users/Kangz/following{/other_user}","gists_url":"https://api.github.com/users/Kangz/gists{/gist_id}","starred_url":"https://api.github.com/users/Kangz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kangz/subscriptions","organizations_url":"https://api.github.com/users/Kangz/orgs","repos_url":"https://api.github.com/users/Kangz/repos","events_url":"https://api.github.com/users/Kangz/events{/privacy}","received_events_url":"https://api.github.com/users/Kangz/received_events","type":"User","site_admin":false},"body":"Done","created_at":"2018-07-20T13:39:57Z","updated_at":"2018-07-20T13:39:57Z","html_url":"https://github.com/google/nxt-standalone/pull/228#discussion_r204047291","pull_request_url":"https://api.github.com/repos/google/nxt-standalone/pulls/228","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/google/nxt-standalone/pulls/comments/204047291"},"html":{"href":"https://github.com/google/nxt-standalone/pull/228#discussion_r204047291"},"pull_request":{"href":"https://api.github.com/repos/google/nxt-standalone/pulls/228"}},"in_reply_to_id":203865072},"pull_request":{"url":"https://api.github.com/repos/google/nxt-standalone/pulls/228","id":202506630,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAyNTA2NjMw","html_url":"https://github.com/google/nxt-standalone/pull/228","diff_url":"https://github.com/google/nxt-standalone/pull/228.diff","patch_url":"https://github.com/google/nxt-standalone/pull/228.patch","issue_url":"https://api.github.com/repos/google/nxt-standalone/issues/228","number":228,"state":"open","locked":false,"title":"State tracker","user":{"login":"Kangz","id":472810,"node_id":"MDQ6VXNlcjQ3MjgxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/472810?v=4","gravatar_id":"","url":"https://api.github.com/users/Kangz","html_url":"https://github.com/Kangz","followers_url":"https://api.github.com/users/Kangz/followers","following_url":"https://api.github.com/users/Kangz/following{/other_user}","gists_url":"https://api.github.com/users/Kangz/gists{/gist_id}","starred_url":"https://api.github.com/users/Kangz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kangz/subscriptions","organizations_url":"https://api.github.com/users/Kangz/orgs","repos_url":"https://api.github.com/users/Kangz/repos","events_url":"https://api.github.com/users/Kangz/events{/privacy}","received_events_url":"https://api.github.com/users/Kangz/received_events","type":"User","site_admin":false},"body":"PTAL","created_at":"2018-07-19T09:59:15Z","updated_at":"2018-07-20T13:39:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"436df7cf53c6f87571fd45aef99f1dc81d62f3c5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":992960350,"node_id":"MDU6TGFiZWw5OTI5NjAzNTA=","url":"https://api.github.com/repos/google/nxt-standalone/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/nxt-standalone/pulls/228/commits","review_comments_url":"https://api.github.com/repos/google/nxt-standalone/pulls/228/comments","review_comment_url":"https://api.github.com/repos/google/nxt-standalone/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/nxt-standalone/issues/228/comments","statuses_url":"https://api.github.com/repos/google/nxt-standalone/statuses/15584824d791cf270f58d875e2167e895d46bc4d","head":{"label":"Kangz:state-tracker","ref":"state-tracker","sha":"15584824d791cf270f58d875e2167e895d46bc4d","user":{"login":"Kangz","id":472810,"node_id":"MDQ6VXNlcjQ3MjgxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/472810?v=4","gravatar_id":"","url":"https://api.github.com/users/Kangz","html_url":"https://github.com/Kangz","followers_url":"https://api.github.com/users/Kangz/followers","following_url":"https://api.github.com/users/Kangz/following{/other_user}","gists_url":"https://api.github.com/users/Kangz/gists{/gist_id}","starred_url":"https://api.github.com/users/Kangz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kangz/subscriptions","organizations_url":"https://api.github.com/users/Kangz/orgs","repos_url":"https://api.github.com/users/Kangz/repos","events_url":"https://api.github.com/users/Kangz/events{/privacy}","received_events_url":"https://api.github.com/users/Kangz/received_events","type":"User","site_admin":false},"repo":{"id":88898317,"node_id":"MDEwOlJlcG9zaXRvcnk4ODg5ODMxNw==","name":"nxt-standalone","full_name":"Kangz/nxt-standalone","owner":{"login":"Kangz","id":472810,"node_id":"MDQ6VXNlcjQ3MjgxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/472810?v=4","gravatar_id":"","url":"https://api.github.com/users/Kangz","html_url":"https://github.com/Kangz","followers_url":"https://api.github.com/users/Kangz/followers","following_url":"https://api.github.com/users/Kangz/following{/other_user}","gists_url":"https://api.github.com/users/Kangz/gists{/gist_id}","starred_url":"https://api.github.com/users/Kangz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kangz/subscriptions","organizations_url":"https://api.github.com/users/Kangz/orgs","repos_url":"https://api.github.com/users/Kangz/repos","events_url":"https://api.github.com/users/Kangz/events{/privacy}","received_events_url":"https://api.github.com/users/Kangz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kangz/nxt-standalone","description":"ANGLE-like library for Chromium's next-generation Web graphics API prototype.","fork":true,"url":"https://api.github.com/repos/Kangz/nxt-standalone","forks_url":"https://api.github.com/repos/Kangz/nxt-standalone/forks","keys_url":"https://api.github.com/repos/Kangz/nxt-standalone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kangz/nxt-standalone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kangz/nxt-standalone/teams","hooks_url":"https://api.github.com/repos/Kangz/nxt-standalone/hooks","issue_events_url":"https://api.github.com/repos/Kangz/nxt-standalone/issues/events{/number}","events_url":"https://api.github.com/repos/Kangz/nxt-standalone/events","assignees_url":"https://api.github.com/repos/Kangz/nxt-standalone/assignees{/user}","branches_url":"https://api.github.com/repos/Kangz/nxt-standalone/branches{/branch}","tags_url":"https://api.github.com/repos/Kangz/nxt-standalone/tags","blobs_url":"https://api.github.com/repos/Kangz/nxt-standalone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kangz/nxt-standalone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kangz/nxt-standalone/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kangz/nxt-standalone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kangz/nxt-standalone/statuses/{sha}","languages_url":"https://api.github.com/repos/Kangz/nxt-standalone/languages","stargazers_url":"https://api.github.com/repos/Kangz/nxt-standalone/stargazers","contributors_url":"https://api.github.com/repos/Kangz/nxt-standalone/contributors","subscribers_url":"https://api.github.com/repos/Kangz/nxt-standalone/subscribers","subscription_url":"https://api.github.com/repos/Kangz/nxt-standalone/subscription","commits_url":"https://api.github.com/repos/Kangz/nxt-standalone/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kangz/nxt-standalone/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kangz/nxt-standalone/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kangz/nxt-standalone/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kangz/nxt-standalone/contents/{+path}","compare_url":"https://api.github.com/repos/Kangz/nxt-standalone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kangz/nxt-standalone/merges","archive_url":"https://api.github.com/repos/Kangz/nxt-standalone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kangz/nxt-standalone/downloads","issues_url":"https://api.github.com/repos/Kangz/nxt-standalone/issues{/number}","pulls_url":"https://api.github.com/repos/Kangz/nxt-standalone/pulls{/number}","milestones_url":"https://api.github.com/repos/Kangz/nxt-standalone/milestones{/number}","notifications_url":"https://api.github.com/repos/Kangz/nxt-standalone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kangz/nxt-standalone/labels{/name}","releases_url":"https://api.github.com/repos/Kangz/nxt-standalone/releases{/id}","deployments_url":"https://api.github.com/repos/Kangz/nxt-standalone/deployments","created_at":"2017-04-20T18:34:06Z","updated_at":"2017-04-20T18:34:08Z","pushed_at":"2018-07-20T13:39:42Z","git_url":"git://github.com/Kangz/nxt-standalone.git","ssh_url":"git@github.com:Kangz/nxt-standalone.git","clone_url":"https://github.com/Kangz/nxt-standalone.git","svn_url":"https://github.com/Kangz/nxt-standalone","homepage":"","size":2579,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"1184e46f873bc595502e9f2ade13cbd6cf5c28f3","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":88893060,"node_id":"MDEwOlJlcG9zaXRvcnk4ODg5MzA2MA==","name":"nxt-standalone","full_name":"google/nxt-standalone","owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/nxt-standalone","description":"ANGLE-like library for Chromium's next-generation Web graphics API prototype.","fork":false,"url":"https://api.github.com/repos/google/nxt-standalone","forks_url":"https://api.github.com/repos/google/nxt-standalone/forks","keys_url":"https://api.github.com/repos/google/nxt-standalone/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/nxt-standalone/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/nxt-standalone/teams","hooks_url":"https://api.github.com/repos/google/nxt-standalone/hooks","issue_events_url":"https://api.github.com/repos/google/nxt-standalone/issues/events{/number}","events_url":"https://api.github.com/repos/google/nxt-standalone/events","assignees_url":"https://api.github.com/repos/google/nxt-standalone/assignees{/user}","branches_url":"https://api.github.com/repos/google/nxt-standalone/branches{/branch}","tags_url":"https://api.github.com/repos/google/nxt-standalone/tags","blobs_url":"https://api.github.com/repos/google/nxt-standalone/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/nxt-standalone/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/nxt-standalone/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/nxt-standalone/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/nxt-standalone/statuses/{sha}","languages_url":"https://api.github.com/repos/google/nxt-standalone/languages","stargazers_url":"https://api.github.com/repos/google/nxt-standalone/stargazers","contributors_url":"https://api.github.com/repos/google/nxt-standalone/contributors","subscribers_url":"https://api.github.com/repos/google/nxt-standalone/subscribers","subscription_url":"https://api.github.com/repos/google/nxt-standalone/subscription","commits_url":"https://api.github.com/repos/google/nxt-standalone/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/nxt-standalone/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/nxt-standalone/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/nxt-standalone/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/nxt-standalone/contents/{+path}","compare_url":"https://api.github.com/repos/google/nxt-standalone/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/nxt-standalone/merges","archive_url":"https://api.github.com/repos/google/nxt-standalone/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/nxt-standalone/downloads","issues_url":"https://api.github.com/repos/google/nxt-standalone/issues{/number}","pulls_url":"https://api.github.com/repos/google/nxt-standalone/pulls{/number}","milestones_url":"https://api.github.com/repos/google/nxt-standalone/milestones{/number}","notifications_url":"https://api.github.com/repos/google/nxt-standalone/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/nxt-standalone/labels{/name}","releases_url":"https://api.github.com/repos/google/nxt-standalone/releases{/id}","deployments_url":"https://api.github.com/repos/google/nxt-standalone/deployments","created_at":"2017-04-20T17:33:32Z","updated_at":"2018-07-19T14:09:03Z","pushed_at":"2018-07-20T13:39:44Z","git_url":"git://github.com/google/nxt-standalone.git","ssh_url":"git@github.com:google/nxt-standalone.git","clone_url":"https://github.com/google/nxt-standalone.git","svn_url":"https://github.com/google/nxt-standalone","homepage":"","size":2279,"stargazers_count":112,"watchers_count":112,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"archived":false,"open_issues_count":17,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":26,"open_issues":17,"watchers":112,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/nxt-standalone/pulls/228"},"html":{"href":"https://github.com/google/nxt-standalone/pull/228"},"issue":{"href":"https://api.github.com/repos/google/nxt-standalone/issues/228"},"comments":{"href":"https://api.github.com/repos/google/nxt-standalone/issues/228/comments"},"review_comments":{"href":"https://api.github.com/repos/google/nxt-standalone/pulls/228/comments"},"review_comment":{"href":"https://api.github.com/repos/google/nxt-standalone/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/nxt-standalone/pulls/228/commits"},"statuses":{"href":"https://api.github.com/repos/google/nxt-standalone/statuses/15584824d791cf270f58d875e2167e895d46bc4d"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"Kangz"}}