radv: Still enable inmemory & API level caching if disk cache is not enabled.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 24 Jul 2018 12:57:42 +0000 (14:57 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 24 Jul 2018 16:06:41 +0000 (18:06 +0200)
That we don't have a background disk cache does not mean we should
prevent the app caching anything.

CC: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/amd/vulkan/radv_pipeline_cache.c

index 6858d37eba8f72c8979d8d8682d6063755b7182b..7e2c305b1a033d7acecc3cdb5a8eea50a3df607f 100644 (file)
@@ -248,7 +248,6 @@ radv_is_cache_disabled(struct radv_device *device)
         * MESA_GLSL_CACHE_DISABLE=1, and when VK_AMD_shader_info is requested.
         */
        return (device->instance->debug_flags & RADV_DEBUG_NO_CACHE) ||
-              !device->physical_device->disk_cache ||
               device->keep_shader_info;
 }
 
@@ -271,7 +270,7 @@ radv_create_shader_variants_from_pipeline_cache(struct radv_device *device,
                /* Don't cache when we want debug info, since this isn't
                 * present in the cache.
                 */
-               if (radv_is_cache_disabled(device)) {
+               if (radv_is_cache_disabled(device) || !device->physical_device->disk_cache) {
                        pthread_mutex_unlock(&cache->mutex);
                        return false;
                }