)]}'
{
  "commit": "3c20b6127e96f26e3019e6c7d2a1138f651d4af1",
  "tree": "488771f3f6a060a6761d2adcdcda63aacea8ff59",
  "parents": [
    "8e0def799cd5743e818502ea509be0277c895e23"
  ],
  "author": {
    "name": "Corentin Wallez",
    "email": "cwallez@chromium.org",
    "time": "Wed Oct 01 07:14:48 2025 -0700"
  },
  "committer": {
    "name": "Dawn LUCI CQ",
    "email": "dawn-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Wed Oct 01 07:14:48 2025 -0700"
  },
  "message": "[dawn][native] Store ExternalTexture in BGL BindingInfo\n\nStore both internal bindings and external bindings in the BGL. This is\nthe new comment at the top of the class that explains the newly added\nAPIBindingIndex as well.\n\n\u003ccopypaste\u003e\nBindGroupLayout stores the information passed in the BindGroupLayoutDescriptor\nbut processes it in various ways to make it more efficient to use internally\nand to add internal bindings used to implement WebGPU feature that don\u0027t exist\nin backend APIs.\n\nStoring information in hashmap\u003cBindingNumber, T\u003e would be inefficient because\nthese numbers may be sparse. Instead the are compacted into vectors, and\nreordered using |BindingTypeOrder| to make it efficient to iterate over all the\nbindings of a same kind. Indexind the packed bindings is done with\n|BindingIndex| or |APIBindingIndex| (see below for the explanation).\n\nIn other cases bindings need to be expanded because a single BGLEntry can\nmatch multiple BGEntries when bindingArraySize \u003e 1. To make handling more\nregular, a fake BGLEntry is created for each array element such that most code\ndoesn\u0027t need to be aware of bindingArraySize.\n\nWe also need to have private bindings that cannot be set by the users: dynamic\nbinding array or ExternalTextures add additional bindings for their inner\nworkings which are private to Dawn. Conversely ExternalTexture is a pure\nfrontend object and doesn\u0027t exist in backends, so dawn::native must mostly be\nunaware about it. This is where |BindingIndex| and |APIBindingIndex| are\ndifferent:\n\n - |APIBindingIndex| are user-facing bindings and cannot be used to access\n private bindings. It is used in code for BindGroup validation and opertations\n and when reflecting/validating WGSL bind points.\n - |BindingIndex| are Dawn-facing bindings where ExternalTexture shouldn\u0027t be\n accessed and instead can be used to access internal bindings.\n\nInternally both |APIBindingIndex| and |BindingIndex| are used to access the\nsame vector, but the types are used to force uses of different BindGroupLayout\naccessors that ASSERT the invariant above.\n\u003c/copypaste\u003e\n\nShaderModule in every backend is modified to iterate over the BGL\u0027s\nBindingInfo using the BindingMap. Previously they iterated over the list\nof bindings in the EntryPointMetadata. Iterating over the BGL\u0027s entries\nallow using the new ExternalTextureBindingInfo that points at the\nBindingIndex of its plane0/1/metadata, but requires converting from\nAPIBindingIndex to BindingIndex. (in future CLs the GenerateBindings can\nbe factored between all the backends)\n\nThe OpenGL ShaderModule is modified further to use a BindingIndex\ninstead of a BindingNumber in the CombinedSamplerPair.\n\nA few additional cleanups will be done in follow-up CLs:\n - The external texture expansion map will be removed.\n - BGL::GetBindingIndex(BindingNumber) will be removed.\n\nBug: 42240282\nChange-Id: I745d6dcaa1368be2656e09525e77edd0a34709bb\nReviewed-on: https://dawn-review.googlesource.com/c/dawn/+/262196\nCommit-Queue: Geoff Lang \u003cgeofflang@chromium.org\u003e\nReviewed-by: Geoff Lang \u003cgeofflang@chromium.org\u003e\nAuto-Submit: Corentin Wallez \u003ccwallez@chromium.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "92de7455796bebcc33bd1c3efc09d84cad408bd6",
      "old_mode": 33188,
      "old_path": "src/dawn/native/BindGroup.cpp",
      "new_id": "b51713c08ef3487e5f67de1fb6b148b6d6e428e1",
      "new_mode": 33188,
      "new_path": "src/dawn/native/BindGroup.cpp"
    },
    {
      "type": "modify",
      "old_id": "8ad772a714590d8bc636631bbbab4c85d156ce37",
      "old_mode": 33188,
      "old_path": "src/dawn/native/BindGroupLayoutInternal.cpp",
      "new_id": "e387b6058e3680bf1a2a80d6bef4e6422c3989a2",
      "new_mode": 33188,
      "new_path": "src/dawn/native/BindGroupLayoutInternal.cpp"
    },
    {
      "type": "modify",
      "old_id": "496b6dfcb7f4a7d807c21c6832ce2afcd5feacf5",
      "old_mode": 33188,
      "old_path": "src/dawn/native/BindGroupLayoutInternal.h",
      "new_id": "be34e25ac3b09ac5ba710cc00869b8dc33dda7d1",
      "new_mode": 33188,
      "new_path": "src/dawn/native/BindGroupLayoutInternal.h"
    },
    {
      "type": "modify",
      "old_id": "957bb7833aeeae4e6568209af86c349e8f937649",
      "old_mode": 33188,
      "old_path": "src/dawn/native/BindingInfo.h",
      "new_id": "9c74bb399ca5fa4b9c07ee46ef5e1e81d1120d8f",
      "new_mode": 33188,
      "new_path": "src/dawn/native/BindingInfo.h"
    },
    {
      "type": "modify",
      "old_id": "df8a6c5d9470ed88eb2dfc211db47f64eb6eb1f4",
      "old_mode": 33188,
      "old_path": "src/dawn/native/IntegerTypes.h",
      "new_id": "6a03c2a3dddf669359a7b0c26c60616f5242e95c",
      "new_mode": 33188,
      "new_path": "src/dawn/native/IntegerTypes.h"
    },
    {
      "type": "modify",
      "old_id": "0504202e6c6316927eb00954643178a458347fad",
      "old_mode": 33188,
      "old_path": "src/dawn/native/ShaderModule.cpp",
      "new_id": "7a03c740f5566177c782b601ad9895788da21a37",
      "new_mode": 33188,
      "new_path": "src/dawn/native/ShaderModule.cpp"
    },
    {
      "type": "modify",
      "old_id": "0caf74dce2997906767f43eecd423595821dfe11",
      "old_mode": 33188,
      "old_path": "src/dawn/native/d3d11/ShaderModuleD3D11.cpp",
      "new_id": "3fee12a845396c028000b3b34056d82dec8f78ec",
      "new_mode": 33188,
      "new_path": "src/dawn/native/d3d11/ShaderModuleD3D11.cpp"
    },
    {
      "type": "modify",
      "old_id": "43f0c0514594a80ca0911cc4fbaf12e56ad3be38",
      "old_mode": 33188,
      "old_path": "src/dawn/native/d3d12/ShaderModuleD3D12.cpp",
      "new_id": "8999ab408e94e8c7657df8d23a215bcbf5286e14",
      "new_mode": 33188,
      "new_path": "src/dawn/native/d3d12/ShaderModuleD3D12.cpp"
    },
    {
      "type": "modify",
      "old_id": "92463a8acb78d20b647379190ce4ff793fa99a77",
      "old_mode": 33188,
      "old_path": "src/dawn/native/metal/CommandBufferMTL.mm",
      "new_id": "485eac56026a3cb751cf5f4fd3150ed95cdc60f7",
      "new_mode": 33188,
      "new_path": "src/dawn/native/metal/CommandBufferMTL.mm"
    },
    {
      "type": "modify",
      "old_id": "8a52061901309c4bb71697d525ea3ff2c666d929",
      "old_mode": 33188,
      "old_path": "src/dawn/native/metal/ShaderModuleMTL.mm",
      "new_id": "a1e4478d0199c6b16be548a74aaf781418580915",
      "new_mode": 33188,
      "new_path": "src/dawn/native/metal/ShaderModuleMTL.mm"
    },
    {
      "type": "modify",
      "old_id": "01e38680cbd0328c03cf8f224689c4d3a5dbf90a",
      "old_mode": 33188,
      "old_path": "src/dawn/native/opengl/PipelineGL.cpp",
      "new_id": "77faf7addfda4378dd57146ad4c7d76f5080de58",
      "new_mode": 33188,
      "new_path": "src/dawn/native/opengl/PipelineGL.cpp"
    },
    {
      "type": "modify",
      "old_id": "971f550fd2907b6a2b1e8b356ac47fa10e139db2",
      "old_mode": 33188,
      "old_path": "src/dawn/native/opengl/ShaderModuleGL.cpp",
      "new_id": "026b6bdaf3030393dbbe8912c1f3c0f56455a39e",
      "new_mode": 33188,
      "new_path": "src/dawn/native/opengl/ShaderModuleGL.cpp"
    },
    {
      "type": "modify",
      "old_id": "38281b41130dbe79b35ac9ba5e996609339d691f",
      "old_mode": 33188,
      "old_path": "src/dawn/native/opengl/ShaderModuleGL.h",
      "new_id": "53743eaf4ac699e5385dd63975431002c508a6eb",
      "new_mode": 33188,
      "new_path": "src/dawn/native/opengl/ShaderModuleGL.h"
    },
    {
      "type": "modify",
      "old_id": "e5977368f737a65e264d4e32f677a5256cda22c0",
      "old_mode": 33188,
      "old_path": "src/dawn/native/vulkan/ShaderModuleVk.cpp",
      "new_id": "32b7e47020b3893379186f05dd9677ff455eed69",
      "new_mode": 33188,
      "new_path": "src/dawn/native/vulkan/ShaderModuleVk.cpp"
    }
  ]
}
