How to use SinglePassInstanced sample texture for VR in ShaderGraph, just like SAMPLE_TEXTURE2D_X

I’m imitating and implementing something like HDRP’s newly introduced screen space thickness map functionality under URP. It has been done under non-VR or MultiPass, like this, to simulate X-ray:


The general idea is to use a shader to draw the thickness to an RTHandle, and then set the global texture through cmd.SetGlobalTexture(k_ThicknessTextureName, m_ThicknessTexture);

Finally, use a full-screen shader to draw to the screen with FullScreenPassRendererFeature.
9006220--1241260--upload_2023-5-11_14-24-47.png
I hope to implement this full-screen Shader in ShaderGraph, so it can be read normally in non-VR by the following method.

But if it is SinglePass, it must be changed to a very inelegant implementation.

And add a line of code:
cmd.SetGlobalTexture(“_ThicknessTextureArray”, m_ThicknessTexture);

Is there something like TEXTURE2D_X and SAMPLE_TEXTURE2D_X in ShaderGraph to unify this sampling operation?

Is it possible to achieve this function through a custom function? This reminds me that _Time has been redefined. Even if the reference to Core.hlsl is deleted, an error will be reported: TEXTURE2D_X is not defined.

ThicknessNode.hlsl

#ifndef MYHLSLINCLUDE_INCLUDED
#define MYHLSLINCLUDE_INCLUDED

#include “Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl”

TEXTURE2D_X(_ThicknessTexture);
SAMPLER(sampler_ThicknessTexture);

void GetThickness_float(float2 uv, out float Out)
{
Out = SAMPLE_TEXTURE2D_X(_ThicknessTexture, sampler_ThicknessTexture, uv).r;
}
#endif