Last active
July 30, 2019 11:42
-
-
Save doitsujin/c3066708e4cab70ac3eb050eea5dfafc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From ead48c30b96cb585584dce766822fac09a753f98 Mon Sep 17 00:00:00 2001 | |
From: Philip Rebohle <philip.rebohle@tu-dortmund.de> | |
Date: Tue, 30 Jul 2019 13:36:09 +0200 | |
Subject: [PATCH] radv: Optimize rebinding the same descriptor set (v2) | |
Same idea as in 02a43edf186cb9998741ba765cb948bb238a122d, but | |
still call radv_set_descriptor_set, only skip BO list iteration. | |
Fixes performance issues in Wolfenstein Youngblood. | |
--- | |
src/amd/vulkan/radv_cmd_buffer.c | 9 +++++++++ | |
1 file changed, 9 insertions(+) | |
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c | |
index dd22b8e9ef3..71f9376d159 100644 | |
--- a/src/amd/vulkan/radv_cmd_buffer.c | |
+++ b/src/amd/vulkan/radv_cmd_buffer.c | |
@@ -3270,9 +3270,18 @@ radv_bind_descriptor_set(struct radv_cmd_buffer *cmd_buffer, | |
struct radv_descriptor_set *set, unsigned idx) | |
{ | |
struct radeon_winsys *ws = cmd_buffer->device->ws; | |
+ struct radv_descriptor_state *descriptors_state = | |
+ radv_get_descriptors_state(cmd_buffer, bind_point); | |
+ bool changed; | |
+ | |
+ changed = descriptors_state->sets[idx] != set || | |
+ !(descriptors_state->valid & (1u << idx)); | |
radv_set_descriptor_set(cmd_buffer, bind_point, set, idx); | |
+ if (!changed) | |
+ return; | |
+ | |
assert(set); | |
assert(!(set->layout->flags & VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR)); | |
-- | |
2.22.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment