Windows : Vulkan backend

105 views
Skip to first unread message

Abhishek Deshpande

unread,
Aug 27, 2024, 9:18:45 AM8/27/24
to angleproject
Hi folks,

Due to some network security reasons, I can not sync the angle source tree completely and I am relying on below code to trigger the Vulkan backend on Windows 11.

I have used these guidelines (specifically first 2 paras) to try the below code.

After copying libGLESv2.dll , libEGL.dll and vulkan-1.dll from Chromium installation in my project folder, I do

#if defined(MYLIB_WITHANGLE)

HMODULE EGLDll = NULL;

EGLDll = LoadLibrary("libEGL_myangle.dll"); // intentional renaming
if (EGLDll == NULL)
{
printf("ERROR: Fail to load libEGL_myangle.dll!\n");
return false;
}

PFNEGLGETPLATFORMDISPLAYEXTPROC pFn_eglGetPlatformDisplayEXT = (PFNEGLGETPLATFORMDISPLAYEXTPROC)GetProcAddress(EGLDll, "eglGetPlatformDisplayEXT");

const EGLint displayattribs[] = { EGL_PLATFORM_ANGLE_TYPE_ANGLE,EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE,EGL_NONE };

NativeDisplayType nd = nullptr;
EGLDisplay ed = pFn_eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, &nd , displayattribs);

if(ed == EGL_NO_DISPLAY)
{
fprintf(stderr, "EGL: eglGetPlatformDisplayEXT failed\n");
return false;
}
#endif


This code SegVs/memory violation at pFn_eglGetPlatformDisplayEXT call.
Its quite visible in the VS 2019 debugger.


Questions
1) Why the memory violation ? Am I missing something obvious ? Is Vulkan backend renderer not supported on Windows ?

2) Is this even possible ? below in order
a] integrate/use some of the EGL + GLES Angle extension headers 
b] use angle DLLs, to load EGL + GLES APIs 
c] run GLES based app on Angle with Vulkan backend renderer on Windows

3) Or do I need all the libs (object library) + DLLs + exported headers to do something like I mentioned in 2) which is most probably possible via complete angle library building

4) Are the .lib files for angle available in any package installation e.g. chromium, cef ?

Thank you in advance.


Cheers,
Abhishek

Geoff Lang

unread,
Aug 27, 2024, 9:46:00 AM8/27/24
to abhi...@gmail.com, angleproject
A couple things could be wrong:

  • Did you rename all the DLLs? Our EGL DLL will load the others by name, they must be in the same directory. Try loading the one directly from the Chromium directory to make sure you didn't miss copying anything.
  • Is pFn_eglGetPlatformDisplayEXT non-null?
  • You ideally just want to GetProcAddress once to get eglGetProcAddress and then use eglGetProcAddress to load everything else.
The Vulkan backend is supported on Windows. Without knowing where the crash is in the stack, try other things like getting the EGL extension strings.

--
You received this message because you are subscribed to the Google Groups "angleproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angleproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/angleproject/868599b6-1365-4704-926b-cf018d7404c2n%40googlegroups.com.

Abhishek Deshpande

unread,
Aug 27, 2024, 1:38:42 PM8/27/24
to angleproject
Thanks for your quick response.


Did you rename all the DLLs?
=> Yes, it was intentional since these dll names were conflicting with my older EGL and GLES dlls

Is pFn_eglGetPlatformDisplayEXT non-null?
=> Yes,  it did come with non-null address

You ideally just want to GetProcAddress once to get eglGetProcAddress and then use eglGetProcAddress to load everything else.
=> Ok, I was not aware that eglGetProcAddress can be used as to load everything in "one go", I will try that next

Without knowing where the crash is in the stack, try other things like getting the EGL extension strings.
=> Stack had nothing at the crash site, it was just stuck at one place. I tried to search pdb files for angle DLLs, but I couldnt find any. I will try the EGL extension strings as you have recommended.

Thanks again! 
Abhishek

Abhishek Deshpande

unread,
Aug 27, 2024, 1:45:45 PM8/27/24
to angleproject
Ok, just to correct myself there,  eglProcAddress is not a "one go" , it needs to be queried for each API's address. 
Reply all
Reply to author
Forward
0 new messages