D3D11: Return error if devices don't support constant buffers' offsets.
This is required because WebGPU allows binding an uniform buffer to a
non-zero offset. If the D3D device doesn't natively support offsetting
a constant buffer, we don't have an alternative workaround yet. e.g.
passing offsets as driver uniforms.
Bug: 405322913
Change-Id: Id2931e31a0ffaa3a0a17bc5b1a73d6743be5f221
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/232294
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Loko Kung <lokokung@google.com>
diff --git a/src/dawn/native/d3d11/DeviceInfoD3D11.cpp b/src/dawn/native/d3d11/DeviceInfoD3D11.cpp
index 97a943e..59511d7 100644
--- a/src/dawn/native/d3d11/DeviceInfoD3D11.cpp
+++ b/src/dawn/native/d3d11/DeviceInfoD3D11.cpp
@@ -47,6 +47,10 @@
info.supportsPartialConstantBufferUpdate = options.ConstantBufferPartialUpdate;
+ // TODO(405401229): Return error if the device doesn't support binding constant buffers with
+ // non-zero offsets.
+ DAWN_INVALID_IF(!options.ConstantBufferOffsetting, "ConstantBufferOffsetting is not supported");
+
D3D11_FEATURE_DATA_D3D11_OPTIONS2 options2;
DAWN_TRY(CheckHRESULT(
device->CheckFeatureSupport(D3D11_FEATURE_D3D11_OPTIONS2, &options2, sizeof(options2)),