PyAPI: GPUShader: make 'uniform_vector_*' less restricted
Buffers larger than required may be allowed without restriction.
This commit is contained in:
parent
b5117660da
commit
4dba206011
|
@ -211,8 +211,9 @@ static bool pygpu_shader_uniform_vector_impl(PyObject *args,
|
|||
return false;
|
||||
}
|
||||
|
||||
if (r_pybuffer->len != (*r_length * *r_count * elem_size)) {
|
||||
PyErr_SetString(PyExc_BufferError, "GPUShader.uniform_vector_*: buffer size does not match.");
|
||||
if (r_pybuffer->len < (*r_length * *r_count * elem_size)) {
|
||||
PyErr_SetString(PyExc_OverflowError,
|
||||
"GPUShader.uniform_vector_*: buffer size smaller than required.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue