mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
dxgsg9: fix startup freeze when VRAM is 4GiB or higher
This commit is contained in:
parent
be464b61b3
commit
f4a8e923f7
@ -341,11 +341,13 @@ find_all_card_memavails() {
|
|||||||
if (!ISPOW2(dwVidMemTotal)) {
|
if (!ISPOW2(dwVidMemTotal)) {
|
||||||
// assume they wont return a proper max value, so round up to next pow
|
// assume they wont return a proper max value, so round up to next pow
|
||||||
// of 2
|
// of 2
|
||||||
UINT count = 0;
|
int count = get_next_higher_bit((uint32_t)(dwVidMemTotal - 1u));
|
||||||
while ((dwVidMemTotal >> count) != 0x0) {
|
if (count >= 32u) {
|
||||||
count++;
|
// Maximum value that fits in a UINT.
|
||||||
|
dwVidMemTotal = 0xffffffffu;
|
||||||
|
} else {
|
||||||
|
dwVidMemTotal = (1u << count);
|
||||||
}
|
}
|
||||||
dwVidMemTotal = (1 << count);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user