Do swapchain resizing properly and re-enable thumbnails (working now?!)

This commit is contained in:
baldurk
2016-02-07 18:43:36 +01:00
parent 4336722e34
commit 963986b9e9
4 changed files with 21 additions and 7 deletions
-1
View File
@@ -43,7 +43,6 @@ On capture:
On replay:
* Only 2D non-array non-integer textures can currently be displayed.
* Thumbnail images aren't rendered (causes crashes/halts on nvidia's driver).
* Auto texture range-fit or histogram display is not implemented.
* Debug overlays aren't implemented.
* Saving textures is not supported.
+19 -3
View File
@@ -111,12 +111,18 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
if(bb != VK_NULL_HANDLE)
{
vt->DestroyRenderPass(Unwrap(device), Unwrap(renderpass));
VKMGR()->ReleaseWrappedResource(renderpass);
renderpass = VK_NULL_HANDLE;
vt->DestroyImage(Unwrap(device), Unwrap(bb));
VKMGR()->ReleaseWrappedResource(bb);
vt->DestroyImageView(Unwrap(device), Unwrap(bbview));
VKMGR()->ReleaseWrappedResource(bbview);
vt->FreeMemory(Unwrap(device), Unwrap(bbmem));
VKMGR()->ReleaseWrappedResource(bbmem);
vt->DestroyFramebuffer(Unwrap(device), Unwrap(fb));
VKMGR()->ReleaseWrappedResource(fb);
bb = VK_NULL_HANDLE;
bbview = VK_NULL_HANDLE;
@@ -126,7 +132,11 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
// not owned - freed with the swapchain
for(size_t i=0; i < ARRAY_COUNT(colimg); i++)
{
if(colimg[i] != VK_NULL_HANDLE)
VKMGR()->ReleaseWrappedResource(colimg[i]);
colimg[i] = VK_NULL_HANDLE;
}
if(dsimg != VK_NULL_HANDLE)
{
@@ -142,7 +152,10 @@ void VulkanReplay::OutputWindow::Destroy(WrappedVulkan *driver, VkDevice device)
}
if(swap != VK_NULL_HANDLE)
{
vt->DestroySwapchainKHR(Unwrap(device), Unwrap(swap));
VKMGR()->ReleaseWrappedResource(swap);
}
}
void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device, bool depth)
@@ -268,7 +281,10 @@ void VulkanReplay::OutputWindow::Create(WrappedVulkan *driver, VkDevice device,
VKMGR()->WrapResource(Unwrap(device), swap);
if(old != VK_NULL_HANDLE)
{
vt->DestroySwapchainKHR(Unwrap(device), Unwrap(old));
VKMGR()->ReleaseWrappedResource(old);
}
vkr = vt->GetSwapchainImagesKHR(Unwrap(device), Unwrap(swap), &numImgs, NULL);
RDCASSERT(vkr == VK_SUCCESS);
@@ -713,12 +729,12 @@ bool VulkanReplay::RenderTextureInternal(TextureDisplay cfg, VkRenderPassBeginIn
if(yscale > xscale)
{
data->Position.x = 0;
data->Position.y = (float(m_DebugWidth)-(tex_y*scale) )*0.5f;
data->Position.y = (float(m_DebugHeight)-(tex_y*scale) )*0.5f;
}
else
{
data->Position.y = 0;
data->Position.x = (float(m_DebugHeight)-(tex_x*scale) )*0.5f;
data->Position.x = (float(m_DebugWidth)-(tex_x*scale) )*0.5f;
}
}
@@ -1009,7 +1025,7 @@ bool VulkanReplay::CheckResizeOutputWindow(uint64_t id)
outw.height = h;
// VKTODOHIGH Currently the resize code crashes - unsure why
if(outw.width > 0 && outw.height > 0 && 0)
if(outw.width > 0 && outw.height > 0)
{
bool depth = (outw.dsimg != VK_NULL_HANDLE);
+1 -2
View File
@@ -234,7 +234,6 @@ bool ReplayOutput::SetPixelContext(void *wnd)
bool ReplayOutput::AddThumbnail(void *wnd, ResourceId texID)
{
#if 0
OutputPair p;
RDCASSERT(wnd);
@@ -273,7 +272,7 @@ bool ReplayOutput::AddThumbnail(void *wnd, ResourceId texID)
RDCASSERT(p.outputID > 0);
m_Thumbnails.push_back(p);
#endif
return true;
}
+1 -1
View File
@@ -146,7 +146,7 @@ namespace renderdocui.Controls
private void thumbnail_Paint(object sender, PaintEventArgs e)
{
if (m_Output == null || m_Core.Renderer == null || true)
if (m_Output == null || m_Core.Renderer == null)
{
e.Graphics.Clear(Color.Black);
return;