-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Made a PKGBUILD for Arch Linux #57
Comments
Great, I'm going to install my first archlinux tonight :-) |
I add to install 'vulkan-devel' to have a successful build. It's great to have an arch package, thanks a lot. I'll put it on my README on my next push. |
done, And I discovered that there's a debian user repo now... |
I am investigating whether we really need the full #include <stdbool.h>
#include <vulkan/vulkan.h>
#include <vkvg.h>
int main(void) {
VkvgDevice d = vkvg_device_create(VK_SAMPLE_COUNT_32_BIT, false);
VkvgSurface s = vkvg_surface_create(d, 1280, 720);
VkvgContext c = vkvg_create(s);
vkvg_select_font_face(c, "serif");
vkvg_set_font_size(c, 32);
vkvg_set_source_rgb(c, 0.0, 0.0, 1.0);
vkvg_move_to(c, 10.0, 50.0);
vkvg_show_text(c, "おはよう, Παν語");
vkvg_destroy(c);
vkvg_surface_write_to_png(s, "hello.png");
vkvg_surface_destroy(s);
} I compiled it with
This happens with and without |
VK_SAMPLE_COUNT_32_BIT is surely not available (max ~8 for common hardwares). I could test maximum available sample count in device creation and throw an error if count not supported. gcc main.c -lvkvg -o test or gcc main.c `pkg-config --libs vkvg` -o test |
I pushed on master a diff with sample count check, but cairo used to return valid pointer even if failed and set status accordingly. I have to make some changes to mimic the same behavior. |
Thanks! I set it to 8 bits, now it works, but the |
you have to select a font which has glyph for the codepoints you provide, for japanese I've test with (on debian) with sudo apt install fonts-umeplus-cl vkvg_select_font_face(c, "UmePlus CL Gothic"); it's possible to load directly .ttf files: |
Thanks, sorry to bother you again... I updated ...
vkvg_load_font_from_path(c, "/usr/share/fonts/noto/NotoSans-Regular.ttf", "Noto Sans Regular");
vkvg_set_font_size(c, 32);
vkvg_set_source_rgb(c, 0.0, 0.0, 1.0);
vkvg_move_to(c, 10.0, 50.0);
vkvg_show_text(c, "Hello, world!");
... but the PNG is still empty. What am I doing wrong? |
No problems, it's always a pleasure to give support for VKVG. |
maybe start with a simple paint: VkvgContext ctx = vkvg_create (surf);
vkvg_set_source_rgb(ctx,1,0,0);
vkvg_paint(ctx);
vkvg_destroy(ctx); |
Thank you for being so kind! I wrote: ...
VkvgContext c = vkvg_create(s);
printf("%d\n", vkvg_status(c));
vkvg_set_source_rgb(c, 1, 0, 0);
printf("%d\n", vkvg_status(c));
vkvg_paint(c);
printf("%d\n", vkvg_status(c));
vkvg_destroy(c);
... The output is: 0
0
0 So it means /usr/bin/ld: CMakeFiles/svg-viewer.dir/vkvg-svg/svg-viewer.c.o: in function `readSVG':
/tmp/vkvg/tests/vkvg-svg/svg-viewer.c:132: undefined reference to `LOG'
/usr/bin/ld: /tmp/vkvg/tests/vkvg-svg/svg-viewer.c:133: undefined reference to `LOG'
/usr/bin/ld: /tmp/vkvg/tests/vkvg-svg/svg-viewer.c:134: undefined reference to `LOG'
/usr/bin/ld: /tmp/vkvg/tests/vkvg-svg/svg-viewer.c:135: undefined reference to `LOG'
/usr/bin/ld: /tmp/vkvg/tests/vkvg-svg/svg-viewer.c:136: undefined reference to `LOG'
/usr/bin/ld: CMakeFiles/svg-viewer.dir/vkvg-svg/svg-viewer.c.o:/tmp/vkvg/tests/vkvg-svg/svg-viewer.c:137: more undefined references to `LOG' follow
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/svg-viewer.dir/build.make:112: tests/svg-viewer] Error 1
make[1]: *** [CMakeFiles/Makefile2:1633: tests/CMakeFiles/svg-viewer.dir/all] Error 2
make: *** [Makefile:156: all] Error 2 even if I did not enable cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DVKVG_USE_GLUTESS=true \
-DVKVG_BUILD_DOCS=true \
-DVKVG_USE_FONTCONFIG=true \
-DVKVG_USE_FREETYPE=true \
-DVKVG_USE_HARFBUZZ=true \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_VALIDATION=true \
-DENABLE_DBG_UTILS=true \
-DENABLE_RENDERDOC=true \
-DENABLE_WIRED_FILL=true \
-DENABLE_PROFILING=true \
-DVKVG_DBG_STATS=true \
..
make install |
you can disable svg to test, the latest cmakefile should disable build vkvg_svg tests (that's where the error is) |
recommended options for tests: cmake -DCMAKE_INSTALL_PREFIX=/usr \
-DVKVG_BUILD_TESTS=true \
-DVKVG_USE_GLUTESS=true \
-DVKVG_SVG=false \
-DVKVG_BUILD_DOCS=false \
-DVKVG_USE_FONTCONFIG=true \
-DVKVG_USE_FREETYPE=true \
-DVKVG_USE_HARFBUZZ=true \
-DCMAKE_BUILD_TYPE=Debug \
-DENABLE_VALIDATION=true \
-DENABLE_DBG_UTILS=true \
-DENABLE_RENDERDOC=false \
-DENABLE_WIRED_FILL=false \
-DENABLE_PROFILING=false \
-DVKVG_DBG_STATS=false \ don't forget to sync submodules if you checkout a more recent version: |
Even with ...
VkvgContext c = vkvg_create(s);
printf("%d\n", vkvg_status(c));
vkvg_load_font_from_path(c, "/usr/share/fonts/noto/NotoSans-Regular.ttf", "Noto Sans Regular");
printf("%d\n", vkvg_status(c));
vkvg_set_font_size(c, 32);
printf("%d\n", vkvg_status(c));
vkvg_set_source_rgb(c, 0.0, 0.0, 1.0);
printf("%d\n", vkvg_status(c));
vkvg_move_to(c, 10.0, 50.0);
printf("%d\n", vkvg_status(c));
vkvg_show_text(c, "Hello, world!");
printf("%d\n", vkvg_status(c));
vkvg_destroy(c);
... the output is still 0
0
0
0
0
0 |
Thanks, now it builds but I get vkvg.c: In function ‘main’:
vkvg.c:8:5: error: ‘vkvg_log_level’ undeclared (first use in this function)
8 | vkvg_log_level = VKVG_LOG_ERR;
| ^~~~~~~~~~~~~~
vkvg.c:8:5: note: each undeclared identifier is reported only once for each function it appears in
Yes, I am building the latest versions of their |
if vkvg_log_level is not defined, it's not a debug build, it's in release mode, double check this. status 0 = success. |
That's what I thought, too, but I don't know why. I ran |
ensure you call cmake with the two dot from the build dir cmake .. -DCMAKE_BUILD_TYPE=Debug maybe, wipe out the build dir (rm -fr build) and start from a fresh one, sometime cmake cached variables are the problem |
Even after starting afresh and running cmake .. -DCMAKE_BUILD_TYPE=Debug
make install I get the same error... I really don't know why. |
I guess only the release lib are installed by the aur build system. And without log, you still have an empty image? #include <stdbool.h>
#include <vulkan/vulkan.h>
#define DEBUG 1 //<===
#include <vkvg.h>
int main(void) {
... |
That's so strange though, in the PKGBUILD I specify the
Yes. |
for the vkvg_log_level, you have to define DEBUG to 1, I've just tested it. |
can you send the image here |
you may try with: vkvg_log_level=VKVG_LOG_FULL, and give me the output |
and your full c source, plz |
Oh, it was so simple! Rip.
Here you go: #include <stdbool.h>
#include <stdio.h>
#include <vulkan/vulkan.h>
#define DEBUG 1
#include <vkvg.h>
int main(void) {
vkvg_log_level = VKVG_LOG_FULL;
VkvgDevice d = vkvg_device_create(VK_SAMPLE_COUNT_8_BIT, false);
VkvgSurface s = vkvg_surface_create(d, 240, 80);
VkvgContext c = vkvg_create(s);
printf("%d\n", vkvg_status(c));
vkvg_set_source_rgb(c, 1, 0, 0);
printf("%d\n", vkvg_status(c));
vkvg_paint(c);
printf("%d\n", vkvg_status(c));
vkvg_destroy(c);
printf("%d\n", vkvg_status(c));
vkvg_destroy(c);
vkvg_surface_write_to_png(s, "hello.png");
vkvg_surface_destroy(s);
return 0;
}
Finally! |
You can run the samples? if you compile with VKVG_BUILD_TESTS (you need glfw3-dev) |
every thing looks good in the log, I get a red image here, strange. |
Yes, I compiled with
|
Just in case, here is the output from the other example:
|
and the test output on screen is ok, not blank? |
Sure, nothing strange. |
so the problem surely comes from the |
I rebuilt it against the new version and I still get an empty image... maybe the problem comes from my graphics card driver's Vulkan implementation? |
There are some fixes in the tests device creation for scalar block layout, also the validation layer here is not enabled. I'll try to make a common method for this part, I'll notify you when it's ready. |
I've pushed the fix on master. |
Ok, thank you very much! |
...still no image nor text, but this time I got validation errors printed, for example in the case of the would-be-red image:
The only thing that changes in the validation errors in the would-be-text image example is the handle, in which case is |
I added the validation layer in debug mode. The last validation error is the problem, that's the final blit to dest image. Your driver miss the blit_dest feature for VK_FORMAT_R8G8B8A8_SRGB, I'll add a test there, but the final colors on the png will not be the same, I'notify when it's ready. |
I've pushed a fix on master: commit:4915cbe |
Thanks! I rebuilt it, now the image isn't even being created, the debug message says: |
I'll investigate the question, but I test 2 very common image formats, one possibility is that blitting may only be done with optimal image format on your driver. Can you send me vulkaninfo.html returned by the command |
Sure, here you go: vulkaninfo.txt (I renamed it to |
that's what I guessed, blit dest feature is only available for optimal tilling, I'll prepare a fix, that should be ok after that. |
I've pushed the fix: commit:f46d8a4 |
Truly marvelous, now both examples work! Thank you so much! I still get the first validation error though, but after all the time I've taken you, this alone is just fantastic. |
I thanks you too for helping me improving vkvg, Hope to have you published some stuffs... |
What do you mean by "some stuffs"? |
If you drive some tests, or you build a small app, don't hesitate to send me notes, and remarks, or publish tuto's, or just return of experience. And if you have some nice screenshots, you may also send it to me. |
Oh, sure! Actually, I'd like to replace |
And what about the first one? Is it still my driver's fault? |
I have to investigate...no it's a vulkan barrier not well configured |
Hi, I'm here just to tell you I made a PKGBUILD for Arch Linux and released it on the Arch User Repository here: https://aur.archlinux.org/packages/vkvg. You can add it in your README if you like it.
The text was updated successfully, but these errors were encountered: