Skip to content

SetDefaultGetInstanceProcAddr doesn't work on MacOS #58

@Nv7-GitHub

Description

@Nv7-GitHub

Using SetDefaultGetInstanceProcAddr on MacOS just causes the error vulkan: error loading default getProcAddr. This is because:

  1. First, this function calls setDefaultProcAddr

    vulkan/init.go

    Line 22 in 956e385

    C.setDefaultProcAddr()
  2. In setDefaultProcAddr, it calls getDefaultProcAddr
    getInstanceProcAddress = getDefaultProcAddr();
  3. In getDefaultProcAddr, for MacOS, it just returns NULL
    #elif defined(__APPLE__) && defined(__MACH__)
    // return &loaderWrap;
    return NULL;
  4. In SetDefaultGetInstanceProcAddr, it checks for isProcAddrSet

    vulkan/init.go

    Lines 23 to 25 in 956e385

    if C.isProcAddrSet() == 0 {
    return errors.New("vulkan: error loading default getProcAddr")
    }
  5. In isProcAddrSet, it checks if it is equal to NULL
    return getInstanceProcAddress == NULL ? 0 : 1;

Therefore, on MacOS, isProcAddrSet will always return false. Why is it like this? Is there a way to get around this error? If you ignore it, you just get an error about proc addr not being set in Init.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions