dawn-cmake/docs/dawn
Le Hoang Quyen 8cc6205bf7 Disable frontend cache when implicit device sync is on.
Normal behavior of ApiObjectBase's APIRelease() which only locks the
device when last ref dropped is not thread safe if the object is cached
as raw pointers by the device. Example of cached objects: bind group
layout, pipeline, sampler, shader module.

The following scenario could happen:
 - thread A:
    - shaderModuleA.APIRealease()
    - shaderModuleA.refCount.Decrement() == true (ref count has reached zero)
    - going to call shaderModuleA.LockAndDeleteThis().
 - thread B:
    - device.CreateShaderModule().
    - lock()
    - device.GetOrCreateShaderModule()
    - shaderModuleA is in the cache, so return it.
    - unlock()
 - thread A:
    - starting to call shaderModuleA.LockAndDeleteThis()
    - lock()
    - erase shaderModuleA from the cache.
    - delete shaderModuleA.
    - unlock()

This CL disables caching when ImplicitDeviceSynchronization is turned on
until we find a better solution.

Bug: dawn:1769
Change-Id: Ideb2a717ece0a40e18bd1c2bef00817262bd25da
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/127900
Commit-Queue: Quyen Le <lehoangquyen@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
2023-04-20 21:12:25 +00:00
..
features Disable frontend cache when implicit device sync is on. 2023-04-20 21:12:25 +00:00
buffer_mapping.md Shuffle 'docs' directories 2022-01-27 18:33:47 +00:00
codegen.md Add an option to enable implicit device synchronization. 2023-04-05 19:35:07 +00:00
debug_markers.md Shuffle 'docs' directories 2022-01-27 18:33:47 +00:00
debugging.md Shuffle 'docs' directories 2022-01-27 18:33:47 +00:00
device_facilities.md Dawn: Refactor device toggles 2023-02-10 01:43:55 +00:00
errors.md Shuffle 'docs' directories 2022-01-27 18:33:47 +00:00
external_resources.md Shuffle 'docs' directories 2022-01-27 18:33:47 +00:00
fuzzing.md Fix inclusive language presubmit 2022-04-19 22:25:45 +00:00
infra.md Update Starlark config to use 'main' branch 2022-04-25 16:39:44 +00:00
overview.md Nuke SPIRV-Cross. 2022-02-11 00:45:51 +00:00
testing.md Fix inclusive language presubmit 2022-04-19 22:25:45 +00:00