/*
 * Copyright (c) Contributors to the Open 3D Engine Project.
 * For complete copyright and license terms please see the LICENSE at the root of this distribution.
 *
 * SPDX-License-Identifier: Apache-2.0 OR MIT
 *
 */

#include <Atom/Features/SrgSemantics.azsli>

#include <Atom/Features/PostProcessing/FullscreenPixelInfo.azsli>
#include <Atom/Features/PostProcessing/FullscreenVertex.azsli>

ShaderResourceGroup PassSrg : SRG_PerPass
{
    Texture2D<float4> m_image1;
    Texture2D<float4> m_image2;

    Sampler m_sampler
    {
        MinFilter = Linear;
        MagFilter = Linear;
        MipFilter = Linear;
        AddressU = Clamp;
        AddressV = Clamp;
        AddressW = Clamp;
    };
}

PSOutput MainPS(VSOutput IN)
{
    PSOutput OUT;

    if(IN.m_texCoord.x <= 0.5)
    {
        OUT.m_color = PassSrg::m_image1.Sample(PassSrg::m_sampler, float2(IN.m_texCoord.x * 2, IN.m_texCoord.y));
    }
    else
    {
        OUT.m_color = PassSrg::m_image2.Sample(PassSrg::m_sampler, float2(IN.m_texCoord.x * 2 - 1, IN.m_texCoord.y));
    }

    return OUT;
}
