nv50: don't try to upload MSAA settings for BUFFER textures
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 3 Apr 2020 01:53:02 +0000 (21:53 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 3 Apr 2020 13:00:08 +0000 (13:00 +0000)
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 <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4424>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4424>

src/gallium/drivers/nouveau/nv50/nv50_tex.c

index a9bf6c023d89ed812657a37a8cb68f6bd82e6d64..3f51c53e9677b9be63c9ae2595c34562a95b8ad4 100644 (file)
@@ -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;