Add label info for storage binding aliasing error msg

Bug: dawn:1642, dawn:840
Change-Id: Ice1661539b40d605a93e805acf7609fd3315606d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122460
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Loko Kung <lokokung@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Shrek Shao <shrekshao@google.com>
This commit is contained in:
shrekshao 2023-03-03 01:19:26 +00:00 committed by Dawn LUCI CQ
parent 861dfd89e8
commit ffe4c6fbaa

View File

@ -598,33 +598,35 @@ MaybeError CommandBufferStateTracker::CheckMissingAspects(ValidationAspects aspe
if (std::holds_alternative<BufferAliasing>(result)) { if (std::holds_alternative<BufferAliasing>(result)) {
const auto& a = std::get<BufferAliasing>(result); const auto& a = std::get<BufferAliasing>(result);
return DAWN_VALIDATION_ERROR( return DAWN_VALIDATION_ERROR(
"Writable storage buffer binding aliasing found between bind group index %u, " "Writable storage buffer binding aliasing found between %s set at bind group index "
"binding index " "%u, binding index %u, and %s set at bind group index %u, binding index %u, with "
"%u, and bind group index %u, binding index %u, with overlapping ranges " "overlapping ranges (offset: %u, size: %u) and (offset: %u, size: %u) in %s.",
"(offset: " mBindgroups[a.e0.bindGroupIndex], static_cast<uint32_t>(a.e0.bindGroupIndex),
"%u, size: %u) and (offset: %u, size: %u).", static_cast<uint32_t>(a.e0.bindingIndex), mBindgroups[a.e1.bindGroupIndex],
static_cast<uint32_t>(a.e0.bindGroupIndex),
static_cast<uint32_t>(a.e0.bindingIndex),
static_cast<uint32_t>(a.e1.bindGroupIndex), static_cast<uint32_t>(a.e1.bindGroupIndex),
static_cast<uint32_t>(a.e1.bindingIndex), a.e0.offset, a.e0.size, a.e1.offset, static_cast<uint32_t>(a.e1.bindingIndex), a.e0.offset, a.e0.size, a.e1.offset,
a.e1.size); a.e1.size,
mBindgroups[a.e0.bindGroupIndex]
->GetBindingAsBufferBinding(a.e0.bindingIndex)
.buffer);
} else { } else {
ASSERT(std::holds_alternative<TextureAliasing>(result)); ASSERT(std::holds_alternative<TextureAliasing>(result));
const auto& a = std::get<TextureAliasing>(result); const auto& a = std::get<TextureAliasing>(result);
return DAWN_VALIDATION_ERROR( return DAWN_VALIDATION_ERROR(
"Writable storage texture binding aliasing found between bind group " "Writable storage texture binding aliasing found between %s set at bind group "
"index %u, binding index " "index %u, binding index %u, and %s set at bind group index %u, binding index %u, "
"%u, and bind group index %u, binding index %u, with subresources " "with subresources (base mipmap level: %u, mip level count: %u, base array layer: "
"(base mipmap level: " "%u, array layer count: %u) and (base mipmap level: %u, mip level count: %u, base "
"%u, mip level count: %u, base array layer: %u, array layer count: %u) and " "array layer: %u, array layer count: %u) in %s.",
"(base mipmap level: %u, mip level count: " mBindgroups[a.e0.bindGroupIndex], static_cast<uint32_t>(a.e0.bindGroupIndex),
"%u, base array layer: %u, array layer count: %u).", static_cast<uint32_t>(a.e0.bindingIndex), mBindgroups[a.e1.bindGroupIndex],
static_cast<uint32_t>(a.e0.bindGroupIndex),
static_cast<uint32_t>(a.e0.bindingIndex),
static_cast<uint32_t>(a.e1.bindGroupIndex), static_cast<uint32_t>(a.e1.bindGroupIndex),
static_cast<uint32_t>(a.e1.bindingIndex), a.e0.baseMipLevel, a.e0.mipLevelCount, static_cast<uint32_t>(a.e1.bindingIndex), a.e0.baseMipLevel, a.e0.mipLevelCount,
a.e0.baseArrayLayer, a.e0.arrayLayerCount, a.e1.baseMipLevel, a.e1.mipLevelCount, a.e0.baseArrayLayer, a.e0.arrayLayerCount, a.e1.baseMipLevel, a.e1.mipLevelCount,
a.e1.baseArrayLayer, a.e1.arrayLayerCount); a.e1.baseArrayLayer, a.e1.arrayLayerCount,
mBindgroups[a.e0.bindGroupIndex]
->GetBindingAsTextureView(a.e0.bindingIndex)
->GetTexture());
} }
// The chunk of code above should be similar to the one in |RecomputeLazyAspects|. // The chunk of code above should be similar to the one in |RecomputeLazyAspects|.