Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vktrace: Check for loadable trace library #501

Closed
wants to merge 2 commits into from

Conversation

davidlunarg
Copy link
Contributor

Modified vktrace when in non-server mode to checkout to see if the
trace layer library file is available and loadable, and generates an
error if is is not. This helps prevent the scenario in which vktrace
hangs or crashes when the trace layer can't be loaded.

Change-Id: I61f02f5aff9cc56b5382ef58b94351f6e9b2b928

Modified vktrace when in non-server mode to checkout to see if the
trace layer library file is available and loadable, and generates an
error if is is not. This helps prevent the scenario in which vktrace
hangs or crashes when the trace layer can't be loaded.

Change-Id: I61f02f5aff9cc56b5382ef58b94351f6e9b2b928
Copy link
Contributor

@TonyBarbour TonyBarbour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM


// Verify trace layer is available.
void* traceLayerLibHandle;
traceLayerLibHandle = vktrace_platform_open_library(VKTRACE_LIBRARY_NAME(VkLayer_vktrace_layer));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will search the system library path, but VK_LAYER_PATH will also need to be searched for this case. It may be necessary to create an instance to check for the presence of the layer.

Revision of previous commit to checkt for loadable trace library.
Instead of simply loading the trace library, call vkCreateInstance
with the trace layer enabled and check to see if the call succeeds.

Change-Id: I283832b4cef430bd2303ca02e0dc33b4f4133001
@davidlunarg
Copy link
Contributor Author

I modified this pull request to use vkCreateInstance with the trace library enabled, then check to see of the call to vkCreateInstance succeeded.

The call to vkCreateInstance will fail and vktrace will print an error message if the json file for the trace layer is missing. However, if the json file is present but the trace layer shared library is missing, vkCreateInstance will indicate success with a return value of VK_SUCCESS. I think this is a bug in the loader, and until this bug is fixed in the loader, this pull request does not completely address the problem it was intended to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants