From 3b28eaabf603657c388caa72bc92b1b660d00b2a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 10 Jul 2017 08:36:15 -0600 Subject: [PATCH] svga: fix PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE value This query is supposed to return the max texture buffer size/width in texels, not size in bytes. Divide by 16 (the largest format size) to return texels. Fixes Piglit arb_texture_buffer_object-max-size test. Cc: mesa-stable@lists.freedesktop.org Reviewed-by :Charmaine Lee --- src/gallium/drivers/svga/svga_screen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index 0b63525aaf2..f40d151af5d 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -312,7 +312,10 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) return svgascreen->ms_samples ? 1 : 0; case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE: - return SVGA3D_DX_MAX_RESOURCE_SIZE; + /* convert bytes to texels for the case of the largest texel + * size: float[4]. + */ + return SVGA3D_DX_MAX_RESOURCE_SIZE / (4 * sizeof(float)); case PIPE_CAP_MIN_TEXEL_OFFSET: return sws->have_vgpu10 ? VGPU10_MIN_TEXEL_FETCH_OFFSET : 0; -- 2.30.2