mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-19 09:55:26 +00:00
Metal: Handle failure to allocate an MTLCommandBuffer
This requires restructuring the logic around MTLCommandBuffer allocation so that GetPendingCommandContext is guaranteed to never fail. Logic in the Metal backend is now similar to the Vulkan backend: the MTLCommandBuffer is prepared at device initialization time, or after a submission, such that it is always valid. A new mUsed boolean is added to CommandRecordingContext to say whether any commands have been recording. Previously mCommandBuffer was used for that purpose, but it is now always non-null. Bug: dawn:801 Change-Id: I5dc6747d1e6d538054010cc50533a03a49af921a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/58720 Auto-Submit: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Stephen White <senorblanco@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
f50c22b998
commit
18f63b4e16
@@ -15,10 +15,7 @@
|
||||
#ifndef COMMON_NONCOPYABLE_H_
|
||||
#define COMMON_NONCOPYABLE_H_
|
||||
|
||||
// NonCopyable:
|
||||
// the base class for the classes that are not copyable.
|
||||
//
|
||||
|
||||
// A base class to make a class non-copyable.
|
||||
class NonCopyable {
|
||||
protected:
|
||||
constexpr NonCopyable() = default;
|
||||
@@ -29,4 +26,15 @@ class NonCopyable {
|
||||
void operator=(const NonCopyable&) = delete;
|
||||
};
|
||||
|
||||
// A base class to make a class non-movable.
|
||||
class NonMovable : NonCopyable {
|
||||
protected:
|
||||
constexpr NonMovable() = default;
|
||||
~NonMovable() = default;
|
||||
|
||||
private:
|
||||
NonMovable(NonMovable&&) = delete;
|
||||
void operator=(NonMovable&&) = delete;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user