Fix bind group binding ID validation. (#227)
* Fix bind group binding ID validation. Use the binding, not the iterator index.
This commit is contained in:
parent
846cfe3421
commit
1184e46f87
|
@ -36,7 +36,8 @@ namespace backend {
|
||||||
DAWN_TRY(ValidateShaderStageBit(binding.visibility));
|
DAWN_TRY(ValidateShaderStageBit(binding.visibility));
|
||||||
DAWN_TRY(ValidateBindingType(binding.type));
|
DAWN_TRY(ValidateBindingType(binding.type));
|
||||||
|
|
||||||
DAWN_TRY_ASSERT(!bindingsSet[i], "some binding index was specified more than once");
|
DAWN_TRY_ASSERT(!bindingsSet[binding.binding],
|
||||||
|
"some binding index was specified more than once");
|
||||||
bindingsSet.set(binding.binding);
|
bindingsSet.set(binding.binding);
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
|
|
|
@ -122,3 +122,13 @@ TEST_F(BindGroupValidationTest, BindGroupLayoutCache) {
|
||||||
// Caching should cause these to be the same.
|
// Caching should cause these to be the same.
|
||||||
ASSERT_EQ(layout1.Get(), layout2.Get());
|
ASSERT_EQ(layout1.Get(), layout2.Get());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This test verifies that the BindGroupLayout bindings are correctly validated, even if the
|
||||||
|
// binding ids are out-of-order.
|
||||||
|
TEST_F(BindGroupValidationTest, BindGroupBinding) {
|
||||||
|
auto layout = utils::MakeBindGroupLayout(
|
||||||
|
device, {
|
||||||
|
{1, dawn::ShaderStageBit::Vertex, dawn::BindingType::UniformBuffer},
|
||||||
|
{0, dawn::ShaderStageBit::Vertex, dawn::BindingType::UniformBuffer},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue