Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

fix SetMesh warning #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

oceancx
Copy link

@oceancx oceancx commented Mar 21, 2021

get warning in unity2020.3.0f1c1

SetSubMesh #1 shares part of its index buffer with SubMesh #2. Sharing part of an index buffer can result in undefined behavior and will be deprecated soon. To future-proof your Project, fix the indexStart/indexCount
UnityEngine.Mesh:SetSubMesh (int,UnityEngine.Rendering.SubMeshDescriptor,UnityEngine.Rendering.MeshUpdateFlags)
ImGuiNET.Unity.ImGuiRendererMesh:UpdateMesh (ImGuiNET.ImDrawDataPtr,UnityEngine.Vector2) (at Packages/dear-imgui-unity/ImGuiNET.Unity/Renderer/ImGuiRendererMesh.cs:127)
ImGuiNET.Unity.ImGuiRendererMesh:RenderDrawLists (UnityEngine.Rendering.CommandBuffer,ImGuiNET.ImDrawDataPtr) (at Packages/dear-imgui-unity/ImGuiNET.Unity/Renderer/ImGuiRendererMesh.cs:71)
ImGuiNET.Unity.DearImGui:Update () (at Packages/dear-imgui-unity/ImGuiNET.Unity/DearImGui.cs:157)

@Themperror
Copy link

Please do not allocate a new List<> every time that UpdateMesh is called, cache it outside the function and call Clear() on it

@oceancx
Copy link
Author

oceancx commented Oct 26, 2021

Please do not allocate a new List<> every time that UpdateMesh is called, cache it outside the function and call Clear() on it

done

@sandrofigo
Copy link

I'd like to see this fixed in the next version, but just out of curiosity where does commit de89418 come from?

@oceancx
Copy link
Author

oceancx commented Nov 15, 2021

I'd like to see this fixed in the next version, but just out of curiosity where does commit de89418 come from?

this commit is only useful for our inner project, you can ignore it...

@IvanXuff
Copy link

you should put descriptors.Clear(); after int idxOf = 0; , otherwise you can not draw all wanted mesh

@oceancx
Copy link
Author

oceancx commented Aug 14, 2023

you should put descriptors.Clear(); after int idxOf = 0; , otherwise you can not draw all wanted mesh

you are right!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants