for each of the exceptions replace them with solutions

private void CheckUseFragment(TextureHandle tex, bool isDepth)
{
    if(RenderGraph.enableValidityChecks)
    {
        // We ignore the version as we don't allow mixing UseTexture/UseFragment between different versions
        // even though it should theoretically work (and we might do so in the future) for now we're overly strict.
        bool alreadyUsed = false;

        //TODO: Check grab textures here and allow if it's grabbed. For now
        // SetRenderAttachment()
        // UseTexture(grab)
        // will work but not the other way around
        for (int i = 0; i < m_RenderPass.resourceReadLists[tex.handle.iType].Count; i++)
        {
            if (m_RenderPass.resourceReadLists[tex.handle.iType][i].index == tex.handle.index)
            {
                alreadyUsed = true;
                break;
            }
        }

        for (int i = 0; i < m_RenderPass.resourceWriteLists[tex.handle.iType].Count; i++)
        {
            if (m_RenderPass.resourceWriteLists[tex.handle.iType][i].index == tex.handle.index)
            {
                alreadyUsed = true;
                break;
            }
        }

        if (alreadyUsed)
        {
            var name = m_Resources.GetRenderGraphResourceName(tex.handle);
            throw new InvalidOperationException($"Trying to SetRenderAttachment on a texture that is already used through UseTexture/SetRenderAttachment. Consider updating your code. (pass '{m_RenderPass.name}' resource '{name}').");
        }

        m_Resources.GetRenderTargetInfo(tex.handle, out var info);

        // The old path is full of invalid uses that somehow work (or seemt to work) so we skip the tests if not using actual native renderpass
        if (m_RenderGraph.nativeRenderPassesEnabled)
        {
            if (isDepth)
            {
                if (!GraphicsFormatUtility.IsDepthFormat(info.format))
                {
                    var name = m_Resources.GetRenderGraphResourceName(tex.handle);
                    throw new InvalidOperationException($"Trying to SetRenderAttachmentDepth on a texture that has a color format {info.format}. Use a texture with a depth format instead. (pass '{m_RenderPass.name}' resource '{name}').");
                }
            }
            else
            {
                if (GraphicsFormatUtility.IsDepthFormat(info.format))
                {
                    var name = m_Resources.GetRenderGraphResourceName(tex.handle);
                    throw new InvalidOperationException($"Trying to SetRenderAttachment on a texture that has a depth format. Use a texture with a color format instead. (pass '{m_RenderPass.name}' resource '{name}').");
                }
            }
        }

        foreach (var globalTex in m_RenderPass.setGlobalsList)
        {
            if (globalTex.Item1.handle.index == tex.handle.index)
            {
                throw new InvalidOperationException("Trying to SetRenderAttachment on a texture that is currently set on a global texture slot. Shaders might be using the texture using samplers. You should ensure textures are not set as globals when using them as fragment attachments.");
            }
        }
    }
}