More shader syncing with SP branch

This commit is contained in:
Robert Beckebans 2022-06-04 11:14:48 +02:00
parent a97c92b6a5
commit 987085a247
13 changed files with 39 additions and 35 deletions

View file

@ -31,10 +31,10 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
TextureCube t_CubeMap : register(t0);
Texture2D t_NormalMap : register(t1);
TextureCube t_CubeMap : register(t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_NormalMap : register(t1 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register(s0); // texture 0 is the cube map
SamplerState samp0 : register(s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is the cube map
struct PS_IN {
float4 position : SV_Position;

View file

@ -28,15 +28,13 @@ If you have questions concerning this license or the applicable additional terms
#include "global_inc.hlsl"
// *INDENT-OFF*
#if USE_GPU_SKINNING
cbuffer CB :
register( b1 )
{
cbuffer CB : register( b1 VK_DESCRIPTOR_SET( 0 )) {
float4 matrices[408];
};
#endif
// *INDENT-OFF*
struct VS_IN {
float4 position : POSITION;
float2 texcoord : TEXCOORD0;
@ -178,4 +176,4 @@ void main( VS_IN vertex, out VS_OUT result )
#endif
result.color = rpColor;
}
}

View file

@ -30,8 +30,8 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
TextureCube t_CubeMap : register( t0 );
SamplerState samp0 : register( s0 ); // texture 0 is the cube map
TextureCube t_CubeMap : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // texture 0 is the cube map
struct PS_IN {
float4 position : SV_Position;

View file

@ -36,10 +36,10 @@ If you have questions concerning this license or the applicable additional terms
#include "SMAA.inc.hlsl"
// *INDENT-OFF*
Texture2D t_CurrentRender : register( t0 );
Texture2D t_PredictColor : register( t1 );
SamplerState samp0 : register( s0 ); // _currentColor
SamplerState samp1 : register( s1 ); // TODO _predictColor
Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_PredictColor : register( t1 VK_DESCRIPTOR_SET( 1 ));
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) ); // _currentColor
SamplerState samp1 : register( s1 VK_DESCRIPTOR_SET( 2 ) ); // TODO _predictColor
struct PS_IN
{

View file

@ -22,6 +22,8 @@
#pragma pack_matrix(row_major)
#include "vulkan.hlsli"
struct ToneMappingConstants
{
uint2 viewOrigin;

View file

@ -30,8 +30,8 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D tex : register( t0 );
SamplerState samp0 : register( s0 );
Texture2D tex : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_Position0;

View file

@ -30,8 +30,8 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D t_BaseColor : register( t0 VK_DESCRIPTOR_SET( 0 ) );
SamplerState s_Sampler : register( s0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_BaseColor : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState s_Sampler : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_POSITION;
@ -49,4 +49,4 @@ void main( in PS_IN fragment, out PS_OUT result )
float4 color = t_BaseColor.Sample( s_Sampler, fragment.texcoord0 ) * fragment.color;
clip( color.a - rpAlphaTest.x );
result.color = sRGBAToLinearRGBA( color );
}
}

View file

@ -46,7 +46,7 @@ struct VS_IN {
};
struct VS_OUT {
float4 position : SV_POSITION;
float4 position : SV_Position;
float2 texcoord0 : TEXCOORD0_centroid;
float4 color : COLOR0;
};
@ -130,4 +130,4 @@ void main( VS_IN vertex, out VS_OUT result )
float4 vertexColor = ( swizzleColor( vertex.color ) * rpVertexColorModulate ) + rpVertexColorAdd;
result.color = vertexColor * rpColor;
}
}

View file

@ -29,11 +29,11 @@ If you have questions concerning this license or the applicable additional terms
#include "global_inc.hlsl"
// *INDENT-OFF*
Texture2D t_Texture : register( t0 );
SamplerState samp0 : register( s0 );
Texture2D t_Texture : register( t0 VK_DESCRIPTOR_SET( 1 ) );
SamplerState samp0 : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : VPOS;
float4 position : SV_Position;
float4 texcoord0 : TEXCOORD0_centroid;
float4 color : COLOR0;
};

View file

@ -30,9 +30,9 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D t_CurrentRender : register( t0 );
Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 0 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 1 ) );
struct PS_IN {
float4 position : SV_Position;

View file

@ -30,10 +30,10 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D t_CurrentRender : register( t0 );
Texture2D t_NormalMap : register( t1 );
Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 1 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ));
struct PS_IN {
float4 position : SV_Position;
@ -60,4 +60,4 @@ void main( PS_IN fragment, out PS_OUT result )
// load the screen render
result.color = t_CurrentRender.Sample( LinearSampler, screenTexCoord );
}
}

View file

@ -31,10 +31,10 @@ If you have questions concerning this license or the applicable additional terms
// *INDENT-OFF*
Texture2D t_CurrentRender : register( t0 );
Texture2D t_NormalMap : register( t1 );
Texture2D t_CurrentRender : register( t0 VK_DESCRIPTOR_SET( 1 ) );
Texture2D t_NormalMap : register( t1 VK_DESCRIPTOR_SET( 1 ) );
SamplerState LinearSampler : register( s0 );
SamplerState LinearSampler : register( s0 VK_DESCRIPTOR_SET( 2 ) );
struct PS_IN {
float4 position : SV_Position;

View file

@ -495,7 +495,8 @@ float3 Hash33( float3 p3 )
return frac( ( p3.xxy + p3.yxx ) * p3.zyx );
}
static float3 ditherRGB( float3 color, float2 uvSeed, float quantSteps )
/*
static float3 DitherRGB( float3 color, float2 uvSeed, float quantSteps )
{
// uniform noise
//float3 noise = Hash33( float3( uvSeed, rpJitterTexOffset.w ) );
@ -529,8 +530,10 @@ static float3 ditherRGB( float3 color, float2 uvSeed, float quantSteps )
return color;
}
*/
static float3 ditherChromaticBlueNoise( float3 color, float2 n, SamplerState blueTex )
/*
static float3 DitherChromaticBlueNoise( float3 color, float2 n, SamplerState blueTex )
{
// uniform noise
//float3 noise = Hash33( float3( n, rpJitterTexOffset.w ) );
@ -563,5 +566,6 @@ static float3 ditherChromaticBlueNoise( float3 color, float2 n, SamplerState blu
return color;
}
*/
#define SMAA_RT_METRICS float4(1.0 / 1280.0, 1.0 / 720.0, 1280.0, 720.0)