Fix T101244: Empty point list in shader batch creation cause error
Allow empty VBOs in Python GPUBatch creation.
This commit is contained in:
parent
116d7b0042
commit
9c20eda0ad
@ -34,13 +34,13 @@ def batch_for_shader(shader, type, content, *, indices=None):
|
|||||||
return 'I32'
|
return 'I32'
|
||||||
|
|
||||||
def recommended_attr_len(attr_name):
|
def recommended_attr_len(attr_name):
|
||||||
item = content[attr_name][0]
|
|
||||||
attr_len = 1
|
attr_len = 1
|
||||||
try:
|
try:
|
||||||
|
item = content[attr_name][0]
|
||||||
while True:
|
while True:
|
||||||
attr_len *= len(item)
|
attr_len *= len(item)
|
||||||
item = item[0]
|
item = item[0]
|
||||||
except TypeError:
|
except (TypeError, IndexError):
|
||||||
pass
|
pass
|
||||||
return attr_len
|
return attr_len
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user