dawn_native: Use refcount-safe methods for reentrant object creation

Previously all uses of reentrant object creation in Dawn native
needed to manually AcquireRef. Change them to use CreateFooInternal that
returns a ResultOrError<Ref<>> and are renamed to CreateFoo.

Bug: dawn:723

Change-Id: Ifcda3659d02cc5a4c63c248dc53af7fee7c4a61d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/46626
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
This commit is contained in:
Corentin Wallez
2021-04-19 08:52:35 +00:00
committed by Commit Bot service account
parent b6c0dac110
commit 0af4a834a9
12 changed files with 174 additions and 154 deletions

View File

@@ -25,11 +25,11 @@ namespace {
wgpu::Buffer timestamps,
wgpu::Buffer availability,
wgpu::Buffer params) {
dawn_native::EncodeConvertTimestampsToNanoseconds(
ASSERT_TRUE(dawn_native::EncodeConvertTimestampsToNanoseconds(
reinterpret_cast<dawn_native::CommandEncoder*>(encoder.Get()),
reinterpret_cast<dawn_native::BufferBase*>(timestamps.Get()),
reinterpret_cast<dawn_native::BufferBase*>(availability.Get()),
reinterpret_cast<dawn_native::BufferBase*>(params.Get()));
reinterpret_cast<dawn_native::BufferBase*>(params.Get())).IsSuccess());
}
class InternalShaderExpectation : public detail::Expectation {