Skip to content
Merged
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
4 changes: 3 additions & 1 deletion USAGE_desktop_Vulkan.md
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,9 @@ Optional arguments:
virtual Virtual Swapchain of images which match
the swapchain in effect at capture time and
which are copied to the underlying swapchain of the
implementation being replayed on. This is default.
implementation being replayed on. Also displays
offscreen frame boundaries to an additional window.
This is default.
captured Use the swapchain indices stored in the
capture directly on the swapchain setup for replay.
offscreen Disable creating swapchains, surfaces
Expand Down
4 changes: 2 additions & 2 deletions framework/decode/replay_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct ReplayOptions
bool flush_measurement_frame_range{ false };
bool flush_inside_measurement_range{ false };
bool force_windowed{ false };
uint32_t windowed_width{ 0 };
uint32_t windowed_height{ 0 };
uint32_t windowed_width{ 320 };
uint32_t windowed_height{ 240 };
bool force_windowed_origin{ false };
int32_t window_topleft_x{ 0 };
int32_t window_topleft_y{ 0 };
Expand Down
23 changes: 23 additions & 0 deletions framework/decode/vulkan_captured_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,29 @@ void VulkanCapturedSwapchain::CmdPipelineBarrier2(PFN_vkCmdPipelineBarrier2 func
func(command_buffer, pDependencyInfo);
}

void VulkanCapturedSwapchain::FrameBoundaryANDROID(PFN_vkFrameBoundaryANDROID func,
const VulkanDeviceInfo* device_info,
const VulkanSemaphoreInfo* semaphore_info,
const VulkanImageInfo* image_info,
VulkanInstanceInfo* instance_info,
const graphics::VulkanInstanceTable* instance_table,
const graphics::VulkanDeviceTable* device_table,
application::Application* application)
{
GFXRECON_UNREFERENCED_PARAMETER(instance_info);
GFXRECON_UNREFERENCED_PARAMETER(instance_table);
GFXRECON_UNREFERENCED_PARAMETER(device_table);
GFXRECON_UNREFERENCED_PARAMETER(application);

GFXRECON_ASSERT(device_info != nullptr);

VkDevice device = device_info->handle;
VkSemaphore semaphore = (semaphore_info == nullptr ? VK_NULL_HANDLE : semaphore_info->handle);
VkImage image = (image_info == nullptr ? VK_NULL_HANDLE : image_info->handle);

func(device, semaphore, image);
}

void VulkanCapturedSwapchain::ProcessSetSwapchainImageStateCommand(
const VulkanDeviceInfo* device_info,
VulkanSwapchainKHRInfo* swapchain_info,
Expand Down
9 changes: 9 additions & 0 deletions framework/decode/vulkan_captured_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,15 @@ class VulkanCapturedSwapchain : public VulkanSwapchain
VulkanCommandBufferInfo* command_buffer_info,
const VkDependencyInfo* pDependencyInfo) override;

virtual void FrameBoundaryANDROID(PFN_vkFrameBoundaryANDROID func,
const VulkanDeviceInfo* device_info,
const VulkanSemaphoreInfo* semaphore_info,
const VulkanImageInfo* image_info,
VulkanInstanceInfo* instance_info,
const graphics::VulkanInstanceTable* instance_table,
const graphics::VulkanDeviceTable* device_table,
application::Application* application) override;

virtual void ProcessSetSwapchainImageStateCommand(const VulkanDeviceInfo* device_info,
VulkanSwapchainKHRInfo* swapchain_info,
uint32_t last_presented_image,
Expand Down
8 changes: 5 additions & 3 deletions framework/decode/vulkan_object_cleanup_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,12 @@ void FreeAllLiveObjects(CommonObjectInfoTable*
&CommonObjectInfoTable::VisitVkDeviceInfo,
&CommonObjectInfoTable::RemoveVkDeviceInfo,
[&](const VulkanDeviceInfo* object_info) {
assert(object_info != nullptr);
GFXRECON_ASSERT(object_info != nullptr);
GFXRECON_ASSERT(swapchain != nullptr)
auto* device_table = get_device_table(object_info->handle);
swapchain->CleanDeviceResources(object_info->handle, device_table);
object_info->allocator->Destroy();
auto table = get_device_table(object_info->handle);
table->DestroyDevice(object_info->handle, nullptr);
device_table->DestroyDevice(object_info->handle, nullptr);
});

// Remove the objects that are not destroyed from the table.
Expand Down
29 changes: 23 additions & 6 deletions framework/decode/vulkan_offscreen_swapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ VkResult VulkanOffscreenSwapchain::CreateSurface(VkResult
VkFlags flags,
HandlePointerDecoder<VkSurfaceKHR>* surface,
const graphics::VulkanInstanceTable* instance_table,
application::Application* application,
const int32_t xpos,
const int32_t ypos,
const uint32_t width,
const uint32_t height,
bool force_windowed)
application::Application* application)
{
GFXRECON_ASSERT(surface);

Expand Down Expand Up @@ -291,6 +286,28 @@ VkResult VulkanOffscreenSwapchain::QueuePresentKHR(VkResult
return original_result;
}

void VulkanOffscreenSwapchain::FrameBoundaryANDROID(PFN_vkFrameBoundaryANDROID func,
const VulkanDeviceInfo* device_info,
const VulkanSemaphoreInfo* semaphore_info,
const VulkanImageInfo* image_info,
VulkanInstanceInfo* instance_info,
const graphics::VulkanInstanceTable* instance_table,
const graphics::VulkanDeviceTable* device_table,
application::Application* application)
{
GFXRECON_UNREFERENCED_PARAMETER(instance_info);
GFXRECON_UNREFERENCED_PARAMETER(instance_table);
GFXRECON_UNREFERENCED_PARAMETER(device_table);
GFXRECON_UNREFERENCED_PARAMETER(application);

GFXRECON_ASSERT(device_info != nullptr);

VkSemaphore semaphore = (semaphore_info == nullptr ? VK_NULL_HANDLE : semaphore_info->handle);
VkImage image = (image_info == nullptr ? VK_NULL_HANDLE : image_info->handle);

func(device_info->handle, semaphore, image);
}

// queue_info could be nullptr. It means it doesn't specify a VkQueue and use default_queue. Its purpose is to singal
// semaphores or fence. All VkQueue should work.
VkResult VulkanOffscreenSwapchain::SignalSemaphoresFence(const VulkanQueueInfo* queue_info,
Expand Down
16 changes: 10 additions & 6 deletions framework/decode/vulkan_offscreen_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ class VulkanOffscreenSwapchain : public VulkanVirtualSwapchain
VkFlags flags,
HandlePointerDecoder<VkSurfaceKHR>* surface,
const graphics::VulkanInstanceTable* instance_table,
application::Application* application,
const int32_t xpos,
const int32_t ypos,
const uint32_t width,
const uint32_t height,
bool force_windowed = false) override;
application::Application* application) override;

virtual void DestroySurface(PFN_vkDestroySurfaceKHR func,
const VulkanInstanceInfo* instance_info,
Expand Down Expand Up @@ -99,6 +94,15 @@ class VulkanOffscreenSwapchain : public VulkanVirtualSwapchain
const VulkanQueueInfo* queue_info,
const VkPresentInfoKHR* present_info) override;

virtual void FrameBoundaryANDROID(PFN_vkFrameBoundaryANDROID func,
const VulkanDeviceInfo* device_info,
const VulkanSemaphoreInfo* semaphore_info,
const VulkanImageInfo* image_info,
VulkanInstanceInfo* instance_info,
const graphics::VulkanInstanceTable* instance_table,
const graphics::VulkanDeviceTable* device_table,
application::Application* application) override;

private:
const uint32_t default_queue_family_index_{ 0 };
VkQueue default_queue_{ VK_NULL_HANDLE }; // default_queue_family_index_,0
Expand Down
Loading
Loading