Hash :
b19d17b8
Author :
Date :
2022-12-09T14:38:08
Vulkan: Split Serial class into UniqueSerial and Serial This CL splits Serial class into two classes: UniqueSerial and Serial. UniqueSerial supports the object unique serial usage where there is == and != operator but no > or < comparison. UniqueSerial can have invalid value, but Serial will not have invalid value (in next CL). The main reason is for next CL we can further optimize out the invalid value check in the QueueSerial comparison. Bug: b/262047600 Change-Id: Ieaed2a0d5546b012a6d63aa18b6006595e4aee1b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4093557 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
//
// Copyright 2019 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// serial_utils_unittest:
// Unit tests for the Serial utils.
//
#include <gtest/gtest.h>
#include "libANGLE/renderer/serial_utils.h"
namespace rx
{
TEST(SerialTest, Monotonic)
{
AtomicSerialFactory factory;
Serial a = factory.generate();
Serial b = factory.generate();
EXPECT_GT(b, a);
Serial zero;
EXPECT_GT(a, zero);
EXPECT_GT(b, zero);
}
} // namespace rx