Skip to content

Commit

Permalink
Remove is_always_lock_free assertion from AtomicQueueSerial
Browse files Browse the repository at this point in the history
Build will fail when compiled on 32 bit architecture. The code will
still function on 32 bit architecture but with performance penalty due
to lock. But we are not really expecting it actually run on 32 bit
platform with vulkan backend (the atomic queue serial is only used by
vulkan backend). We could move AtomicQueueSerial into vulkan backend,
but that will be a much larger change that I try to avoid. This CL
removes the static_assertion and make it 8 bytes aligned as well.

Bug: angleproject:7989
Change-Id: I3c0bd9877c4171485ca1aa9af0cf4621c1c23f56
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5407870
Reviewed-by: Shahbaz Youssefi <[email protected]>
Commit-Queue: Charlie Lao <[email protected]>
  • Loading branch information
cclao authored and Angle LUCI CQ committed Mar 29, 2024
1 parent 499c7c7 commit 321c6b6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libANGLE/renderer/serial_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Serial final
};

// Defines class to track the queue serial that can be load/store from multiple threads atomically.
class AtomicQueueSerial final
class alignas(8) AtomicQueueSerial final
{
public:
AtomicQueueSerial &operator=(const Serial &other)
Expand All @@ -129,7 +129,6 @@ class AtomicQueueSerial final
private:
static constexpr uint64_t kInvalid = 0;
std::atomic<uint64_t> mValue = kInvalid;
static_assert(decltype(mValue)::is_always_lock_free, "Must always be lock free");
};

// Used as default/initial serial
Expand Down

0 comments on commit 321c6b6

Please sign in to comment.