PyAPI: GPUShader: make 'uniform_vector_*' less restricted

Buffers larger than required may be allowed without restriction.
This commit is contained in:
Germano Cavalcante 2021-08-16 13:53:56 -03:00
parent b5117660da
commit 4dba206011
1 changed files with 3 additions and 2 deletions

View File

@ -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;
}