mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(gx): add AdapterFormatSort
This commit is contained in:
parent
4f5c90b690
commit
2565588d81
@ -21,3 +21,24 @@ int32_t CGxFormat::formatToBitsUint[] = {
|
||||
24, // Fmt_Ds248
|
||||
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;
|
||||
};
|
||||
|
||||
int32_t AdapterFormatSort(const void* a, const void* b);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user