mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-04-30 21:30:50 +00:00
Fixed crash with NVRHI context
This commit is contained in:
parent
51d317543c
commit
fe80d08eb0
1 changed files with 11 additions and 50 deletions
|
@ -31,19 +31,6 @@ If you have questions concerning this license or the applicable additional terms
|
||||||
#include "precompiled.h"
|
#include "precompiled.h"
|
||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
|
|
||||||
// SRS - Include SDL headers to enable vsync changes without restart for UNIX-like OSs
|
|
||||||
#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
|
|
||||||
// SRS - Don't seem to need these #undefs (at least on macOS), are they needed for Linux, etc?
|
|
||||||
// DG: SDL.h somehow needs the following functions, so #undef those silly
|
|
||||||
// "don't use" #defines from Str.h
|
|
||||||
//#undef strncmp
|
|
||||||
//#undef strcasecmp
|
|
||||||
//#undef vsnprintf
|
|
||||||
// DG end
|
|
||||||
#include <SDL.h>
|
|
||||||
#endif
|
|
||||||
// SRS end
|
|
||||||
|
|
||||||
#include "../RenderCommon.h"
|
#include "../RenderCommon.h"
|
||||||
#include "../RenderBackend.h"
|
#include "../RenderBackend.h"
|
||||||
#include "../../framework/Common_local.h"
|
#include "../../framework/Common_local.h"
|
||||||
|
@ -74,12 +61,16 @@ public:
|
||||||
|
|
||||||
int currentImageParm = 0;
|
int currentImageParm = 0;
|
||||||
idArray< idImage*, MAX_IMAGE_PARMS > imageParms;
|
idArray< idImage*, MAX_IMAGE_PARMS > imageParms;
|
||||||
nvrhi::GraphicsPipelineHandle pipeline;
|
//nvrhi::GraphicsPipelineHandle pipeline;
|
||||||
bool fullscreen = false;
|
//bool fullscreen = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
static NvrhiContext context;
|
static NvrhiContext context;
|
||||||
|
|
||||||
|
extern DeviceManager* deviceManager;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
GL_CheckErrors
|
GL_CheckErrors
|
||||||
|
@ -91,37 +82,6 @@ bool GL_CheckErrors_( const char* filename, int line )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
========================
|
|
||||||
DebugCallback
|
|
||||||
|
|
||||||
For ARB_debug_output
|
|
||||||
========================
|
|
||||||
*/
|
|
||||||
// RB: added const to userParam
|
|
||||||
static void CALLBACK DebugCallback( unsigned int source, unsigned int type,
|
|
||||||
unsigned int id, unsigned int severity, int length, const char* msg, const void* userParam )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
==================
|
|
||||||
R_CheckPortableExtensions
|
|
||||||
==================
|
|
||||||
*/
|
|
||||||
// RB: replaced QGL with GLEW
|
|
||||||
static void R_CheckPortableExtensions()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
// RB end
|
|
||||||
|
|
||||||
|
|
||||||
idStr extensions_string;
|
|
||||||
|
|
||||||
extern DeviceManager* deviceManager;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
==================
|
==================
|
||||||
R_InitOpenGL
|
R_InitOpenGL
|
||||||
|
@ -156,6 +116,10 @@ void idRenderBackend::Init()
|
||||||
// input and sound systems need to be tied to the new window
|
// input and sound systems need to be tied to the new window
|
||||||
Sys_InitInput();
|
Sys_InitInput();
|
||||||
|
|
||||||
|
// clear NVRHI context
|
||||||
|
context.currentImageParm = 0;
|
||||||
|
context.imageParms.Zero();
|
||||||
|
|
||||||
// Need to reinitialize this pass once this image is resized.
|
// Need to reinitialize this pass once this image is resized.
|
||||||
renderProgManager.Init( deviceManager->GetDevice() );
|
renderProgManager.Init( deviceManager->GetDevice() );
|
||||||
|
|
||||||
|
@ -182,7 +146,7 @@ void idRenderBackend::Init()
|
||||||
// allocate the frame data, which may be more if smp is enabled
|
// allocate the frame data, which may be more if smp is enabled
|
||||||
R_InitFrameData();
|
R_InitFrameData();
|
||||||
|
|
||||||
// Reset our gamma
|
// TODO REMOVE: reset our gamma
|
||||||
R_SetColorMappings();
|
R_SetColorMappings();
|
||||||
|
|
||||||
slopeScaleBias = 0.f;
|
slopeScaleBias = 0.f;
|
||||||
|
@ -766,9 +730,6 @@ void idRenderBackend::GL_SetDefaultState()
|
||||||
{
|
{
|
||||||
RENDERLOG_PRINTF( "--- GL_SetDefaultState ---\n" );
|
RENDERLOG_PRINTF( "--- GL_SetDefaultState ---\n" );
|
||||||
|
|
||||||
// make sure our GL state vector is set correctly
|
|
||||||
memset( &context.imageParms, 0, sizeof( context.imageParms ) );
|
|
||||||
|
|
||||||
glStateBits = 0;
|
glStateBits = 0;
|
||||||
|
|
||||||
GL_State( 0, true );
|
GL_State( 0, true );
|
||||||
|
|
Loading…
Reference in a new issue