mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
put in override of fullscrn res mem estimator for intel i810
This commit is contained in:
parent
f3e2c18cc6
commit
ab4ac7fed0
@ -1539,6 +1539,29 @@ bool wdxGraphicsWindow::resize(unsigned int xsize,unsigned int ysize) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// overrides of the general estimator for known working cases
|
||||||
|
bool wdxGraphicsWindow::
|
||||||
|
special_check_fullscreen_resolution(UINT xsize,UINT ysize) {
|
||||||
|
assert(IS_VALID_PTR(_dxgsg));
|
||||||
|
|
||||||
|
DWORD VendorId=_dxgsg->scrn.DXDeviceID.dwVendorId;
|
||||||
|
DWORD DeviceId=_dxgsg->scrn.DXDeviceID.dwDeviceId;
|
||||||
|
switch(VendorId) {
|
||||||
|
case 0x8086: // Intel
|
||||||
|
// Intel i810,i815
|
||||||
|
if((DeviceId==0x7121)||(DeviceId==0x7121)||(DeviceId==0x1132)) {
|
||||||
|
if((xsize==800)&&(ysize==600))
|
||||||
|
return true;
|
||||||
|
if((xsize==1024)&&(ysize==768))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int wdxGraphicsWindow::
|
unsigned int wdxGraphicsWindow::
|
||||||
verify_window_sizes(unsigned int numsizes,unsigned int *dimen) {
|
verify_window_sizes(unsigned int numsizes,unsigned int *dimen) {
|
||||||
DWORD num_valid_modes=0;
|
DWORD num_valid_modes=0;
|
||||||
@ -1573,25 +1596,30 @@ verify_window_sizes(unsigned int numsizes,unsigned int *dimen) {
|
|||||||
|
|
||||||
bool bIsGoodMode=false;
|
bool bIsGoodMode=false;
|
||||||
|
|
||||||
if(_dxgsg->scrn.bIsLowVidMemCard)
|
if(special_check_fullscreen_resolution(xsize,ysize)) {
|
||||||
bIsGoodMode=(((float)xsize*(float)ysize)<=(float)(640*480));
|
// bypass the test below for certain cards we know have valid modes
|
||||||
else if(DMI.supportedBitDepths & (DDBD_16 | DDBD_24 | DDBD_32)) {
|
bIsGoodMode=true;
|
||||||
// assume user is testing fullscreen, not windowed, so use the dwTotal value
|
} else {
|
||||||
// see if 3 scrnbufs (front/back/z)at 16bpp at xsize*ysize will fit with a few
|
if(_dxgsg->scrn.bIsLowVidMemCard)
|
||||||
// extra megs for texmem
|
bIsGoodMode=(((float)xsize*(float)ysize)<=(float)(640*480));
|
||||||
|
else if(DMI.supportedBitDepths & (DDBD_16 | DDBD_24 | DDBD_32)) {
|
||||||
|
// assume user is testing fullscreen, not windowed, so use the dwTotal value
|
||||||
|
// see if 3 scrnbufs (front/back/z)at 16bpp at xsize*ysize will fit with a few
|
||||||
|
// extra megs for texmem
|
||||||
|
|
||||||
// 8MB Rage Pro says it has 6.8 megs Total free and will run at 1024x768, so
|
// 8MB Rage Pro says it has 6.8 megs Total free and will run at 1024x768, so
|
||||||
// formula makes it so that is OK
|
// formula makes it so that is OK
|
||||||
|
|
||||||
#define REQD_TEXMEM 1800000.0f
|
#define REQD_TEXMEM 1800000.0f
|
||||||
|
|
||||||
if(_dxgsg->scrn.MaxAvailVidMem==0) {
|
if(_dxgsg->scrn.MaxAvailVidMem==0) {
|
||||||
//assume buggy drivers return bad val of 0 and everything will be OK
|
//assume buggy drivers return bad val of 0 and everything will be OK
|
||||||
bIsGoodMode=true;
|
bIsGoodMode=true;
|
||||||
} else {
|
} else {
|
||||||
bIsGoodMode = ((((float)xsize*(float)ysize)*6+REQD_TEXMEM) < (float)_dxgsg->scrn.MaxAvailVidMem);
|
bIsGoodMode = ((((float)xsize*(float)ysize)*6+REQD_TEXMEM) < (float)_dxgsg->scrn.MaxAvailVidMem);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bIsGoodMode)
|
if(bIsGoodMode)
|
||||||
num_valid_modes++;
|
num_valid_modes++;
|
||||||
|
@ -80,6 +80,7 @@ public:
|
|||||||
void show_frame();
|
void show_frame();
|
||||||
virtual bool resize(unsigned int xsize,unsigned int ysize);
|
virtual bool resize(unsigned int xsize,unsigned int ysize);
|
||||||
virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);
|
virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);
|
||||||
|
bool special_check_fullscreen_resolution(UINT xsize,UINT ysize);
|
||||||
virtual int get_depth_bitwidth(void);
|
virtual int get_depth_bitwidth(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1628,6 +1628,28 @@ bool wdxGraphicsWindow::resize(unsigned int xsize,unsigned int ysize) {
|
|||||||
return bResizeSucceeded;
|
return bResizeSucceeded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// overrides of the general estimator for known working cases
|
||||||
|
bool wdxGraphicsWindow::
|
||||||
|
special_check_fullscreen_resolution(UINT xsize,UINT ysize) {
|
||||||
|
assert(IS_VALID_PTR(_dxgsg));
|
||||||
|
|
||||||
|
DWORD VendorId=_dxgsg->scrn.DXDeviceID.VendorId;
|
||||||
|
DWORD DeviceId=_dxgsg->scrn.DXDeviceID.DeviceId;
|
||||||
|
switch(VendorId) {
|
||||||
|
case 0x8086: // Intel
|
||||||
|
// Intel i810,i815
|
||||||
|
if((DeviceId==0x7121)||(DeviceId==0x7121)||(DeviceId==0x1132)) {
|
||||||
|
if((xsize==800)&&(ysize==600))
|
||||||
|
return true;
|
||||||
|
if((xsize==1024)&&(ysize==768))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
UINT wdxGraphicsWindow::
|
UINT wdxGraphicsWindow::
|
||||||
verify_window_sizes(UINT numsizes,UINT *dimen) {
|
verify_window_sizes(UINT numsizes,UINT *dimen) {
|
||||||
// unfortunately this only works AFTER you make the window initially,
|
// unfortunately this only works AFTER you make the window initially,
|
||||||
@ -1648,20 +1670,32 @@ verify_window_sizes(UINT numsizes,UINT *dimen) {
|
|||||||
bool CouldntFindAnyValidZBuf;
|
bool CouldntFindAnyValidZBuf;
|
||||||
D3DFORMAT newPixFmt=D3DFMT_UNKNOWN;
|
D3DFORMAT newPixFmt=D3DFMT_UNKNOWN;
|
||||||
|
|
||||||
if(!(_dxgsg->scrn.bIsLowVidMemCard && ((xsize!=640) || (ysize!=480))))
|
|
||||||
search_for_valid_displaymode(xsize,ysize,_dxgsg->scrn.PresParams.EnableAutoDepthStencil!=false,
|
if(special_check_fullscreen_resolution(xsize,ysize)) {
|
||||||
IS_STENCIL_FORMAT(_dxgsg->scrn.PresParams.AutoDepthStencilFormat),
|
// bypass the test below for certain cards we know have valid modes
|
||||||
&_dxgsg->scrn.SupportedScreenDepthsMask,&CouldntFindAnyValidZBuf,
|
bIsGoodMode=true;
|
||||||
&newPixFmt);
|
} else {
|
||||||
if(newPixFmt!=D3DFMT_UNKNOWN) {
|
if(_dxgsg->scrn.bIsLowVidMemCard) {
|
||||||
|
bIsGoodMode=((xsize==640) && (ysize==480));
|
||||||
|
} else {
|
||||||
|
search_for_valid_displaymode(xsize,ysize,_dxgsg->scrn.PresParams.EnableAutoDepthStencil!=false,
|
||||||
|
IS_STENCIL_FORMAT(_dxgsg->scrn.PresParams.AutoDepthStencilFormat),
|
||||||
|
&_dxgsg->scrn.SupportedScreenDepthsMask,&CouldntFindAnyValidZBuf,
|
||||||
|
&newPixFmt);
|
||||||
|
bIsGoodMode=(newPixFmt!=D3DFMT_UNKNOWN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(bIsGoodMode) {
|
||||||
num_valid_modes++;
|
num_valid_modes++;
|
||||||
} else {
|
} else {
|
||||||
// tell caller the mode is invalid
|
// tell caller the mode is invalid
|
||||||
pCurDim[0] = 0;
|
pCurDim[0] = 0;
|
||||||
pCurDim[1] = 0;
|
pCurDim[1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(wdxdisplay_cat.is_spam())
|
if(wdxdisplay_cat.is_spam())
|
||||||
wdxdisplay_cat.spam() << "Fullscrn Mode (" << xsize << "," << ysize << ")\t" << ((newPixFmt!=D3DFMT_UNKNOWN) ? "V" : "Inv") <<"alid\n";
|
wdxdisplay_cat.spam() << "Fullscrn Mode (" << xsize << "," << ysize << ")\t" << (bIsGoodMode ? "V" : "Inv") <<"alid\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return num_valid_modes;
|
return num_valid_modes;
|
||||||
|
@ -89,6 +89,7 @@ public:
|
|||||||
|
|
||||||
virtual bool resize(unsigned int xsize,unsigned int ysize);
|
virtual bool resize(unsigned int xsize,unsigned int ysize);
|
||||||
virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);
|
virtual unsigned int verify_window_sizes(unsigned int numsizes,unsigned int *dimen);
|
||||||
|
bool special_check_fullscreen_resolution(UINT xsize,UINT ysize);
|
||||||
virtual int get_depth_bitwidth(void);
|
virtual int get_depth_bitwidth(void);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user