{"action":"created","comment":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/222339151","pull_request_review_id":161200715,"id":222339151,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMjMzOTE1MQ==","diff_hunk":"@@ -864,7 +864,70 @@ spv_result_t CheckVulkanMemoryModelDeprecatedDecorations(\n       }\n     }\n   }\n+  return SPV_SUCCESS;\n+}\n+\n+spv_result_t CheckDecorationsOfConversions(ValidationState_t& vstate) {\n+  for (const auto& kv : vstate.id_decorations()) {\n+    const uint32_t id = kv.first;\n+    const auto& decorations = kv.second;\n+    if (decorations.empty()) {\n+      continue;\n+    }\n+\n+    const Instruction* inst = vstate.FindDef(id);\n+    assert(inst);\n+\n+    // Validates FPRoundingMode decoration\n+    for (const auto& decoration : decorations) {\n+      if (decoration.dec_type() != SpvDecorationFPRoundingMode) {\n+        continue;\n+      }\n+\n+      // Validates width-only conversion instruction for floating-point object\n+      // i.e., OpFConvert\n+      if (inst->opcode() != SpvOpFConvert) {\n+        return vstate.diag(SPV_ERROR_INVALID_ID, inst)\n+               << \"FPRoundingMode decoration can be applied only to a \"\n+                  \"width-only conversion instruction for floating-point \"\n+                  \"object.\";\n+      }\n+\n+      // Validates Object operand of an OpStore\n+      for (const auto& use : inst->uses()) {\n+        const auto store = use.first;\n+        if (store->opcode() != SpvOpStore) {\n+            return vstate.diag(SPV_ERROR_INVALID_ID, inst)\n+                   << \"FPRoundingMode decoration can be applied only to the \"\n+                      \"Object operand of an OpStore.\";\n+        }\n+\n+        const auto object_id = store->GetOperandAs<uint32_t>(1);\n+        if (object_id != inst->id()) {","path":"source/val/validate_decorations.cpp","position":43,"original_position":43,"commit_id":"1e36d9e9552b21052ec8c81c4aab21d34a40d479","original_commit_id":"4e8a7ae7372412c152094754fa3c0a4629c45fad","user":{"login":"alan-baker","id":33432579,"node_id":"MDQ6VXNlcjMzNDMyNTc5","avatar_url":"https://avatars1.githubusercontent.com/u/33432579?v=4","gravatar_id":"","url":"https://api.github.com/users/alan-baker","html_url":"https://github.com/alan-baker","followers_url":"https://api.github.com/users/alan-baker/followers","following_url":"https://api.github.com/users/alan-baker/following{/other_user}","gists_url":"https://api.github.com/users/alan-baker/gists{/gist_id}","starred_url":"https://api.github.com/users/alan-baker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alan-baker/subscriptions","organizations_url":"https://api.github.com/users/alan-baker/orgs","repos_url":"https://api.github.com/users/alan-baker/repos","events_url":"https://api.github.com/users/alan-baker/events{/privacy}","received_events_url":"https://api.github.com/users/alan-baker/received_events","type":"User","site_admin":false},"body":"I would change this to use the second element of the use. This would avoid missing some bizarre state where we don't otherwise catch `OpStore %conv %conv`.","created_at":"2018-10-03T14:43:50Z","updated_at":"2018-10-03T14:44:44Z","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1897#discussion_r222339151","pull_request_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments/222339151"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1897#discussion_r222339151"},"pull_request":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897"}}},"pull_request":{"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897","id":216105575,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE2MTA1NTc1","html_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1897","diff_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1897.diff","patch_url":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1897.patch","issue_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1897","number":1897,"state":"open","locked":false,"title":"Validator: FPRoundingMode decoration (#1482)","user":{"login":"jaebaek","id":1430374,"node_id":"MDQ6VXNlcjE0MzAzNzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1430374?v=4","gravatar_id":"","url":"https://api.github.com/users/jaebaek","html_url":"https://github.com/jaebaek","followers_url":"https://api.github.com/users/jaebaek/followers","following_url":"https://api.github.com/users/jaebaek/following{/other_user}","gists_url":"https://api.github.com/users/jaebaek/gists{/gist_id}","starred_url":"https://api.github.com/users/jaebaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaebaek/subscriptions","organizations_url":"https://api.github.com/users/jaebaek/orgs","repos_url":"https://api.github.com/users/jaebaek/repos","events_url":"https://api.github.com/users/jaebaek/events{/privacy}","received_events_url":"https://api.github.com/users/jaebaek/received_events","type":"User","site_admin":false},"body":"The following statement from SPIR-V spec is not checked by Validator:\r\nThe FPRoundingMode decoration can be applied only to a width-only conversion instruction that is used as the Object operand of an OpStore storing through a pointer to a 16-bit floating-point object in the StorageBuffer, Uniform, PushConstant, Input, or Output Storage Classes.","created_at":"2018-09-17T20:30:59Z","updated_at":"2018-10-03T14:44:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71424cfca4a17bbc6dd14e33fd5d65c119ebb7f6","assignee":null,"assignees":[],"requested_reviewers":[{"login":"dneto0","id":13054574,"node_id":"MDQ6VXNlcjEzMDU0NTc0","avatar_url":"https://avatars0.githubusercontent.com/u/13054574?v=4","gravatar_id":"","url":"https://api.github.com/users/dneto0","html_url":"https://github.com/dneto0","followers_url":"https://api.github.com/users/dneto0/followers","following_url":"https://api.github.com/users/dneto0/following{/other_user}","gists_url":"https://api.github.com/users/dneto0/gists{/gist_id}","starred_url":"https://api.github.com/users/dneto0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dneto0/subscriptions","organizations_url":"https://api.github.com/users/dneto0/orgs","repos_url":"https://api.github.com/users/dneto0/repos","events_url":"https://api.github.com/users/dneto0/events{/privacy}","received_events_url":"https://api.github.com/users/dneto0/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897/commits","review_comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897/comments","review_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1897/comments","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/1e36d9e9552b21052ec8c81c4aab21d34a40d479","head":{"label":"jaebaek:FPRoundingMode","ref":"FPRoundingMode","sha":"1e36d9e9552b21052ec8c81c4aab21d34a40d479","user":{"login":"jaebaek","id":1430374,"node_id":"MDQ6VXNlcjE0MzAzNzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1430374?v=4","gravatar_id":"","url":"https://api.github.com/users/jaebaek","html_url":"https://github.com/jaebaek","followers_url":"https://api.github.com/users/jaebaek/followers","following_url":"https://api.github.com/users/jaebaek/following{/other_user}","gists_url":"https://api.github.com/users/jaebaek/gists{/gist_id}","starred_url":"https://api.github.com/users/jaebaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaebaek/subscriptions","organizations_url":"https://api.github.com/users/jaebaek/orgs","repos_url":"https://api.github.com/users/jaebaek/repos","events_url":"https://api.github.com/users/jaebaek/events{/privacy}","received_events_url":"https://api.github.com/users/jaebaek/received_events","type":"User","site_admin":false},"repo":{"id":124247741,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQyNDc3NDE=","name":"SPIRV-Tools","full_name":"jaebaek/SPIRV-Tools","private":false,"owner":{"login":"jaebaek","id":1430374,"node_id":"MDQ6VXNlcjE0MzAzNzQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1430374?v=4","gravatar_id":"","url":"https://api.github.com/users/jaebaek","html_url":"https://github.com/jaebaek","followers_url":"https://api.github.com/users/jaebaek/followers","following_url":"https://api.github.com/users/jaebaek/following{/other_user}","gists_url":"https://api.github.com/users/jaebaek/gists{/gist_id}","starred_url":"https://api.github.com/users/jaebaek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaebaek/subscriptions","organizations_url":"https://api.github.com/users/jaebaek/orgs","repos_url":"https://api.github.com/users/jaebaek/repos","events_url":"https://api.github.com/users/jaebaek/events{/privacy}","received_events_url":"https://api.github.com/users/jaebaek/received_events","type":"User","site_admin":false},"html_url":"https://github.com/jaebaek/SPIRV-Tools","description":null,"fork":true,"url":"https://api.github.com/repos/jaebaek/SPIRV-Tools","forks_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/releases{/id}","deployments_url":"https://api.github.com/repos/jaebaek/SPIRV-Tools/deployments","created_at":"2018-03-07T14:27:53Z","updated_at":"2018-10-03T14:24:49Z","pushed_at":"2018-10-03T14:44:27Z","git_url":"git://github.com/jaebaek/SPIRV-Tools.git","ssh_url":"git@github.com:jaebaek/SPIRV-Tools.git","clone_url":"https://github.com/jaebaek/SPIRV-Tools.git","svn_url":"https://github.com/jaebaek/SPIRV-Tools","homepage":null,"size":9192,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"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":"KhronosGroup:master","ref":"master","sha":"a8697b0612cdc8c607ca21683a0e9916f4bd2f52","user":{"login":"KhronosGroup","id":1608701,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDg3MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/1608701?v=4","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"repo":{"id":45981801,"node_id":"MDEwOlJlcG9zaXRvcnk0NTk4MTgwMQ==","name":"SPIRV-Tools","full_name":"KhronosGroup/SPIRV-Tools","private":false,"owner":{"login":"KhronosGroup","id":1608701,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2MDg3MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/1608701?v=4","gravatar_id":"","url":"https://api.github.com/users/KhronosGroup","html_url":"https://github.com/KhronosGroup","followers_url":"https://api.github.com/users/KhronosGroup/followers","following_url":"https://api.github.com/users/KhronosGroup/following{/other_user}","gists_url":"https://api.github.com/users/KhronosGroup/gists{/gist_id}","starred_url":"https://api.github.com/users/KhronosGroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KhronosGroup/subscriptions","organizations_url":"https://api.github.com/users/KhronosGroup/orgs","repos_url":"https://api.github.com/users/KhronosGroup/repos","events_url":"https://api.github.com/users/KhronosGroup/events{/privacy}","received_events_url":"https://api.github.com/users/KhronosGroup/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/KhronosGroup/SPIRV-Tools","description":null,"fork":false,"url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools","forks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/forks","keys_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/teams","hooks_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/hooks","issue_events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/events{/number}","events_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/events","assignees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/assignees{/user}","branches_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/branches{/branch}","tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/tags","blobs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/{sha}","languages_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/languages","stargazers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/stargazers","contributors_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contributors","subscribers_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscribers","subscription_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/subscription","commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/contents/{+path}","compare_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/merges","archive_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/downloads","issues_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues{/number}","pulls_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls{/number}","milestones_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/milestones{/number}","notifications_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/labels{/name}","releases_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/releases{/id}","deployments_url":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/deployments","created_at":"2015-11-11T12:56:25Z","updated_at":"2018-10-03T14:11:35Z","pushed_at":"2018-10-03T14:44:29Z","git_url":"git://github.com/KhronosGroup/SPIRV-Tools.git","ssh_url":"git@github.com:KhronosGroup/SPIRV-Tools.git","clone_url":"https://github.com/KhronosGroup/SPIRV-Tools.git","svn_url":"https://github.com/KhronosGroup/SPIRV-Tools","homepage":null,"size":9269,"stargazers_count":316,"watchers_count":316,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":127,"mirror_url":null,"archived":false,"open_issues_count":209,"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":127,"open_issues":209,"watchers":316,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897"},"html":{"href":"https://github.com/KhronosGroup/SPIRV-Tools/pull/1897"},"issue":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1897"},"comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/issues/1897/comments"},"review_comments":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897/comments"},"review_comment":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/pulls/1897/commits"},"statuses":{"href":"https://api.github.com/repos/KhronosGroup/SPIRV-Tools/statuses/1e36d9e9552b21052ec8c81c4aab21d34a40d479"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"alan-baker"}}