mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Move vulkan layer name and android library filename to global defines
This commit is contained in:
@@ -140,7 +140,7 @@ uint32_t StartAndroidPackageForCapture(const char *host, const char *package)
|
||||
// force stop the package if it was running before
|
||||
adbExecCommand(deviceID, "shell am force-stop " + packageName);
|
||||
// enable the vulkan layer (will only be used by vulkan programs)
|
||||
adbExecCommand(deviceID, "shell setprop debug.vulkan.layers VK_LAYER_RENDERDOC_Capture");
|
||||
adbExecCommand(deviceID, "shell setprop debug.vulkan.layers " RENDERDOC_VULKAN_LAYER_NAME);
|
||||
// start the activity in this package with debugging enabled and force-stop after starting
|
||||
adbExecCommand(deviceID, StringFormat::Fmt("shell am start -S -D %s/%s", packageName.c_str(),
|
||||
activityName.c_str()));
|
||||
|
||||
@@ -126,6 +126,10 @@ enum
|
||||
RenderDoc_AndroidPortOffset = 50,
|
||||
};
|
||||
|
||||
#define RENDERDOC_VULKAN_LAYER_NAME "VK_LAYER_RENDERDOC_Capture"
|
||||
|
||||
#define RENDERDOC_ANDROID_LIBRARY "libVkLayer_GLES_RenderDoc.so"
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Debugging features configuration
|
||||
|
||||
|
||||
@@ -310,8 +310,6 @@ struct MemoryAllocation
|
||||
bool buffer = false;
|
||||
};
|
||||
|
||||
#define RENDERDOC_LAYER_NAME "VK_LAYER_RENDERDOC_Capture"
|
||||
|
||||
#define IMPLEMENT_FUNCTION_SERIALISED(ret, func, ...) \
|
||||
ret func(__VA_ARGS__); \
|
||||
template <typename SerialiserType> \
|
||||
|
||||
@@ -220,7 +220,7 @@ VK_LAYER_EXPORT VkResult VKAPI_CALL VK_LAYER_RENDERDOC_CaptureEnumerateDeviceLay
|
||||
return VK_INCOMPLETE;
|
||||
|
||||
const VkLayerProperties layerProperties = {
|
||||
RENDERDOC_LAYER_NAME, VK_API_VERSION_1_0,
|
||||
RENDERDOC_VULKAN_LAYER_NAME, VK_API_VERSION_1_0,
|
||||
VK_MAKE_VERSION(RENDERDOC_VERSION_MAJOR, RENDERDOC_VERSION_MINOR, 0),
|
||||
"Debugging capture layer for RenderDoc",
|
||||
};
|
||||
@@ -238,7 +238,7 @@ VK_LAYER_EXPORT VkResult VKAPI_CALL VK_LAYER_RENDERDOC_CaptureEnumerateDeviceExt
|
||||
{
|
||||
// if pLayerName is NULL or not ours we're calling down through the layer chain to the ICD.
|
||||
// This is our chance to filter out any reported extensions that we don't support
|
||||
if(physicalDevice != NULL && (pLayerName == NULL || strcmp(pLayerName, RENDERDOC_LAYER_NAME)))
|
||||
if(physicalDevice != NULL && (pLayerName == NULL || strcmp(pLayerName, RENDERDOC_VULKAN_LAYER_NAME)))
|
||||
return CoreDisp(physicalDevice)
|
||||
->FilterDeviceExtensionProperties(physicalDevice, pPropertyCount, pProperties);
|
||||
|
||||
@@ -249,7 +249,7 @@ VK_LAYER_EXPORT VkResult VKAPI_CALL VK_LAYER_RENDERDOC_CaptureEnumerateInstanceE
|
||||
const VkEnumerateInstanceExtensionPropertiesChain *pChain, const char *pLayerName,
|
||||
uint32_t *pPropertyCount, VkExtensionProperties *pProperties)
|
||||
{
|
||||
if(pLayerName && !strcmp(pLayerName, RENDERDOC_LAYER_NAME))
|
||||
if(pLayerName && !strcmp(pLayerName, RENDERDOC_VULKAN_LAYER_NAME))
|
||||
return WrappedVulkan::GetProvidedInstanceExtensionProperties(pPropertyCount, pProperties);
|
||||
|
||||
return WrappedVulkan::FilterInstanceExtensionProperties(pChain, pLayerName, pPropertyCount,
|
||||
|
||||
@@ -54,7 +54,7 @@ static void StripUnwantedLayers(vector<string> &Layers)
|
||||
for(auto it = Layers.begin(); it != Layers.end();)
|
||||
{
|
||||
// don't try and create our own layer on replay!
|
||||
if(*it == RENDERDOC_LAYER_NAME)
|
||||
if(*it == RENDERDOC_VULKAN_LAYER_NAME)
|
||||
{
|
||||
it = Layers.erase(it);
|
||||
continue;
|
||||
|
||||
@@ -385,11 +385,11 @@ void PosixHookApply()
|
||||
suppressTLS = Threading::AllocateTLSSlot();
|
||||
|
||||
// blacklist hooking certain system libraries or ourselves
|
||||
GetHookInfo().AlreadyHooked("libVkLayer_GLES_RenderDoc.so");
|
||||
GetHookInfo().AlreadyHooked(RENDERDOC_ANDROID_LIBRARY);
|
||||
GetHookInfo().AlreadyHooked("libc.so");
|
||||
GetHookInfo().AlreadyHooked("libvndksupport.so");
|
||||
|
||||
GetHookInfo().AddLibHook("libVkLayer_GLES_RenderDoc.so");
|
||||
GetHookInfo().AddLibHook(RENDERDOC_ANDROID_LIBRARY);
|
||||
|
||||
loader_dlopen = (pfn__loader_dlopen)dlsym(RTLD_NEXT, "__loader_dlopen");
|
||||
|
||||
@@ -416,7 +416,7 @@ void PosixHookReapply()
|
||||
void *intercept_dlopen(const char *filename, int flag)
|
||||
{
|
||||
if(GetHookInfo().IsLibHook(filename))
|
||||
return dlopen("libVkLayer_GLES_RenderDoc.so", flag);
|
||||
return dlopen(RENDERDOC_ANDROID_LIBRARY, flag);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user