From 6249e381896aa843ee88d0008e50c1e84d961e6b Mon Sep 17 00:00:00 2001 From: dan sinclair Date: Mon, 6 Jul 2020 19:50:42 +0000 Subject: [PATCH] Use Tint Generator Number. This Cl updates the code to use the new Tint generator ID. Bug: tint:5 https://chromium.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git/+log/11d7637e7a43..308bd0742435 $ git log 11d7637e7..308bd0742 --date=short --no-merges --format='%ad %ae %s' 2020-06-26 dj2 Register the Tint compiler Created with: roll-dep build buildtools testing third_party/binutils third_party/googletest third_party/spirv-headers third_party/spirv-tools tools/clang Change-Id: I703d7bf7ad81bc6190e45a5271a30bc7110f4cb7 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/24401 Reviewed-by: David Neto --- DEPS | 2 +- src/writer/spirv/binary_writer.cc | 4 +--- src/writer/spirv/binary_writer_test.cc | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/DEPS b/DEPS index 0b5bcbba8a..f2a4d2a8ea 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { 'clang_revision': 'b49c12a8f3fb25181855d0ea641bbcc2b2e95213', 'cpplint_revision': '305ac8725a166ed42e3f5dd3f80d6de2cf840ef1', 'googletest_revision': '356f2d264a485db2fcc50ec1c672e0d37b6cb39b', - 'spirv_headers_revision': '11d7637e7a43cd88cfd4e42c99581dcb682936aa', + 'spirv_headers_revision': '308bd07424350a6000f35a77b5f85cd4f3da319e', 'spirv_tools_revision': 'bd2a9ea85210d3bb474bc5adb9ff4b0bb536b4fc', 'testing_revision': 'a711b1132571869bdd7084c86083698671b290a6', } diff --git a/src/writer/spirv/binary_writer.cc b/src/writer/spirv/binary_writer.cc index 294bae8fe5..c414b084d7 100644 --- a/src/writer/spirv/binary_writer.cc +++ b/src/writer/spirv/binary_writer.cc @@ -21,9 +21,7 @@ namespace writer { namespace spirv { namespace { -// TODO(dsinclair): Reserve a generator ID for Tint. -// https://github.com/KhronosGroup/SPIRV-Headers/blob/master/include/spirv/spir-v.xml#L75 -const uint32_t kGeneratorId = 0; +const uint32_t kGeneratorId = 23u << 16; } // namespace diff --git a/src/writer/spirv/binary_writer_test.cc b/src/writer/spirv/binary_writer_test.cc index 63e6f04911..9589761d6a 100644 --- a/src/writer/spirv/binary_writer_test.cc +++ b/src/writer/spirv/binary_writer_test.cc @@ -37,7 +37,7 @@ TEST_F(BinaryWriterTest, Preamble) { ASSERT_EQ(res.size(), 5u); EXPECT_EQ(res[0], spv::MagicNumber); EXPECT_EQ(res[1], 0x00010300u); // SPIR-V 1.3 - EXPECT_EQ(res[2], 0u); // Generator ID + EXPECT_EQ(res[2], 23u << 16); // Generator ID EXPECT_EQ(res[3], 5u); // ID Bound EXPECT_EQ(res[4], 0u); // Reserved }