Add early-exit validation to MapAsync for already mapped buffers and …#42
Add early-exit validation to MapAsync for already mapped buffers and …#42rajv79 wants to merge 3 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
1f3e7cd to
f601680
Compare
|
👋 Thanks for your contribution! Your PR has been imported to Gerrit. |
|
Hi @nico @precision @dj2 , To help CI proceed, I temporarily disabled DAWN_ENABLE_INSTALL in the cache config file. It doesn’t affect the feature I added — just helps bypass the CMake export error. Please let me know if there’s a better way to handle this. Thanks so much! |
Summary of Commit
This PR adds an early-exit check in
BufferBase::APIMapAsync()to prevent callingMapAsync on a buffer that is already mapped (either via
MapAsyncormappedAtCreation).It improves developer feedback and avoids redundant validation, while returning
a null future and triggering the error callback early.
Key Changes
ValidateMapAsync()dawn::EmitWarningFutureon invalid useWGPUMapAsyncStatus_ErrorTest Coverage
Added
MapAsyncFailsWhenAlreadyMappedinBufferValidationTeststo verify behavior.CI Note (Temporary Workaround)
This PR includes a temporary local patch to work around a known Protobuf build issue on macOS
It can be removed once the CI or Protobuf dependency is updated.