-
Notifications
You must be signed in to change notification settings - Fork 123
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
Add used resolutions info #1167
Open
bartosz-muszarski-arm
wants to merge
2
commits into
LunarG:dev
Choose a base branch
from
bartosz-muszarski-arm:resolution-report
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,11 +30,14 @@ | |
#include "generated/generated_vulkan_struct_decoders.h" | ||
#include "generated/generated_vulkan_consumer.h" | ||
#include "util/defines.h" | ||
#include "vulkan/vulkan.hpp" | ||
#include "vulkan/vulkan_hash.hpp" | ||
|
||
#include "vulkan/vulkan.h" | ||
|
||
#include <set> | ||
#include <unordered_map> | ||
#include <unordered_set> | ||
|
||
GFXRECON_BEGIN_NAMESPACE(gfxrecon) | ||
GFXRECON_BEGIN_NAMESPACE(decode) | ||
|
@@ -57,6 +60,7 @@ class VulkanStatsConsumer : public gfxrecon::decode::VulkanConsumer, public gfxr | |
uint64_t GetMaxAllocationSize() const { return max_allocation_size_; } | ||
uint64_t GetAnnotationCount() const { return annotation_count_; } | ||
const std::vector<std::string>& GetOperationAnnotationDatas() const { return operation_annotation_datas_; } | ||
const auto& GetResolutions() const { return resolutions_; } | ||
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'm not a fan of |
||
|
||
const std::set<gfxrecon::format::HandleId>& GetInstantiatedDevices() const { return used_physical_devices_; } | ||
const VkPhysicalDeviceProperties* GetDeviceProperties(gfxrecon::format::HandleId id) const | ||
|
@@ -408,6 +412,40 @@ class VulkanStatsConsumer : public gfxrecon::decode::VulkanConsumer, public gfxr | |
} | ||
} | ||
|
||
virtual void Process_vkCreateSwapchainKHR( | ||
const gfxrecon::decode::ApiCallInfo& call_info, | ||
VkResult returnValue, | ||
gfxrecon::format::HandleId device, | ||
gfxrecon::decode::StructPointerDecoder<gfxrecon::decode::Decoded_VkSwapchainCreateInfoKHR>* pCreateInfo, | ||
gfxrecon::decode::StructPointerDecoder<gfxrecon::decode::Decoded_VkAllocationCallbacks>* pAllocator, | ||
gfxrecon::decode::HandlePointerDecoder<VkSwapchainKHR>* pSwapchain) | ||
{ | ||
if (!pCreateInfo->IsNull()) | ||
{ | ||
const auto& extent = pCreateInfo->GetPointer()->imageExtent; | ||
resolutions_.insert(extent); | ||
} | ||
} | ||
|
||
virtual void | ||
Process_vkCreateSharedSwapchainsKHR(const ApiCallInfo& call_info, | ||
VkResult returnValue, | ||
format::HandleId device, | ||
uint32_t swapchainCount, | ||
StructPointerDecoder<Decoded_VkSwapchainCreateInfoKHR>* pCreateInfos, | ||
StructPointerDecoder<Decoded_VkAllocationCallbacks>* pAllocator, | ||
HandlePointerDecoder<VkSwapchainKHR>* pSwapchains) | ||
{ | ||
if (!pCreateInfos->IsNull()) | ||
{ | ||
for (uint32_t i = 0; i < swapchainCount; ++i) | ||
{ | ||
const auto& extent = pCreateInfos->GetPointer()[i].imageExtent; | ||
resolutions_.insert(extent); | ||
} | ||
} | ||
} | ||
|
||
private: | ||
uint32_t trimmed_frame_{ 0 }; | ||
|
||
|
@@ -438,6 +476,8 @@ class VulkanStatsConsumer : public gfxrecon::decode::VulkanConsumer, public gfxr | |
// Annotation info. | ||
std::vector<std::string> operation_annotation_datas_; | ||
uint64_t annotation_count_{ 0 }; | ||
|
||
std::unordered_set<vk::Extent2D> resolutions_; | ||
}; | ||
|
||
GFXRECON_END_NAMESPACE(decode) | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sorry, I didn't catch this on first pass. This would be the first inclusion of VulkanHpp and I want to be a little more deliberate about adding it. Can you just use VkExtent2D?
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.
@bartosz-muszarski-arm if you haven't done this already I see how it smooths out the feature you added and I'm not in principle against it. I'm doing a straw poll to see if anyone has any issues with including VulkanHpp.
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.
Could we at least reduce this to just including the structs header and not taking in the entire C++ wrapper?
EDIT:
vulkan_hash.hpp
included on the next line includesvulkan.hpp
anyway...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.
And also turn off every feature we don't need in the headers that has a macro that defaults to enabled. e.g. in our CMake configs for all projects define
VULKAN_HPP_NO_STRUCT_SETTERS
. We can then turn stuff on when we need it, where we need it.