d3d11: fix indirect indexed draw

Bug: dawn:1791
Change-Id: If2fe2df3fdd5d719070e07afd1d7c7b68b42e1ee
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/131801
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:
Peng Huang 2023-05-06 01:14:18 +00:00 committed by Dawn LUCI CQ
parent 2ab0ee01f9
commit 3ee4f6af41
2 changed files with 4 additions and 8 deletions

View File

@ -171,13 +171,12 @@ MaybeError BindGroupTracker::ApplyBindGroup(BindGroupIndex index) {
case kInternalStorageBufferBinding: {
ASSERT(IsSubset(bindingInfo.visibility, wgpu::ShaderStage::Compute));
ComPtr<ID3D11UnorderedAccessView> d3d11UAV;
DAWN_TRY_ASSIGN(d3d11UAV, ToBackend(binding.buffer)
->CreateD3D11UnorderedAccessView1(
0, binding.buffer->GetSize()));
UINT firstElement = offset / 4;
DAWN_TRY_ASSIGN(
d3d11UAV, ToBackend(binding.buffer)
->CreateD3D11UnorderedAccessView1(offset, binding.size));
if (bindingInfo.visibility & wgpu::ShaderStage::Compute) {
deviceContext1->CSSetUnorderedAccessViews(
bindingSlot, 1, d3d11UAV.GetAddressOf(), &firstElement);
bindingSlot, 1, d3d11UAV.GetAddressOf(), nullptr);
}
break;
}

View File

@ -303,9 +303,6 @@ TEST_P(DrawIndexedIndirectTest, ValidateMultipleDraws) {
// TODO(dawn:1549) Fails on Qualcomm-based Android devices.
DAWN_SUPPRESS_TEST_IF(IsAndroid() && IsQualcomm());
// TODO(dawn:1791): Test fails with D3D11.
DAWN_SUPPRESS_TEST_IF(IsD3D11());
// It doesn't make sense to test invalid inputs when validation is disabled.
DAWN_SUPPRESS_TEST_IF(HasToggleEnabled("skip_validation"));