mirror of
https://github.com/whoahq/whoa.git
synced 2026-11-27 16:22:32 +03:00
feat(gx): add AdapterFormatSort
This commit is contained in:
2 files changed
+23
No files matched your search
@@ -21,3 +21,24 @@ int32_t CGxFormat::formatToBitsUint[] = {
|
|||||||
24, // Fmt_Ds248
|
24, // Fmt_Ds248
|
||||||
32, // Fmt_Ds320
|
32, // Fmt_Ds320
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int32_t AdapterFormatSort(const void* a, const void* b) {
|
||||||
|
auto formatA = static_cast<const CGxFormat*>(a);
|
||||||
|
auto formatB = static_cast<const CGxFormat*>(b);
|
||||||
|
|
||||||
|
auto sizeSort = (formatA->size.x * formatA->size.y) - (formatB->size.x * formatB->size.y);
|
||||||
|
|
||||||
|
if (sizeSort != 0) {
|
||||||
|
return sizeSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto colorSort = formatA->colorFormat - formatB->colorFormat;
|
||||||
|
|
||||||
|
if (colorSort != 0) {
|
||||||
|
return colorSort;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto multisampleSort = formatA->multisampleCount - formatB->multisampleCount;
|
||||||
|
|
||||||
|
return multisampleSort;
|
||||||
|
}
|
||||||
@@ -36,4 +36,6 @@ class CGxFormat {
|
|||||||
C2iVector pos;
|
C2iVector pos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int32_t AdapterFormatSort(const void* a, const void* b);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in new issue
Block a user