Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12141

panic: runtime error: cgo argument has Go pointer to unpinned Go pointer (in Go Vulkan While Creating a Swapchain)

$
0
0

I am Creating a swapchain in go vulkan im not sure why the above error is occuring below is the piece of code the error occur in vulkan CreateSwapchain function

createInfo := vk.SwapchainCreateInfo{    SType:            vk.StructureTypeSwapchainCreateInfo,    Surface:          p.Surface,    MinImageCount:    imageCount,    ImageFormat:      p.SurfaceFrormat.Format,    ImageColorSpace:  p.SurfaceFrormat.ColorSpace,    ImageExtent:      p.Extend,    ImageArrayLayers: 1,    ImageUsage:       vk.ImageUsageFlags(vk.ImageUsageColorAttachmentBit),}indices := p.findQueueFamily()var queuefamilyIndices []uint32queuefamilyIndices = append(queuefamilyIndices, *indices.graphicsFamily)queuefamilyIndices = append(queuefamilyIndices, *indices.presentFamily)if *indices.presentFamily != *indices.graphicsFamily {    createInfo.ImageSharingMode = vk.SharingMode(vk.SharingModeConcurrent)    createInfo.QueueFamilyIndexCount = 1    createInfo.PQueueFamilyIndices = queuefamilyIndices} else {    createInfo.ImageSharingMode = vk.SharingMode(vk.SharingModeExclusive)}createInfo.PreTransform = swapchainSupport.sCapabilities.CurrentTransformcreateInfo.CompositeAlpha = vk.CompositeAlphaFlagBits(vk.CompositeAlphaOpaqueBit)createInfo.PresentMode = p.PresentModecreateInfo.Clipped = vk.TruecreateInfo.Ref()result := vk.CreateSwapchain(p.LogicalDevice, &createInfo, nil, &p.Swapchain)if result != vk.Success {    panic(handleVkError(result))}

I tried Free() Deref() on the createinfo struct its not working Note i am not using New() anywherethis is happening in go-Vulkan


Viewing all articles
Browse latest Browse all 12141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>