Compile shaders to renderprogs2, removed motion_vectors.*.hlsl

This commit is contained in:
Robert Beckebans 2022-05-07 18:57:25 +02:00
parent c6735ce1df
commit 1c4968a873
5 changed files with 3 additions and 140 deletions

View file

@ -121,11 +121,11 @@ void idRenderProgManager::LoadShader( shader_t& shader )
adjustedName.StripFileExtension();
if( deviceManager->GetGraphicsAPI() == nvrhi::GraphicsAPI::D3D12 )
{
adjustedName = idStr( "renderprogs/dxil/" ) + adjustedName + "." + stage + ".bin";
adjustedName = idStr( "renderprogs2/dxil/" ) + adjustedName + "." + stage + ".bin";
}
else if( deviceManager->GetGraphicsAPI() == nvrhi::GraphicsAPI::VULKAN )
{
adjustedName = idStr( "renderprogs/spirv/" ) + adjustedName + "." + stage + ".bin";
adjustedName = idStr( "renderprogs2/spirv/" ) + adjustedName + "." + stage + ".bin";
}
else
{

View file

@ -34,7 +34,7 @@ source_group("user" FILES ${usershaders})
compile_shaders_all_platforms(
TARGET Shaders
CONFIG ${CMAKE_CURRENT_SOURCE_DIR}/shaders.cfg
OUTPUT_BASE ${CMAKE_CURRENT_SOURCE_DIR}/../../base/renderprogs # This path scheme is a bit odd.
OUTPUT_BASE ${CMAKE_CURRENT_SOURCE_DIR}/../../base/renderprogs2 # This path scheme is a bit odd.
SHADER_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
SOURCES ${shaders}
)

View file

@ -1,102 +0,0 @@
/*
* Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma pack_matrix(row_major)
//#include <donut/shaders/taa_cb.h>
struct TemporalAntiAliasingConstants
{
float4x4 reprojectionMatrix;
float2 inputViewOrigin;
float2 inputViewSize;
float2 outputViewOrigin;
float2 outputViewSize;
float2 inputPixelOffset;
float2 outputTextureSizeInv;
float2 inputOverOutputViewSize;
float2 outputOverInputViewSize;
float clampingFactor;
float newFrameWeight;
float pqC;
float invPqC;
uint stencilMask;
};
cbuffer c_TemporalAA :
register( b0 )
{
TemporalAntiAliasingConstants g_TemporalAA;
};
Texture2D<float> t_GBufferDepth :
register( t0 );
#if USE_STENCIL
Texture2D<uint2> t_GBufferStencil :
register( t1 );
#endif
void main(
in float4 i_position : SV_Position,
in float2 i_uv : UV,
out float4 o_color : SV_Target0
)
{
o_color = 0;
#if USE_STENCIL
uint stencil = t_GBufferStencil[i_position.xy].y;
if( ( stencil & g_TemporalAA.stencilMask ) == g_TemporalAA.stencilMask )
{
discard;
}
#endif
float depth = t_GBufferDepth[i_position.xy].x;
float4 clipPos;
clipPos.x = i_uv.x * 2 - 1;
clipPos.y = 1 - i_uv.y * 2;
clipPos.z = depth;
clipPos.w = 1;
float4 prevClipPos = mul( clipPos, g_TemporalAA.reprojectionMatrix );
if( prevClipPos.w <= 0 )
{
return;
}
prevClipPos.xyz /= prevClipPos.w;
float2 prevUV;
prevUV.x = 0.5 + prevClipPos.x * 0.5;
prevUV.y = 0.5 - prevClipPos.y * 0.5;
float2 prevWindowPos = prevUV * g_TemporalAA.inputViewSize + g_TemporalAA.inputViewOrigin;
o_color.xy = prevWindowPos.xy - i_position.xy;
}

View file

@ -1,33 +0,0 @@
/*
* Copyright (c) 2014-2021, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
void main(
in uint iVertex : SV_VertexID,
out float4 o_posClip : SV_Position,
out float2 o_uv : UV )
{
uint u = iVertex & 1;
uint v = ( iVertex >> 1 ) & 1;
o_posClip = float4( float( u ) * 2 - 1, 1 - float( v ) * 2, QUAD_Z, 1 );
o_uv = float2( u, v );
}

View file

@ -74,8 +74,6 @@ builtin/post/exposure.cs.hlsl -T cs_5_0 -D HISTOGRAM_BINS=256
builtin/post/histogram.cs.hlsl -T cs_5_0 -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1}
builtin/post/tonemapping.ps.hlsl -T ps_5_0 -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1} -D QUAD_Z={0,1}
builtin/post/tonemapping.vs.hlsl -T vs_5_0 -D HISTOGRAM_BINS=256 -D SOURCE_ARRAY={0,1} -D QUAD_Z={0,1}
builtin/post/motion_vectors.vs.hlsl -T vs_5_0 -D USE_STENCIL=0 -D QUAD_Z={0,1}
builtin/post/motion_vectors.ps.hlsl -T ps_5_0 -D USE_STENCIL=0 -D QUAD_Z={0,1}
builtin/post/taa.cs.hlsl -T cs_5_0 -D SAMPLE_COUNT={1,2,4,8} -D USE_CATMULL_ROM_FILTER={0,1}
builtin/SSAO/AmbientOcclusion_AO.vs.hlsl -T vs_5_0 -D BRIGHTPASS={0,1}