From 81addb75cb5d3e7f49c3b3635cf6006066055ba5 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Wed, 12 May 2021 17:01:01 +0000 Subject: [PATCH] Pass mayCollide argument to Tint's BindingRemapper Added in https://dawn-review.googlesource.com/c/tint/+/50742 Bindings may not collide except on the D3D12 backend where we use the register offset as the binding number. Offsets may alias if they are for different HLSL register types (buffer, texture, etc.) Bug: tint:797 Change-Id: I020e3b5cd1d35fdf5678b587225507e0cf24f5b3 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/50801 Commit-Queue: Austin Eng Commit-Queue: Ben Clayton Auto-Submit: Austin Eng Reviewed-by: Ben Clayton --- src/dawn_native/d3d12/ShaderModuleD3D12.cpp | 5 ++++- src/dawn_native/vulkan/ShaderModuleVk.cpp | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp index 1392b2fd71..c554dacb5a 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp @@ -258,8 +258,11 @@ namespace dawn_native { namespace d3d12 { transformManager.Add(); transformManager.Add(); + // D3D12 registers like `t3` and `c3` have the same bindingOffset number in the + // remapping but should not be considered a collision because they have different types. + const bool mayCollide = true; transformInputs.Add(std::move(bindingPoints), - std::move(accessControls)); + std::move(accessControls), mayCollide); tint::Program program; tint::transform::DataMap transformOutputs; diff --git a/src/dawn_native/vulkan/ShaderModuleVk.cpp b/src/dawn_native/vulkan/ShaderModuleVk.cpp index 2f09efa12d..2e256da045 100644 --- a/src/dawn_native/vulkan/ShaderModuleVk.cpp +++ b/src/dawn_native/vulkan/ShaderModuleVk.cpp @@ -172,7 +172,8 @@ namespace dawn_native { namespace vulkan { tint::transform::DataMap transformInputs; transformInputs.Add(std::move(bindingPoints), - std::move(accessControls)); + std::move(accessControls), + /* mayCollide */ false); tint::Program program; DAWN_TRY_ASSIGN(program, RunTransforms(&transformManager, GetTintProgram(), transformInputs,