Skip to content

VulkanDebug() == true panics #3

Open
@fzwoch

Description

@fzwoch

Enabling VulkanDebug() causes a panic during registering the debug callback in cgo.

$ go version
go version go1.11.12 linux/amd64
2019/07/24 11:28:36 vulkan: enabling 0 instance extensions
panic: runtime error: cgo argument has Go pointer to Go pointer

goroutine 1 [running]:
github.com/vulkan-go/vulkan.CreateDebugReportCallback.func1(0x10fd490, 0x11766b0, 0x0, 0xc0000cea68, 0x10fd490)
	/home/fzwoch/go/pkg/mod/github.com/vulkan-go/[email protected]/vulkan.go:1556 +0xcd
github.com/vulkan-go/vulkan.CreateDebugReportCallback(0x10fd490, 0xc0000f7da0, 0x0, 0xc0000cea68, 0x0)
	/home/fzwoch/go/pkg/mod/github.com/vulkan-go/[email protected]/vulkan.go:1556 +0x57
github.com/vulkan-go/asche.NewPlatform(0x52bca0, 0xc0000ae370, 0x0, 0x0, 0xc000070f88, 0xc0000a4058)
	/home/fzwoch/go/pkg/mod/github.com/vulkan-go/[email protected]/platform.go:95 +0x1aee
main.main()

example.go:

package main

import (
	as "github.com/vulkan-go/asche"
	vk "github.com/vulkan-go/vulkan"
)

type application struct {
	as.BaseVulkanApp
}

func (a *application) VulkanDebug() bool {
	return true
}

func main() {
	if err := vk.SetDefaultGetInstanceProcAddr(); err != nil {
		panic(err)
	}

	if err := vk.Init(); err != nil {
		panic(err)
	}

	app := &application{}

	as.NewPlatform(app)
}

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