-
Notifications
You must be signed in to change notification settings - Fork 461
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
Status of glad2 #208
Comments
glad2 is basically done, there is some cleanup left, I wanna finish the documentation and improve the web loader first before updating all the links in this repo. Vulkan works (at least with my tests). The Regarding the includes, I don't wanna do that because those headers are not generated by glad and may also be provided by the system. If you want to get rid of them you can use the header only build which embeds them in the glad header. |
Could you please update the APIs in the web service? The Vulkan API seems to be quite old. |
It is 5 days old, the last change to the specification was on April 19th. What are you missing, maybe something else is causing your problem. |
In |
I regenerated the loader and now it is: This is also newer than I remember: The last time I checked it used to be something like 6-7 months older. I have also another question: Is it possible to make the loader generate the function macros without the vk... and gl.. prefixes? |
Okay good, glad it's working now.
Yeah, I checked on the server and ran the update just to make sure it's the same files. I'll have it update daily like glad1 soon.
Yeah, when you opened the issue initially the specifications where that old.
Currently no, this would be what I consider a post processing step, which probably should be doable with a simple The prefixes are stripped in a MX context, but you'll have to use a context for that. |
I use some ugly caller macro The Vulkan loader provides:
Wouldn't it make sense to also have a
for loading the instance level functions and so skipping the 'loader' loader part if desired? For example SDL2 provides So more control could be possible:
I don't have enough experience with the stuff yet. Excuse me if I am writing non-sense here! |
This is basically what you'd be doing, calling the loader 3 times (with that said skipping device level functions can be considered since the loader function has to filter out functions properly due to: KhronosGroup/Vulkan-LoaderAndValidationLayers#2323) gladLoadVulkanUserPtr(NULL, glfwGetInstanceProcAddress, NULL);
gladLoadVulkanUserPtr(physical_device, glfwGetInstanceProcAddress, instance); With the builtin loader it would be like this: gladLoaderLoadVulkan(NULL, NULL, NULL);
gladLoaderLoadVulkan(instance, phyiscal_device, NULL);
gladLoaderLoadVulkan(instance, phyiscal_device, device); The pyhsical device passed to Thanks to @elmindreda I recently swapped the arguments in the loader function, so it allows you to pass the instance as user pointer and accepts the instance loader procs as loader function. Maybe this helps for clarity, the builtin loader function and its user pointer: struct _glad_vulkan_userptr {
void *vk_handle;
VkInstance vk_instance;
VkDevice vk_device;
PFN_vkGetInstanceProcAddr get_instance_proc_addr;
PFN_vkGetDeviceProcAddr get_device_proc_addr;
};
static GLADapiproc glad_vulkan_get_proc(void *vuserptr, const char *name) {
struct _glad_vulkan_userptr userptr = *(struct _glad_vulkan_userptr*) vuserptr;
PFN_vkVoidFunction result = NULL;
if (userptr.vk_device != NULL && glad_vulkan_is_device_function(name)) {
result = userptr.get_device_proc_addr(userptr.vk_device, name);
}
if (result == NULL && userptr.vk_instance != NULL) {
result = userptr.get_instance_proc_addr(userptr.vk_instance, name);
}
if(result == NULL) {
result = (PFN_vkVoidFunction) glad_dlsym_handle(userptr.vk_handle, name);
}
return (GLADapiproc) result;
} |
Thank you for the clarification. My orignal point was to skip calling the dlopen part, etc since in my case SDL2 was doing already (probably). I tested the instance initialization procedure on Windows and Android. I am yet to render anything. BTW. The VS static analyzer reports these issues: vulkan.c(416): warning C6387: 'extensions[i]' could be '0': this does not adhere to the specification for the function 'memcpy'. |
SDL should work like the GLFW example, just with Something like: gladLoadVulkanUserPtr(NULL, (GLADuserptrloadfunc) SDL_Vulkan_GetVkInstanceProcAddr(), NULL);
gladLoadVulkanUserPtr(physical_device, (GLADuserptrloadfunc) SDL_Vulkan_GetVkInstanceProcAddr(), instance);
Thanks, I'll look into it. |
I still haven't completed my journey to setup a basic Vulkan sample with glad2, so I might not be fully aware of how to use it properly and to comment on it without talking non-sense. |
I completely ignored the extensions. For some reason I assumed they'll be included by default. As there are so many extensions it may be helpful if the generator offers a filter/option to select a minimal core selection of the most essential extensions (like validation layers, etc). I also noticed a bunch of empty
Also there is an empty line before
|
There is room for improvement on the generator, but at the end of the day it is generated code not meant to be read, that's why I am not bothered by the "useless" I was thinking about having a few pre-selections, not sure about it yet. |
What is the status of glad2? I've been using the OpenGL part for a while and I haven't experienced any issues yet.
What is the situation with the vulkan part? Does it work? There isn't any documentation yet. For example what does the " loader Include internal loaders for APIs" do and when does it do anything? I guess it is the same as in GL? The service may use an interface that is relevant to the corresponding API.
IMHO it would make sense to put all the platform headers in a subdirectory to not the polute the include intellisense functionality. e.g.
include/glad/KHR/khrplatform.h
include/glad/KHR/vk_platform.h
include/glad/gl.h
include/glad/vulkan.h
The text was updated successfully, but these errors were encountered: