mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-15 07:00:58 +00:00
Fixed some depth bias pipeline problems
This commit is contained in:
parent
e692c5f8f4
commit
e281cceb94
2 changed files with 3 additions and 33 deletions
|
@ -3648,14 +3648,8 @@ int idRenderBackend::DrawShaderPasses( const drawSurf_t* const* const drawSurfs,
|
|||
|
||||
if( shader->TestMaterialFlag( MF_POLYGONOFFSET ) )
|
||||
{
|
||||
surfGLState = GLS_POLYGON_OFFSET;
|
||||
|
||||
// RB: make sure the pipeline of the current shader has dynamic polygon offset enabled
|
||||
//renderProgManager.CommitUniforms( surfGLState );
|
||||
|
||||
#if !defined( USE_VULKAN )
|
||||
GL_PolygonOffset( r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat() * shader->GetPolygonOffset() );
|
||||
#endif
|
||||
surfGLState = GLS_POLYGON_OFFSET;
|
||||
}
|
||||
|
||||
for( int stage = 0; stage < shader->GetNumStages(); stage++ )
|
||||
|
@ -3686,7 +3680,6 @@ int idRenderBackend::DrawShaderPasses( const drawSurf_t* const* const drawSurfs,
|
|||
continue;
|
||||
}
|
||||
|
||||
|
||||
// see if we are a new-style stage
|
||||
newShaderStage_t* newStage = pStage->newStage;
|
||||
if( newStage != NULL )
|
||||
|
@ -3856,6 +3849,7 @@ int idRenderBackend::DrawShaderPasses( const drawSurf_t* const* const drawSurfs,
|
|||
// bind the texture
|
||||
BindVariableStageImage( &pStage->texture, regs );
|
||||
|
||||
// set privatePolygonOffset if necessary
|
||||
if( pStage->privatePolygonOffset )
|
||||
{
|
||||
stageGLState |= GLS_POLYGON_OFFSET;
|
||||
|
@ -3864,29 +3858,6 @@ int idRenderBackend::DrawShaderPasses( const drawSurf_t* const* const drawSurfs,
|
|||
// set the state
|
||||
GL_State( stageGLState );
|
||||
|
||||
// set privatePolygonOffset if necessary
|
||||
#if defined( USE_VULKAN )
|
||||
if( shader->TestMaterialFlag( MF_POLYGONOFFSET ) || pStage->privatePolygonOffset )
|
||||
{
|
||||
// RB: make sure the pipeline of the current shader has dynamic polygon offset enabled
|
||||
renderProgManager.CommitUniforms( stageGLState );
|
||||
|
||||
if( shader->TestMaterialFlag( MF_POLYGONOFFSET ) )
|
||||
{
|
||||
GL_PolygonOffset( r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat() * shader->GetPolygonOffset() );
|
||||
}
|
||||
else
|
||||
{
|
||||
GL_PolygonOffset( r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat() * pStage->privatePolygonOffset );
|
||||
}
|
||||
}
|
||||
#else
|
||||
if( pStage->privatePolygonOffset )
|
||||
{
|
||||
GL_PolygonOffset( r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat() * pStage->privatePolygonOffset );
|
||||
}
|
||||
#endif
|
||||
|
||||
PrepareStageTexturing( pStage, surf );
|
||||
|
||||
// draw it
|
||||
|
@ -3899,7 +3870,6 @@ int idRenderBackend::DrawShaderPasses( const drawSurf_t* const* const drawSurfs,
|
|||
{
|
||||
GL_PolygonOffset( r_offsetFactor.GetFloat(), r_offsetUnits.GetFloat() * shader->GetPolygonOffset() );
|
||||
}
|
||||
|
||||
renderLog.CloseBlock();
|
||||
}
|
||||
|
||||
|
|
|
@ -1302,7 +1302,7 @@ static VkPipeline CreateGraphicsPipeline(
|
|||
dynamic.Append( VK_DYNAMIC_STATE_SCISSOR );
|
||||
dynamic.Append( VK_DYNAMIC_STATE_VIEWPORT );
|
||||
|
||||
if( stateBits & GLS_POLYGON_OFFSET )
|
||||
//if( stateBits & GLS_POLYGON_OFFSET )
|
||||
{
|
||||
dynamic.Append( VK_DYNAMIC_STATE_DEPTH_BIAS );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue