)]}'
{
  "commit": "eab1f626295c64225e95862b35e2a359559bbdc7",
  "tree": "04a6568d5a387a6de5fc4a0df7a5547c5cfb1fe3",
  "parents": [
    "98bd83a8fca4b358885ea77a17faa2c4a8a7a768"
  ],
  "author": {
    "name": "Antonio Maiorano",
    "email": "amaiorano@google.com",
    "time": "Wed Feb 01 15:46:34 2023 +0000"
  },
  "committer": {
    "name": "Dawn LUCI CQ",
    "email": "dawn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Feb 01 15:46:34 2023 +0000"
  },
  "message": "tint/hlsl: for default-only switch, only emit condition if it has side-effects\n\nThis fixes edge-cases, like the condition expression being a type-cast,\nwhich DXC apparently sees as a variable re-declaration. Example:\n\nfn foo(x : f32) {\n  switch (i32(x)) {\n    default {\n    }\n  }\n}\n\nwas emitted as HLSL:\n\nvoid foo(float x) {\n  int(x);\n  do {\n  } while (false);\n}\n\nThe `int(x)` is seen as a re-declaration of `x` by DXC.\n\nWe fix this by only emitted the condition expression if it has\nside-effects (which currently means it contains a call expression).\n\nBug: tint:1820\nChange-Id: I7e4320fa09ea2d634c9e324cb0b752b0ee7dcde9\nReviewed-on: https://dawn-review.googlesource.com/c/dawn/+/118161\nKokoro: Kokoro \u003cnoreply+kokoro@google.com\u003e\nReviewed-by: James Price \u003cjrprice@google.com\u003e\nReviewed-by: Ben Clayton \u003cbclayton@google.com\u003e\nCommit-Queue: Antonio Maiorano \u003camaiorano@google.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bde9d703f33e2887d4da8403ac0295499812e8a4",
      "old_mode": 33188,
      "old_path": "src/tint/writer/hlsl/generator_impl.cc",
      "new_id": "d49bcc92e6196615d494bd90695cf622f5b3b7e6",
      "new_mode": 33188,
      "new_path": "src/tint/writer/hlsl/generator_impl.cc"
    },
    {
      "type": "modify",
      "old_id": "698083a03e3349306b4d53a1b2e0a5d2a93ab9d8",
      "old_mode": 33188,
      "old_path": "src/tint/writer/hlsl/generator_impl_switch_test.cc",
      "new_id": "6426b7c343c5c6fed4a27cd59ba48205a6e805c2",
      "new_mode": 33188,
      "new_path": "src/tint/writer/hlsl/generator_impl_switch_test.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "781a980e031b177c9dab106bc273c4fc0a431107",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5e7dc3966c3b5a727764a0196c017fd970b5d397",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl.expected.dxc.hlsl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5e7dc3966c3b5a727764a0196c017fd970b5d397",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl.expected.fxc.hlsl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "9fa7dd083a4d9b3f5238785e87ae4e1022b0eecd",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl.expected.glsl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e811b1bcf590335f036915e2032ee8679c1b4834",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl.expected.msl"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1a4bc100080af7220d6012d08d133e67ddf18bbb",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl.expected.spvasm"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5fa9cd94872f4659f420b117c2d3a8ceed0aef75",
      "new_mode": 33188,
      "new_path": "test/tint/bug/tint/1820.wgsl.expected.wgsl"
    },
    {
      "type": "modify",
      "old_id": "128b8a2393e4fdcbc0782b7ad2f28a1437606bf8",
      "old_mode": 33188,
      "old_path": "test/tint/statements/switch/only_default_case.wgsl.expected.dxc.hlsl",
      "new_id": "ded0d6647dbd18614c36e40237e00c1d13c04779",
      "new_mode": 33188,
      "new_path": "test/tint/statements/switch/only_default_case.wgsl.expected.dxc.hlsl"
    },
    {
      "type": "modify",
      "old_id": "128b8a2393e4fdcbc0782b7ad2f28a1437606bf8",
      "old_mode": 33188,
      "old_path": "test/tint/statements/switch/only_default_case.wgsl.expected.fxc.hlsl",
      "new_id": "ded0d6647dbd18614c36e40237e00c1d13c04779",
      "new_mode": 33188,
      "new_path": "test/tint/statements/switch/only_default_case.wgsl.expected.fxc.hlsl"
    }
  ]
}
