lakal3 / vge Goto Github PK
View Code? Open in Web Editor NEWVulkan Graphics Engine
License: Other
Vulkan Graphics Engine
License: Other
As of commit 8df9634, the VGE go.mod language requirements were incremented from Go 1.12 to Go 1.16, as Go 1.16 is required for the Go embed directives.
Given that users would have to update their Go version, and their version of VGE to use the latest changes, I suggest this would be a good time to fully deprecate and remove the packspv tool from the VGE codebase. Any old users of the tool would still have an old version of VGE, and when updating they can switch to using Go embed directives instead. No code base of users would stop functioning, as their previous use of packspv
would have generated source code, and given the recommendations of Go generate, the suggested approach for generated Go code is to check in the code into the users source code revision control system.
Edit: PR #8 updates the documentation to remove the mention of the packspv tool and suggest users to use Go embed instead.
$ time make
[ 85%] Building CXX object CMakeFiles/VGELib.dir/vgelib/pipeline.cpp.o
/home/u/Desktop/VGE/cpp/vgelib/pipeline.cpp: In member function ‘void vge::GraphicsPipeline::Create(vge::RenderPass*)’:
/home/u/Desktop/VGE/cpp/vgelib/pipeline.cpp:74:102: error: ambiguous overload for ‘operator=’ (operand types are ‘vk::Pipeline’ and ‘vk::ResultValue<vk::Pipeline>’)
74 | _pipeline = _dev->get_device().createGraphicsPipeline(nullptr, gpci, allocator, _dev->get_dispatch());
| ^
In file included from /home/u/Desktop/VGE/cpp/vgelib/vgelib.hpp:11,
from /home/u/Desktop/VGE/cpp/vgelib/pipeline.cpp:1:
/usr/include/vulkan/vulkan.hpp:26417:9: note: candidate: ‘constexpr vk::Pipeline& vk::Pipeline::operator=(const vk::Pipeline&)’
26417 | class Pipeline
| ^~~~~~~~
/usr/include/vulkan/vulkan.hpp:26417:9: note: candidate: ‘constexpr vk::Pipeline& vk::Pipeline::operator=(vk::Pipeline&&)’
/home/u/Desktop/VGE/cpp/vgelib/pipeline.cpp: In member function ‘void vge::ComputePipeline::Create()’:
/home/u/Desktop/VGE/cpp/vgelib/pipeline.cpp:175:101: error: ambiguous overload for ‘operator=’ (operand types are ‘vk::Pipeline’ and ‘vk::ResultValue<vk::Pipeline>’)
175 | _pipeline = _dev->get_device().createComputePipeline(nullptr, cpci, allocator, _dev->get_dispatch());
| ^
In file included from /home/u/Desktop/VGE/cpp/vgelib/vgelib.hpp:11,
from /home/u/Desktop/VGE/cpp/vgelib/pipeline.cpp:1:
/usr/include/vulkan/vulkan.hpp:26417:9: note: candidate: ‘constexpr vk::Pipeline& vk::Pipeline::operator=(const vk::Pipeline&)’
26417 | class Pipeline
| ^~~~~~~~
/usr/include/vulkan/vulkan.hpp:26417:9: note: candidate: ‘constexpr vk::Pipeline& vk::Pipeline::operator=(vk::Pipeline&&)’
make[2]: *** [CMakeFiles/VGELib.dir/build.make:147: CMakeFiles/VGELib.dir/vgelib/pipeline.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:134: CMakeFiles/VGELib.dir/all] Error 2
make: *** [Makefile:149: all] Error 2
The error was encountered at rev 15f418d, using GCC 10.2.0 on Arch Linux, and Vulkan header version 1.2.172. Let me know if you need any additional details to troubleshoot.
$ uname -a
Linux x1 5.11.7-arch1-1 #1 SMP PREEMPT Wed, 17 Mar 2021 16:59:58 +0000 x86_64 GNU/Linux
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC)
$ pacman -Qi vulkan-headers
Name : vulkan-headers
Version : 1:1.2.172-1
Hej Lauri,
It's exciting to see your continued development of VGE.
I think we touched upon the issue of enabling static builds of VGE before, but as it was not listed in /issues, I added this one for tracking.
My previous attempt at this is present in https://github.com/mewpull/VGE/tree/static-lib-on-linux
The benefit of static linking is that it would make it easier to distribute binaries depending on VGE (not needing to also distribute libvgelib.{dll,so}
).
Running go install ./...
on VGE currently results in build errors for the example directory, as there exist multiple Go source files defining the main
function in the same directory.
$ go install -v ./...
github.com/lakal3/vge/vge/materials/phong
github.com/lakal3/vge/examples/basic
# github.com/lakal3/vge/examples/basic
examples/basic/logo.go:16:6: main redeclared in this block
previous declaration at examples/basic/hello.go:13:6
examples/basic/logo.go:31:6: buildScene redeclared in this block
previous declaration at examples/basic/hello.go:29:21
examples/basic/logo_an.go:21:6: main redeclared in this block
previous declaration at examples/basic/logo.go:16:6
examples/basic/logo_an.go:50:6: buildScene redeclared in this block
previous declaration at examples/basic/logo.go:31:21
examples/basic/logo_an.go:152:6: nodeVisible redeclared in this block
previous declaration at examples/basic/logo.go:109:6
examples/basic/logo_an.go:156:23: (*nodeVisible).Process redeclared in this block
previous declaration at examples/basic/logo.go:113:6
github.com/lakal3/vge/examples/model
To resolve this issue, one approach is to add build tags (Go proposal for new build tag syntax golang/go#41184) which exclude these examples from default builds, e.g.
//go:build examples
$ env LD_LIBRARY_PATH=. ./hello
panic: runtime error: cgo argument has Go pointer to Go pointer
goroutine 1 [running]:
github.com/lakal3/vge/vge/dldyn.Invoke.func3(0x7f634c572a00, 0x1b6aa30, 0xc00009a770, 0x28)
/home/u/Desktop/VGE/vge/dldyn/dl.go:95 +0xa5
github.com/lakal3/vge/vge/dldyn.Invoke(0x7f634c572a00, 0x2, 0x1b6aa30, 0xc00009a770, 0x0, 0x28)
/home/u/Desktop/VGE/vge/dldyn/dl.go:95 +0xfb
github.com/lakal3/vge/vge/vk.call_NewDesktop(0x577148, 0x6b0de0, 0x1b6aa30, 0xc00009a770)
/home/u/Desktop/VGE/vge/vk/libcall_linux_amd64.go:796 +0xaa
github.com/lakal3/vge/vge/vk.NewDesktop(0x577148, 0x6b0de0, 0xc0000ce000, 0x6f676f6c)
/home/u/Desktop/VGE/vge/vk/desktop.go:22 +0xa5
github.com/lakal3/vge/vge/vapp.Desktop.InitApp()
/home/u/Desktop/VGE/vge/vapp/win.go:117 +0xed
github.com/lakal3/vge/vge/vapp.Init(0x54ab00, 0x4, 0xc0000b3f58, 0x2, 0x2)
/home/u/Desktop/VGE/vge/vapp/app.go:71 +0x218
main.main()
/home/u/Desktop/VGE/examples/basic/hello.go:20 +0xcc
From https://golang.org/pkg/cmd/cgo/#hdr-C_references_to_Go
Go code may pass a Go pointer to C provided the Go memory to which it points does not contain any Go pointers.
The GetImage
method of GlyphSet
seem to have been renamed or removed, thus causing the test to fail.
$ go test ./vge/vui/mintheme
# github.com/lakal3/vge/vge/vui/mintheme [github.com/lakal3/vge/vge/vui/mintheme.test]
vge/vui/mintheme/theme_test.go:32:23: gs.GetImage undefined (type *vglyph.GlyphSet has no field or method GetImage)
FAIL github.com/lakal3/vge/vge/vui/mintheme [build failed]
FAIL
The image button asset used by the vge/vui test seem to have been moved or deleted, thus causing the test to fail.
$ go test ./vge/vui
--- FAIL: TestNewUIView (0.01s)
testapp.go:23: API call failed: open /home/u/Desktop/VGE/assets/glyphs/basicui/btn.png: no such file or directory
FAIL
FAIL github.com/lakal3/vge/vge/vui 0.016s
FAIL
I tried to get the examples running, and with the merged PRs they are now successfully compiling.
However, when I try to run an example it opens a window, but does not seem to draw anything into it. (note: the window just gets the contents of the background, so, I switched wallpaper to make the VGE window more visible.)
I tried vkcube and it is working correctly.
Any idea how to go about troubleshooting this? I'm still very new to Vulkan and would love to dive in and learn more. That's why I felt to happy to discover your work on VGE!
Cheers,
Robin
On rev 64b317f, there exist a crash in the cube example, where the Dispose
method may be called on nil
cache objects.
Using device Intel(R) HD Graphics 620 (KBL GT2)
Event {302 660 360 0 30306944}
Event {103 638 697 0 30306944}
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x4c96c2]
goroutine 20 [running]:
github.com/lakal3/vge/vge/vk.(*RenderCache).NewFrame(...)
/home/u/Desktop/play_vge/VGE/vge/vk/rendercache.go:53
github.com/lakal3/vge/vge/vk.(*RenderCache).Dispose(0x0)
/home/u/Desktop/play_vge/VGE/vge/vk/rendercache.go:27 +0x22
main.(*cubeApp).renderLoop(0x5dc860, 0xc0000be1c0)
/home/u/Desktop/play_vge/VGE/examples/cube/main.go:186 +0x76
created by main.main
/home/u/Desktop/play_vge/VGE/examples/cube/main.go:71 +0x265
Printf-debugging reveals that cache objects may be nil
(the slice is allocated ):
ca: &{0xc0000cc000 0x5dc860 {[] <nil> map[16:0xc000069260 22:0xc00001a0f8 23:0xc00006e060 24:0xc000014020]} {[] <nil> map[9:0xc000070000 16:0xc000069260 20:0xc000014060 21:0xc000010528]}}
ca: &{0xc0000cc000 0x5dc860 {[] <nil> map[16:0xc0000b9500 22:0xc0000b20c8 23:0xc00009c3f0 24:0xc00009a5c0]} {[] <nil> map[9:0xc0000f2000 16:0xc0000b9500 20:0xc00009a600 21:0xc0000aa570]}}
ca: <nil>
Call to printf added to the following line:
// If image index < 0, there was some error acquiring image. Most likely window was resized which in many cases mean that we
// must destroy existing rendering assets like depth buffers etc and recreate them. Next call to GetNextFrame should again succeed
if imageIndex < 0 {
// Reset all render caches
for _, ca := range caches {
+ fmt.Println("ca:", ca)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.