d3d11: fix and enable ExternalTextureTests
Bug: dawn:1705 Change-Id: I29fbb5bebbc217a4f95a51e24ec295d6e3cd6e8e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/132740 Kokoro: Kokoro <noreply+kokoro@google.com> Commit-Queue: Peng Huang <penghuang@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
c29e10c442
commit
64df2e6235
|
@ -125,6 +125,27 @@ ResultOrError<d3d::CompiledShader> ShaderModule::Compile(
|
|||
bindingRemapper.binding_points.emplace(srcBindingPoint, dstBindingPoint);
|
||||
}
|
||||
}
|
||||
|
||||
// Tint will add two bindings (plane1, params) for one external texture binding.
|
||||
// We need to remap the binding points for the two bindings.
|
||||
// we cannot specified the final slot of those two bindings in
|
||||
// req.hlsl.externalTextureOptions because the final slots may be conflict with
|
||||
// existing other bindings, and then they will be remapped again with bindingRemapper
|
||||
// incorrectly. So we have to use intermediate binding slots in
|
||||
// req.hlsl.externalTextureOptions, and then map them to the final slots with
|
||||
// bindingRemapper.
|
||||
for (const auto& [_, expansion] : groupLayout->GetExternalTextureBindingExpansionMap()) {
|
||||
uint32_t plane1Slot = indices[groupLayout->GetBindingIndex(expansion.plane1)];
|
||||
uint32_t paramsSlot = indices[groupLayout->GetBindingIndex(expansion.params)];
|
||||
bindingRemapper.binding_points.emplace(
|
||||
tint::writer::BindingPoint{static_cast<uint32_t>(group),
|
||||
static_cast<uint32_t>(expansion.plane1)},
|
||||
tint::writer::BindingPoint{0u, plane1Slot});
|
||||
bindingRemapper.binding_points.emplace(
|
||||
tint::writer::BindingPoint{static_cast<uint32_t>(group),
|
||||
static_cast<uint32_t>(expansion.params)},
|
||||
tint::writer::BindingPoint{0u, paramsSlot});
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<tint::ast::transform::SubstituteOverride::Config> substituteOverrideConfig;
|
||||
|
|
|
@ -996,6 +996,7 @@ TEST_P(ExternalTextureTests, CropMultiplanar) {
|
|||
}
|
||||
|
||||
DAWN_INSTANTIATE_TEST(ExternalTextureTests,
|
||||
D3D11Backend(),
|
||||
D3D12Backend(),
|
||||
MetalBackend(),
|
||||
OpenGLBackend(),
|
||||
|
|
Loading…
Reference in New Issue