mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:58:10 +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() {
|
void Context::updateSwapchainMemoryCounter() {
|
||||||
if (_window) {
|
if (_window) {
|
||||||
auto newSize = _window->size();
|
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);
|
gl::Context::updateSwapchainMemoryUsage(_swapchainMemoryUsage, newMemSize);
|
||||||
_swapchainMemoryUsage = newMemSize;
|
_swapchainMemoryUsage = newMemSize;
|
||||||
} else {
|
} else {
|
||||||
|
@ -257,8 +257,9 @@ void Context::create() {
|
||||||
wglChoosePixelFormatARB(_hdc, &formatAttribs[0], NULL, 1, &pixelFormat, &numFormats);
|
wglChoosePixelFormatARB(_hdc, &formatAttribs[0], NULL, 1, &pixelFormat, &numFormats);
|
||||||
DescribePixelFormat(_hdc, pixelFormat, sizeof(pfd), &pfd);
|
DescribePixelFormat(_hdc, pixelFormat, sizeof(pfd), &pfd);
|
||||||
}
|
}
|
||||||
// The swap chain pixel size for swap chains is : rgba32 * double buffer + depth24stencil8
|
// The swap chain pixel size for swap chains is : rgba32 + depth24stencil8
|
||||||
_swapchainPixelSize = 32 * 2 + 32;
|
// 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();
|
updateSwapchainMemoryCounter();
|
||||||
|
|
||||||
SetPixelFormat(_hdc, pixelFormat, &pfd);
|
SetPixelFormat(_hdc, pixelFormat, &pfd);
|
||||||
|
|
|
@ -15,9 +15,11 @@
|
||||||
|
|
||||||
size_t evalGLFormatSwapchainPixelSize(const QSurfaceFormat& format) {
|
size_t evalGLFormatSwapchainPixelSize(const QSurfaceFormat& format) {
|
||||||
size_t pixelSize = format.redBufferSize() + format.greenBufferSize() + format.blueBufferSize() + format.alphaBufferSize();
|
size_t pixelSize = format.redBufferSize() + format.greenBufferSize() + format.blueBufferSize() + format.alphaBufferSize();
|
||||||
if (format.swapBehavior() > 0) {
|
// We don't apply the length of the swap chain into this pixelSize since it is not vsible for the Process (on windows).
|
||||||
pixelSize *= format.swapBehavior(); // multiply the color buffer pixel size by the actual swapchain depth
|
// 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();
|
pixelSize += format.stencilBufferSize() + format.depthBufferSize();
|
||||||
return pixelSize;
|
return pixelSize;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue