Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_mesh_arrays() generates nonsensical ARRAY_INDEX values #79114

Closed
UQuark opened this issue Jul 6, 2023 · 1 comment
Closed

get_mesh_arrays() generates nonsensical ARRAY_INDEX values #79114

UQuark opened this issue Jul 6, 2023 · 1 comment

Comments

@UQuark
Copy link

UQuark commented Jul 6, 2023

Godot version

4.0, 4.1 stable

System information

Godot v4.1.stable - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Tue, 04 Jul 2023 08:39:22 +0000 - Vulkan (Mobile) - dedicated AMD Radeon RX 6700 XT (RADV NAVI22) () - AMD Ryzen 5 5600X 6-Core Processor (12 Threads)

Issue description

I'm trying to modify PlaneMesh geometry with code (via MeshDataTool).
To do that, I construct ArrayMesh and copy PlaneMesh's arrays to it (obtained with get_mesh_arrays()).
It works perfectly on PC, but failed on Android.
The error was:

E 0:00:01:0300   Soil.gd:23 @ _fill_grass(): Index r[i] = 16256 is out of bounds (vcount = 144).
  <C++ Source>   scene/resources/mesh_data_tool.cpp:72 @ create_from_surface()
  <Stack Trace>  Soil.gd:23 @ _fill_grass()
                 Soil.gd:15 @ _ready()

After some debugging I found out that arrays 12th array (ARRAY_INDEX as is declared here) is full of seemingly leftover uninitialized junk.

PC values:
Screenshot from 2023-07-06 19-03-42
Android values:
Screenshot from 2023-07-06 19-03-24

Steps to reproduce

  1. Create a new project
  2. Add a node, attach a script
  3. Put
        var pm = PlaneMesh.new()
	var arrays = pm.get_mesh_arrays()
  1. Set a breakpoint
  2. Run with remote debug on an Android device
  3. Observe arrays 12th element going nuts in Stack Variables

Minimal reproduction project

test.zip

@AThousandShips
Copy link
Member

Thank you for reporting

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

No branches or pull requests

2 participants