[PATCH umr 17/17] gui/waves_panel: grey out inactive lanes of VGPRs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Nicolai Hähnle <nicolai.haehnle@xxxxxxx>
---
 src/app/gui/waves_panel.cpp | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/app/gui/waves_panel.cpp b/src/app/gui/waves_panel.cpp
index 68b06ea..cc37a1b 100644
--- a/src/app/gui/waves_panel.cpp
+++ b/src/app/gui/waves_panel.cpp
@@ -153,26 +153,30 @@ public:
 
 		ImGui::Separator();
 		if (!waves.empty()) {
 			ImGui::BeginChild("Waves", ImVec2(avail.x / 2, 0), false, ImGuiWindowFlags_NoTitleBar);
 			bool force_scroll = false;
 			for (size_t i = 0; i < waves.size(); ++i) {
 				JSON_Object *wave = waves[i].wave;
 				JSON_Object *status = json_object(json_object_get_value(wave, "status"));
 
 				int active_threads = -1;
+				uint64_t exec = 0;
 				JSON_Array *threads = json_object_get_array(wave, "threads");
 				if (threads) {
 					active_threads = 0;
 					int s = json_array_get_count(threads);
 					for (int i = 0; i < s; i++) {
-						active_threads += json_array_get_boolean(threads, i);
+						bool active = json_array_get_boolean(threads, i) == 1;
+						active_threads += active ? 1 : 0;
+						if (active)
+							exec |= (uint64_t)1 << i;
 					}
 				}
 				const char *shader_address_str = json_object_get_string(wave, "shader");
 
 				char label[256];
 				if (active_threads < 0)
 					sprintf(label, "Wave %s", waves[i].id.c_str());
 				else if (shader_address_str)
 					sprintf(label, "Wave %s (#dbde79%d threads, valid PC)", waves[i].id.c_str(), active_threads);
 				else
@@ -288,21 +292,22 @@ public:
 								ImGui::PopID();
 								ImGui::NextColumn();
 							}
 							ImGui::PopID();
 							ImGui::Columns(1);
 							ImGui::TreePop();
 						}
 					}
 
 					{
-						static const char *formats[] = { "#6c71c4%d", "#6c71c4%u", "#6c71c4%08x" };
+						static const char *formats_active[] = { "#6c71c4%d", "#6c71c4%u", "#6c71c4%08x", "#6c71c4%f" };
+						static const char *formats_inactive[] = { "#818181%d", "#818181%u", "#818181%08x", "#818181%f" };
 						JSON_Array *vgpr = json_object_get_array(wave, "vgpr");
 						if (vgpr && ImGui::TreeNodeEx("#6c71c4VGPRs")) {
 							int s = json_array_get_count(vgpr);
 
 							ImGui::BeginTable("vgprvalues", 5, ImGuiTableFlags_Borders);
 							ImGui::TableSetupColumn("Base");
 							ImGui::TableSetupColumn("+ 0");
 							ImGui::TableSetupColumn("+ 1");
 							ImGui::TableSetupColumn("+ 2");
 							ImGui::TableSetupColumn("+ 3");
@@ -330,26 +335,28 @@ public:
 									int num_thread = json_array_get_count(vgp);
 
 									for (int t = 0; t < num_thread; t++) {
 										if (t % 4 == 0) {
 											ImGui::TableNextRow();
 											ImGui::TableSetColumnIndex(0);
 											ImGui::Text("%d", t);
 										}
 										ImGui::TableSetColumnIndex(1 + t % 4);
 
+										const char **formats = (exec >> t) & 1 ? formats_active : formats_inactive;
+
 										JSON_Value *v = json_array_get_value(vgp, t);
 										ImGui::PushID(v);
 										int aaa = (int)json_number(v);
 										if (*mode == 3) {
 											float f = reinterpret_cast<float&>(aaa);
-											ImGui::Text("#6c71c4%f", f);
+											ImGui::Text(formats[3], f);
 										} else {
 											ImGui::Text(formats[*mode], aaa);
 										}
 										ImGui::PopID();
 									}
 								}
 								ImGui::PopID();
 							}
 							ImGui::EndTable();
 							ImGui::TreePop();
-- 
2.40.0




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux