mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
allow device change at any time
This commit is contained in:
parent
fd035c0f70
commit
d1912ba929
4 changed files with 18 additions and 4 deletions
|
@ -193,7 +193,7 @@ void RenderPassStats::EndFrame(uint32_t cpu, uint32_t gpu)
|
|||
|
||||
void GRP::Init()
|
||||
{
|
||||
RHI::Init();
|
||||
firstInit = RHI::Init();
|
||||
|
||||
if(firstInit)
|
||||
{
|
||||
|
|
|
@ -133,6 +133,11 @@ static void UpdateEntityData(bool& depthHack, int entityNum, double originalTime
|
|||
|
||||
void World::Init()
|
||||
{
|
||||
if(grp.firstInit)
|
||||
{
|
||||
fogDescriptorTable = RHI_MAKE_NULL_HANDLE();
|
||||
}
|
||||
|
||||
{
|
||||
TextureDesc desc("depth buffer", glConfig.vidWidth, glConfig.vidHeight);
|
||||
desc.committedResource = true;
|
||||
|
|
|
@ -2329,7 +2329,7 @@ namespace RHI
|
|||
}
|
||||
}
|
||||
|
||||
void Init()
|
||||
bool Init()
|
||||
{
|
||||
Sys_V_Init();
|
||||
|
||||
|
@ -2417,7 +2417,7 @@ namespace RHI
|
|||
|
||||
rhi.vsync = vsync;
|
||||
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// @NOTE: we can't use memset because of the StaticPool members
|
||||
|
@ -2761,12 +2761,21 @@ namespace RHI
|
|||
glInfo.depthFadeSupport = qfalse;
|
||||
|
||||
rhi.initialized = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShutDown(bool destroyWindow)
|
||||
{
|
||||
#define DESTROY_POOL(Name, Func) DestroyPool(rhi.Name, &Func, !!destroyWindow);
|
||||
|
||||
if(!destroyWindow &&
|
||||
r_gpuPreference->latchedString != NULL &&
|
||||
Q_stricmp(r_gpuPreference->latchedString, r_gpuPreference->string) != 0)
|
||||
{
|
||||
destroyWindow = true;
|
||||
}
|
||||
|
||||
if(rhi.frameBegun)
|
||||
{
|
||||
backEnd.renderFrame = qfalse;
|
||||
|
|
|
@ -676,7 +676,7 @@ namespace RHI
|
|||
const ShaderMacro* macros = NULL;
|
||||
};
|
||||
|
||||
void Init();
|
||||
bool Init(); // true when a full init happened (the device was created)
|
||||
void ShutDown(bool destroyWindow);
|
||||
|
||||
void BeginFrame();
|
||||
|
|
Loading…
Reference in a new issue