16TEST(AllocatorTest, TextureDescriptorCompatibility) {
23 ASSERT_EQ(desc_a, desc_b);
24 ASSERT_NE(desc_a, desc_c);
32 ASSERT_EQ(desc_a, desc_b);
33 ASSERT_NE(desc_a, desc_c);
41 ASSERT_EQ(desc_a, desc_b);
42 ASSERT_NE(desc_a, desc_c);
50 ASSERT_EQ(desc_a, desc_b);
51 ASSERT_NE(desc_a, desc_c);
59 ASSERT_EQ(desc_a, desc_b);
60 ASSERT_NE(desc_a, desc_c);
68 ASSERT_EQ(desc_a, desc_b);
69 ASSERT_NE(desc_a, desc_c);
77 ASSERT_EQ(desc_a, desc_b);
78 ASSERT_NE(desc_a, desc_c);
82TEST(AllocatorTest, RangeTest) {
86 auto merged = a.
Merge(b);
88 EXPECT_EQ(merged.offset, 0u);
89 EXPECT_EQ(merged.length, 30u);
95 auto merged = a.
Merge(b);
97 EXPECT_EQ(merged.offset, 0u);
98 EXPECT_EQ(merged.length, 120u);
104 auto merged = b.Merge(a);
106 EXPECT_EQ(merged.offset, 0u);
107 EXPECT_EQ(merged.length, 120u);
113 auto merged = b.Merge(a);
115 EXPECT_EQ(merged.offset, 0u);
116 EXPECT_EQ(merged.length, 10u);
122 auto merged = b.Merge(a);
124 EXPECT_EQ(merged.offset, 0u);
125 EXPECT_EQ(merged.length, 10u);
129TEST(AllocatorTest, CompressedFormatClassification) {
147TEST(AllocatorTest, CompressedFormatBlockMath) {
169TEST(AllocatorTest, CompressedFormatRegionByteSizes) {
187TEST(AllocatorTest, CompressedTextureDescriptorByteSizes) {
190 .size =
ISize(8, 8)};
196 .size =
ISize(16, 16)};
TEST(FrameTimingsRecorderTest, RecordVsync)
constexpr size_t CompressedBlockHeightForPixelFormat(PixelFormat format)
The height, in texels, of one compression block. Uncompressed formats report 1.
@ kASTCHDR
ASTC HDR. A separate device feature from ASTC LDR.
@ kBC
S3TC, RGTC, and BPTC (BC1 through BC7). Desktop GPUs.
@ kETC2
ETC2 and EAC. Mobile, OpenGL ES 3.0, and WebGL2.
@ kASTC
ASTC LDR. Modern mobile and some desktop.
constexpr size_t CompressedBlockWidthForPixelFormat(PixelFormat format)
The width, in texels, of one compression block. Uncompressed formats report 1.
constexpr size_t BytesForTextureRegion(PixelFormat format, int64_t width, int64_t height)
The number of bytes required to store a width x height texel region in format. Block-compressed forma...
constexpr size_t BytesPerRowForTextureWidth(PixelFormat format, int64_t width)
The number of bytes in a single row of texel blocks for a texture of the given width in format.
constexpr size_t BytesPerBlockForPixelFormat(PixelFormat format)
The number of bytes used to store one block of format. For uncompressed formats a block is a single p...
constexpr CompressedTextureFamily CompressedTextureFamilyForFormat(PixelFormat format)
The compression family that format belongs to. Only valid for formats where IsCompressed is true.
constexpr bool IsCompressed(PixelFormat format)
Whether format is a block-compressed format.
constexpr Range Merge(const Range &other)
Create a new range that is a union of this range and other.
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
constexpr size_t GetByteSizeOfBaseMipLevel() const
constexpr size_t GetBytesPerRow() const
CompressionType compression_type