Mesa (master): radv: fix shader caching with discard->demote workaround
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Nov 3 11:45:54 UTC 2020
Module: Mesa
Branch: master
Commit: 36f62494ec7148931201726dcb5f79e5d7965ae6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=36f62494ec7148931201726dcb5f79e5d7965ae6
Author: Rhys Perry <pendingchaos02 at gmail.com>
Date: Tue Nov 3 10:54:59 2020 +0000
radv: fix shader caching with discard->demote workaround
Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Fixes: bdd75874144 ("radv: use nir_lower_discard_to_demote to work around game bugs")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7423>
---
src/amd/vulkan/radv_pipeline.c | 2 ++
src/amd/vulkan/radv_private.h | 1 +
2 files changed, 3 insertions(+)
diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 2818088de3c..02e346d9b82 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -219,6 +219,8 @@ static uint32_t get_hash_flags(const struct radv_device *device)
hash_flags |= RADV_HASH_SHADER_GE_WAVE32;
if (device->physical_device->use_llvm)
hash_flags |= RADV_HASH_SHADER_LLVM;
+ if (device->instance->debug_flags & RADV_DEBUG_DISCARD_TO_DEMOTE)
+ hash_flags |= RADV_HASH_SHADER_DISCARD_TO_DEMOTE;
return hash_flags;
}
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 6287e26f77a..fdf763a1286 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1646,6 +1646,7 @@ struct radv_shader_module;
#define RADV_HASH_SHADER_PS_WAVE32 (1 << 2)
#define RADV_HASH_SHADER_GE_WAVE32 (1 << 3)
#define RADV_HASH_SHADER_LLVM (1 << 4)
+#define RADV_HASH_SHADER_DISCARD_TO_DEMOTE (1 << 5)
void
radv_hash_shaders(unsigned char *hash,
More information about the mesa-commit
mailing list