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

00:25:buffer_update argument not valid #32

Open
GigglingGalaxy opened this issue Sep 24, 2023 · 10 comments
Open

00:25:buffer_update argument not valid #32

GigglingGalaxy opened this issue Sep 24, 2023 · 10 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@GigglingGalaxy
Copy link

This is ONLY in Showcase with the Train. I don't think it affects the actual plugin. LOW importance.

Godot version
v4.1.1.stable.mono.official [bd6af8e0e]

Plugin version
1.3.0 (was included in demo scene project, I didn't even have to add it, although I did follow the text tutorial on GitHub and checked it was there but the checkbox was already checked)
Got it from Git Latest Button: https://github.com/dreadpon/godot_spatial_gardener/releases/tag/v1.3.0

Platform
MacOS, latest 9-24-2023, Ventura 13.4.1 (22F82)
MacBook Pro 14, M1 Max, late 2021, 32GB Memory

Issue description
Only in Showcase Scene
No gameplay seems to be affected.
802 errors (only 2 actual errors but they are repeated continuously):

  1. About ⅔ of them are this one:
    E 0:00:25:0844 buffer_update: Buffer argument is not a valid buffer of any type.
    <C++ Error> Method/function failed. Returning: ERR_INVALID_PARAMETER
    <C++ Source> drivers/vulkan/rendering_device_vulkan.cpp:5858 @ buffer_update()

  2. Second ⅓ errors are this one:
    E 0:02:17:0536 dummy.gd:6 @ _ready(): Buffer argument is not a valid buffer of any type.
    <C++ Error> Method/function failed. Returning: ERR_INVALID_PARAMETER
    <C++ Source> drivers/vulkan/rendering_device_vulkan.cpp:5858 @ buffer_update()
    dummy.gd:6 @ _ready()

Upon playing Showcase Scene a second time got this before moving or anything: E 0:00:07:0778 buffer_update: Buffer argument is not a valid buffer of any type.
<C++ Error> Method/function failed. Returning: ERR_INVALID_PARAMETER
<C++ Source> drivers/vulkan/rendering_device_vulkan.cpp:5858 @ buffer_update()

And then "Too many errors! Ignoring for up to 1 second..."

When the train left, they stopped. I waited for train to return.

I rode the train the whole way. Got back off where I started. Ran along track, fell to my infinite falling world lol, never got the second "dummy" error from above...and I never got another error after the initial 401 buffer update ones.

Steps to Reproduce

  1. Go to Showcase
  2. Click on play current scene
  3. Observe the errors happening continuously while playing.
    I walked along track (whole way to end), ran along track, and jumped, then got on train and rode it the whole way. Then Clicked Restart to try getting on the train.
  4. The second time I pushed play, the dummy error (2) didn't appear. I restarted via UI to see if that threw more errors, it didn't.
  5. The errors only happened at beginning. They didn't appear as new at any point in my travels.

NOTE: All PathFollows in the RailPath->PathFollow show a warning (yellow triangle ! ). Tried to find what this was referring to, but couldn't. See Screenshot.
Screenshot 2023-09-24 at 9 47 07 AM

Minimal reproduction project
I just downloaded the project from latest Git and opened Showcase Scene in project file, no adds or changes to original

@dreadpon
Copy link
Owner

dreadpon commented Oct 10, 2023

Thanks, I'll check it out when I have the time (since low-ish priority)
Had a few weird Vulkan errors myself, but I thought I worked around most of them
If you see something similar in an actual project, please report, as it might hint at some deeper problem (and a more urgent one)

@qwertzuiopy
Copy link

Godot version:
4.1.2.stable.flathub.399c9dc39
Plugin version:
1.3.0 from the Godot Asset Library

As this message also shows up in my project I did some experimentation and found a minimal reproduction project with just a gardener and a cube:

Gardener.zip

The error messages occurs only when there are more instances of a plant then max chunk capacity is set to.
In the example project there are 76 Suzannes scattered but the max chunk capacity is set to 75. If I remove one instance the message disappears.

@dreadpon dreadpon added the bug Something isn't working label Nov 10, 2023
@dreadpon dreadpon added this to the 1.4.0 milestone Nov 10, 2023
dreadpon added a commit that referenced this issue Nov 18, 2023
fix ThemeAdapter errors to work with Godot 4.2
@dreadpon
Copy link
Owner

Fixed by [4d96dc7]

The issue was not about having instances above limit, but having empty multimeshes (which were generated when going above limit). Thanks to @qwertzuiopy for providing a reproduction project and @wladi0097 for pointing out the relevant Godot issue (godotengine/godot#68592).

Solved by setting MultiMeshInstance.multimesh = null whenever MultiMesh.instance_count == 0.

Please download from master branch and test if the issue is gone on your side as well.

@qwertzuiopy
Copy link

Master works fine on my side. Thank you for fixing this!

@dreadpon
Copy link
Owner

dreadpon commented Apr 30, 2024

The issue above seemed to have returned (or not been gone at all).
Is directly related to godotengine/godot#68592

Noticed it in the demo project, when exporting it for a new version.
Spatial Gardener sets resource_local_to_scene to true whenever it creates a new MultiMesh, which when drawing instances happens pretty much all the time.

I do not believe it to be possible to work around this bug save for completely rewriting how we store and load Gardeners from disk. It seems excessive to do so, since the error spam has no functional downsides, it only floods the console and lags the scene opening on the initial opening (because of multiple error messages).

It is important to note, that this issue might cause crashes in OpenGL ES Compatibility renderer, so take care.

@dreadpon dreadpon reopened this Apr 30, 2024
@dreadpon
Copy link
Owner

dreadpon commented Apr 30, 2024

What's interesting, is that it doesn't seem to be an issue in editor itself anymore. Guess part of my fix IS working, just not at runtime. Would be grateful if others can confirm this is indeed the case on their side as well.

A workaround for this in runtime builds would be to manually scan .tscn files (using regex or some such) for MultiMesh resources that have resource_local_to_scene = true and setting it to false. This WILL NOT persist any edits to plants you do in the editor, but WILL allow game builds to run without triggering the error above.

As a side effect - if you pack your Gardeners in a subscene and instantiate it more than once - LOD changes will synchronize across instances. Visually, it means you will have weird jumps between mesh detalization, all the way to full disappearance (if you use the Kill Threshold).

@Kriso23
Copy link

Kriso23 commented Apr 30, 2024

Funny I just noticed I started getting this error too, wasn't getting it before but I've been editing my level a bit and it seems to have triggered something. Didn't really touch the gardener either, was just placing down some building meshes.

@qwertzuiopy
Copy link

Using Godot v4.2.2.stable and Spatial Gardener 1.3.1 from the Godot Asset Store I am not seeing any Errors related to any Buffers in the Editor, when running the Project or in a Linux export (both with or without debug enabled) even though there are empty MultiMeshInstances present.

When running the exported project there are a bunch of Errors regarding an UndoRedoManager not being found in "res://addons/dreadpon.spatial_gardener/utility/undo_redo_interface.gd" but nothing else.

resource_local_to_scene was set to true for all these meshes.

@dreadpon
Copy link
Owner

Okay, I forgot to mention: this error now seems to trigger for non-empty multi-meshes as well.

The UndoRedo thing should be fixed in Master/1.3.2 that I published today. Actually, could be interesting to see whether any of the 1.3.2 changes are actually causing this or not...

@qwertzuiopy
Copy link

I tested the master branch and am now not seeing any Errors at all. I'm sorry if this is not that helpful...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants