Outcommented unused renderpasses

This commit is contained in:
Robert Beckebans 2022-03-12 10:14:05 +01:00
parent 8f97eb6973
commit 52d20500d7
9 changed files with 33 additions and 49 deletions

View file

@ -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
}

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;