Replay functions compiling

This commit is contained in:
baldurk
2015-12-10 13:28:13 +01:00
parent 3649fc4134
commit 63d643d43c
15 changed files with 370 additions and 343 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ struct VulkanPipelineState
struct DescriptorBinding
{
uint32_t arraySize;
uint32_t descriptorCount;
ShaderBindType type;
ShaderStageBits stageFlags;
+1
View File
@@ -1062,6 +1062,7 @@ string ToStrHelper<false, VkResourceType>::Get(const VkResourceType &el)
TOSTR_CASE_STRINGIZE(eResQueryPool)
TOSTR_CASE_STRINGIZE(eResSemaphore)
TOSTR_CASE_STRINGIZE(eResSwapchain)
TOSTR_CASE_STRINGIZE(eResSurface)
default: break;
}
+2
View File
@@ -187,6 +187,7 @@ private:
VkInstance m_Instance; // the instance corresponding to this WrappedVulkan
VkDbgMsgCallback m_DbgMsgCallback; // the instance's dbg msg callback handle
VkPhysicalDevice m_PhysicalDevice; // the physical device we created m_Device with
VkDevice m_Device; // the device used for our own command buffer work
PhysicalDeviceData m_PhysicalDeviceData; // the data about the physical device used for the above device;
uint32_t m_QueueFamilyIdx; // the family index that we've selected in CreateDevice for our queue
@@ -224,6 +225,7 @@ private:
VkDevice GetDev() { RDCASSERT(m_Device != VK_NULL_HANDLE); return m_Device; }
VkQueue GetQ() { RDCASSERT(m_Device != VK_NULL_HANDLE); return m_Queue; }
VkInstance GetInstance() { RDCASSERT(m_Instance != VK_NULL_HANDLE); return m_Instance; }
VkPhysicalDevice GetPhysDev() { RDCASSERT(m_PhysicalDevice != VK_NULL_HANDLE); return m_PhysicalDevice; }
VkCommandBuffer GetNextCmd();
void SubmitCmds();
void FlushQ();
+4 -4
View File
@@ -974,7 +974,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
vkr = vt->GetImageMemoryRequirements(Unwrap(dev), Unwrap(m_TextAtlas), &mrq);
RDCASSERT(vkr == VK_SUCCESS);
VkImageSubresource subr = { VK_IMAGE_ASPECT_COLOR, 0, 0 };
VkImageSubresource subr = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 };
VkSubresourceLayout layout = { 0 };
vt->GetImageSubresourceLayout(Unwrap(dev), Unwrap(m_TextAtlas), &subr, &layout);
@@ -1083,7 +1083,7 @@ VulkanDebugManager::VulkanDebugManager(WrappedVulkan *driver, VkDevice dev)
vkr = vt->GetImageMemoryRequirements(Unwrap(dev), Unwrap(m_PickPixelImage), &mrq);
RDCASSERT(vkr == VK_SUCCESS);
VkImageSubresource subr = { VK_IMAGE_ASPECT_COLOR, 0, 0 };
VkImageSubresource subr = { VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 };
VkSubresourceLayout layout = { 0 };
vt->GetImageSubresourceLayout(Unwrap(dev), Unwrap(m_PickPixelImage), &subr, &layout);
@@ -1621,7 +1621,7 @@ void VulkanDebugManager::BeginText(const TextPrintState &textstate)
{ { 0, 0, }, { textstate.w, textstate.h} },
1, &clearval,
};
vt->CmdBeginRenderPass(Unwrap(textstate.cmd), &rpbegin, VK_RENDER_PASS_CONTENTS_INLINE);
vt->CmdBeginRenderPass(Unwrap(textstate.cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
vt->CmdBindPipeline(Unwrap(textstate.cmd), VK_PIPELINE_BIND_POINT_GRAPHICS, Unwrap(m_TextPipeline));
@@ -2326,7 +2326,7 @@ ResourceId VulkanDebugManager::RenderOverlay(ResourceId texid, TextureDisplayOve
m_pDriver->m_RenderState.renderArea,
1, &clearval,
};
vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_RENDER_PASS_CONTENTS_INLINE);
vt->CmdBeginRenderPass(Unwrap(cmd), &rpbegin, VK_SUBPASS_CONTENTS_INLINE);
VkRect3D rect = {
{
@@ -84,6 +84,8 @@ void InitInstanceReplayTables(VkInstance instance)
#ifdef VK_USE_PLATFORM_XLIB_KHR
InstanceGPA(CreateXlibSurfaceKHR)
#endif
InstanceGPA(DestroySurfaceKHR)
#undef InstanceGPA
}
+1 -3
View File
@@ -46,10 +46,8 @@ void VulkanReplay::OutputWindow::SetWindowHandle(void *wn)
screen = iter.data;
}
void VulkanReplay::OutputWindow::InitSurfaceDescription(WrappedVulkan *driver)
void VulkanReplay::OutputWindow::InitSurfaceDescription(VkInstance inst)
{
VkInstance inst = driver->GetInstance();
VkResult vkr = ObjDisp(inst)->vkCreateXcbSurfaceKHR(Unwrap(inst), connection, &wnd, NULL, &surface);
RDCASSERT(vkr == VK_SUCCESS);
}
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -58,7 +58,7 @@ using std::map;
#define VULKANNOTIMP(...) do { static bool msgprinted = false; if(!msgprinted) RDCDEBUG("Vulkan not implemented - " __VA_ARGS__); msgprinted = true; } while(0)
// allows easy disabling of MSAA
#define VULKAN_MESH_VIEW_SAMPLES 1U
#define VULKAN_MESH_VIEW_SAMPLES VK_SAMPLE_COUNT_1_BIT
class WrappedVulkan;
class VulkanDebugManager;
@@ -179,7 +179,7 @@ class VulkanReplay : public IReplayDriver
void Destroy(WrappedVulkan *driver, VkDevice device);
// implemented in vk_replay_platform.cpp
void CreateSurface(WrappedVulkan *driver);
void CreateSurface(VkInstance inst);
void SetWindowHandle(void *wn);
WINDOW_HANDLE_DECL
+1
View File
@@ -94,6 +94,7 @@ VkResourceType IdentifyTypeByPtr(WrappedVkRes *ptr)
if(WrappedVkQueryPool::IsAlloc(ptr)) return eResQueryPool;
if(WrappedVkSemaphore::IsAlloc(ptr)) return eResSemaphore;
if(WrappedVkSwapchainKHR::IsAlloc(ptr)) return eResSwapchain;
if(WrappedVkSurfaceKHR::IsAlloc(ptr)) return eResSurface;
RDCERR("Unknown type for ptr 0x%p", ptr);
+8
View File
@@ -69,6 +69,7 @@ enum VkResourceType
eResSemaphore,
eResSwapchain,
eResSurface
};
// dummy standin for a typeless real resource
@@ -359,6 +360,12 @@ struct WrappedVkSwapchainKHR : WrappedVkNonDispRes
typedef VkSwapchainKHR InnerType; ALLOCATE_WITH_WRAPPED_POOL(WrappedVkSwapchainKHR);
enum { TypeEnum = eResSwapchain, };
};
struct WrappedVkSurfaceKHR : WrappedVkNonDispRes
{
WrappedVkSurfaceKHR(VkSurfaceKHR obj, ResourceId objId) : WrappedVkNonDispRes(obj, objId) {}
typedef VkSurfaceKHR InnerType; ALLOCATE_WITH_WRAPPED_POOL(WrappedVkSurfaceKHR);
enum { TypeEnum = eResSurface, };
};
// VKTODOMED Need to find out which resources can validly return duplicate
// handles for unique creates. E.g. if there are the same input parameters
@@ -418,6 +425,7 @@ UNWRAP_NONDISP_HELPER(VkDescriptorSet)
UNWRAP_NONDISP_HELPER(VkFramebuffer)
UNWRAP_NONDISP_HELPER(VkCommandPool)
UNWRAP_NONDISP_HELPER(VkSwapchainKHR)
UNWRAP_NONDISP_HELPER(VkSurfaceKHR)
#define WRAPPING_DEBUG 0
+1 -3
View File
@@ -32,10 +32,8 @@ void VulkanReplay::OutputWindow::SetWindowHandle(void *wn)
wnd = (HWND)wn;
}
void VulkanReplay::OutputWindow::CreateSurface(WrappedVulkan *driver)
void VulkanReplay::OutputWindow::CreateSurface(VkInstance inst)
{
VkInstance inst = driver->GetInstance();
HINSTANCE hinst;
GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS|GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
@@ -106,6 +106,7 @@ void WrappedVulkan::Initialise(VkInitParams &params)
GetResourceManager()->AddLiveResource(params.InstanceID, m_Instance);
m_DbgMsgCallback = VK_NULL_HANDLE;
m_PhysicalDevice = VK_NULL_HANDLE;
m_Device = VK_NULL_HANDLE;
m_QueueFamilyIdx = ~0U;
m_Queue = VK_NULL_HANDLE;
@@ -150,6 +151,7 @@ VkResult WrappedVulkan::vkCreateInstance(
*pInstance = m_Instance;
m_DbgMsgCallback = VK_NULL_HANDLE;
m_PhysicalDevice = VK_NULL_HANDLE;
m_Device = VK_NULL_HANDLE;
m_QueueFamilyIdx = ~0U;
m_Queue = VK_NULL_HANDLE;
@@ -204,7 +206,8 @@ void WrappedVulkan::Shutdown()
delete GetWrapped(m_Device);
delete GetWrapped(m_Instance);
m_PhysicalDevice = VK_NULL_HANDLE;
m_Device = VK_NULL_HANDLE;
m_Instance = VK_NULL_HANDLE;
@@ -544,7 +547,8 @@ bool WrappedVulkan::Serialise_vkCreateDevice(
InitDeviceReplayTables(Unwrap(device));
RDCASSERT(m_Device == VK_NULL_HANDLE); // MULTIDEVICE
m_PhysicalDevice = physicalDevice;
m_Device = device;
m_QueueFamilyIdx = qFamilyIdx;
@@ -700,6 +704,7 @@ VkResult WrappedVulkan::vkCreateDevice(
RDCASSERT(m_Device == VK_NULL_HANDLE); // MULTIDEVICE
m_PhysicalDevice = physicalDevice;
m_Device = device;
m_QueueFamilyIdx = qFamilyIdx;
@@ -775,6 +780,7 @@ void WrappedVulkan::vkDestroyDevice(VkDevice device)
ObjDisp(m_Device)->DestroyDevice(Unwrap(m_Device));
GetResourceManager()->ReleaseWrappedResource(m_Device);
m_Device = VK_NULL_HANDLE;
m_PhysicalDevice = VK_NULL_HANDLE;
}
bool WrappedVulkan::Serialise_vkDeviceWaitIdle(Serialiser* localSerialiser, VkDevice device)
@@ -134,11 +134,12 @@ bool WrappedVulkan::ReleaseResource(WrappedVkRes *res)
switch(IdentifyTypeByPtr(res))
{
case eResSurface:
case eResSwapchain:
if(m_State >= WRITING)
RDCERR("Swapchain object is leaking");
RDCERR("Swapchain/swapchain object is leaking");
else
RDCERR("Should be no swapchain objects created on replay");
RDCERR("Should be no swapchain/surface objects created on replay");
break;
case eResUnknown:
+4 -4
View File
@@ -902,9 +902,9 @@ namespace renderdocui.Code
) && (bind.stageFlags & mask) == mask)
{
var key = new BindpointMap(set, slot);
var val = new BoundResource[bind.arraySize];
var val = new BoundResource[bind.descriptorCount];
for (UInt32 i = 0; i < bind.arraySize; i++)
for (UInt32 i = 0; i < bind.descriptorCount; i++)
{
val[i] = new BoundResource();
val[i].Id = bind.binds[i].res;
@@ -1000,9 +1000,9 @@ namespace renderdocui.Code
) && (bind.stageFlags & mask) == mask)
{
var key = new BindpointMap(set, slot);
var val = new BoundResource[bind.arraySize];
var val = new BoundResource[bind.descriptorCount];
for (UInt32 i = 0; i < bind.arraySize; i++)
for (UInt32 i = 0; i < bind.descriptorCount; i++)
{
val[i] = new BoundResource();
val[i].Id = bind.binds[i].res;
+1 -1
View File
@@ -45,7 +45,7 @@ namespace renderdoc
[StructLayout(LayoutKind.Sequential)]
public class DescriptorBinding
{
public UInt32 arraySize;
public UInt32 descriptorCount;
public ShaderBindType type;
public ShaderStageBits stageFlags;