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

Crash when vertex buffer is resized on DirectX #824

Closed
MDTech-us-MAN opened this issue Dec 25, 2019 · 1 comment
Closed

Crash when vertex buffer is resized on DirectX #824

MDTech-us-MAN opened this issue Dec 25, 2019 · 1 comment
Assignees
Labels
Milestone

Comments

@MDTech-us-MAN
Copy link
Contributor

@MDTech-us-MAN MDTech-us-MAN commented Dec 25, 2019

When I play a specific particle effect when using DirectX, panda3d crashes. There are no crashes when using OpenGL.

Crash:
image

Call Stack:
image

Code:
https://gist.github.com/MDTech-us-MAN/fc5556e74c4b3353816c86d7f9229909

(press the "P" key to trigger the effect)

@rdb rdb added bug windows labels Dec 28, 2019
@rdb rdb changed the title Crash when playing Particle Effect on DirectX Crash when vertex buffer is resized on DirectX Dec 28, 2019
@rdb

This comment has been minimized.

Copy link
Member

@rdb rdb commented Dec 28, 2019

It happens when resizing any vertex buffer without using the appropriate modify_() calls. This is a more isolated sample that does not involve the particle system:

# Press space several times
from panda3d.core import *
import sys

f = GeomVertexFormat.get_v3()
gvd = GeomVertexData('vdata', f, Geom.UH_dynamic)
gvd.set_num_rows(60)

gp = GeomPoints(Geom.UH_static)
gp.add_next_vertices(1)

g = Geom(gvd)
g.add_primitive(gp)
gp = None

gn = GeomNode("test")
gn.add_geom(g)
gn.set_bounds(OmniBoundingVolume())
gn.set_final(True)


def resize_gvd():
    rows = gvd.get_num_rows() + 1
    print("Resizing to " + str(rows) + " rows")
    gvd.set_num_rows(rows)
    sys.stdout.flush()


load_prc_file_data("", "load-display pandadx9")

from direct.directbase.DirectStart import base
np = base.render.attach_new_node(gn)
base.accept('space', resize_gvd)

sys.stdout.flush()
base.run()
@rdb rdb self-assigned this Dec 28, 2019
@rdb rdb added this to the 1.10.5 milestone Dec 28, 2019
@rdb rdb closed this in b656b0b Dec 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.