This commit is contained in:
Vasily Petrov 2026-06-18 01:18:29 +03:00
commit 2fe6ca2f65
1473 changed files with 251771 additions and 0 deletions

View file

@ -0,0 +1,43 @@
#include "common.hlsli"
#if defined(SM_5) || defined(SM_4_1)
#define SMAA_HLSL_4_1
#else
#define SMAA_HLSL_4
#endif
#define SMAA_INCLUDE_VS 1
uniform float4 scaled_screen_res;
#define SMAA_RT_METRICS scaled_screen_res.zwxy
#include "smaa.hlsli"
// Struct
struct p_smaa
{
float4 hpos : SV_POSITION;
float2 tc0 : TEXCOORD0; // Texture coordinates (for sampling maps)
float4 offset[3] : TEXCOORD1;
};
struct v2p_smaa
{
float2 tc0 : TEXCOORD0;
float4 HPos : POSITIONT; // Clip-space position (for rasterization)
};
// Vertex
p_smaa main(v2p_smaa I)
{
p_smaa O;
// Transform to screen space (in d3d9 it was done automatically)
O.hpos.x = (I.HPos.x * scaled_screen_res.z * 2 - 1);
O.hpos.y = -(I.HPos.y * scaled_screen_res.w * 2 - 1);
O.hpos.zw = I.HPos.zw;
O.tc0 = I.tc0;
SMAAEdgeDetectionVS(I.tc0, O.offset);
return O;
}