mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Fixed failed PSO bug with blend lights
This commit is contained in:
parent
ef72010b01
commit
592d587228
7 changed files with 47 additions and 10 deletions
|
@ -40,7 +40,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// RB: changed home folder so we don't break the savegame of the original game
|
||||
#define SAVE_PATH "\\id Software\\RBDOOM 3 BFG"
|
||||
|
||||
#define ENGINE_VERSION "RBDOOM 3 BFG 1.4.0" // printed in console
|
||||
#define ENGINE_VERSION "RBDOOM 3 BFG 1.5.0" // printed in console
|
||||
// RB end
|
||||
|
||||
// jmarshall
|
||||
|
|
|
@ -684,6 +684,36 @@ void idRenderBackend::GetCurrentBindingLayout( int type )
|
|||
desc[1].bindings[0].resourceHandle = commonPasses.m_LinearWrapSampler;
|
||||
}
|
||||
}
|
||||
else if( type == BINDING_LAYOUT_BLENDLIGHT )
|
||||
{
|
||||
if( desc[0].bindings.empty() )
|
||||
{
|
||||
desc[0].bindings =
|
||||
{
|
||||
nvrhi::BindingSetItem::ConstantBuffer( 0, renderProgManager.ConstantBuffer() ),
|
||||
nvrhi::BindingSetItem::Texture_SRV( 0, ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID() ),
|
||||
nvrhi::BindingSetItem::Texture_SRV( 1, ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID() )
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
desc[0].bindings[0].resourceHandle = renderProgManager.ConstantBuffer();
|
||||
desc[0].bindings[1].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 0 )->GetTextureID();
|
||||
desc[0].bindings[2].resourceHandle = ( nvrhi::ITexture* )GetImageAt( 1 )->GetTextureID();
|
||||
}
|
||||
|
||||
if( desc[1].bindings.empty() )
|
||||
{
|
||||
desc[1].bindings =
|
||||
{
|
||||
nvrhi::BindingSetItem::Sampler( 0, commonPasses.m_LinearBorderSampler )
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
desc[1].bindings[0].resourceHandle = commonPasses.m_LinearBorderSampler;
|
||||
}
|
||||
}
|
||||
else if( type == BINDING_LAYOUT_TAA_MOTION_VECTORS )
|
||||
{
|
||||
if( desc[0].bindings.empty() )
|
||||
|
|
|
@ -864,6 +864,7 @@ enum bindingLayoutType_t
|
|||
BINDING_LAYOUT_DRAW_FOG,
|
||||
BINDING_LAYOUT_POST_PROCESS_CNM,
|
||||
BINDING_LAYOUT_NORMAL_CUBE,
|
||||
BINDING_LAYOUT_BLENDLIGHT,
|
||||
|
||||
// NVRHI render passes specific
|
||||
BINDING_LAYOUT_TAA_MOTION_VECTORS,
|
||||
|
|
|
@ -300,6 +300,14 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
|
|||
|
||||
bindingLayouts[BINDING_LAYOUT_NORMAL_CUBE] = { device->createBindingLayout( normalCubeBindingLayout ), samplerOneBindingLayout };
|
||||
|
||||
auto blendLightBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 0 ) ) // light 1
|
||||
.addItem( nvrhi::BindingLayoutItem::Texture_SRV( 1 ) ); // light 2
|
||||
|
||||
bindingLayouts[BINDING_LAYOUT_BLENDLIGHT] = { device->createBindingLayout( blendLightBindingLayout ), samplerOneBindingLayout };
|
||||
|
||||
auto motionVectorsBindingLayout = nvrhi::BindingLayoutDesc()
|
||||
.setVisibility( nvrhi::ShaderType::All )
|
||||
.addItem( nvrhi::BindingLayoutItem::VolatileConstantBuffer( 0 ) )
|
||||
|
@ -454,7 +462,7 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
|
|||
{ BUILTIN_SHADOW_DEBUG, "builtin/debug/shadowDebug", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_SHADOW_DEBUG_SKINNED, "builtin/debug/shadowDebug", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
|
||||
{ BUILTIN_BLENDLIGHT, "builtin/fog/blendlight", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
{ BUILTIN_BLENDLIGHT, "builtin/fog/blendlight", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_BLENDLIGHT },
|
||||
{ BUILTIN_FOG, "builtin/fog/fog", "", { {"USE_GPU_SKINNING", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_FOG },
|
||||
{ BUILTIN_FOG_SKINNED, "builtin/fog/fog", "_skinned", { {"USE_GPU_SKINNING", "1" } }, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DRAW_FOG },
|
||||
{ BUILTIN_SKYBOX, "builtin/legacy/skybox", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
|
@ -472,7 +480,6 @@ void idRenderProgManager::Init( nvrhi::IDevice* _device )
|
|||
{ BUILTIN_SMAA_NEIGHBORHOOD_BLENDING, "builtin/post/SMAA_final", "", {}, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_DEFAULT },
|
||||
|
||||
{ BUILTIN_MOTION_BLUR, "builtin/post/motionBlur", "_vectors", { { "VECTORS_ONLY", "1" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT, BINDING_LAYOUT_TAA_MOTION_VECTORS },
|
||||
//{ BUILTIN_TAA_MOTION_VECTORS, "builtin/post/motion_vectors", "", { { "USE_STENCIL", "0" }, { "QUAD_Z", "0" } }, false, SHADER_STAGE_DEFAULT, LAYOUT_UNKNOWN, BINDING_LAYOUT_TAA_MOTION_VECTORS },
|
||||
{ BUILTIN_TAA_RESOLVE, "builtin/post/taa", "", { { "SAMPLE_COUNT", "1" }, { "USE_CATMULL_ROM_FILTER", "1" } }, false, SHADER_STAGE_COMPUTE, LAYOUT_UNKNOWN, BINDING_LAYOUT_TAA_RESOLVE },
|
||||
{ BUILTIN_TAA_RESOLVE_MSAA_2X, "builtin/post/taa", "_msaa2x", { { "SAMPLE_COUNT", "2" }, { "USE_CATMULL_ROM_FILTER", "1" } }, false, SHADER_STAGE_COMPUTE, LAYOUT_UNKNOWN, BINDING_LAYOUT_TAA_RESOLVE },
|
||||
{ BUILTIN_TAA_RESOLVE_MSAA_4X, "builtin/post/taa", "_msaa4x", { { "SAMPLE_COUNT", "4" }, { "USE_CATMULL_ROM_FILTER", "1" } }, false, SHADER_STAGE_COMPUTE, LAYOUT_UNKNOWN, BINDING_LAYOUT_TAA_RESOLVE },
|
||||
|
|
|
@ -33,8 +33,7 @@ If you have questions concerning this license or the applicable additional terms
|
|||
// *INDENT-OFF*
|
||||
Texture2D t_Light1 : register( t0 VK_DESCRIPTOR_SET( 0 ) );
|
||||
Texture2D t_Light2 : register( t1 VK_DESCRIPTOR_SET( 0 ) );
|
||||
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 1 ) );
|
||||
SamplerState samp1 : register( s1 VK_DESCRIPTOR_SET( 1 ) );
|
||||
SamplerState s_LinearClamp : register( s0 VK_DESCRIPTOR_SET( 1 ) );
|
||||
|
||||
struct PS_IN {
|
||||
float4 position : SV_Position;
|
||||
|
@ -49,7 +48,7 @@ struct PS_OUT {
|
|||
|
||||
void main( PS_IN fragment, out PS_OUT result )
|
||||
{
|
||||
float4 c = idtex2Dproj( samp0, t_Light1, fragment.texcoord0 ) * t_Light2.Sample( samp1, fragment.texcoord1 ) * rpColor;
|
||||
float4 c = idtex2Dproj( s_LinearClamp, t_Light1, fragment.texcoord0 ) * t_Light2.Sample( s_LinearClamp, fragment.texcoord1 ) * rpColor;
|
||||
|
||||
result.color = sRGBAToLinearRGBA( c );
|
||||
}
|
||||
|
|
|
@ -35,14 +35,13 @@ struct VS_IN {
|
|||
float2 texcoord : TEXCOORD0;
|
||||
float4 normal : NORMAL;
|
||||
float4 tangent : TANGENT;
|
||||
float4 binormal : BINORMAL;
|
||||
float4 color : COLOR0;
|
||||
};
|
||||
|
||||
struct VS_OUT {
|
||||
float4 position : SV_Position;
|
||||
float4 texcoord0 : TEXCOORD0;
|
||||
float2 texcoord1 : TEXCOORD1;
|
||||
float4 texcoord0 : TEXCOORD0_centroid;
|
||||
float2 texcoord1 : TEXCOORD1_centroid;
|
||||
};
|
||||
// *INDENT-ON*
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
REM 7z a RBDOOM-3-BFG-1.3.1.1-lite-win64-20220109-git-xxxxxxx.7z -r base/env/ base/maps/*.lightgrid base/maps/*_extra_ents.map -x!generated
|
||||
set filename=RBDOOM-3-BFG-1.4.0.9-lite-win64-20220306-git-xxxxxxx.7z
|
||||
set filename=RBDOOM-3-BFG-1.5.0.1-lite-win64-20220529-git-xxxxxxx.7z
|
||||
7z a %filename% README.md RELEASE-NOTES.md base/devtools.cfg base/modelviewer.cfg base/extract_resources.cfg base/convert_maps_to_valve220.cfg base/def/*.def base/materials/*.mtr base/textures/common base/textures/editor base/maps/zoomaps -x!generated -xr!autosave -xr!*.xcf -xr!*.blend
|
||||
7z a %filename% README.md RELEASE-NOTES.md base/renderprogs2/dxil/*.bin
|
||||
7z a %filename% README.md RELEASE-NOTES.md base/_tb/fgd/*.fgd
|
||||
7z a %filename% README.md RELEASE-NOTES.md tools/trenchbroom -xr!TrenchBroom-nomanual* -xr!TrenchBroom.pdb
|
||||
pause
|
||||
|
|
Loading…
Reference in a new issue