Changeset 89550 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Jun 8, 2021 12:34:08 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144967
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIVideoMemoryEditor.cpp
r86085 r89550 272 272 return; 273 273 274 /* Get monitors count and base video memory requirements: */ 275 quint64 uNeedMBytes = UICommon::requiredVideoMemory(m_comGuestOSType.GetId(), m_cGuestScreenCount) / _1M; 276 277 /* Initial value: */ 274 /* Init visible maximum VRAM: */ 278 275 m_iMaxVRAMVisible = m_cGuestScreenCount * 32; 279 276 280 /* No more than m_iMaxVRAM: */ 281 if (m_iMaxVRAMVisible > m_iMaxVRAM) 282 m_iMaxVRAMVisible = m_iMaxVRAM; 283 284 /* No less than 128MB (if possible): */ 277 /* Get monitors count and recommended VRAM: */ 278 int iNeedMBytes = UICommon::requiredVideoMemory(m_comGuestOSType.GetId(), m_cGuestScreenCount) / _1M; 279 /* Adjust visible maximum VRAM to be no less than 128MB (if possible): */ 285 280 if (m_iMaxVRAMVisible < 128 && m_iMaxVRAM >= 128) 286 281 m_iMaxVRAMVisible = 128; 287 282 288 /* No less than initial VRAM size (wtf?): */289 if (m_iMaxVRAMVisible < m_iInitialVRAM)290 m_iMaxVRAMVisible = m_iInitialVRAM;291 292 283 #ifdef VBOX_WITH_3D_ACCELERATION 293 284 if (m_f3DAccelerationEnabled && m_f3DAccelerationSupported) 294 285 { 295 uNeedMBytes = qMax(uNeedMBytes, (quint64)128); 296 /* No less than 256MB (if possible): */ 286 /* Adjust recommended VRAM to be no less than 128MB: */ 287 iNeedMBytes = qMax(iNeedMBytes, 128); 288 /* Adjust visible maximum VRAM to be no less than 256MB (if possible): */ 297 289 if (m_iMaxVRAMVisible < 256 && m_iMaxVRAM >= 256) 298 290 m_iMaxVRAMVisible = 256; 299 291 } 300 292 #endif 293 294 /* Adjust visible maximum VRAM to be no less than initial VRAM: */ 295 m_iMaxVRAMVisible = qMax(m_iMaxVRAMVisible, m_iInitialVRAM); 296 /* Adjust visible maximum VRAM to be no less than recommended VRAM: */ 297 m_iMaxVRAMVisible = qMax(m_iMaxVRAMVisible, iNeedMBytes); 298 299 /* Adjust recommended VRAM to be no more than actual maximum VRAM: */ 300 iNeedMBytes = qMin(iNeedMBytes, m_iMaxVRAM); 301 /* Adjust visible maximum VRAM to be no more than actual maximum VRAM: */ 302 m_iMaxVRAMVisible = qMin(m_iMaxVRAMVisible, m_iMaxVRAM); 301 303 302 304 if (m_pSpinBox) … … 306 308 m_pSlider->setMaximum(m_iMaxVRAMVisible); 307 309 m_pSlider->setPageStep(calculatePageStep(m_iMaxVRAMVisible)); 308 m_pSlider->setWarningHint(1, qMin( (int)uNeedMBytes, m_iMaxVRAMVisible));309 m_pSlider->setOptimalHint(qMin( (int)uNeedMBytes, m_iMaxVRAMVisible), m_iMaxVRAMVisible);310 m_pSlider->setWarningHint(1, qMin(iNeedMBytes, m_iMaxVRAMVisible)); 311 m_pSlider->setOptimalHint(qMin(iNeedMBytes, m_iMaxVRAMVisible), m_iMaxVRAMVisible); 310 312 } 311 313 if (m_pLabelMemoryMax)
Note:
See TracChangeset
for help on using the changeset viewer.