mesa: clamp texbuf query size to MAX_TEXTURE_BUFFER_SIZE
Fixes upcoming CTS test checking for clamping. Cc: mesa-stable Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34428>
This commit is contained in:
@@ -1997,8 +1997,15 @@ get_tex_level_parameter_buffer(struct gl_context *ctx,
|
||||
*params = bo->Name;
|
||||
break;
|
||||
case GL_TEXTURE_WIDTH:
|
||||
*params = ((texObj->BufferSize == -1) ? bo->Size : texObj->BufferSize)
|
||||
/ bytes;
|
||||
/* From OpenGL 4.6 spec "8.9 Buffer Textures":
|
||||
*
|
||||
* "The number of texels in the texture image is then clamped to an
|
||||
* implementation-dependent limit, the value of
|
||||
* MAX_TEXTURE_BUFFER_SIZE."
|
||||
*/
|
||||
*params = CLAMP(((texObj->BufferSize == -1) ?
|
||||
bo->Size : texObj->BufferSize) / bytes,
|
||||
0, ctx->Const.MaxTextureBufferSize);
|
||||
break;
|
||||
case GL_TEXTURE_HEIGHT:
|
||||
case GL_TEXTURE_DEPTH:
|
||||
|
||||
Reference in New Issue
Block a user