mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Some GGP modifications
qrenderdoc/Code/CaptureContext.cpp - Adds GGP windowing system renderdoc/driver/ihv/amd/amd_counters.cpp - Enables AMD counters renderdoc/driver/vulkan/vk_serialise.cpp - Handling VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP in pNext for vkQueuePresentKHR renderdoc/os/posix/ggp/ggp_callstack.cpp - Check that the file was opened
This commit is contained in:
committed by
Baldur Karlsson
parent
d9915388c7
commit
c1ecd9d375
@@ -919,6 +919,8 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const Repla
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_APPLE)
|
||||
m_CurWinSystem = WindowingSystem::MacOS;
|
||||
#elif defined(RENDERDOC_PLATFORM_GGP)
|
||||
m_CurWinSystem = WindowingSystem::GGP;
|
||||
#endif
|
||||
|
||||
m_StructuredFile = &r->GetStructuredFile();
|
||||
@@ -2049,6 +2051,11 @@ WindowingData CaptureContext::CreateWindowingData(QWidget *window)
|
||||
WindowingData ret = {WindowingSystem::Unknown};
|
||||
return ret;
|
||||
|
||||
#elif defined(RENDERDOC_PLATFORM_GGP)
|
||||
|
||||
WindowingData ret = {WindowingSystem::GGP};
|
||||
return ret;
|
||||
|
||||
#else
|
||||
|
||||
#error "Unknown platform"
|
||||
|
||||
@@ -68,7 +68,7 @@ AMDCounters::AMDCounters(bool dx12DebugLayerEnabled)
|
||||
|
||||
bool AMDCounters::Init(ApiType apiType, void *pContext)
|
||||
{
|
||||
#if DISABLED(RDOC_WIN32) && DISABLED(RDOC_LINUX)
|
||||
#if DISABLED(RDOC_WIN32) && DISABLED(RDOC_LINUX) && DISABLED(RDOC_GGP)
|
||||
(void)m_dx12DebugLayerEnabled;
|
||||
return false;
|
||||
#else
|
||||
|
||||
@@ -48,6 +48,7 @@ set(sources
|
||||
official/vulkan.h
|
||||
official/vulkan_android.h
|
||||
official/vulkan_core.h
|
||||
official/vulkan_ggp.h
|
||||
official/vulkan_ios.h
|
||||
official/vulkan_macos.h
|
||||
official/vulkan_fuchsia.h
|
||||
|
||||
@@ -210,6 +210,9 @@
|
||||
<ClInclude Include="official\vulkan_core.h">
|
||||
<Filter>official</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="official\vulkan_ggp.h">
|
||||
<Filter>official</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="official\vulkan_ios.h">
|
||||
<Filter>official</Filter>
|
||||
</ClInclude>
|
||||
|
||||
@@ -1502,6 +1502,13 @@ DECLARE_DESERIALISE_TYPE(VkMemoryGetAndroidHardwareBufferInfoANDROID);
|
||||
DECLARE_DESERIALISE_TYPE(VkExternalFormatANDROID);
|
||||
#endif
|
||||
|
||||
// GGP only structs
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
DECLARE_REFLECTION_STRUCT(VkPresentFrameTokenGGP);
|
||||
|
||||
DECLARE_DESERIALISE_TYPE(VkPresentFrameTokenGGP);
|
||||
#endif
|
||||
|
||||
// enums
|
||||
|
||||
DECLARE_REFLECTION_ENUM(VkAccessFlagBits);
|
||||
|
||||
@@ -586,7 +586,6 @@ static void AppendModifiedChainedStruct(byte *&tempMem, VkStruct *outputStruct,
|
||||
case VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK: \
|
||||
case VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK: \
|
||||
case VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT: \
|
||||
case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP: \
|
||||
case VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP: \
|
||||
case VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN: \
|
||||
case VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR: \
|
||||
@@ -992,6 +991,16 @@ size_t GetNextPatchSize(const void *pNext)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(RDOC_GGP)
|
||||
COPY_STRUCT_CAPTURE_ONLY(VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP, VkPresentFrameTokenGGP);
|
||||
#else
|
||||
case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP:
|
||||
{
|
||||
RDCERR("Support for GGP frame token extension not compiled in");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// NV win32 external memory extensions
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
COPY_STRUCT_CAPTURE_ONLY(VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_NV,
|
||||
@@ -1795,6 +1804,16 @@ void UnwrapNextChain(CaptureState state, const char *structName, byte *&tempMem,
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(RDOC_GGP)
|
||||
COPY_STRUCT_CAPTURE_ONLY(VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP, VkPresentFrameTokenGGP);
|
||||
#else
|
||||
case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP:
|
||||
{
|
||||
RDCERR("Support for GGP frame token extension not compiled in");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// NV win32 external memory extensions
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
// Structs that can be copied into place
|
||||
@@ -2053,6 +2072,16 @@ void CopyNextChainForPatching(const char *structName, byte *&tempMem, VkBaseInSt
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ENABLED(RDOC_GGP)
|
||||
COPY_STRUCT_CAPTURE_ONLY(VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP, VkPresentFrameTokenGGP);
|
||||
#else
|
||||
case VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP:
|
||||
{
|
||||
RDCERR("Support for GGP frame token extension not compiled in");
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
// NV win32 external memory extensions
|
||||
#if ENABLED(RDOC_WIN32)
|
||||
// Structs that can be copied into place
|
||||
|
||||
@@ -275,6 +275,17 @@ void DoSerialiseViaResourceId(SerialiserType &ser, type &el)
|
||||
|
||||
SERIALISE_VK_HANDLES();
|
||||
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
|
||||
#define HANDLE_PNEXT_OS_GGP() \
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP, VkPresentFrameTokenGGP)
|
||||
|
||||
#else
|
||||
|
||||
#define HANDLE_PNEXT_OS_GGP() PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
|
||||
#define HANDLE_PNEXT_OS_WIN32() \
|
||||
@@ -390,6 +401,7 @@ SERIALISE_VK_HANDLES();
|
||||
/* OS-specific extensions */ \
|
||||
HANDLE_PNEXT_OS_WIN32() \
|
||||
HANDLE_PNEXT_OS_ANDROID() \
|
||||
HANDLE_PNEXT_OS_GGP() \
|
||||
\
|
||||
/* Core 1.0 structs. Should never be serialised in a pNext chain */ \
|
||||
PNEXT_STRUCT(VK_STRUCTURE_TYPE_APPLICATION_INFO, VkApplicationInfo) \
|
||||
@@ -1098,7 +1110,6 @@ SERIALISE_VK_HANDLES();
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_IOS_SURFACE_CREATE_INFO_MVK) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_MACOS_SURFACE_CREATE_INFO_MVK) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN) \
|
||||
PNEXT_UNSUPPORTED(VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR) \
|
||||
@@ -5411,7 +5422,7 @@ void DoSerialise(SerialiserType &ser, VkPastPresentationTimingGOOGLE &el)
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkPresentTimesInfoGOOGLE &el)
|
||||
{
|
||||
RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_PRESENT_REGIONS_KHR);
|
||||
RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE);
|
||||
SerialiseNext(ser, el.sType, el.pNext);
|
||||
|
||||
SERIALISE_MEMBER(swapchainCount);
|
||||
@@ -9211,6 +9222,23 @@ INSTANTIATE_SERIALISE_TYPE(ImageSubresourceRange);
|
||||
INSTANTIATE_SERIALISE_TYPE(ImageSubresourceStateForRange);
|
||||
INSTANTIATE_SERIALISE_TYPE(ImageState);
|
||||
|
||||
#ifdef VK_USE_PLATFORM_GGP
|
||||
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkPresentFrameTokenGGP &el)
|
||||
{
|
||||
RDCASSERT(ser.IsReading() || el.sType == VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP);
|
||||
SerialiseNext(ser, el.sType, el.pNext);
|
||||
}
|
||||
|
||||
template <>
|
||||
void Deserialise(const VkPresentFrameTokenGGP &el)
|
||||
{
|
||||
DeserialiseNext(el.pNext);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef VK_USE_PLATFORM_WIN32_KHR
|
||||
template <typename SerialiserType>
|
||||
void DoSerialise(SerialiserType &ser, VkImportMemoryWin32HandleInfoNV &el)
|
||||
|
||||
@@ -121,22 +121,29 @@ bool GetLoadedModules(byte *buf, size_t &size)
|
||||
// parsing without needing to recapture
|
||||
FILE *f = FileIO::fopen("/proc/self/maps", FileIO::ReadText);
|
||||
|
||||
size = 0;
|
||||
|
||||
if(buf)
|
||||
memcpy(buf, "LNUXCALL", 8);
|
||||
|
||||
size += 8;
|
||||
|
||||
byte dummy[512];
|
||||
|
||||
while(!feof(f))
|
||||
if(f == NULL)
|
||||
{
|
||||
byte *readbuf = buf ? buf + size : dummy;
|
||||
size += FileIO::fread(readbuf, 1, 512, f);
|
||||
RDCWARN("Opening %s failed", "/proc/self/maps");
|
||||
}
|
||||
else
|
||||
{
|
||||
size = 0;
|
||||
|
||||
FileIO::fclose(f);
|
||||
if(buf)
|
||||
memcpy(buf, "LNUXCALL", 8);
|
||||
|
||||
size += 8;
|
||||
|
||||
byte dummy[512];
|
||||
|
||||
while(!feof(f))
|
||||
{
|
||||
byte *readbuf = buf ? buf + size : dummy;
|
||||
size += FileIO::fread(readbuf, 1, 512, f);
|
||||
}
|
||||
|
||||
FileIO::fclose(f);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user