summaryrefslogtreecommitdiffstats
path: root/doxygen/glsl.doxy
diff options
context:
space:
mode:
authorPierre-Eric Pelloux-Prayer <[email protected]>2019-07-05 14:51:23 +0200
committerMarek Olšák <[email protected]>2019-07-15 15:22:25 -0400
commita9655f36fe9088816973c19df9399268ef6bfcd8 (patch)
tree3cda1835f0978917b7308bc0c40e4cdec5f1b636 /doxygen/glsl.doxy
parentce04fbf67c9ded75a206c9560a3869df76a46839 (diff)
st/mesa: verify that vertex buffer offset isn't negative
For drivers supporting PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET the buffer_offset value will be interpreted as an signed int. An example of application code causing a negative offset: float b[] = { ... }; // 3 float for pos, 3 for color glBufferData(GL_ARRAY_BUFFER, ..., b, ...); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), 0); glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 6 * sizeof(float), &b[3]); ^ should be 3 * sizeof(float) The offset is a ptr so when interpreted as a signed int it can be negative. This commit adds a verification that (int) buffer_offset is not negative - this would indicate an application bug. Since it's too late to emit a GL_INVALID_VALUE error, we replace the negative offset by 0 and emit a debug message. Signed-off-by: Marek Olšák <[email protected]>
Diffstat (limited to 'doxygen/glsl.doxy')
0 files changed, 0 insertions, 0 deletions