-
Notifications
You must be signed in to change notification settings - Fork 14
Cleanup AMD specific features. #682
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,6 @@ class DiveTreeView; | |
| class ErrorDialog; | ||
| class EventSelection; | ||
| class EventStateView; | ||
| class EventTimingView; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think we could remove event timing for now, but one of the tasks i want @GrantComm to work on is to use the timeline view (not necessarily this one) to replace the gpu timing table that we have now. The old event timing view could be a good reference for Grant. |
||
| class FrameTabView; | ||
| class GfxrVulkanCommandArgumentsFilterProxyModel; | ||
| class GfxrVulkanCommandArgumentsTabView; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,9 +19,31 @@ | |
| #include <QTreeWidget> | ||
| #include <QVBoxLayout> | ||
|
|
||
| #include "absl/strings/str_format.h" | ||
| #include "dive_core/data_core.h" | ||
| #include "dive_core/dive_strings.h" | ||
|
|
||
| namespace | ||
| { | ||
| QString GetHeapString(Dive::MemoryAllocationData::GpuHeap heap) | ||
| { | ||
| switch (heap) | ||
| { | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapLocal: | ||
| return QObject::tr("Local"); | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapInvisible: | ||
| return QObject::tr("Invisible"); | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapGartUswc: | ||
| return QObject::tr("GartUswc"); | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapGartCacheable: | ||
| return QObject::tr("GartCacheable"); | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapCount: | ||
| return QObject::tr("GpuHeap(unknown)"); | ||
| } | ||
| return QObject::tr("GpuHeap(unknown)"); | ||
| } | ||
| } // namespace | ||
|
|
||
| // ================================================================================================= | ||
| // BufferWidgetItem | ||
| // ================================================================================================= | ||
|
|
@@ -46,15 +68,10 @@ BufferView::BufferView(const Dive::DataCore &data_core) | |
| { | ||
| QVBoxLayout *layout = new QVBoxLayout(); | ||
| m_buffer_list = new QTreeWidget(); | ||
| m_buffer_list->setColumnCount(9); | ||
| m_buffer_list->setColumnCount(4); | ||
| m_buffer_list->setHeaderLabels(QStringList() << "Shader Stage" | ||
| << "Address" | ||
| << "Size" | ||
| << "Format" | ||
| << "Dest-X" | ||
| << "Dest-Y" | ||
| << "Dest-Z" | ||
| << "Dest-W" | ||
| << "Preferred Heap"); | ||
| m_memory_view = new QTableWidget(); | ||
| m_memory_view->setColumnCount(kNumDwordsPerRow + 1); | ||
|
|
@@ -100,40 +117,14 @@ void BufferView::OnEventSelected(uint32_t event_index) | |
| treeItem->setText(0, tr(kShaderStageStrings[shader_stage])); | ||
|
|
||
| // Column 1 | ||
| constexpr uint32_t kStrBufferSize = 256; | ||
| char str_buffer[kStrBufferSize]; | ||
| snprintf(str_buffer, kStrBufferSize, "%p", (void *)buffer_info.m_addr); | ||
| treeItem->setText(1, tr(str_buffer)); | ||
| treeItem->setText( | ||
| 1, QString::fromStdString(absl::StrFormat("%" PRIx64, buffer_info.m_addr))); | ||
|
|
||
| // Column 2 | ||
| snprintf(str_buffer, kStrBufferSize, "%" PRIu64, buffer_info.m_size); | ||
| treeItem->setText(2, tr(str_buffer)); | ||
| /* | ||
| treeItem->setText( | ||
| 2, QString::fromStdString(absl::StrFormat("%" PRIu64, buffer_info.m_size))); | ||
|
|
||
| // Column 3 | ||
| snprintf(str_buffer, | ||
| kStrBufferSize, | ||
| "%s_%s", | ||
| kBufferDataFormatStrings[buffer_info.m_data_format], | ||
| kBufferNumFormatStrings[buffer_info.m_num_format]); | ||
| treeItem->setText(3, tr(str_buffer)); | ||
|
|
||
| // Column 4 | ||
| snprintf(str_buffer, kStrBufferSize, "%s", | ||
| kSqSelStrings[(uint32_t)buffer_info.m_dst_sel_x]); treeItem->setText(4, tr(str_buffer)); | ||
|
|
||
| // Column 5 | ||
| snprintf(str_buffer, kStrBufferSize, "%s", | ||
| kSqSelStrings[(uint32_t)buffer_info.m_dst_sel_y]); treeItem->setText(5, tr(str_buffer)); | ||
|
|
||
| // Column 6 | ||
| snprintf(str_buffer, kStrBufferSize, "%s", | ||
| kSqSelStrings[(uint32_t)buffer_info.m_dst_sel_z]); treeItem->setText(6, tr(str_buffer)); | ||
|
|
||
| // Column 7 | ||
| snprintf(str_buffer, kStrBufferSize, "%s", | ||
| kSqSelStrings[(uint32_t)buffer_info.m_dst_sel_w]); treeItem->setText(7, tr(str_buffer)); | ||
| */ | ||
| // Column 8 | ||
| // Find preferred heap | ||
| const Dive::Pm4CaptureData &capture_data = m_data_core.GetPm4CaptureData(); | ||
| const Dive::MemoryManager &memory = capture_data.GetMemoryManager(); | ||
|
|
@@ -142,24 +133,8 @@ void BufferView::OnEventSelected(uint32_t event_index) | |
| mem_alloc_ptr = | ||
| mem_alloc_info.FindGlobalAllocation(buffer_info.m_addr, buffer_info.m_size); | ||
| DIVE_ASSERT(mem_alloc_ptr != nullptr); | ||
| switch ((Dive::MemoryAllocationData::GpuHeap)mem_alloc_ptr->m_preferred_heap) | ||
| { | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapLocal: | ||
| snprintf(str_buffer, kStrBufferSize, "Local"); | ||
| break; | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapInvisible: | ||
| snprintf(str_buffer, kStrBufferSize, "Invisible"); | ||
| break; | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapGartUswc: | ||
| snprintf(str_buffer, kStrBufferSize, "GartUswc"); | ||
| break; | ||
| case Dive::MemoryAllocationData::GpuHeap::GpuHeapGartCacheable: | ||
| snprintf(str_buffer, kStrBufferSize, "GartCacheable"); | ||
| break; | ||
| default: | ||
| DIVE_ASSERT(false); | ||
| } | ||
| treeItem->setText(8, tr(str_buffer)); | ||
| treeItem->setText(3, GetHeapString(static_cast<Dive::MemoryAllocationData::GpuHeap>( | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wow, i didn't know we can check the heap info. where can i see this heap info? i tried a capture but couldn't find this info in the shader tab or pm4 packets tab.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh i see, need to enable ENABLE_CAPTURE_BUFFERS? i never tried it. can you add a screenshot of the heap info in this PR?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The source information was from AMD open source driver. This view is compile time disabled ( |
||
| mem_alloc_ptr->m_preferred_heap))); | ||
|
|
||
| // Store the buffer index for retrieval on item selection | ||
| m_buffer_indices.push_back(buffer_index); | ||
|
|
||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think could remove ENABLE_CAPTURE_BUFFERS, is it expensive of enabling it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENABLE_CAPTURE_BUFFERS was an AMDVLK-only experimental feature that does not apply for our new Adrenal world. I would remove the entirety of buffers_view.cpp, since it's very old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is the part i am confused, i saw some later code in this PR when we parse the PM4, we actually get heap types from PM4, and show it in UI when the buffer capture is enabled. and the Heap type seems to be valid for Adreno gpu?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure we can also infer some basic information from Vulkan capture.