mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
mesa: Generate GL_INVALID_VALUE in framebuffer_texture when layer < 0
Signed-off-by: Fredrik Höglund <fredrik@kde.org> Reviewed-by: Adam Jackson <ajax@redhat.com> Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
parent
f9f5c82284
commit
8ba7ad8abc
1 changed files with 12 additions and 0 deletions
|
|
@ -2668,6 +2668,18 @@ framebuffer_texture(struct gl_context *ctx, const char *caller, GLenum target,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Page 306 (page 328 of the PDF) of the OpenGL 4.5 (Core Profile)
|
||||
* spec says:
|
||||
*
|
||||
* "An INVALID_VALUE error is generated if texture is non-zero
|
||||
* and layer is negative."
|
||||
*/
|
||||
if (zoffset < 0) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE,
|
||||
"glFramebufferTexture%s(layer %u < 0)", caller, zoffset);
|
||||
return;
|
||||
}
|
||||
|
||||
if (texObj->Target == GL_TEXTURE_3D) {
|
||||
const GLuint maxSize = 1 << (ctx->Const.Max3DTextureLevels - 1);
|
||||
if (zoffset >= maxSize) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue