mirror of
https://github.com/reactos/wine.git
synced 2025-01-21 03:15:18 +00:00
wined3d: Registry setting for the amount of simulated texture memory.
Set VideoMemorySize under HKCU\Software\Wine\Direct3D to amount in MB as string.
This commit is contained in:
parent
f1adb69c2e
commit
4d6cfb6351
@ -70,9 +70,6 @@ inline static Display *get_display( HDC hdc )
|
||||
return display;
|
||||
}
|
||||
|
||||
/* Memory tracking and object counting */
|
||||
static unsigned int emulated_textureram = 64*1024*1024;
|
||||
|
||||
/* TODO: setup some flags in the regestry to enable, disable pbuffer support */
|
||||
/* enable pbuffer support for offscreen textures */
|
||||
BOOL pbuffer_support = FALSE;
|
||||
@ -2264,19 +2261,22 @@ static HRESULT WINAPI IWineD3DDeviceImpl_GetDirect3D(IWineD3DDevice *iface, IWin
|
||||
static UINT WINAPI IWineD3DDeviceImpl_GetAvailableTextureMem(IWineD3DDevice *iface) {
|
||||
/** NOTE: There's a probably a hack-around for this one by putting as many pbuffers, VBO's (or whatever)
|
||||
* Into the video ram as possible and seeing how many fit
|
||||
* you can also get the correct initial value from via X and ATI's driver
|
||||
* you can also get the correct initial value from nvidia and ATI's driver via X
|
||||
* texture memory is video memory + AGP memory
|
||||
*******************/
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
static BOOL showfixmes = TRUE;
|
||||
if (showfixmes) {
|
||||
FIXME("(%p) : stub, emulating %dMB for now, returning %dMB\n", This, (emulated_textureram/(1024*1024)),
|
||||
((emulated_textureram - wineD3DGlobalStatistics->glsurfaceram) / (1024*1024)));
|
||||
FIXME("(%p) : stub, simulating %dMB for now, returning %dMB left\n", This,
|
||||
(wined3d_settings.emulated_textureram/(1024*1024)),
|
||||
((wined3d_settings.emulated_textureram - wineD3DGlobalStatistics->glsurfaceram) / (1024*1024)));
|
||||
showfixmes = FALSE;
|
||||
}
|
||||
TRACE("(%p) : emulating %dMB for now, returning %dMB\n", This, (emulated_textureram/(1024*1024)),
|
||||
((emulated_textureram - wineD3DGlobalStatistics->glsurfaceram) / (1024*1024)));
|
||||
/* videomemory is simulated videomemory + AGP memory left */
|
||||
return (emulated_textureram - wineD3DGlobalStatistics->glsurfaceram);
|
||||
TRACE("(%p) : simulating %dMB, returning %dMB left\n", This,
|
||||
(wined3d_settings.emulated_textureram/(1024*1024)),
|
||||
((wined3d_settings.emulated_textureram - wineD3DGlobalStatistics->glsurfaceram) / (1024*1024)));
|
||||
/* return simulated texture memory left */
|
||||
return (wined3d_settings.emulated_textureram - wineD3DGlobalStatistics->glsurfaceram);
|
||||
}
|
||||
|
||||
|
||||
|
@ -100,6 +100,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
||||
HKEY hkey = 0;
|
||||
HKEY appkey = 0;
|
||||
DWORD len;
|
||||
wined3d_settings.emulated_textureram = 64*1024*1024;
|
||||
|
||||
DisableThreadLibraryCalls(hInstDLL);
|
||||
|
||||
@ -225,6 +226,19 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
||||
wined3d_settings.rendertargetlock_mode = RTL_TEXTEX;
|
||||
}
|
||||
}
|
||||
if ( !get_config_key( hkey, appkey, "VideoMemorySize", buffer, size) )
|
||||
{
|
||||
int TmpVideoMemorySize = atoi(buffer);
|
||||
if(TmpVideoMemorySize > 0)
|
||||
{
|
||||
wined3d_settings.emulated_textureram = TmpVideoMemorySize *1024*1024;
|
||||
TRACE("Use %iMB = %d byte for emulated_textureram\n",
|
||||
TmpVideoMemorySize,
|
||||
wined3d_settings.emulated_textureram);
|
||||
}
|
||||
else
|
||||
ERR("VideoMemorySize is %i but must be >0\n", TmpVideoMemorySize);
|
||||
}
|
||||
}
|
||||
if (wined3d_settings.vs_mode == VS_HW)
|
||||
TRACE("Allow HW vertex shaders\n");
|
||||
|
@ -159,6 +159,8 @@ typedef struct wined3d_settings_s {
|
||||
/* nonpower 2 function */
|
||||
int nonpower2_mode;
|
||||
int rendertargetlock_mode;
|
||||
/* Memory tracking and object counting */
|
||||
unsigned int emulated_textureram;
|
||||
} wined3d_settings_t;
|
||||
|
||||
extern wined3d_settings_t wined3d_settings;
|
||||
|
Loading…
x
Reference in New Issue
Block a user