Rasagar/Library/PackageCache/com.unity.render-pipelines.core/ShaderLibrary/DynamicScaling.hlsl

18 lines
627 B
HLSL
Raw Normal View History

2024-08-26 13:07:20 -07:00
#ifndef UNITY_DYNAMIC_SCALING_INCLUDED
#define UNITY_DYNAMIC_SCALING_INCLUDED
float2 DynamicScalingApplyScaleBias(float2 xy, float4 dynamicScalingScaleBias)
{
return dynamicScalingScaleBias.zw + xy * dynamicScalingScaleBias.xy;
}
float2 DynamicScalingRemoveScaleBias(float2 xy, float4 dynamicScalingScaleBias)
{
return (xy - dynamicScalingScaleBias.zw) / dynamicScalingScaleBias.xy;
}
#define DYNAMIC_SCALING_APPLY_SCALEBIAS(uv) DynamicScalingApplyScaleBias(uv, _BlitScaleBias)
#define DYNAMIC_SCALING_REMOVE_SCALEBIAS(uv) DynamicScalingRemoveScaleBias(uv, _BlitScaleBias)
#endif // UNITY_DYNAMIC_SCALING_INCLUDED