private static DirectXTransformerPlaneData CreatePlane(DirectXContext dx, int width, int height, DirectXDownloaderFormatPlane plane)
        {
            var config = new DirectXPipelineConfig
            {
                VertexShaderFile     = "format_conversion.hlsl",
                VertexShaderFunction = plane.VS,
                PixelShaderFile      = "format_conversion.hlsl",
                PixelShaderFunction  = plane.PS,
            };

            var pipeline = new DirectXPipeline <ConverterFilterConstantBuffer>(config, dx);

            pipeline.SetDebugColor(0, 0, 0, 1);
            pipeline.SetPosition(DirectXPipelineConfig.FullRectangle, new Viewport(0, 0, width / plane.WidthFactor, height / plane.HeightFactor));
            var colorMatrix = ColorMatrices.GetInverted(ColorMatrices.Full709);
            var cm          = colorMatrix.Values;
            var cb          = new ConverterFilterConstantBuffer
            {
                width      = width,
                height     = height,
                width_i    = 1.0f / width,
                width_d2   = width / 2,
                height_d2  = height / 2,
                width_x2_i = 0.5f / width,

                color_vec0      = new Vector4(cm[0], cm[1], cm[2], cm[3]),
                color_vec1      = new Vector4(cm[4], cm[5], cm[6], cm[7]),
                color_vec2      = new Vector4(cm[8], cm[9], cm[10], cm[11]),
                color_range_min = new Vector3(0.0f, 0.0f, 0.0f),
                color_range_max = new Vector3(1.0f, 1.0f, 1.0f),
            };

            pipeline.SetConstantBuffer(cb, false);

            return(new DirectXTransformerPlaneData {
                Pipeline = pipeline, Format = plane.Format
            });
        }
 public DirectXFilterStage(DirectXContext dx, DirectXPipelineConfig config)
 {
     Dx       = dx.AddRef();
     Pipeline = new DirectXPipeline <TConstantBuffer>(config, Dx);
 }