19#ifndef AVFILTER_VSRC_GFXCAPTURE_SHADER_H
20#define AVFILTER_VSRC_GFXCAPTURE_SHADER_H
22#define HLSL_SHADER(shader) #shader
30 cbuffer
cb :
register(
b0) {
40 Texture2D t0 :
register(t0);
41 SamplerState s0 :
register(s0);
43 VSOut main_vs(uint
id : SV_VertexID) {
45 o.pos =
float4(
id == 2 ? 3.0 : -1.0,
id == 1 ? 3.0 : -1.0, 0, 1);
46 o.uv =
lerp(uvMin, uvMax,
float2((o.pos.x + 1) * 0.5, 1 - (o.pos.y + 1) * 0.5));
54 float y =
s.y - 4.0 *
s.x;
55 float z =
s.z - 4.0 *
s.y + 6.0 *
s.x;
56 float w = 6.0 - x - y - z;
57 return float4(x, y, z,
w) * (1.0 / 6.0);
79 float sx =
s.x / (
s.x +
s.y);
80 float sy =
s.z / (
s.z +
s.w);
87 return float4(0.0, 0.0, 0.0, 0.0);
95 float3 linear_to_srgb(float3
c) {
97 float3 lo = 12.92 *
c;
98 float3 hi = 1.055 * pow(
c, 1.0 / 2.4) - 0.055;
103 if (to_unpremult || to_srgb)
104 c = unpremultiply(
c);
106 c.rgb = linear_to_srgb(
c.rgb);
113 float4 main_ps(VSOut
i) : SV_Target {
114 return fix_color(t0.Sample(s0,
i.uv));
117 float4 main_ps_bicubic(VSOut
i) : SV_Target {
120 return fix_color(texBicubic(t0, s0,
i.uv));
#define i(width, name, range_min, range_max)
#define ss(width, name, subs,...)
static av_unused double cubic(double x, const double *params)
static double lerp(double a, double b, double x)
static float saturate(float input)
static double cb(void *priv, double x, double y)
static double b0(void *priv, double x, double y)
#define HLSL_SHADER(shader)
static const char render_shader_src[]