mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Outcommented unused renderpasses
This commit is contained in:
parent
8f97eb6973
commit
52d20500d7
9 changed files with 33 additions and 49 deletions
|
@ -39,6 +39,7 @@ nvrhi::BindingSetHandle BindingCache::GetCachedBindingSet( const nvrhi::BindingS
|
|||
|
||||
nvrhi::BindingSetHandle BindingCache::GetOrCreateBindingSet( const nvrhi::BindingSetDesc& desc, nvrhi::IBindingLayout* layout )
|
||||
{
|
||||
#if 1
|
||||
size_t hash = 0;
|
||||
nvrhi::hash_combine( hash, desc );
|
||||
nvrhi::hash_combine( hash, layout );
|
||||
|
@ -60,27 +61,6 @@ nvrhi::BindingSetHandle BindingCache::GetOrCreateBindingSet( const nvrhi::Bindin
|
|||
|
||||
if( !result )
|
||||
{
|
||||
/*
|
||||
mutex.Lock();
|
||||
|
||||
int entryIndex = bindingSets.Append( result );
|
||||
bindingHash.Add( hash, entryIndex );
|
||||
|
||||
nvrhi::BindingSetHandle& entry = bindingSets[entryIndex];
|
||||
|
||||
if( !entry )
|
||||
{
|
||||
result = device->createBindingSet( desc, layout );
|
||||
entry = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = entry;
|
||||
}
|
||||
|
||||
mutex.Unlock();
|
||||
*/
|
||||
|
||||
mutex.Lock();
|
||||
|
||||
result = device->createBindingSet( desc, layout );
|
||||
|
@ -97,6 +77,9 @@ nvrhi::BindingSetHandle BindingCache::GetOrCreateBindingSet( const nvrhi::Bindin
|
|||
}
|
||||
|
||||
return result;
|
||||
#else
|
||||
return device->createBindingSet( desc, layout );
|
||||
#endif
|
||||
}
|
||||
|
||||
void BindingCache::Clear()
|
||||
|
@ -122,6 +105,7 @@ void SamplerCache::Clear()
|
|||
|
||||
nvrhi::SamplerHandle SamplerCache::GetOrCreateSampler( nvrhi::SamplerDesc desc )
|
||||
{
|
||||
#if 1
|
||||
size_t hash = std::hash<nvrhi::SamplerDesc> {}( desc );
|
||||
|
||||
mutex.Lock();
|
||||
|
@ -141,27 +125,6 @@ nvrhi::SamplerHandle SamplerCache::GetOrCreateSampler( nvrhi::SamplerDesc desc )
|
|||
|
||||
if( !result )
|
||||
{
|
||||
/*
|
||||
mutex.Lock();
|
||||
|
||||
int entryIndex = samplers.Append( result );
|
||||
samplerHash.Add( hash, entryIndex );
|
||||
|
||||
nvrhi::SamplerHandle& entry = samplers[entryIndex];
|
||||
|
||||
if( !entry )
|
||||
{
|
||||
result = device->createSampler( desc );
|
||||
entry = result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = entry;
|
||||
}
|
||||
|
||||
mutex.Unlock();
|
||||
*/
|
||||
|
||||
mutex.Lock();
|
||||
|
||||
result = device->createSampler( desc );
|
||||
|
@ -178,4 +141,7 @@ nvrhi::SamplerHandle SamplerCache::GetOrCreateSampler( nvrhi::SamplerDesc desc )
|
|||
}
|
||||
|
||||
return result;
|
||||
#else
|
||||
return device->createSampler( desc );
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -546,7 +546,7 @@ void idRenderBackend::Init()
|
|||
commonPasses.Init( deviceManager->GetDevice() );
|
||||
hiZGenPass = nullptr;
|
||||
ssaoPass = nullptr;
|
||||
fowardShadingPass.Init( deviceManager->GetDevice() );
|
||||
//fowardShadingPass.Init( deviceManager->GetDevice() );
|
||||
|
||||
tr.SetInitialized();
|
||||
|
||||
|
@ -746,15 +746,15 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
common->FatalError( "Invalid binding set %d\n", renderProgManager.BindingLayoutType() );
|
||||
}
|
||||
|
||||
int bindingLayoutType = renderProgManager.BindingLayoutType();
|
||||
currentBindingSet = bindingCache.GetOrCreateBindingSet( bindingSetDesc, renderProgManager.BindingLayout() );
|
||||
//int bindingLayoutType = renderProgManager.BindingLayoutType();
|
||||
nvrhi::BindingSetHandle sourceBindingSet = bindingCache.GetOrCreateBindingSet( bindingSetDesc, renderProgManager.BindingLayout() );
|
||||
renderProgManager.CommitConstantBuffer( commandList );
|
||||
|
||||
PipelineKey key{ glStateBits, renderProgManager.CurrentProgram(), viewDef->isMirror, depthBias, slopeScaleBias, currentFrameBuffer };
|
||||
auto pipeline = pipelineCache.GetOrCreatePipeline( key );
|
||||
|
||||
nvrhi::GraphicsState state;
|
||||
state.bindings = { currentBindingSet };
|
||||
state.bindings = { sourceBindingSet };
|
||||
state.indexBuffer = { currentIndexBuffer, nvrhi::Format::R16_UINT, indexOffset };
|
||||
state.vertexBuffers = { { currentVertexBuffer, 0, vertOffset } };
|
||||
state.pipeline = pipeline;
|
||||
|
|
|
@ -34,6 +34,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "FowardShadingPass.h"
|
||||
|
||||
#if 0
|
||||
|
||||
/*
|
||||
same as D3DXMatrixOrthoOffCenterRH
|
||||
|
||||
|
@ -853,3 +855,5 @@ void ForwardShadingPass::SetupInputBuffers( const drawSurf_t* surf, nvrhi::Graph
|
|||
void ForwardShadingPass::SetPushConstants( nvrhi::ICommandList* commandList, nvrhi::GraphicsState& state, nvrhi::DrawArguments& args )
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
|
@ -30,6 +30,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "GeometryPasses.h"
|
||||
|
||||
#if 0
|
||||
class ForwardShadingPass : IGeometryPass
|
||||
{
|
||||
public:
|
||||
|
@ -64,5 +65,6 @@ private:
|
|||
idRenderMatrix shadowV[6]; // shadow depth view matrix
|
||||
idRenderMatrix shadowP[6]; // shadow depth projection matrix
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -32,6 +32,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "GBufferFillPass.h"
|
||||
|
||||
#if 0
|
||||
|
||||
void GBufferFillPass::Init( nvrhi::DeviceHandle deviceHandle )
|
||||
{
|
||||
}
|
||||
|
@ -681,3 +683,5 @@ void GBufferFillPass::SetupInputBuffers( const drawSurf_t* drawSurf, nvrhi::Grap
|
|||
void GBufferFillPass::SetPushConstants( nvrhi::ICommandList* commandList, nvrhi::GraphicsState& state, nvrhi::DrawArguments& args )
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
|
@ -30,6 +30,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "GeometryPasses.h"
|
||||
|
||||
#if 0
|
||||
|
||||
// "Light" G-Buffer that renders the normals of the geometry
|
||||
class GBufferFillPass : IGeometryPass
|
||||
{
|
||||
|
@ -61,4 +63,6 @@ public:
|
|||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -34,7 +34,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
#include "nvrhi/utils.h"
|
||||
|
||||
|
||||
#if 0
|
||||
static ID_INLINE void SetVertexParm( renderParm_t rp, const float* value )
|
||||
{
|
||||
renderProgManager.SetUniformValue( rp, value );
|
||||
|
@ -802,3 +802,4 @@ void IGeometryPass::GL_ClearDepthStencil( nvrhi::ICommandList* commandList )
|
|||
{
|
||||
nvrhi::utils::ClearDepthStencilAttachment( commandList, currentFramebuffer->GetApiObject( ), depthClearValue, stencilClearValue );
|
||||
}
|
||||
#endif
|
|
@ -31,6 +31,8 @@ If you have questions concerning this license or the applicable additional terms
|
|||
|
||||
constexpr std::size_t MAX_IMAGE_PARMS = 16;
|
||||
|
||||
#if 0
|
||||
|
||||
class IGeometryPass
|
||||
{
|
||||
public:
|
||||
|
@ -92,5 +94,6 @@ protected:
|
|||
GL_Scissor( x, y, w, h );
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -502,7 +502,7 @@ private:
|
|||
int currentVertexOffset;
|
||||
nvrhi::BufferHandle currentIndexBuffer;
|
||||
int currentIndexOffset;
|
||||
nvrhi::BindingSetHandle currentBindingSet;
|
||||
//nvrhi::BindingSetHandle currentBindingSet;
|
||||
nvrhi::BindingLayoutHandle currentBindingLayout;
|
||||
nvrhi::GraphicsPipelineHandle currentPipeline;
|
||||
nvrhi::RenderState currentRenderState;
|
||||
|
@ -516,7 +516,7 @@ private:
|
|||
MipMapGenPass* hiZGenPass;
|
||||
TonemapPass toneMapPass;
|
||||
|
||||
ForwardShadingPass fowardShadingPass;
|
||||
//ForwardShadingPass fowardShadingPass;
|
||||
|
||||
BindingCache bindingCache;
|
||||
SamplerCache samplerCache;
|
||||
|
|
Loading…
Reference in a new issue