Search Unity

Resolved SRP Batcher not compatible with tex2Dlod in vert program?

Discussion in 'Shaders' started by chrismarch, May 23, 2020.

  1. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    472
    I have a custom shader that is SRP Batcher compatible, until I use tex2Dlod in the vertex program. Then I get:
    upload_2020-5-22_18-22-4.png

    The offending line is (as a simplified example):

    float4 texSample = tex2Dlod(sampler_MainTex, float4(.5f, .5f, 0.0f, 0.0f));

    Is there a macro, like SAMPLE_TEXTURE2D, that would fix this? If so, where is the reference/repo for such macros?

    URP 7.3.1, Unity 2019.3.13f1, Build target iOS, Metal
     
  2. chrismarch

    chrismarch

    Joined:
    Jul 24, 2013
    Posts:
    472
    Last edited: May 26, 2020