[virglrenderer-devel] [PATCH 1/3] vrend, allocal_texture: Set mip-map levels correctly in the texture's state

Dave Airlie airlied at gmail.com
Fri Jun 22 02:34:34 UTC 2018


On 20 June 2018 at 19:02, Gert Wollny <gert.wollny at collabora.com> wrote:
> OpenGL defaults GL_TEXTURE_MIN_FILTER=GL_NEAREST_MIPMAP_LINEAR and
> GL_TEXTURE_MAX_LEVEL=1000, and expects all these mip-map levels to be
> defined. With glTexStorage this is set apropriately, but when the mip-map
> levels are initialiazed manually, then the GL_TEXTURE_MAX_LEVEL must be set.

We do set those on sampler view creation, is there a problem with doing it here?

I'm guessing we don't create a sampler view before we get a resource
copy I suppose.

If that makes sense, R-b me.

Dave.

>
> Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
> ---
>  src/vrend_renderer.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
> index f9ec520..b769e8a 100644
> --- a/src/vrend_renderer.c
> +++ b/src/vrend_renderer.c
> @@ -4934,6 +4934,11 @@ static int vrend_renderer_resource_allocate_texture(struct vrend_resource *gr,
>        }
>     }
>
> +   if (!vrend_state.have_texture_storage) {
> +      glTexParameteri(gr->target, GL_TEXTURE_BASE_LEVEL, 0);
> +      glTexParameteri(gr->target, GL_TEXTURE_MAX_LEVEL, pr->last_level);
> +   }
> +
>     gt->state.max_lod = -1;
>     gt->cur_swizzle_r = gt->cur_swizzle_g = gt->cur_swizzle_b = gt->cur_swizzle_a = -1;
>     return 0;
> --
> 2.16.4
>
> _______________________________________________
> virglrenderer-devel mailing list
> virglrenderer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/virglrenderer-devel


More information about the virglrenderer-devel mailing list