-
Notifications
You must be signed in to change notification settings - Fork 43
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
VkResult & vkCreateInstance #2
Comments
Hello @sunbearc22. Take a look at this part of the README: https://github.com/realitix/vulkan#functions 1The wrapper handles VkResult for you. If VkResult is not VK_SUCCESS, an exception is raised. try:
instance = vkCreateInstance(
pCreateInfo = inst_Info,
pAllocator = None)#,
#pInstance = inst)
except VkError:
print('error') 2Here the magic of this wrapper, functions will return what you wait for. Don't forget something, in Python, there is no pointer like in C. When you pass When you call Is this answer enough for you or do you need more informations ? |
Don't forget that I am on IRC, we can speak faster by chatting |
Thanks. I understood Ans 1. My bad for forgetting you wrote that in Readme. I was just about to reply with the same answer. I think it will be helpful to include your answer 1 as an example to Readme too. Just a suggestion. For Ans 2, is there another example you can give? |
Just tried IRC ##vulkan but you are offline. I am sunbearc22. |
How do i see the next level of error message under
Is this correct?
|
Sorry I was offline. For answer 2, I can point you different example in the Return an object: https://github.com/realitix/vulkan/blob/master/example/example.py#L18 Return a list: https://github.com/realitix/vulkan/blob/master/example/example.py#L26 Return nothing: https://github.com/realitix/vulkan/blob/master/example/example.py#L684 You can easily know if a function will return a list or an object, for example, if you look at
It's clear it will return an object. For pProperties is either NULL or a pointer to an array of VkExtensionProperties structures. It's clear it will return a Is it ok now or do you need more informations ? |
For the last question: You must do:
|
Thanks for the Ans 2 elaboration. Helpful. Can you clarify if my Exception code is correct for my question on Ans 1? I submitted the code with not python error but not sure if it is correct. |
I have just answered above. |
Sorry. Screen did not refresh so did not see your answer. So what is the purpose of VkError & VkException given that their subsets may be called directly? |
It's a classic Python pattern. |
Got it. |
Can I close this issue ? |
yep. Thanks. |
You're welcome ! |
Error message:
Question 1:
How do I call "VkResult" in your wrapper? VkResult is use to return the state of Vulkan function. I noticed your example.py code, VkResult is not used. How can I report the state of a Vulkan function in vulkan?
Question 2:
In the definition of
instance
usingvkCreateInstance
, what do I give topInstance
? My confusion here isinstance
is created so what is the purpose ofpInstance
. I triedinst = VkInstance()
but got error messageNameError: name 'VkInstance' is not defined
. At the moment, I commented it out to avoid error.The text was updated successfully, but these errors were encountered: