Giter Site home page Giter Site logo

jpbruyere / vkvg Goto Github PK

View Code? Open in Web Editor NEW
728.0 32.0 32.0 4.37 MB

Vulkan 2D graphics library

Home Page: https://jpbruyere.github.io/vkvg

License: MIT License

CMake 1.46% C 97.71% GLSL 0.74% Shell 0.09%
vulkan 2d vector graphics-library drawing-library cairo gpu graphics

vkvg's Introduction


vkvg

Vulkan Vector Graphics

vkvg is an open-source 2D graphics library written in C using Vulkan as backend. The API follows the same pattern as Cairo, but new functions and original drawing mechanics may be added.

vkvg is in alpha development stage and the core api is mostly stabilized. All contributions are welcome.

In progress API documentation is available online at http://vkvg.org.

Performance comparison


major libs perf comparison

Current status:

  • Fill (stencil even-odd, non-zero).
  • Stroke.
  • Basic painting operation.
  • Font system with caching operational.
  • Linear/Radial Gradients.
  • Line caps and joins.
  • Dashes.
  • Context should be thread safe, extensive tests required.
  • Image loading and writing with stb lib
  • Test includes svg rendering either with built-in renderer or nanoSVG

Requirements:

  • CMake: version >= 3.16
  • Vulkan: version >= 1.1
  • FontConfig: optional, without fontconfig, use vkvg_load_font_from_path.
  • Freetype: optional, stb_truetype as alternative.
  • Harfbuzz: optional, without complex text shaping may be wrong.
  • GLSLC: spirv compiler, included in LunarG SDK: compile shader to spir-V (building only, optional)
  • xxd: generate headers with precompiled shaders (building only, optional)
  • GLFW: optional, if present tests are built.

if glslc or xxd are not present, a precompiled version of the shaders is stored in the git tree.

Building

#fetch sources from github
git clone --recursive https://github.com/jpbruyere/vkvg.git
cd vkvg
# Create build directory
mkdir build
cd build
# Run CMake configuration
cmake ..

CMake configure options

Core library options:
  • -DVKVG_USE_GLUTESS=true: Use embedded glu tesselator to fill polygones in NON-ZERO mode. If false, a simple ear clipping algorithm is used.
  • -DVKVG_SVG=true: Enable experimental svg renderer. If false, use nanoSVG.
  • -DVKVG_RECORDING=true: Enable experimental draw commands recording infrastructure.
  • -DVKVG_BUILD_DOCS=true: Build documentation if doxygen is found.
Vulkan Features:
  • -DVKVG_ENABLE_VK_SCALAR_BLOCK_LAYOUT=true: Enable VK_EXT_scalar_block_layout that reduce structure padding for gpu.
  • -VKVG_ENABLE_VK_TIMELINE_SEMAPHORE=true: Enable experimental work syncing with VK_KHR_timeline_semaphore instead of Fences.
Text rendering libraries:

Those libraries are enabled by default, but disabled if not found.

  • -DVKVG_USE_FONTCONFIG=true: enable FontConfig to resolve font's names.
  • -DVKVG_USE_FREETYPE=true: enable FreeType to render glyphs, if false glyphs are rendered with stb_truetype.
  • -DVKVG_USE_HARFBUZZ=true: enable harfbuzz for text shaping.
Tests options:
  • -DVKVG_BUILD_TESTS=true: build all tests in the tests forlder.
  • -DVKVG_TEST_DIRECT_DRAW=true: enable drawing directly on the swapchain images.
Debugging options:

If vkvg is compiled with CMAKE_BUILD_TYPE=Debug, several additional options are made available to help debugging:

  • -DENABLE_VALIDATION=true: enable vulkan validation layer.
  • -DENABLE_DBG_UTILS=true: enable various vulkan debug utils extensions features.
  • -DENABLE_RENDERDOC=true: enable renderdoc layer.
  • -DENABLE_WIRED_FILL=true: enable rendering in wired mode, current mode is controled with the global variable vkvg_wired_debug.
  • -DENABLE_PROFILING=true: add -pg to the compile options.
  • -DVKVG_DBG_STATS=true: store various context statistics fetchable with vkvg_device_get_stats()
cmake --build .

A detailed tutorial is available for Windows.

Running tests

Append the -h option to see available command line parameters.

Contributing

See the contribution guide for more information.

Join us on gitter for any question.

Addtitional Credits

Change log

  • v0.2.0
    • radial gradients.
    • better stroke joins handling.
    • png saved in srgb format.
    • doxygen cmake target and style

To Do

  • Use Scissor where possible.
  • Improve stroke algorithms.
  • Radial gradients.
  • Dashed lines.
  • Operators.
  • Optimize vulkan memory allocations by sub-allocating from a single shared memory chunk per type.
  • Optimize command submissions.
  • Test SDF font rendering.
  • Avoid line joins inside curves and arc.
  • Structured unit testing.
  • Perf and memory checks.
  • Code cleanup and comments.
  • Documentations.

vkvg's People

Contributors

chrismile avatar fzwoch avatar jpbruyere avatar panaman67 avatar rubo3 avatar volatus 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vkvg's Issues

Segfaults in surface test

When I run the test surface in release mode, it always segfaults, sometimes with malloc_consolidate(): unaligned fastbin chunk detected, or free(): double free detected in tcache 2. While in debug mode I also get corrupted double-linked list, munmap_chunk(): invalid pointer, free(): invalid pointer, double free or corruption (!prev) or malloc(): unsorted double linked list corrupted.

Pattern extend implementation

Pattern are implemented in the main shader, so for now I can't reuse the texture extend properties which would make things a lot easier.

Using vkvg with cpp

After using a lot of hours, I still can't get vkvg to work nicely with cpp.

Right now i'm stuck at creating the device with vkvg_device_create_multisample, where I get a segmentation fault.
The segmentation fault occurs around the VkvgDevice variable created inside the function

I'm using the same approach as the examples

`void InitEngine(uint32_t Width, uint32_t Height) {

Inst = VkEngineCreate(VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU, VK_PRESENT_MODE_FIFO_KHR, TWidth, THeight);

VkhPresenter Render = Inst->Renderer; 
bool DeferredResolve = false;

Dev = vkvg_device_create_multisample(vkh_app_get_inst(Inst->App), Render->dev->phy, Render->dev->dev, Render->qFam, 0, Samples, DeferredResolve);

vkvg_device_set_dpy(Dev, 96, 96);
Surface = vkvg_surface_create(Dev, Width, Height);
vkh_presenter_build_blit_cmd(Render, vkvg_surface_get_vk_image(Surface), TWidth, THeight);

}`

Linking failure

After following the installations instructions precisely I get the following errors on my Fedora 32 system:

-*- mode: compilation; default-directory: "/space/pub-repos/vkvg/build/" -*-
Compilation started at Wed Aug 12 23:18:59

make
[ 10%] Built target vkh_static
[ 23%] Built target vkvg_static
[ 25%] Built target tests_common
[ 26%] Linking CXX executable test_compositing
/usr/bin/ld: libtests_common.a(test.c.o):/space/pub-repos/vkvg/vkh/src/vkh_device.h:32: multiple definition of `CreateDebugReportCallback'; CMakeFiles/test_compositing.dir/tests/compositing.c.o:/space/pub-repos/vkvg/vkh/src/vkh_device.h:32: first defined here
/usr/bin/ld: libtests_common.a(test.c.o):/space/pub-repos/vkvg/vkh/src/vkh_device.h:33: multiple definition of `DestroyDebugReportCallback'; CMakeFiles/test_compositing.dir/tests/compositing.c.o:/space/pub-repos/vkvg/vkh/src/vkh_device.h:33: first defined here
/usr/bin/ld: libtests_common.a(test.c.o):/space/pub-repos/vkvg/vkh/src/vkh_device.h:34: multiple definition of `dbgBreakCallback'; CMakeFiles/test_compositing.dir/tests/compositing.c.o:/space/pub-repos/vkvg/vkh/src/vkh_device.h:34: first defined here
/usr/bin/ld: libtests_common.a(vkengine.c.o):/space/pub-repos/vkvg/vkh/src/vkh_device.h:32: multiple definition of `CreateDebugReportCallback'; CMakeFiles/test_compositing.dir/tests/compositing.c.o:/space/pub-repos/vkvg/vkh/src/vkh_device.h:32: first defined here
/usr/bin/ld: libtests_common.a(vkengine.c.o):/space/pub-repos/vkvg/vkh/src/vkh_device.h:33: multiple definition of `DestroyDebugReportCallback'; CMakeFiles/test_compositing.dir/tests/compositing.c.o:/space/pub-repos/vkvg/vkh/src/vkh_device.h:33: first defined here
:

Multithreading

Context has dedicated command pool and dedicated descriptor pool.
There is a single graphic queue instantiated in the device.
All commands (from device, surfaces and contexts) are submitted to that queue from their respective threads.
Validation layer complaints when submitting commands from other threads.

I have to find the correct way to build command buffers in different threads and submitting them to the main graphic queue.

Validation give errors with image format not being in presentable format

Output repets last error several times:

WRN: [ UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass ] Object: VK_NULL_HANDLE (Type = 0) | Render pass has an attachment with loadOp == V
K_ATTACHMENT_LOAD_OP_LOAD and initialLayout == VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you intended. Consider using VK_ATTACHMENT_L
OAD_OP_DONT_CARE instead if the image truely is undefined at the start of the render pass.
WRN: [ UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass ] Object: VK_NULL_HANDLE (Type = 0) | Render pass has an attachment with stencilLoad
Op == VK_ATTACHMENT_LOAD_OP_LOAD and initialLayout == VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you intended. Consider using VK_ATTAC
HMENT_LOAD_OP_DONT_CARE instead if the image truely is undefined at the start of the render pass.
WRN: [ UNASSIGNED-CoreValidation-DrawState-InvalidRenderpass ] Object: VK_NULL_HANDLE (Type = 0) | Render pass has an attachment with loadOp == V
K_ATTACHMENT_LOAD_OP_LOAD and initialLayout == VK_IMAGE_LAYOUT_UNDEFINED. This is probably not what you intended. Consider using VK_ATTACHMENT_L
OAD_OP_DONT_CARE instead if the image truely is undefined at the start of the render pass.
DBG: While debugging through RenderDoc, debug output through validation layers is suppressed.
To show debug output look at the 'DebugOutputMute' capture option in RenderDoc's API, but be aware of false positives from the validation layers.
ERR: [ VUID-vkAcquireNextImageKHR-semaphore-01780 ] Object: 0x557f21c34aa0 (Type = 3) | vkAcquireNextImageKHR: Semaphore and fence cannot both be
VK_NULL_HANDLE. There would be no way to determine the completion of this operation. The Vulkan spec states: semaphore and fence must not both be
equal to VK_NULL_HANDLE (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01780
)
ERR: [ VUID-VkPresentInfoKHR-pImageIndices-01296 ] Object: 0x557f21c9cac0 (Type = 4) | Images passed to present must be in layout VK_IMAGE_LAYOUT
_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. The Vulkan spec states: Each element of
pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains arra
y, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout at the time the operation is executed on a VkDevice (
https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-01296)
ERR: [ VUID-vkAcquireNextImageKHR-semaphore-01780 ] Object: 0x557f21c34aa0 (Type = 3) | vkAcquireNextImageKHR: Semaphore and fence cannot both be
VK_NULL_HANDLE. There would be no way to determine the completion of this operation. The Vulkan spec states: semaphore and fence must not both be
equal to VK_NULL_HANDLE (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01780
)
ERR: [ VUID-VkPresentInfoKHR-pImageIndices-01296 ] Object: 0x557f21c9cac0 (Type = 4) | Images passed to present must be in layout VK_IMAGE_LAYOUT
_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL. The Vulkan spec states: Each element of
pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains arra
y, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout at the time the operation is executed on a VkDevice (
https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkPresentInfoKHR-pImageIndices-01296)
ERR: [ VUID-vkAcquireNextImageKHR-semaphore-01780 ] Object: 0x557f21c34aa0 (Type = 3) | vkAcquireNextImageKHR: Semaphore and fence cannot both be
VK_NULL_HANDLE. There would be no way to determine the completion of this operation. The Vulkan spec states: semaphore and fence must not both be
equal to VK_NULL_HANDLE (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01780
)

Performances

The first tests with vgperf against skia's vulkan backend and cairo gles show that solid colored rectangles and circles output of vkvg is 4 to 10 times slower due to the solid color handling: vkvg use push constants to set colors, resulting in too small triangles count submitted to gpu (cmdDrawIndexed vertices count too small). other libraries use color vertex attribute, which is by far the most efficient way to output lots of solid colored simple shape when vertex count/mesh is small.

Actual vertex attributes:

  • vec2 pos (RG32Float)
  • Vec3 TexCoord (RGB32Float) (only used for font char addressing in cache texture)

A possible plan for vertex attribute is:

  • Vec pos (RG32Float)
  • Vec4 color (RGBA8UNorm)

And use another dedicated vertex buffer for font texture coordinate, this imply to create a separate pipeline for text rendering. For now, I use a single pipeline for all pattern types and texts.

Font cache update

The font cache is a global cache at the device level, contexts have one descriptor pointing on a common texture array. If this texture array has to be expanded, all contexts are flushed thanks to a double linked list of contexts in the device.
This pattern has to be simplified and reorganized, only contexts updating and using new chars should have an up to date descriptor to the last font cache texture array. Other contexts should keep old cache texture as long as their don't upload new chars.

Build using meson?

I see that the project uses cmake to build itself. I find the syntax a bit challenging to understand, and I think meson is a bit more readable. I would be happy to add meson support to vkvg. I would just need a bit of guidance in translating cmake to meson.

gradient alpha channel ignored

It seems the alpha channel in gradients is ignored. For example, if I create a linear gradient with two identical color stops (r=1, g=0, b=0, a=0.5), I would expect the behavior to be the same as set_source_rgba(1,0,0,0.5), but instead I get solid red with no blending.

Samples Questions

Question: In the samples you define the graphics and the presentation queue as the same queue. Is it possible that this becomes a bottleneck for the measurements?

There are 1041 build warnings

I would say that 99% of these warnings are false alarms, possibly all of them.

But their presence makes it nearly impossible to spot new and dangerous ones as they are added.

I cleaned up about 3,000+ of these at my last employer and uncovered 50 attempts to write out of bounds. The writes only passed because they were writing less than 4 bytes to memory allocated on 4 byte boundaries. It worked but was a ticking bomb.

One I found was
#include "vk_mem_alloc.h".h

Just a dangling '.h' which the compiler let pass with a warning.

Stuff like this doesn't engender a lot of confidence in the package.

I expect to be using this package as a foundation for some upcoming work and I'm open to doing some cleanup work if requested.

Bob Tipton
Dark Sky Innovative Solutions.

Documentation

I am interested in understanding the library. I would like to dedicate some of my time to help in the documentation department, if that would be helpful to you.

Build deb for Debian / Ubuntu

It would be good if there was a .deb package for Debian or Ubuntu.

I guess in the Ubuntu version, it makes it possible to have a PPA which makes it much easier to try out vkvg.

Triangle Fan topology not supported on macOS

Triangle fans are used to fill polygons with the Even/Odd technic, it's not supported by moltenVK.
A quick fix has be apply to disable Even/Odd on macOS.

The workaround is to bind the IBO in the _poly_fill() method and produce triangle list indices as the fan would output with the contour.

Unable to make on Windows 10. Can't find FreeType

I keep getting this message.

CMake Error at C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find Freetype (missing: FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS)
Call Stack (most recent call first):
C:/Program Files/CMake/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
C:/Program Files/CMake/share/cmake-3.13/Modules/FindFreetype.cmake:156 (find_package_handle_standard_args)
CMakeLists.txt:74 (FIND_PACKAGE)

I've tried installing FreeType two different ways. Once via the detailed Windows Instructions and directly from the FreeType download.

I'm building for x64.

I've tried manually doing
set FREETYPE_INCLUDE_DIRS="\Program Files (x86)\GnuWin32\include"
set FREETYPE_LIBRARY="\Program Files (x86)\GnuWin32\lib"

This had no effect.

First dashes with offset > 0 not drawn

When offset is greater than 0, first dashes until total dash length are not drawn.
In closed path with offset > 0, inked dash on the closing corner must be handled with continuous line where possible.

single float to double float api

SIMD instructions target minimum 128 bits registers for floats, so for 2 dimensions vectors, the minimal alignment is 128bits, this makes use of SIMD only possible for 2*64bit float component vectors. So I'm planning to test and maybe move the vkvg api to double float instead of single float to be able to use SIMD.

stdarg.h include

As revealed here #79 by @Rubo3 , stdarg.h is indirectly included by vulkan wayland, so a clean inclusion is required.

Release build cause sigsev

glfwCreateWindowSurface returns 0 => presentation queue not found => sigsev.
In Debug mode glfwCreateWindowSurface returns correct pointer for surface...

vkvg_set_fill_rule

My side is win10 vs 2019

VKVG_ FILL_ RULE_ NON_ ZERO and VKVG_ FILL_ RULE_ EVEN_ ODD, The effect is the same

Failed to compile because of missing function definitions

I pulled the recent changes from this repository and tried to build it, but the linkage failed:

[ 49%] Linking CXX executable arcs
/usr/bin/ld: CMakeFiles/tests_common.dir/common/vkengine.c.o: in function `vkengine_create':
[many undefined references]
/usr/bin/ld: ../libvkvg.a(vkvg_device.c.o): in function `vkvg_device_create':
[many undefined references]
collect2: error: ld returned 1 exit status
make[2]: *** [tests/CMakeFiles/arcs.dir/build.make:112: tests/arcs] Error 1
make[1]: *** [CMakeFiles/Makefile2:485: tests/CMakeFiles/arcs.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I see some missing function definitions are related to vkh_layer* and vkh_extension*, have you perhaps forgotten to push changes to vkhelpers?

Implement Text direction

Harfbuzz is designed to handle complex text shaping and text direction.

It has to be implemented in VkvgText.

android / enable scalarBlockLayout

Android currently does not build because Vulkan 1.2 is not supported. I'm not particularly familiar with Vulkan, but I think these steps are needed.

  1. VK_MAKE_API_VERSION is not present, so just fallback to VK_MAKE_VERSION if VK_MAKE_API_VERSION is not defined (vkh_app.c).
  2. Use '#ifdef VK_VERSION_1_2' to guard against the usage of VkPhysicalDeviceVulkan12Features
  3. If Vulkan 1.2 is detected at runtime, set scalarBlockLayout in VkPhysicalDeviceVulkan12Features
  4. Otherwise, if VK_EXT_scalar_block_layout is detected set scalarBlockLayout in VkPhysicalDeviceScalarBlockLayoutFeaturesEXT and point pNext to this struct.
  5. Fallback to default layout???

text feature requests

Coming from nanovg, these are some features I miss:

  1. support for text strings that are not null terminated. just a convenience for rendering long/multi-line text.
  2. load font from memory
  3. return array of glyph positions. useful for selecting text with a mouse.
  4. font kerning without harfbuzz

Line cap bug

possibly missing triangle in the start cap (direction:BottomLeft to TopRight), but it maybe a driver stack bug (rasteriser)

Combine usage of context caching (reuse) and multithreading

Context caching is a new feature that allow caching of created context that dramatically increase context creation time. Maximum cached context count is controlled by the macro VKVG_MAX_CACHED_CONTEXT_COUNT.
Several vulkan objects are reused that cause error when manipulated by different threads.
So for now on master, max_cached_context_count is set to 0. To resolve this issue the following tasks are required:

  • Faulting vulkan objects has to be clearly identify (pools, buffers, ...)
  • test thread aware context caching, reusing context only and only if created by the same thread.

save and restore current context's pattern

patterns data's are stored in context push constant, and ubo, the full pattern struct should be stored in ctx to allow save and restore. struct lifetime sync between context and pattern should be handled.

Examples fail creating the app

I get the following error message when trying to run one of the examples:

Fatal : VkResult is -6 in /home/porky11/build/vkvg/vkh/src/vkh_app.c at line 83
test_colinear: /home/porky11/build/vkvg/vkh/src/vkh_app.c:83: vkh_app_create: Assertion `res == VK_SUCCESS' failed.

Cant run test with VK_IMAGE_TILING_LINEAR images.

IMAGE(ERROR / SPEC): object: 0x0 type: 0 msgNum: 165676968 - vkCreateImage: usage bit VK_IMAGE_USAGE_COLOR_ATTACHMENT is not supported for format VK_FORMAT_B8G8R8A8_UNORM with tiling VK_IMAGE_TILING_LINEAR. The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00980)
IMAGE(ERROR): object: 0x0 type: 0 location: 677 msg_code: 165676968: Object: 0x0 | vkCreateImage: usage bit VK_IMAGE_USAGE_COLOR_ATTACHMENT is not supported for format VK_FORMAT_B8G8R8A8_UNORM with tiling VK_IMAGE_TILING_LINEAR. The spec valid usage text states 'If tiling is VK_IMAGE_TILING_LINEAR, and VkFormatProperties::linearTilingFeatures (as returned by vkGetPhysicalDeviceFormatProperties with the same value of format) does not include VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT, usage must not contain VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-tiling-00980)
IMAGE(ERROR / SPEC): object: 0x0 type: 0 msgNum: 165676888 - vkCreateImage: The combination of format, type, tiling, usage and flags supplied in the VkImageCreateInfo struct is reported by vkGetPhysicalDeviceImageFormatProperties() as unsupported. The spec valid usage text states 'The combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-format-00940)
IMAGE(ERROR): object: 0x0 type: 0 location: 708 msg_code: 165676888: Object: 0x0 | vkCreateImage: The combination of format, type, tiling, usage and flags supplied in the VkImageCreateInfo struct is reported by vkGetPhysicalDeviceImageFormatProperties() as unsupported. The spec valid usage text states 'The combination of format, imageType, tiling, usage, and flags must be supported, as indicated by a VK_SUCCESS return value from vkGetPhysicalDeviceImageFormatProperties invoked with the same values passed to the corresponding parameters.' (https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VUID-VkImageCreateInfo-format-00940)
vkvg_test: vkh_image.c:57: _vkh_image_create: Assertion `res == VK_SUCCESS' failed.

If I change VK_IMAGE_TILING_LINEAR->VK_IMAGE_TILING_OPTIMAL then vkvg_test runs, but still with validation errors:

DS(ERROR / SPEC): object: 0x1f00 type: 23 msgNum: 61 - Descriptor set 0x1f00 encountered the following validation error at vkCmdDrawIndexed() time: Descriptor in bindi
ng #0 at global descriptor index 0 is being used in draw but has not been updated.

Curves with tight angle segments

When a curve segment has a very tight angle, currently the join is extended or converted to miter join. Ideally, under a certain angle, the segment join should be converted to curved join to render a perfect curve.

missing stbi

for build vkvg need install stb, on fedora

sudo dnf install stbi-devel

and edit CMakeLists.txt on line 7

SET(CMAKE_EXE_LINKER_FLAGS "-lm -lstbi")

Clipping transformations

Clipping is done with the stencil buffer. Once clipped, the clipped regions are not transformed by new matrices.

  • Transform + Clip + draw => ok
  • Clip + Transform + draw => nok
    To solve this issue, untransformed clipping geometries have to be stored, and the stencil has to be rebuild after each transformation.
    Several options exists, taking care that path caches does not know about current fill mode, and that it would be more optimal to have draw commands already built in cache.

build issues on alpine linux / musl libc

  1. In cross_os.h, I had to change #define isnanf __isnanf to #define isnanf isnan.
  2. vkvg_record_internal.c uses va_arg, but does not include stdlib.h.
  3. tests/text segfaults if I build without fontconfig. ctx is a null pointer in _find_or_create_font_size when trying to load the mono font.
  4. If I build with freetype, I get:
[ 84%] Building C object tests/CMakeFiles/gradient2.dir/gradient2.c.o
In file included from /home/bill/vkvg/tests/../src/vkvg_context_internal.h:29,
                 from /home/bill/vkvg/tests/getarcstep.c:3:
/home/bill/vkvg/tests/../src/vkvg_fonts.h:29:11: fatal error: ft2build.h: No such file or directory
   29 |  #include <ft2build.h>
      |           ^~~~~~~~~~~~
compilation terminated.

pangocairo ➫ pangovkvg?

Would you like to be able to use Pango in concert with Vkvg, as you can do with Cairo in pangocairo? I could work on it.

Make vkvg reproducible

This part of the message I posted on the issue #57 made me wonder:

Fatal : VkResult is -2 in /run/media/Volume/Marco/Nextcloud/Sviluppo/aur-vkvg/src/vkvg-0.2.1/vkh/src/vkh_image.c at line 57
Segmentation fault (core dumped)

The path of my build directory ended up in the binaries, that's why makepkg tells:

==> WARNING: Package contains reference to $srcdir
usr/lib/libvkh.so.0.1.0
usr/lib/libvkvg.so.0.2

So it seems the issue is here https://github.com/jpbruyere/vkhelpers/blob/41daf55f834aede1698aaa1afae02e2faf22530a/src/vkh_image.c#L57 with VK_CHECK_RESULT. Looking for some CMAKE variables, I found this https://cmake.org/cmake/help/latest/prop_tgt/BUILD_RPATH_USE_ORIGIN.html but even after raising the minimum CMake version to 3.14 and adding SET(BUILD_RPATH_USE_ORIGIN TRUE) I still get the warning.
How can we make this library reproducible?

Logo idea

VKVG is Vectors in Vulkan, right?

So why not have the icon be a volcano, with beziér curve handles on a line and it's pulling at a line as it's expanding like you're making it erupt.

I feel like that could be an awesome logo ngl.

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.