radeonsi/tmz: use secure job if using an encrypted z/s buffer
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 23 Sep 2020 13:15:41 +0000 (15:15 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 24 Sep 2020 14:51:16 +0000 (14:51 +0000)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6049>

src/gallium/drivers/radeonsi/si_descriptors.c

index 7e859ea..76c35ca 100644 (file)
@@ -2720,9 +2720,15 @@ bool si_gfx_resources_check_encrypted(struct si_context *sctx)
       }
    }
 
-   /* TODO: we should assert that either use_encrypted_bo is false,
-    * or all writable buffers are encrypted.
-    */
+   if (sctx->framebuffer.state.zsbuf) {
+      struct si_texture* zs = (struct si_texture *)sctx->framebuffer.state.zsbuf->texture;
+      if (zs &&
+          (zs->buffer.flags & RADEON_FLAG_ENCRYPTED)) {
+         /* TODO: This isn't needed if depth.func is PIPE_FUNC_NEVER or PIPE_FUNC_ALWAYS */
+         use_encrypted_bo = true;
+      }
+   }
+
    return use_encrypted_bo;
 }