I have a render feature that processes renderers with a specific shader, and it works perfectly. However, when there are no renderers with this shader in the scene, I get the following error:
“A multisampled texture being bound to a non-multisampled sampler. Disabling in order to avoid undefined behavior. Please use Texture2DMS in the shader.”
And the error appears after the last line of the following snippet:
// Draw render list
cmd.SetRenderTarget(data.colorHandle, data.depthHandle);
cmd.ClearRenderTarget(true, true, Color.white);
cmd.DrawRendererList(data.rendererListHandle);
// Perform blit
cmd.SetGlobalTexture("_MainTex", data.colorHandle);
cmd.SetGlobalTexture("_MainTex_Depth", data.depthHandle);
cmd.SetGlobalVector("_TexelSize", data.texelSize);
// So if no objects with the involved shader, then I have "A multisampled texture..." error here:
Blitter.BlitCameraTexture(buffer, data.colorHandle, data.destination, data.blitMat, 0);
Does anyone have any idea how I can properly check if there are renderers with the target shader so I can enqueue the pass?
Thanks in advance!