)]}'
{
  "commit": "2a87c84c56a209bfa67f7076c9fd9a65f4344ee0",
  "tree": "84a03b2be5d5f84b20fda0c1621e608646c168f0",
  "parents": [
    "42e76ba82a23adc059f33de300e4872ffc95e6d4"
  ],
  "author": {
    "name": "Yunchao He",
    "email": "yunchao.he@intel.com",
    "time": "Sat Apr 02 00:18:00 2022 +0000"
  },
  "committer": {
    "name": "Dawn LUCI CQ",
    "email": "dawn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Sat Apr 02 00:18:00 2022 +0000"
  },
  "message": "Add end2end tests to expose buffer size error on D3D12\n\nWhen we do B2T or T2B copy from/to a buffer with paddings,\nD3D12 may wrongly calculate the required buffer size.\n\nFor example, if copySize \u003d {1, 1, 2}, offset \u003d 0, bytesPerRow \u003d\n256, and rowsPerImage \u003d 2 (there is 1-row padding for every image),\nand we are copying a non-compressed format like rgba8unorm,\nthe required minimum buffer size should be:\noffset + bytesPerRow * rowsPerImage * (copySize.depthOrArrayLayers - 1)\n+ bytesPerRow * (copySize.height - 1) + bytesPerBlock * copySize.width.\nIt is 0 + 256 * 2 * (2 - 1) + 256 * (1 - 1) + 4 * 1 \u003d 516.\n\nThe required minimum buffer on D3D12 (including WARP) size is:\noffset + bytesPerRow * rowsPerImage * (copySize.depthOrArrayLayers - 1)\n+ bytesPerRow * (rowsPerImage - 1) + bytesPerBlock * copySize.width.\nOr offset + bytesPerRow * rowsPerImage * copySize.depthOrArrayLayers\n+ bytesPerBlock * copySize.width - bytesPerRow.\nIt is 0 + 256 * 2 * (2 - 1) + 256 * (2 - 1) + 4 * 1 \u003d 772.\n\nIt looks like D3D12 requires unnecessary buffer storage for\nrowsPerImagePadding in the last image. It does respect\nbytesPerRowPadding in the last row and doesn\u0027t require storage for\nthat part, though.\n\nYou can verify the buffer size requirement on D3D12 backend with the\nnew tests via --enable-backend-validation. The validation layer\nsays that D3D12 requires 772 bytes but we only provide a 516-bytes\nbuffer, and leads to E_INVALIDARG (Error code 0x80070057) when run\nmD3d12CommandList-\u003eClose() in CommandRecordingContext::ExecuteCommandList\nand causes device lost.\n\nBug: dawn:1278, dawn:1288, dawn:1289\nChange-Id: Icfb792dec60ff7444cb20b3c283709cdb165f80a\nReviewed-on: https://dawn-review.googlesource.com/c/dawn/+/85341\nReviewed-by: Austin Eng \u003cenga@chromium.org\u003e\nCommit-Queue: Yunchao He \u003cyunchao.he@intel.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "0951b9ba6cc7355690cf7afc4256c095748670d0",
      "old_mode": 33188,
      "old_path": "src/dawn/tests/BUILD.gn",
      "new_id": "748ffac07bc472bb5384d9894cd8065a51f9aa43",
      "new_mode": 33188,
      "new_path": "src/dawn/tests/BUILD.gn"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "78856a8543abb017ce45fd3e53f269cd09195c6e",
      "new_mode": 33188,
      "new_path": "src/dawn/tests/end2end/RequiredBufferSizeInCopyTests.cpp"
    }
  ]
}
