From 1288ac7632b31a20497a0e75f374f66ce3d5bc3c Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 2 Apr 2020 21:53:02 -0400 Subject: [PATCH] nv50: don't try to upload MSAA settings for BUFFER textures We need the MSAA scaling parameters to properly fetch samples from MSAA textures. These are stored in the miptree which wraps all regular textures. However it does not wrap buffer textures, so make sure to skip them rather than accessing out-of-bounds or unmapped memory. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2727 Fixes: 3bd40073b98 ("nv50: add support for texelFetch'ing MS textures") Signed-off-by: Ilia Mirkin Cc: mesa-stable@lists.freedesktop.org Tested-by: Marge Bot Part-of: --- src/gallium/drivers/nouveau/nv50/nv50_tex.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c index a9bf6c023d8..3f51c53e967 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c @@ -315,7 +315,7 @@ nv50_validate_tic(struct nv50_context *nv50, int s) struct nv50_tic_entry *tic = nv50_tic_entry(nv50->textures[s][i]); struct nv50_miptree *res; - if (!tic) { + if (!tic || tic->pipe.target == PIPE_BUFFER) { PUSH_DATA (push, 0); PUSH_DATA (push, 0); continue; -- 2.30.2