When I enable Anti Aliasing (MSAA) in the URP asset’s quality settings, there’s this log spam happening:
A non-multisampled texture being bound to a multisampled sampler. Disabling in order to avoid undefined behavior. Please enable the bindMS flag on the texture.
UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal()
This is on Unity 6 23f1, visionOS plugin 2.0.4, metal passthrough and I’m just using the vision os samples to test with.
Note that when you first run it, the debugger will detect a crash. If you run it again without the debugger it will work but the framerate will be compromised because of this log spam.
Any workarounds? it would be nice to have anti aliasing.
Also, I tried anti aliasing on the camera with post processing, that makes passthrough render black and the framerate is pretty bad anyway.
Hey there! Sorry to hear that you’re having trouble.
MSAA should be working, but might interfere with other rendering features like HDR and post processing. Are you using default settings otherwise? Did you start with the default URP core template? I believe I’ve seen this bug before, but I don’t think it was happening with default settings as long as I fixed the issues highlighted under Project Settings > Project Validation.
Even though it’s just using the samples/defaults, would you mind reporting a bug with the project attached? That will make it easier to track and ensure we fix the right issue. Thanks!
I can’t upload it, it says the file is too big.
But this is just visionOSTemplate-2.0.0-pre.11 as default as it gets. I only selected Anti Aliasing (MSAA) 4x in UniversalRenderPipelineAsset.asset. Configured the plugin as Metal Rendering with compositor services, and the scene being loaded is “Metal Sample - URP/Scenes/Main”. You should be able to repro, this happens on my main project as well.
There are no issues whatsoever in XR plugin management - project validation, HDR is off, no post processing.
Here is the console log when run it with the debugger and it crashes, note that this seems to make Vision OS crash as well because i see an apple logo right after. I only know there’s a log spam when you aren’t debugging because that’s what happens on my main app that does have a way to see the console log in-game. Didn’t verify that part with the template, but the log i’m refering is being shown and i show it in bold.
RequestCreateTexture
SetupRenderTextureFromXRRequest (id: 1 col: 0x100d3ffe0 d: 0x100d3d380 sr: 0x0)
RenderTexture::Create (id: 1)
IVRDeviceCallback_CreateEyeTextureResources 0x100d3ffe0
IVRDeviceCallback_CreateEyeTextureResources 0x100d3d380
A non-multisampled texture being bound to a multisampled sampler. Disabling in order to avoid undefined behavior. Please enable the bindMS flag on the texture.
UnityEngine.Rendering.ScriptableRenderContext:Submit_Internal()
UnityEngine.Rendering.ScriptableRenderContext:Submit()
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderSingleCamera(ScriptableRenderContext, UniversalCameraData)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:RenderCameraStack(ScriptableRenderContext, Camera)
UnityEngine.Rendering.Universal.UniversalRenderPipeline:Render(ScriptableRenderContext, List1) UnityEngine.Rendering.RenderPipeline:InternalRender(ScriptableRenderContext, List1)
UnityEngine.Rendering.RenderPipeline:InternalRender(ScriptableRenderContext, List1) UnityEngine.Rendering.RenderPipelineManager:DoRenderLoop_Internal(RenderPipelineAsset, IntPtr, Object) [ line 1871598776] -[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5779: failed assertion Draw Errors Validation
Fragment Function(xlatMtlMain): incorrect type of texture (MTLTextureType2DArray) bound at texture binding at index 0 (expect MTLTextureType2DMultisampleArray) for _CameraDepthAttachment[0].
’
Can’t show file for stack frame : <DBGLLDBStackFrame: 0x10d159550> - stackNumber:11 - name:DrawNullGeometry. The file path does not exist on the file system: /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/metal/GfxDeviceMetal.mm
Are you trying to upload it to Discussions? I meant for you to use Help > Report a Bug... in the Editor. It should automatically pack up the project for you. If that isn’t working, can you use Google Drive or some other secure file sharing service? If you aren’t able to share the link publicly here, you could DM it to me. But the bug reporter should work…
If you don’t have HDR or post processing enabled, there may be some other configuration I’m forgetting or this may be a new bug I haven’t seen before. That’s why it will help to see your project.
Ok it’s uploaded
IN-87706
Thanks! I’ll take a look as soon as I can.
I got a same issue. But I managed to get MSAA work in another project. Just cannot figure out what’s wrong.
Right! I just realized the issue here. I’ve been testing projects with Metal API Validation disabled, but it is enabled by default (and in the template project, which is generally configured for PolySpatial, not Metal). If you disable this setting in Player Settings (you can also disable it in Xcode), you can work around the error.
I’ll see about fixing the core issue, and if it turns out to be too risky or might take a long time, I’ll add a project validation rule in the package to remind folks to turn this off.
Please let me know if this works to resolve your issue. Thanks for your patience!
Sadly that didn’t fix it, you got me excited there for a moment hopefully we can still make it work.
I tried turning off metal api validation from the vision os settings but that didn’t help. Rebuilt the XCode project from scratch as well just in case. Didn’t have any luck in my main project either.
What else could it be?
Hm… in my case I happened to do it in Xcode. Maybe that setting in Unity isn’t working properly? Can you see if it’s enabled in Xcode under the main target scheme?
This works for me. I disabled it in Xcode, as setting in Unity indeed not working.
The log spam problem remains, changing that setting in XCode only makes it so the debugger doesn’t crash, but the log spam is there and it affects performance so we can’t use it.
And yes, Unity’s bugged when it makes a build with API Validation off, it just leaves it on in XCode so you have to manually disable it.
@epsychic watch out, it may not crash but the problem isn’t fixed.
What log spam is this? Are you sure it is the thing impacting performance? I see a bunch of logs from Apple libraries on app start, but no persistent spam while the app is running. What logs are you seeing?
Good to know. I’ll chase this down and try to get a fix out.
The log spam is what the report was about, it happens every single frame, here it is:
Ah. OK, that is indeed a Unity log, not API validation. I don’t see this in the project that you submitted in the bug report, or maybe I just missed it? Are you seeing this in the template project from your bug report now that you’ve disabled Metal API Validation?
I’ll double-check again today after I’m done with meetings.
It happens in the sample project that I submitted yes.
Thanks for your help by the way!
My bad, then.
I was too focused on the validation crash/hang.
Also, someone on the docs team corrected me about the setting above. Apparently the Metal API Validation setting in Player Settings only affects validation in the Editor. To disable the setting in Xcode, you can switch the Run in Xcode as setting under Build Settings to Release.
Thank you for the heads-up. I looked closely, and you’re right—the errors are still present, and there’s a noticeable drop in frame rate. It seems the errors are indeed impacting performance.
Just found a workaround - I enabled Compatibility Mode for Render Graph in Graphics setting, then MASS worked fine and error log disappeared. It Might be a issue between Render Graph and visionOS.