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

fix SetMesh warning - #24

Open
oceancx wants to merge 3 commits into
realgamessoftware:masterfrom
oceancx:master
Open

fix SetMesh warning#24
oceancx wants to merge 3 commits into
realgamessoftware:masterfrom
oceancx:master

Conversation

@oceancx

@oceancx oceancx commented Mar 21, 2021

Copy link
Copy Markdown

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
Copy Markdown

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

@oceancx

oceancx commented Oct 26, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown

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

@oceancx

oceancx commented Nov 15, 2021

Copy link
Copy Markdown
Author

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
Copy Markdown

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

@oceancx

oceancx commented Aug 14, 2023

Copy link
Copy Markdown
Author

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