Skip to content

Commit

Permalink
Implement win32/linux checking and registering of vulkan layers
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Feb 16, 2017
1 parent 72921f2 commit 11a914b
Show file tree
Hide file tree
Showing 14 changed files with 640 additions and 379 deletions.
13 changes: 13 additions & 0 deletions qrenderdoc/Windows/Dialogs/CaptureDialog.cpp
Expand Up @@ -294,6 +294,19 @@ void CaptureDialog::on_vulkanLayerWarn_clicked()
const bool registerAll = (flags & eVulkan_RegisterAll); const bool registerAll = (flags & eVulkan_RegisterAll);
const bool updateAllowed = (flags & eVulkan_UpdateAllowed); const bool updateAllowed = (flags & eVulkan_UpdateAllowed);


if(flags & eVulkan_Unfixable)
{
QString msg =
tr("There is an unfixable problem with your vulkan layer configuration. Please consult the "
"RenderDoc documentation, or package/distribution documentation on linux\n\n");

for(const rdctype::str &j : otherJSONs)
msg += ToQStr(j) + "\n";

RDDialog::critical(this, tr("Unfixable vulkan layer configuration"), msg);
return;
}

QString msg = QString msg =
tr("Vulkan capture happens through the API's layer mechanism. RenderDoc has detected that "); tr("Vulkan capture happens through the API's layer mechanism. RenderDoc has detected that ");


Expand Down
2 changes: 1 addition & 1 deletion qrenderdoc/Windows/Dialogs/CaptureDialog.ui
Expand Up @@ -271,7 +271,7 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>36</height> <height>40</height>
</size> </size>
</property> </property>
<property name="cursor"> <property name="cursor">
Expand Down
2 changes: 1 addition & 1 deletion renderdoc/api/replay/renderdoc_replay.h
Expand Up @@ -648,7 +648,7 @@ extern "C" RENDERDOC_API uint32_t RENDERDOC_CC RENDERDOC_InjectIntoProcess(


extern "C" RENDERDOC_API bool RENDERDOC_CC RENDERDOC_NeedVulkanLayerRegistration( extern "C" RENDERDOC_API bool RENDERDOC_CC RENDERDOC_NeedVulkanLayerRegistration(
uint32_t *flags, rdctype::array<rdctype::str> *myJSONs, rdctype::array<rdctype::str> *otherJSONs); uint32_t *flags, rdctype::array<rdctype::str> *myJSONs, rdctype::array<rdctype::str> *otherJSONs);
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_UpdateVulkanLayerRegistration(bool elevate); extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_UpdateVulkanLayerRegistration(bool systemLevel);


////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
// Miscellaneous! // Miscellaneous!
Expand Down
1 change: 1 addition & 0 deletions renderdoc/api/replay/replay_enums.h
Expand Up @@ -610,4 +610,5 @@ enum VulkanFlags
eVulkan_CouldElevate = 0x8, eVulkan_CouldElevate = 0x8,
eVulkan_RegisterAll = 0x10, eVulkan_RegisterAll = 0x10,
eVulkan_UpdateAllowed = 0x20, eVulkan_UpdateAllowed = 0x20,
eVulkan_Unfixable = 0x40,
}; };
3 changes: 3 additions & 0 deletions renderdoc/core/core.cpp
Expand Up @@ -237,6 +237,9 @@ RenderDoc::RenderDoc()


m_Overlay = eRENDERDOC_Overlay_Default; m_Overlay = eRENDERDOC_Overlay_Default;


m_VulkanCheck = NULL;
m_VulkanInstall = NULL;

m_TargetControlThreadShutdown = false; m_TargetControlThreadShutdown = false;
m_ControlClientThreadShutdown = false; m_ControlClientThreadShutdown = false;
} }
Expand Down
24 changes: 24 additions & 0 deletions renderdoc/core/core.h
Expand Up @@ -171,6 +171,10 @@ class IReplayDriver;
typedef ReplayCreateStatus (*RemoteDriverProvider)(const char *logfile, IRemoteDriver **driver); typedef ReplayCreateStatus (*RemoteDriverProvider)(const char *logfile, IRemoteDriver **driver);
typedef ReplayCreateStatus (*ReplayDriverProvider)(const char *logfile, IReplayDriver **driver); typedef ReplayCreateStatus (*ReplayDriverProvider)(const char *logfile, IReplayDriver **driver);


typedef bool (*VulkanLayerCheck)(uint32_t &flags, std::vector<std::string> &myJSONs,
std::vector<std::string> &otherJSONs);
typedef void (*VulkanLayerInstall)(bool systemLevel);

typedef void (*ShutdownFunction)(); typedef void (*ShutdownFunction)();


// this class mediates everything and owns any 'global' resources such as the crash handler. // this class mediates everything and owns any 'global' resources such as the crash handler.
Expand Down Expand Up @@ -240,6 +244,23 @@ class RenderDoc
void RegisterReplayProvider(RDCDriver driver, const char *name, ReplayDriverProvider provider); void RegisterReplayProvider(RDCDriver driver, const char *name, ReplayDriverProvider provider);
void RegisterRemoteProvider(RDCDriver driver, const char *name, RemoteDriverProvider provider); void RegisterRemoteProvider(RDCDriver driver, const char *name, RemoteDriverProvider provider);


void SetVulkanLayerCheck(VulkanLayerCheck callback) { m_VulkanCheck = callback; }
void SetVulkanLayerInstall(VulkanLayerInstall callback) { m_VulkanInstall = callback; }
bool NeedVulkanLayerRegistration(uint32_t &flags, std::vector<std::string> &myJSONs,
std::vector<std::string> &otherJSONs)
{
if(m_VulkanCheck)
return m_VulkanCheck(flags, myJSONs, otherJSONs);

return false;
}

void UpdateVulkanLayerRegistration(bool systemLevel)
{
if(m_VulkanInstall)
m_VulkanInstall(systemLevel);
}

ReplayCreateStatus CreateReplayDriver(RDCDriver driverType, const char *logfile, ReplayCreateStatus CreateReplayDriver(RDCDriver driverType, const char *logfile,
IReplayDriver **driver); IReplayDriver **driver);
ReplayCreateStatus CreateRemoteDriver(RDCDriver driverType, const char *logfile, ReplayCreateStatus CreateRemoteDriver(RDCDriver driverType, const char *logfile,
Expand Down Expand Up @@ -355,6 +376,9 @@ class RenderDoc
map<RDCDriver, ReplayDriverProvider> m_ReplayDriverProviders; map<RDCDriver, ReplayDriverProvider> m_ReplayDriverProviders;
map<RDCDriver, RemoteDriverProvider> m_RemoteDriverProviders; map<RDCDriver, RemoteDriverProvider> m_RemoteDriverProviders;


VulkanLayerCheck m_VulkanCheck;
VulkanLayerInstall m_VulkanInstall;

set<ShutdownFunction> m_ShutdownFunctions; set<ShutdownFunction> m_ShutdownFunctions;


struct FrameCap struct FrameCap
Expand Down
11 changes: 11 additions & 0 deletions renderdoc/driver/vulkan/vk_android.cpp
Expand Up @@ -57,3 +57,14 @@ void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h
} }


const char *VulkanLibraryName = "libvulkan.so"; const char *VulkanLibraryName = "libvulkan.so";

bool VulkanReplay::CheckVulkanLayer(uint32_t &flags, std::vector<std::string> &myJSONs,
std::vector<std::string> &otherJSONs)
{
// nothing to do
return false;
}

void VulkanReplay::InstallVulkanLayer(bool systemLevel)
{
}
10 changes: 10 additions & 0 deletions renderdoc/driver/vulkan/vk_apple.cpp
Expand Up @@ -42,3 +42,13 @@ void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h
} }


const char *VulkanLibraryName = "libvulkan.so"; const char *VulkanLibraryName = "libvulkan.so";

bool VulkanReplay::CheckVulkanLayer(uint32_t &flags, std::vector<std::string> &myJSONs,
std::vector<std::string> &otherJSONs)
{
return false;
}

void VulkanReplay::InstallVulkanLayer(bool systemLevel)
{
}

0 comments on commit 11a914b

Please sign in to comment.