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

segfault in vulkaninfo example #47

Open
splace opened this issue Oct 15, 2020 · 2 comments
Open

segfault in vulkaninfo example #47

splace opened this issue Oct 15, 2020 · 2 comments

Comments

@splace
Copy link

splace commented Oct 15, 2020

on investigating seems to be three issues in play (see below code extract)

deviceCreate requires swapchain, my vulkan setup doesn't have it, so this errors.

but swapchain doesn't actually seem to be needed anyway, so it just commented it out to fix.

but when erroring the code calls DestroySurface without first having setup one, so this is the seqfault.

again i just commented out to get to work; correctly report unavailable extension.

when i looked in the docs of DistroySurface, to see if the surface could be null, the link in the docs is broken, seems the url changed? this;

https://www.khronos.org/registry/vulkan/specs/1.0-wsi_extensions/html/vkspec.html#VkDestroySurfaceKHR

needs the uppercase 'V' changed to lowercase to work.

	deviceExtensions := []string{
		"VK_KHR_swapchain\x00",
	}
	deviceCreateInfo := &vk.DeviceCreateInfo{
		SType:                   vk.StructureTypeDeviceCreateInfo,
		QueueCreateInfoCount:    uint32(len(queueCreateInfos)),
		PQueueCreateInfos:       queueCreateInfos,
		EnabledExtensionCount:   uint32(len(deviceExtensions)),
		PpEnabledExtensionNames: deviceExtensions,
	}
	var device vk.Device
	err = vk.Error(vk.CreateDevice(v.gpuDevices[0], deviceCreateInfo, nil, &device))
	if err != nil {
		v.gpuDevices = nil
		vk.DestroySurface(v.instance, v.surface, nil)
		vk.DestroyInstance(v.instance, nil)
		err = fmt.Errorf("CreateDevice with extensions %s failed with %s",deviceExtensions, err)
		return

@splace
Copy link
Author

splace commented Oct 24, 2020

deviceCreate requires swapchain, my vulkan setup doesn't have it, so this errors.

actually vulkaninfo (the CLI) shows it does, i did wonder, vulkaninfo (the example) says, when fixed, that it doesn't.

in fact; about half the device extensions aren't being reported.

@splace
Copy link
Author

splace commented Dec 30, 2020

in fact; about half the device extensions aren't being reported.

after the latest update to vulkan (solus) all extensions produced by this are now agreeing with vulkaninfo. which is reassuring.

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

No branches or pull requests

1 participant