mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 16:55:07 +02:00
Actually remove the multiplication of the color buffer cost by the swapchain length in the pixel SIze estimation since it doesn;t look true
This commit is contained in:
parent
507d3e5a39
commit
c586bef452
2 changed files with 9 additions and 6 deletions
|
@ -109,7 +109,7 @@ Context::~Context() {
|
|||
void Context::updateSwapchainMemoryCounter() {
|
||||
if (_window) {
|
||||
auto newSize = _window->size();
|
||||
auto newMemSize = gl::Context::evalSurfaceMemoryUsage(newSize.width(), newSize.height(), _swapchainPixelSize);
|
||||
auto newMemSize = gl::Context::evalSurfaceMemoryUsage(newSize.width(), newSize.height(), (uint32_t) _swapchainPixelSize);
|
||||
gl::Context::updateSwapchainMemoryUsage(_swapchainMemoryUsage, newMemSize);
|
||||
_swapchainMemoryUsage = newMemSize;
|
||||
} else {
|
||||
|
@ -257,8 +257,9 @@ void Context::create() {
|
|||
wglChoosePixelFormatARB(_hdc, &formatAttribs[0], NULL, 1, &pixelFormat, &numFormats);
|
||||
DescribePixelFormat(_hdc, pixelFormat, sizeof(pfd), &pfd);
|
||||
}
|
||||
// The swap chain pixel size for swap chains is : rgba32 * double buffer + depth24stencil8
|
||||
_swapchainPixelSize = 32 * 2 + 32;
|
||||
// The swap chain pixel size for swap chains is : rgba32 + depth24stencil8
|
||||
// We don't apply the length of the swap chain into this pixelSize since it is not vsible for the Process (on windows).
|
||||
_swapchainPixelSize = 32 + 32;
|
||||
updateSwapchainMemoryCounter();
|
||||
|
||||
SetPixelFormat(_hdc, pixelFormat, &pfd);
|
||||
|
|
|
@ -15,9 +15,11 @@
|
|||
|
||||
size_t evalGLFormatSwapchainPixelSize(const QSurfaceFormat& format) {
|
||||
size_t pixelSize = format.redBufferSize() + format.greenBufferSize() + format.blueBufferSize() + format.alphaBufferSize();
|
||||
if (format.swapBehavior() > 0) {
|
||||
pixelSize *= format.swapBehavior(); // multiply the color buffer pixel size by the actual swapchain depth
|
||||
}
|
||||
// We don't apply the length of the swap chain into this pixelSize since it is not vsible for the Process (on windows).
|
||||
// Let s keep this here remember that:
|
||||
// if (format.swapBehavior() > 0) {
|
||||
// pixelSize *= format.swapBehavior(); // multiply the color buffer pixel size by the actual swapchain depth
|
||||
// }
|
||||
pixelSize += format.stencilBufferSize() + format.depthBufferSize();
|
||||
return pixelSize;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue