Re: [Piglit] [PATCH] fbo-maxsize: Try to avoid allocating miplevels.

2016-12-10 Thread Mark Janes
This patch allows the test to complete on a Braswell system with 1.5GB
memory.  Without it, the OOM killer is dispatched.

Tested-by: Mark Janes 

Kenneth Graunke  writes:

> A 16384x16384 RGBA buffer takes 1GB of RAM.  If the driver allocates
> mipmap levels, that increases our storage requirements to 1.5GB.  The
> test doesn't use mipmapping, so this seems like a waste.
>
> Disabling mipmap filtering before allocating the texture provides a hint
> to the driver, suggesting that it should only allocate space for the
> base level.  Most Mesa drivers (Gallium and i965) follow this practice.
>
> Signed-off-by: Kenneth Graunke 
> ---
>  tests/fbo/fbo-maxsize.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/tests/fbo/fbo-maxsize.c b/tests/fbo/fbo-maxsize.c
> index 64dcd99..cec6716 100644
> --- a/tests/fbo/fbo-maxsize.c
> +++ b/tests/fbo/fbo-maxsize.c
> @@ -107,6 +107,11 @@ static int create_fbo(void)
>   glGenTextures(1, &tex);
>   glBindTexture(GL_TEXTURE_2D, tex);
>  
> + /* Turn off mipmap filtering as a hint to the driver that we don't
> +  * need multiple mipmap levels (as those can increase the memory
> +  * requirements by 50%, and we don't need them in this test.
> +  */
> + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
>   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, maxsize, maxsize,
>0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
>  
> -- 
> 2.10.2
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] fbo-maxsize: Try to avoid allocating miplevels.

2016-12-10 Thread Kenneth Graunke
A 16384x16384 RGBA buffer takes 1GB of RAM.  If the driver allocates
mipmap levels, that increases our storage requirements to 1.5GB.  The
test doesn't use mipmapping, so this seems like a waste.

Disabling mipmap filtering before allocating the texture provides a hint
to the driver, suggesting that it should only allocate space for the
base level.  Most Mesa drivers (Gallium and i965) follow this practice.

Signed-off-by: Kenneth Graunke 
---
 tests/fbo/fbo-maxsize.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/fbo/fbo-maxsize.c b/tests/fbo/fbo-maxsize.c
index 64dcd99..cec6716 100644
--- a/tests/fbo/fbo-maxsize.c
+++ b/tests/fbo/fbo-maxsize.c
@@ -107,6 +107,11 @@ static int create_fbo(void)
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
 
+   /* Turn off mipmap filtering as a hint to the driver that we don't
+* need multiple mipmap levels (as those can increase the memory
+* requirements by 50%, and we don't need them in this test.
+*/
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, maxsize, maxsize,
 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 
-- 
2.10.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit