Giter Site home page Giter Site logo

vulkan-go / demos Goto Github PK

View Code? Open in Web Editor NEW
148.0 10.0 26.0 2.39 MB

Vulkan API crossplatform demos in Go

Home Page: https://vulkanGo.com

License: Do What The F*ck You Want To Public License

Makefile 10.13% Go 86.16% GLSL 3.44% CMake 0.27%
golang vulkan vulkan-api vulkan-demos go glfw

demos's People

Contributors

diegoflassa avatar jclc avatar maxekman avatar tomas-mraz avatar xlab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

demos's Issues

vulkaninfo compute not working on linux.

i get this...

fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x0]

runtime stack:
runtime.throw(0x52b296, 0x2a)
	/usr/lib64/golang/src/runtime/panic.go:774 +0x72
runtime.sigpanic()
	/usr/lib64/golang/src/runtime/signal_unix.go:378 +0x47c
runtime.asmcgocall(0xc000080400, 0x0)
	/usr/lib64/golang/src/runtime/asm_amd64.s:659 +0x70

goroutine 1 [syscall]:
runtime.cgocall(0x4d9060, 0xc0000add28, 0x4a6859)
	/usr/lib64/golang/src/runtime/cgocall.go:128 +0x5b fp=0xc0000adcf8 sp=0xc0000adcc0 pc=0x40c1fb
github.com/vulkan-go/vulkan._Cfunc_callVkDestroySurfaceKHR(0x1e795a0, 0x0, 0x0)
	_cgo_gotypes.go:6073 +0x45 fp=0xc0000add28 sp=0xc0000adcf8 pc=0x49d295
github.com/vulkan-go/vulkan.DestroySurface.func1(0x1e795a0, 0x0, 0x0)
	/home/simon/go/src/github.com/vulkan-go/vulkan/vulkan.go:1359 +0xc4 fp=0xc0000add60 sp=0xc0000add28 pc=0x4a6b14
github.com/vulkan-go/vulkan.DestroySurface(0x1e795a0, 0x0, 0x0)
	/home/simon/go/src/github.com/vulkan-go/vulkan/vulkan.go:1359 +0x3f fp=0xc0000add88 sp=0xc0000add60 pc=0x4a5fff
github.com/vulkan-go/demos/vulkaninfo.NewVulkanDevice(0x5e7ac0, 0x0, 0x0, 0x0, 0x0)
	/home/simon/go/src/github.com/vulkan-go/demos/vulkaninfo/vulkaninfo.go:63 +0x462 fp=0xc0000adf20 sp=0xc0000add88 pc=0x4d3892
main.main()
	/home/simon/go/src/github.com/vulkan-go/demos/vulkaninfo/vulkaninfo_compute/main.go:19 +0x70 fp=0xc0000adf60 sp=0xc0000adf20 pc=0x4d7d90
runtime.main()
	/usr/lib64/golang/src/runtime/proc.go:203 +0x21e fp=0xc0000adfe0 sp=0xc0000adf60 pc=0x4355be
runtime.goexit()
	/usr/lib64/golang/src/runtime/asm_amd64.s:1357 +0x1 fp=0xc0000adfe8 sp=0xc0000adfe0 pc=0x45db41
exit status 2

bit opaque but i figured it asking for swapchain in vulkaninfo.go wasn't right for term output, and fixed by commenting out...

...
	PQueuePriorities: []float32{1.0},
	}}
	deviceExtensions := []string{
// XXX		"VK_KHR_swapchain\x00",
	}
	deviceCreateInfo := &vk.DeviceCreateInfo{
		SType:                   vk.StructureTypeDeviceCreateInfo,
...

MemCopyFloat32 Deprecated?

In the file vulkandraw.go:662 there is MemCopyFloat32 used, but in the current vulkan-go api there is only Memcopy defined, which only takes []byte

Also in the file helpers.go:70 there is MemCopyByte used which should be changed to Memcopy

panic: vkInit failed

I don't know if I have installed it correctly, but I get this error:
~/Go/src/demos/vulkancube/vulkancube_desktop $ go run main.go
panic: vkInit failed
...

I'm using Linux with a Nvidia 1070 (375.66 drivers) and GLFW 3.2 with OpenGL 4.5 works fine. I just cloned the repo and run "go get -u" in the vulkancube_desktop folder.

Do you know what could be the problem?

Thanks!

vulkandraw on linux not working? yet?

 ~/go/src/github.com/vulkan-go/demos/vulkandraw/vulkandraw_desktop $ go build main.go
# github.com/vulkan-go/demos/vulkandraw
../vulkandraw.go:266:24: undefined: vulkan.GetRequiredInstanceExtensions
../vulkandraw.go:305:17: undefined: vulkan.CreateWindowSurface

functions do seem to be there for ios and windows, just not for Linux. (or am i missing something? a directive?)

others demos work.

i was looking at playing with instance extensions, so this function is, coincidentally, the very one i was looking at.

GLFW setup on OSX

Because the setup is a bit heavy what do you think about a docker building to help people try this out ?

I had trouble with some of the dependencies.

Linux Support

What would it take to look at supporting linux? I would like to slowly contribute something but I am a bit unsure about where to start.

Assume nvidia hardware on a machine that already runs steam.

iOS and Android open GL running inside flutter

https://github.com/mogol/opengl_texture_widget_example

I am going to try to get this going with your code. I already use golang I side flutter and it's very easy once the pattern is worked out.
I use the gomobile init again at the android NDK, but using a flag to build a .so out from go build and using that inside flutter will work too as I see your using that approach.

The cool thing with a flutter wrapper like this is that it makes it very accessible for Devs. Also the Flutter texture object that the example loads into get all the features like gestures, etc exposed in a neutral cross platform way.
Flutter also runs on all Desktops too btw.

Anyway holler if your interested :)

demo vulkan cube sdl2 invalid go

# github.com/vulkan-go/demos/vulkancube/vulkancube_sdl2
./main.go:33:31: cannot use surfPtr (type unsafe.Pointer) as type uintptr in argument to vulkan.SurfaceFromPointer
Tue 1 Dec 18:29:30 GMT 2020

fixed by adding type conversion...

surf := vk.SurfaceFromPointer(surfPtr)

->

surf := vk.SurfaceFromPointer(uintptr(surfPtr))

Makefile does not work on windows

running the makefile does not successfully build when it runs the go install or go build commands
even after setting
GLFW_INCLUDE_DIR
GLFW_LIB_DIR

I think this has something to do with how the make environment works on windows

'manual' builds are still possible, by setting the environment variables yourself

set CGO_CFLAGS=-I"dependencies/include" # set to location of your include folder
set CGO_LDFLAGS=-L"dependencies/libs" # set to location of your libs folder
go install # or `go build`

when the variables are no longer needed, you can set them to nothing

CGO_CFLAGS=
CGO_LDFLAGS=

or if you are done, just close the terminal in use, they won't be permanently saved

Error finding linmath package

I get the following when trying to build/run any of the demos.

$ go mod tidy
....
go: finding module for package github.com/xlab/linmath-go/linmath
github.com/vulkan-go/demos/vulkancube imports
        github.com/xlab/linmath tested by
        github.com/xlab/linmath.test imports
        github.com/xlab/linmath-go/linmath: cannot find module providing package github.com/xlab/linmath-go/linmath: module github.com/xlab/linmath-go/linmath: git ls-remote -q origin in /home/maugre/go/pkg/mod/cache/vcs/97833a51e0eb989d3a7ed868526b7c9da4576ae8e9721796c4eaad8eb994ea79: exit status 128:
        fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.