Skip to content
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

Align capture and replay swapchain transformations #2025

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions framework/decode/vulkan_replay_consumer_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6384,6 +6384,12 @@ VkResult VulkanReplayConsumerBase::OverrideCreateSwapchainKHR(
{
SetSwapchainWindowSize(meta_info);

#if defined(VK_USE_PLATFORM_ANDROID_KHR)
// On Android, SetSwapchainWindowSize will take care of non identity transformations by requesting the
// appropriate orientation with setRequestedOrientation
modified_create_info.preTransform = VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR;
#endif

const auto surface_info = object_info_table_->GetVkSurfaceKHRInfo(meta_info->surface);

if (surface_info && (surface_info->window != nullptr))
Expand Down
8 changes: 4 additions & 4 deletions framework/generated/generated_vulkan_replay_consumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5249,8 +5249,8 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceCapabilities2KHR(
}
auto in_physicalDevice = GetObjectInfoTable().GetVkPhysicalDeviceInfo(physicalDevice);

if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
MapStructHandles(pSurfaceInfo->GetMetaStructPointer(), GetObjectInfoTable());
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
auto in_pSurfaceInfo_meta = pSurfaceInfo->GetMetaStructPointer();
if (GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface) == nullptr || GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface)->surface_creation_skipped) { return; }
pSurfaceCapabilities->IsNull() ? nullptr : pSurfaceCapabilities->AllocateOutputData(1, { VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_2_KHR, nullptr });
Expand All @@ -5275,8 +5275,8 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfaceFormats2KHR(
}
VkPhysicalDevice in_physicalDevice = MapHandle<VulkanPhysicalDeviceInfo>(physicalDevice, &CommonObjectInfoTable::GetVkPhysicalDeviceInfo);
const VkPhysicalDeviceSurfaceInfo2KHR* in_pSurfaceInfo = pSurfaceInfo->GetPointer();
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
MapStructHandles(pSurfaceInfo->GetMetaStructPointer(), GetObjectInfoTable());
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
auto in_pSurfaceInfo_meta = pSurfaceInfo->GetMetaStructPointer();
if (GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface) == nullptr || GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface)->surface_creation_skipped) { return; }
uint32_t* out_pSurfaceFormatCount = pSurfaceFormatCount->IsNull() ? nullptr : pSurfaceFormatCount->AllocateOutputData(1, GetOutputArrayCount<uint32_t, VulkanPhysicalDeviceInfo>("vkGetPhysicalDeviceSurfaceFormats2KHR", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceSurfaceFormats2KHR, pSurfaceFormatCount, pSurfaceFormats, &CommonObjectInfoTable::GetVkPhysicalDeviceInfo));
Expand Down Expand Up @@ -8400,8 +8400,8 @@ void VulkanReplayConsumer::Process_vkGetPhysicalDeviceSurfacePresentModes2EXT(
}
VkPhysicalDevice in_physicalDevice = MapHandle<VulkanPhysicalDeviceInfo>(physicalDevice, &CommonObjectInfoTable::GetVkPhysicalDeviceInfo);
const VkPhysicalDeviceSurfaceInfo2KHR* in_pSurfaceInfo = pSurfaceInfo->GetPointer();
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
MapStructHandles(pSurfaceInfo->GetMetaStructPointer(), GetObjectInfoTable());
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
auto in_pSurfaceInfo_meta = pSurfaceInfo->GetMetaStructPointer();
if (GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface) == nullptr || GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface)->surface_creation_skipped) { return; }
uint32_t* out_pPresentModeCount = pPresentModeCount->IsNull() ? nullptr : pPresentModeCount->AllocateOutputData(1, GetOutputArrayCount<uint32_t, VulkanPhysicalDeviceInfo>("vkGetPhysicalDeviceSurfacePresentModes2EXT", returnValue, physicalDevice, kPhysicalDeviceArrayGetPhysicalDeviceSurfacePresentModes2EXT, pPresentModeCount, pPresentModes, &CommonObjectInfoTable::GetVkPhysicalDeviceInfo));
Expand Down Expand Up @@ -8465,8 +8465,8 @@ void VulkanReplayConsumer::Process_vkGetDeviceGroupSurfacePresentModes2EXT(
}
VkDevice in_device = MapHandle<VulkanDeviceInfo>(device, &CommonObjectInfoTable::GetVkDeviceInfo);
const VkPhysicalDeviceSurfaceInfo2KHR* in_pSurfaceInfo = pSurfaceInfo->GetPointer();
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
MapStructHandles(pSurfaceInfo->GetMetaStructPointer(), GetObjectInfoTable());
if (pSurfaceInfo->GetPointer()->surface == VK_NULL_HANDLE) { return; }
auto in_pSurfaceInfo_meta = pSurfaceInfo->GetMetaStructPointer();
if (GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface) == nullptr || GetObjectInfoTable().GetVkSurfaceKHRInfo(in_pSurfaceInfo_meta->surface)->surface_creation_skipped) { return; }
VkDeviceGroupPresentModeFlagsKHR* out_pModes = pModes->IsNull() ? nullptr : pModes->AllocateOutputData(1, static_cast<VkDeviceGroupPresentModeFlagsKHR>(0));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,20 +573,17 @@ def make_body_expressions(self, return_type, name, values, is_override):
name=value.name
)
else:
# If surface was not created, need to automatically ignore for non-overrides queries
# Swapchain also need to check if a dummy swapchain was created instead
if value.name == "pSurfaceInfo":
expr = 'if ({}->GetPointer()->surface == VK_NULL_HANDLE) {{ return; }}'.format(
value.name
)
preexpr.append(expr)

expr = 'MapStructHandles({}->GetMetaStructPointer(), GetObjectInfoTable());'.format(
value.name
)
preexpr.append(expr)

# If surface was not created, need to automatically ignore for non-overrides queries
# Swapchain also need to check if a dummy swapchain was created instead
if value.name == "pSurfaceInfo":
expr = 'if ({}->GetPointer()->surface == VK_NULL_HANDLE) {{ return; }}'.format(
value.name
)
preexpr.append(expr)

var_name = 'in_' + value.name + '_meta'
Expand All @@ -599,7 +596,8 @@ def make_body_expressions(self, return_type, name, values, is_override):
var_name
)
preexpr.append(expr)
expr = ''

expr = ''
else:
# Initialize output pointer.
if value.is_array:
Expand Down
Loading