Python 有没有办法让多个IndexedVertexList引用相同的顶点,同时拥有不同的索引列表

Python 有没有办法让多个IndexedVertexList引用相同的顶点,同时拥有不同的索引列表,python,pyglet,Python,Pyglet,我希望有两个(或更多)IndexedVertexList,它们引用相同的顶点,同时具有不同的索引列表。我遇到的问题是,如果我创建两个(或更多)具有相同顶点的IndexedVertexList,它将占用GPU实际需要的内存量的两倍 我的意思是: import pyglet vertices = [ 0, 0, 0, 0.5, 0.5, 0, 0.5, 0.5 ] indices1 = [0, 1, 2] indices2 = [

我希望有两个(或更多)IndexedVertexList,它们引用相同的顶点,同时具有不同的索引列表。我遇到的问题是,如果我创建两个(或更多)具有相同顶点的IndexedVertexList,它将占用GPU实际需要的内存量的两倍

我的意思是:

import pyglet


vertices = [
        0, 0,
        0, 0.5,
        0.5, 0,
        0.5, 0.5
]

indices1 = [0, 1, 2]
indices2 = [0, 2, 3]

vertex_list_indexed_1 = pyglet.graphics.vertex_list_indexed(4, indices1, ('v2f', vertices))
vertex_list_indexed_2 = pyglet.graphics.vertex_list_indexed(4, indices2, ('v2f', vertices))
我想要的是这样的东西(这显然不起作用):


我在中找不到任何可以解决我问题的方法。

我不确定我是否理解这个问题,列表不是通过引用传递的吗?这意味着您可以创建一个列表并将其传递,然后共享它?或者是Pyglet的内部结构正在复制,并且没有传递引用?Pyglet每次调用
顶点列表索引()
时都会将整个
顶点列表复制到GPU的内存中。你找到解决方案了吗,伙计?我也有同样的问题,不能让它工作。
import pyglet


vertices = [
        0, 0,
        0, 0.5,
        0.5, 0,
        0.5, 0.5
]

indices1 = [0, 1, 2]
indices2 = [0, 2, 3]

vertex_list  = pyglet.graphics.vertex_list(4, ('v2f', vertices))

vertex_list_indexed_1 = pyglet.graphics.vertex_list_indexed(4, indices1, vertex_list)
vertex_list_indexed_2 = pyglet.graphics.vertex_list_indexed(4, indices2, vertex_list)