mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 06:34:10 +00:00
Removed many obsolete #if defined( USE_NVRHI )
This commit is contained in:
parent
a3dd0011e7
commit
e5519c5fc4
14 changed files with 45 additions and 190 deletions
|
@ -37,10 +37,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "../sound/sound.h"
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
// RB begin
|
||||
#if defined(USE_DOOMCLASSIC)
|
||||
|
|
|
@ -33,10 +33,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "Common_local.h"
|
||||
#include "../imgui/BFGimgui.h"
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
#define CON_TEXTSIZE 0x30000
|
||||
#define NUM_CON_TIMES 4
|
||||
|
|
|
@ -73,7 +73,6 @@ void R_ReloadImages_f( const idCmdArgs& args )
|
|||
}
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
tr.commandList->open();
|
||||
globalImages->ReloadImages( all, tr.commandList );
|
||||
tr.commandList->close();
|
||||
|
@ -81,9 +80,6 @@ void R_ReloadImages_f( const idCmdArgs& args )
|
|||
|
||||
// Images (including the framebuffer images) were reloaded, reinitialize the framebuffers.
|
||||
Framebuffer::ResizeFramebuffers();
|
||||
#else
|
||||
globalImages->ReloadImages( all );
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
@ -480,11 +476,7 @@ idImage* idImageManager::ImageFromFile( const char* _name, textureFilter_t filte
|
|||
image->levelLoadReferenced = true;
|
||||
|
||||
// load it if we aren't in a level preload
|
||||
#if defined( USE_NVRHI )
|
||||
if( !insideLevelLoad || preloadingMapImages )
|
||||
#else
|
||||
if( ( !insideLevelLoad || preloadingMapImages ) && idLib::IsMainThread() )
|
||||
#endif
|
||||
{
|
||||
image->referencedOutsideLevelLoad = ( !insideLevelLoad && !preloadingMapImages );
|
||||
image->FinalizeImage( false, nullptr );
|
||||
|
@ -785,9 +777,7 @@ void idImageManager::Shutdown()
|
|||
imageHash.Clear();
|
||||
deferredImages.DeleteContents( true );
|
||||
deferredImageHash.Clear();
|
||||
#if defined( USE_NVRHI )
|
||||
commandList.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -889,7 +879,6 @@ idImageManager::LoadLevelImages
|
|||
*/
|
||||
int idImageManager::LoadLevelImages( bool pacifier )
|
||||
{
|
||||
#if defined( USE_NVRHI )
|
||||
if( !commandList )
|
||||
{
|
||||
nvrhi::CommandListParameters params = {};
|
||||
|
@ -905,21 +894,12 @@ int idImageManager::LoadLevelImages( bool pacifier )
|
|||
common->UpdateLevelLoadPacifier();
|
||||
|
||||
commandList->open();
|
||||
#endif
|
||||
|
||||
int loadCount = 0;
|
||||
for( int i = 0 ; i < images.Num() ; i++ )
|
||||
{
|
||||
idImage* image = images[ i ];
|
||||
|
||||
#if !defined( USE_NVRHI )
|
||||
if( pacifier )
|
||||
{
|
||||
// SP: Cannot update the pacifier because then two command lists would be open at once.
|
||||
common->UpdateLevelLoadPacifier();
|
||||
}
|
||||
#endif
|
||||
|
||||
if( image->generatorFunction )
|
||||
{
|
||||
continue;
|
||||
|
@ -932,7 +912,6 @@ int idImageManager::LoadLevelImages( bool pacifier )
|
|||
}
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
globalImages->LoadDeferredImages( commandList );
|
||||
|
||||
commandList->close();
|
||||
|
@ -940,7 +919,6 @@ int idImageManager::LoadLevelImages( bool pacifier )
|
|||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
|
||||
common->UpdateLevelLoadPacifier();
|
||||
#endif
|
||||
|
||||
return loadCount;
|
||||
}
|
||||
|
|
|
@ -576,12 +576,10 @@ void idImage::FinalizeImage( bool fromBackEnd, nvrhi::ICommandList* commandList
|
|||
opts.numLevels = 1;
|
||||
DeriveOpts();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
if( !commandList )
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
AllocImage();
|
||||
|
||||
|
@ -664,12 +662,10 @@ void idImage::FinalizeImage( bool fromBackEnd, nvrhi::ICommandList* commandList
|
|||
binaryFileTime = im.WriteGeneratedFile( sourceFileTime );
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
if( !commandList )
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
AllocImage();
|
||||
|
||||
|
@ -896,8 +892,6 @@ idImage::Reload
|
|||
*/
|
||||
void idImage::Reload( bool force, nvrhi::ICommandList* commandList )
|
||||
{
|
||||
#if defined( USE_NVRHI )
|
||||
|
||||
// always regenerate functional images
|
||||
if( generatorFunction )
|
||||
{
|
||||
|
@ -905,24 +899,6 @@ void idImage::Reload( bool force, nvrhi::ICommandList* commandList )
|
|||
generatorFunction( this, commandList );
|
||||
return;
|
||||
}
|
||||
#else
|
||||
// don't break render targets that have this image attached
|
||||
if( opts.isRenderTarget )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// always regenerate functional images
|
||||
if( generatorFunction )
|
||||
{
|
||||
if( force )
|
||||
{
|
||||
common->DPrintf( "regenerating %s.\n", GetName() );
|
||||
generatorFunction( this, commandList );
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
// check file times
|
||||
if( !force )
|
||||
|
@ -1233,15 +1209,6 @@ void idImage::UploadScratch( const byte* data, int cols, int rows, nvrhi::IComma
|
|||
else
|
||||
{
|
||||
#if defined( USE_NVRHI )
|
||||
|
||||
/*
|
||||
if( opts.textureType != TT_2D )//|| usage != TD_LOOKUP_TABLE_RGBA )
|
||||
{
|
||||
GenerateImage( data, cols, rows, TF_LINEAR, TR_REPEAT, TD_LOOKUP_TABLE_RGBA, commandList );
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
if( opts.width != cols || opts.height != rows )
|
||||
{
|
||||
opts.width = cols;
|
||||
|
|
|
@ -34,12 +34,10 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "Model_local.h"
|
||||
#include "RenderCommon.h" // just for R_FreeWorldInteractions and R_CreateWorldInteractions
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include <sys/DeviceManager.h>
|
||||
#include <sys/DeviceManager.h>
|
||||
|
||||
extern DeviceManager* deviceManager;
|
||||
extern idCVar r_uploadBufferSizeMB;
|
||||
#endif
|
||||
extern DeviceManager* deviceManager;
|
||||
extern idCVar r_uploadBufferSizeMB;
|
||||
|
||||
idCVar binaryLoadRenderModels( "binaryLoadRenderModels", "1", 0, "enable binary load/write of render models" );
|
||||
idCVar preload_MapModels( "preload_MapModels", "1", CVAR_SYSTEM | CVAR_BOOL, "preload models during begin or end levelload" );
|
||||
|
@ -243,7 +241,6 @@ idRenderModelManagerLocal::Init
|
|||
*/
|
||||
void idRenderModelManagerLocal::Init()
|
||||
{
|
||||
#if defined( USE_NVRHI )
|
||||
if( !commandList )
|
||||
{
|
||||
nvrhi::CommandListParameters params = {};
|
||||
|
@ -255,7 +252,6 @@ void idRenderModelManagerLocal::Init()
|
|||
}
|
||||
commandList = deviceManager->GetDevice()->createCommandList( params );
|
||||
}
|
||||
#endif
|
||||
|
||||
cmdSystem->AddCommand( "listModels", ListModels_f, CMD_FL_RENDERER, "lists all models" );
|
||||
cmdSystem->AddCommand( "printModel", PrintModel_f, CMD_FL_RENDERER, "prints model info", idCmdSystem::ArgCompletion_ModelName );
|
||||
|
@ -295,9 +291,7 @@ void idRenderModelManagerLocal::Shutdown()
|
|||
{
|
||||
models.DeleteContents( true );
|
||||
hash.Free();
|
||||
#if defined( USE_NVRHI )
|
||||
commandList.Reset();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -39,14 +39,12 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "imgui/ImGui_Hooks.h"
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include "RenderPass.h"
|
||||
#include <sys/DeviceManager.h>
|
||||
#include <nvrhi/utils.h>
|
||||
#include "RenderPass.h"
|
||||
#include <sys/DeviceManager.h>
|
||||
#include <nvrhi/utils.h>
|
||||
|
||||
idCVar r_useNewSsaoPass( "r_useNewSSAOPass", "1", CVAR_RENDERER | CVAR_BOOL, "use the new SSAO pass from Donut" );
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
idCVar r_useNewSsaoPass( "r_useNewSSAOPass", "1", CVAR_RENDERER | CVAR_BOOL, "use the new SSAO pass from Donut" );
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
idCVar r_drawEyeColor( "r_drawEyeColor", "0", CVAR_RENDERER | CVAR_BOOL, "Draw a colored box, red = left eye, blue = right eye, grey = non-stereo" );
|
||||
idCVar r_motionBlur( "r_motionBlur", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "1 - 5, log2 of the number of motion blur samples" );
|
||||
|
@ -2100,6 +2098,7 @@ void idRenderBackend::AmbientPass( const drawSurf_t* const* drawSurfs, int numDr
|
|||
commandList->clearTextureFloat( globalImages->gbufferNormalsRoughnessImage->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 0.f ) );
|
||||
}
|
||||
|
||||
// RB: TODO remove this
|
||||
if( !fillGbuffer && r_useSSAO.GetBool() && r_ssaoDebug.GetBool() )
|
||||
{
|
||||
GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO | GLS_DEPTHMASK | GLS_DEPTHFUNC_ALWAYS );
|
||||
|
@ -2118,9 +2117,7 @@ void idRenderBackend::AmbientPass( const drawSurf_t* const* drawSurfs, int numDr
|
|||
|
||||
currentSpace = NULL;
|
||||
auto mvp = renderMatrix_identity;
|
||||
#if defined( USE_NVRHI )
|
||||
mvp[1][1] = -mvp[1][1]; // flip y
|
||||
#endif
|
||||
RB_SetMVP( mvp );
|
||||
|
||||
renderProgManager.BindShader_Texture();
|
||||
|
@ -5364,10 +5361,8 @@ void idRenderBackend::DrawScreenSpaceAmbientOcclusion( const viewDef_t* _viewDef
|
|||
int screenWidth = renderSystem->GetWidth();
|
||||
int screenHeight = renderSystem->GetHeight();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList->clearTextureFloat( globalImages->hierarchicalZbufferImage->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 1.f ) );
|
||||
commandList->clearTextureFloat( globalImages->ambientOcclusionImage[0]->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 1.f ) );
|
||||
#endif
|
||||
|
||||
// build hierarchical depth buffer
|
||||
if( r_useHierarchicalDepthBuffer.GetBool() )
|
||||
|
@ -5413,17 +5408,12 @@ void idRenderBackend::DrawScreenSpaceAmbientOcclusion( const viewDef_t* _viewDef
|
|||
|
||||
GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO | GLS_DEPTHMASK | GLS_DEPTHFUNC_ALWAYS | GLS_CULL_TWOSIDED );
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
const nvrhi::FramebufferAttachment& att = globalFramebuffers.ambientOcclusionFBO[0]->GetApiObject()->getDesc().colorAttachments[0];
|
||||
|
||||
if( att.texture )
|
||||
{
|
||||
commandList->clearTextureFloat( att.texture, att.subresources, 0 );
|
||||
}
|
||||
#else
|
||||
glClearColor( 0, 0, 0, 0 );
|
||||
glClear( GL_COLOR_BUFFER_BIT );
|
||||
#endif
|
||||
|
||||
if( r_ssaoFiltering.GetBool() )
|
||||
{
|
||||
|
@ -5500,9 +5490,7 @@ void idRenderBackend::DrawScreenSpaceAmbientOcclusion( const viewDef_t* _viewDef
|
|||
{
|
||||
float jitterTexScale[4];
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList->clearTextureFloat( globalImages->ambientOcclusionImage[1]->GetTextureHandle(), nvrhi::AllSubresources, nvrhi::Color( 1.f ) );
|
||||
#endif
|
||||
|
||||
// AO blur X
|
||||
globalFramebuffers.ambientOcclusionFBO[1]->Bind();
|
||||
|
@ -5614,11 +5602,6 @@ BACKEND COMMANDS
|
|||
=========================================================================================================
|
||||
*/
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
====================
|
||||
RB_ExecuteBackEndCommands
|
||||
|
@ -5658,7 +5641,6 @@ void idRenderBackend::ExecuteBackEndCommands( const emptyCommand_t* cmds )
|
|||
void* textureId = globalImages->hierarchicalZbufferImage->GetTextureID();
|
||||
globalImages->LoadDeferredImages( commandList );
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
if( !ssaoPass && r_useNewSsaoPass.GetBool() )
|
||||
{
|
||||
ssaoPass = new SsaoPass(
|
||||
|
@ -5700,7 +5682,6 @@ void idRenderBackend::ExecuteBackEndCommands( const emptyCommand_t* cmds )
|
|||
taaPass = new TemporalAntiAliasingPass();
|
||||
taaPass->Init( deviceManager->GetDevice(), &commonPasses, NULL, taaParams );
|
||||
}
|
||||
#endif
|
||||
|
||||
uint64 backEndStartTime = Sys_Microseconds();
|
||||
|
||||
|
@ -5997,8 +5978,6 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
GL_SelectTexture( 0 );
|
||||
|
||||
// resolve the screen
|
||||
#if defined( USE_NVRHI )
|
||||
|
||||
if( R_GetMSAASamples() > 1 )
|
||||
{
|
||||
renderLog.OpenBlock( "Resolve to _currentRender" );
|
||||
|
@ -6018,9 +5997,6 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
}
|
||||
|
||||
renderLog.CloseBlock();
|
||||
#else
|
||||
globalImages->currentRenderImage->CopyFramebuffer( x, y, w, h );
|
||||
#endif
|
||||
|
||||
currentRenderCopied = true;
|
||||
|
||||
|
@ -6097,20 +6073,13 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
// bloom post processing
|
||||
//-------------------------------------------------
|
||||
|
||||
if( !r_skipBloom.GetBool() )
|
||||
{
|
||||
// TODO(Stephen): implement bloom
|
||||
#if !defined( USE_NVRHI )
|
||||
Bloom( _viewDef );
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
//TODO(Stephen): Move somewhere else?
|
||||
// RB: this needs to be done after next post processing steps later on
|
||||
// TODO implement bloom
|
||||
//Bloom( _viewDef );
|
||||
|
||||
if( _viewDef->renderView.rdflags & RDF_IRRADIANCE )
|
||||
{
|
||||
// copy LDR result to DX12 / Vulkan swapchain image
|
||||
|
||||
// we haven't changed ldrImage so it's basically the previewsRenderLDR
|
||||
BlitParameters blitParms;
|
||||
blitParms.sourceTexture = ( nvrhi::ITexture* )globalImages->ldrImage->GetTextureID();
|
||||
|
@ -6118,6 +6087,8 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
blitParms.targetViewport = nvrhi::Viewport( renderSystem->GetWidth(), renderSystem->GetHeight() );
|
||||
commonPasses.BlitTexture( commandList, blitParms, &bindingCache );
|
||||
|
||||
// blit envprobe over it for quick review where we are
|
||||
|
||||
blitParms.sourceTexture = ( nvrhi::ITexture* )globalImages->envprobeHDRImage->GetTextureID();
|
||||
blitParms.targetFramebuffer = deviceManager->GetCurrentFramebuffer();
|
||||
blitParms.targetViewport = nvrhi::Viewport( ENVPROBE_CAPTURE_SIZE, ENVPROBE_CAPTURE_SIZE );
|
||||
|
@ -6125,13 +6096,14 @@ void idRenderBackend::DrawViewInternal( const viewDef_t* _viewDef, const int ste
|
|||
}
|
||||
else
|
||||
{
|
||||
// copy LDR result to DX12 / Vulkan swapchain image
|
||||
|
||||
BlitParameters blitParms;
|
||||
blitParms.sourceTexture = ( nvrhi::ITexture* )globalImages->ldrImage->GetTextureID();
|
||||
blitParms.targetFramebuffer = deviceManager->GetCurrentFramebuffer();
|
||||
blitParms.targetViewport = nvrhi::Viewport( renderSystem->GetWidth(), renderSystem->GetHeight() );
|
||||
commonPasses.BlitTexture( commandList, blitParms, &bindingCache );
|
||||
}
|
||||
#endif
|
||||
|
||||
renderLog.CloseBlock();
|
||||
}
|
||||
|
|
|
@ -34,17 +34,14 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "RenderLog.h"
|
||||
|
||||
#if defined(USE_NVRHI)
|
||||
#include "Passes/CommonPasses.h"
|
||||
#include "Passes/MipMapGenPass.h"
|
||||
#include "Passes/FowardShadingPass.h"
|
||||
#include "Passes/SsaoPass.h"
|
||||
#include "Passes/TonemapPass.h"
|
||||
#include "Passes/TemporalAntiAliasingPass.h"
|
||||
#include "Passes/CommonPasses.h"
|
||||
#include "Passes/MipMapGenPass.h"
|
||||
#include "Passes/FowardShadingPass.h"
|
||||
#include "Passes/SsaoPass.h"
|
||||
#include "Passes/TonemapPass.h"
|
||||
#include "Passes/TemporalAntiAliasingPass.h"
|
||||
|
||||
#include "PipelineCache.h"
|
||||
|
||||
#endif
|
||||
#include "PipelineCache.h"
|
||||
|
||||
|
||||
#if USE_OPTICK
|
||||
|
|
|
@ -1008,9 +1008,7 @@ public:
|
|||
public:
|
||||
// renderer globals
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
nvrhi::CommandListHandle commandList;
|
||||
#endif
|
||||
|
||||
bool registered; // cleared at shutdown, set at InitOpenGL
|
||||
|
||||
|
@ -1104,9 +1102,7 @@ extern idCVar r_windowWidth;
|
|||
extern idCVar r_windowHeight;
|
||||
|
||||
extern idCVar r_debugContext; // enable various levels of context debug
|
||||
#if defined(USE_NVRHI)
|
||||
extern idCVar r_useValidationLayers;
|
||||
#endif
|
||||
extern idCVar r_useValidationLayers;
|
||||
extern idCVar r_skipAMDWorkarounds; // skip work arounds for AMD driver bugs
|
||||
extern idCVar r_skipIntelWorkarounds; // skip work arounds for Intel driver bugs
|
||||
extern idCVar r_vidMode; // video mode number
|
||||
|
@ -1399,10 +1395,6 @@ struct glimpParms_t
|
|||
// Helper function for using SDL2 and Vulkan on Linux.
|
||||
std::vector<const char*> get_required_extensions();
|
||||
|
||||
#if !defined( USE_NVRHI )
|
||||
extern vulkanContext_t vkcontext;
|
||||
#endif
|
||||
|
||||
// DG: R_GetModeListForDisplay is called before GLimp_Init(), but SDL needs SDL_Init() first.
|
||||
// So add PreInit for platforms that need it, others can just stub it.
|
||||
void VKimp_PreInit();
|
||||
|
|
|
@ -268,7 +268,6 @@ struct shaderMacro_t
|
|||
{ }
|
||||
};
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
struct programInfo_t
|
||||
{
|
||||
int bindingLayoutType;
|
||||
|
@ -278,7 +277,6 @@ struct programInfo_t
|
|||
nvrhi::InputLayoutHandle inputLayout;
|
||||
idStaticList<nvrhi::BindingLayoutHandle, nvrhi::c_MaxBindingLayouts>* bindingLayouts;
|
||||
};
|
||||
#endif
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -1160,15 +1160,12 @@ bool idRenderSystemLocal::UploadImage( const char* imageName, const byte* data,
|
|||
return false;
|
||||
}
|
||||
|
||||
#if defined(USE_NVRHI)
|
||||
commandList->open();
|
||||
#endif
|
||||
|
||||
image->UploadScratch( data, width, height, commandList );
|
||||
|
||||
#if defined(USE_NVRHI)
|
||||
commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -36,9 +36,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "RenderCommon.h"
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include "sys/DeviceManager.h"
|
||||
#endif
|
||||
#include "sys/DeviceManager.h"
|
||||
|
||||
// RB begin
|
||||
#if defined(_WIN32)
|
||||
|
@ -65,15 +63,15 @@ glconfig_t glConfig;
|
|||
|
||||
idCVar r_requestStereoPixelFormat( "r_requestStereoPixelFormat", "1", CVAR_RENDERER, "Ask for a stereo GL pixel format on startup" );
|
||||
idCVar r_debugContext( "r_debugContext", "0", CVAR_RENDERER, "Enable various levels of context debug." );
|
||||
#if defined( USE_NVRHI )
|
||||
#if defined( _WIN32 )
|
||||
idCVar r_graphicsAPI( "r_graphicsAPI", "dx12", CVAR_RENDERER | CVAR_INIT | CVAR_ARCHIVE, "Specifies the graphics api to use (dx12, vulkan)" );
|
||||
#else
|
||||
idCVar r_graphicsAPI( "r_graphicsAPI", "vulkan", CVAR_RENDERER | CVAR_ROM | CVAR_STATIC, "Specifies the graphics api to use (vulkan)" );
|
||||
#endif
|
||||
|
||||
idCVar r_useValidationLayers( "r_useValidationLayers", "1", CVAR_INTEGER | CVAR_INIT, "1 is just the NVRHI and 2 will turn on additional DX12, VK validation layers" );
|
||||
#if defined( _WIN32 )
|
||||
idCVar r_graphicsAPI( "r_graphicsAPI", "dx12", CVAR_RENDERER | CVAR_INIT | CVAR_ARCHIVE, "Specifies the graphics api to use (dx12, vulkan)" );
|
||||
#else
|
||||
idCVar r_graphicsAPI( "r_graphicsAPI", "vulkan", CVAR_RENDERER | CVAR_ROM | CVAR_STATIC, "Specifies the graphics api to use (vulkan)" );
|
||||
#endif
|
||||
|
||||
idCVar r_useValidationLayers( "r_useValidationLayers", "1", CVAR_INTEGER | CVAR_INIT, "1 is just the NVRHI and 2 will turn on additional DX12, VK validation layers" );
|
||||
|
||||
// SRS - Added workaround for AMD OSX driver bugs caused by GL_EXT_timer_query when shadow mapping enabled; Intel bugs not present on OSX
|
||||
#if defined(__APPLE__)
|
||||
idCVar r_skipIntelWorkarounds( "r_skipIntelWorkarounds", "1", CVAR_RENDERER | CVAR_BOOL, "skip workarounds for Intel driver bugs" );
|
||||
|
@ -324,9 +322,7 @@ const char* fileExten[4] = { "tga", "png", "jpg", "exr" };
|
|||
const char* envDirection[6] = { "_px", "_nx", "_py", "_ny", "_pz", "_nz" };
|
||||
const char* skyDirection[6] = { "_forward", "_back", "_left", "_right", "_up", "_down" };
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
DeviceManager* deviceManager;
|
||||
#endif
|
||||
DeviceManager* deviceManager;
|
||||
|
||||
|
||||
bool R_UseTemporalAA()
|
||||
|
@ -485,7 +481,6 @@ void R_SetNewMode( const bool fullInit )
|
|||
{
|
||||
// create the context as well as setting up the window
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
nvrhi::GraphicsAPI api = nvrhi::GraphicsAPI::D3D12;
|
||||
if( !idStr::Icmp( r_graphicsAPI.GetString(), "vulkan" ) )
|
||||
{
|
||||
|
@ -496,7 +491,6 @@ void R_SetNewMode( const bool fullInit )
|
|||
api = nvrhi::GraphicsAPI::D3D12;
|
||||
}
|
||||
deviceManager = DeviceManager::Create( api );
|
||||
#endif
|
||||
|
||||
#if defined( VULKAN_USE_PLATFORM_SDL )
|
||||
if( VKimp_Init( parms ) )
|
||||
|
@ -576,19 +570,14 @@ static void R_ReloadSurface_f( const idCmdArgs& args )
|
|||
// reload the decl
|
||||
mt.material->base->Reload();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
nvrhi::CommandListHandle commandList = deviceManager->GetDevice()->createCommandList();
|
||||
|
||||
commandList->open();
|
||||
#endif
|
||||
|
||||
// reload any images used by the decl
|
||||
mt.material->ReloadImages( false, commandList );
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2241,9 +2230,7 @@ void idRenderSystemLocal::Shutdown()
|
|||
|
||||
Clear();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList.Reset();
|
||||
#endif
|
||||
|
||||
ShutdownOpenGL();
|
||||
|
||||
|
@ -2290,10 +2277,8 @@ void idRenderSystemLocal::LoadLevelImages()
|
|||
{
|
||||
globalImages->LoadLevelImages( false );
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
deviceManager->GetDevice()->waitForIdle();
|
||||
deviceManager->GetDevice()->runGarbageCollection();
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -33,10 +33,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "RenderCommon.h"
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
/*
|
||||
===================
|
||||
|
@ -1983,9 +1981,7 @@ void idRenderWorldLocal::GenerateAllInteractions()
|
|||
int size = interactionTableWidth * interactionTableHeight * sizeof( *interactionTable );
|
||||
interactionTable = ( idInteraction** )R_ClearedStaticAlloc( size );
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
tr.commandList->open();
|
||||
#endif
|
||||
|
||||
// iterate through all lights
|
||||
int count = 0;
|
||||
|
@ -2040,10 +2036,8 @@ void idRenderWorldLocal::GenerateAllInteractions()
|
|||
session->Pump();
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
tr.commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( tr.commandList );
|
||||
#endif
|
||||
|
||||
int end = Sys_Milliseconds();
|
||||
int msec = end - start;
|
||||
|
|
|
@ -37,10 +37,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "CmdlineProgressbar.h"
|
||||
#include "../framework/Common_local.h" // commonLocal.WaitGameThread();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
/*
|
||||
=============
|
||||
|
@ -1127,11 +1125,8 @@ CONSOLE_COMMAND( bakeEnvironmentProbes, "Bake environment probes", NULL )
|
|||
|
||||
int totalEnd = Sys_Milliseconds();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
nvrhi::CommandListHandle commandList = deviceManager->GetDevice()->createCommandList();
|
||||
|
||||
commandList->open();
|
||||
#endif
|
||||
|
||||
//--------------------------------------------
|
||||
// LOAD CONVOLVED OCTAHEDRONS INTO THE GPU
|
||||
|
@ -1148,10 +1143,8 @@ CONSOLE_COMMAND( bakeEnvironmentProbes, "Bake environment probes", NULL )
|
|||
def->radianceImage->Reload( true, commandList );
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList->close();
|
||||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
#endif
|
||||
|
||||
idLib::Printf( "----------------------------------\n" );
|
||||
idLib::Printf( "Processed %i light probes\n", totalProcessedProbes );
|
||||
|
|
|
@ -35,10 +35,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
#include "CmdlineProgressbar.h"
|
||||
#include "../framework/Common_local.h" // commonLocal.WaitGameThread();
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
#endif
|
||||
#include <sys/DeviceManager.h>
|
||||
extern DeviceManager* deviceManager;
|
||||
|
||||
|
||||
#define LGRID_FILE_EXT "lightgrid"
|
||||
|
@ -419,11 +417,8 @@ void idRenderWorldLocal::LoadLightGridImages()
|
|||
|
||||
idStr filename;
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
nvrhi::CommandListHandle commandList = deviceManager->GetDevice()->createCommandList();
|
||||
|
||||
commandList->open();
|
||||
#endif
|
||||
|
||||
// try to load existing lightgrid image data
|
||||
for( int i = 0; i < numPortalAreas; i++ )
|
||||
|
@ -441,11 +436,8 @@ void idRenderWorldLocal::LoadLightGridImages()
|
|||
}
|
||||
}
|
||||
|
||||
#if defined( USE_NVRHI )
|
||||
commandList->close();
|
||||
|
||||
deviceManager->GetDevice()->executeCommandList( commandList );
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue