Mesa (main): radv: move forcing VRS rates to the graphics pipeline key

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Oct 4 10:22:22 UTC 2021


Module: Mesa
Branch: main
Commit: 0fa431087c8dc8905c96d63e54bdb255bd0894d2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0fa431087c8dc8905c96d63e54bdb255bd0894d2

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Sep 29 11:51:51 2021 +0200

radv: move forcing VRS rates to the graphics pipeline key

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13099>

---

 src/amd/vulkan/radv_pipeline.c | 8 ++------
 src/amd/vulkan/radv_private.h  | 3 ---
 src/amd/vulkan/radv_shader.c   | 2 +-
 src/amd/vulkan/radv_shader.h   | 1 +
 4 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/src/amd/vulkan/radv_pipeline.c b/src/amd/vulkan/radv_pipeline.c
index 4150617b995..9fac3b31b62 100644
--- a/src/amd/vulkan/radv_pipeline.c
+++ b/src/amd/vulkan/radv_pipeline.c
@@ -231,12 +231,6 @@ radv_get_hash_flags(const struct radv_device *device, bool stats)
       hash_flags |= RADV_HASH_SHADER_LLVM;
    if (stats)
       hash_flags |= RADV_HASH_SHADER_KEEP_STATISTICS;
-   if (device->force_vrs == RADV_FORCE_VRS_2x2)
-      hash_flags |= RADV_HASH_SHADER_FORCE_VRS_2x2;
-   if (device->force_vrs == RADV_FORCE_VRS_2x1)
-      hash_flags |= RADV_HASH_SHADER_FORCE_VRS_2x1;
-   if (device->force_vrs == RADV_FORCE_VRS_1x2)
-      hash_flags |= RADV_HASH_SHADER_FORCE_VRS_1x2;
    if (device->robust_buffer_access) /* forces per-attribute vertex descriptors */
       hash_flags |= RADV_HASH_SHADER_ROBUST_BUFFER_ACCESS;
    if (device->robust_buffer_access2) /* affects load/store vectorizer */
@@ -2728,6 +2722,8 @@ radv_generate_graphics_pipeline_key(const struct radv_pipeline *pipeline,
    if (pipeline->device->instance->enable_mrt_output_nan_fixup)
       key.ps.enable_mrt_output_nan_fixup = true;
 
+   key.ps.force_vrs = pipeline->device->force_vrs;
+
    if (pipeline->device->instance->debug_flags & RADV_DEBUG_INVARIANT_GEOM)
       key.invariant_geom = true;
 
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h
index 943f053b785..69179a1b641 100644
--- a/src/amd/vulkan/radv_private.h
+++ b/src/amd/vulkan/radv_private.h
@@ -1660,9 +1660,6 @@ struct radv_event {
 #define RADV_HASH_SHADER_GE_WAVE32         (1 << 3)
 #define RADV_HASH_SHADER_LLVM              (1 << 4)
 #define RADV_HASH_SHADER_KEEP_STATISTICS   (1 << 8)
-#define RADV_HASH_SHADER_FORCE_VRS_2x2     (1 << 9)
-#define RADV_HASH_SHADER_FORCE_VRS_2x1     (1 << 10)
-#define RADV_HASH_SHADER_FORCE_VRS_1x2     (1 << 11)
 #define RADV_HASH_SHADER_FORCE_NGG_CULLING (1 << 13)
 #define RADV_HASH_SHADER_ROBUST_BUFFER_ACCESS (1 << 14)
 #define RADV_HASH_SHADER_ROBUST_BUFFER_ACCESS2 (1 << 15)
diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 33fd0c50bb5..169719eb700 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -1576,7 +1576,7 @@ shader_variant_compile(struct radv_device *device, struct vk_shader_module *modu
    options->debug.func = radv_compiler_debug;
    options->debug.private_data = &debug_data;
 
-   switch (device->force_vrs) {
+   switch (options->key.ps.force_vrs) {
    case RADV_FORCE_VRS_2x2:
       options->force_vrs_rates = (1u << 2) | (1u << 4);
       break;
diff --git a/src/amd/vulkan/radv_shader.h b/src/amd/vulkan/radv_shader.h
index 4c607127e16..09bc33cebfe 100644
--- a/src/amd/vulkan/radv_shader.h
+++ b/src/amd/vulkan/radv_shader.h
@@ -79,6 +79,7 @@ struct radv_pipeline_key {
 
       bool lower_discard_to_demote;
       bool enable_mrt_output_nan_fixup;
+      uint8_t force_vrs;
    } ps;
 
    struct {



More information about the mesa-commit mailing list