diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-19 16:04:20 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-19 16:04:20 +0200 |
| commit | 745160b4e258f9f09797086f3839184ceef7d24c (patch) | |
| tree | ea9060966be94f66a22d7cee10141e4234d1138f | |
| parent | 52f88915e975484122ffc4039c7b28cd86f88929 (diff) | |
vkvg_surface_create_ms for multisample surface creation
| -rw-r--r-- | include/vkvg.h | 9 | ||||
| -rw-r--r-- | src/vkvg_surface.c | 8 |
2 files changed, 15 insertions, 2 deletions
diff --git a/include/vkvg.h b/include/vkvg.h index 2378bbc..e15eab0 100644 --- a/include/vkvg.h +++ b/include/vkvg.h @@ -758,6 +758,15 @@ vkvg_public const void* vkvg_get_device_requirements(VkPhysicalDeviceFeatures* p */ vkvg_public VkvgSurface vkvg_surface_create(VkvgDevice dev, uint32_t width, uint32_t height); /** + * @brief create mulstisample surface + * @param dev The vkvg device used for creating the surface. + * @param width Width in pixel of the surface to create. + * @param height Height in pixel of the surface to create. + * @param sampleCount sample count for the new surface. + * @return The new vkvg surface pointer, or null if an error occured. + */ +VkvgSurface vkvg_surface_create_ms(VkvgDevice dev, uint32_t width, uint32_t height, VkSampleCountFlags sampleCount); +/** * @brief Create a new vkvg surface by loading an image file. * The resulting surface will have the same dimension as the supplied image. * This method will always return a valid pointer. diff --git a/src/vkvg_surface.c b/src/vkvg_surface.c index 985a623..1d8ab57 100644 --- a/src/vkvg_surface.c +++ b/src/vkvg_surface.c @@ -39,8 +39,8 @@ void vkvg_surface_clear(VkvgSurface surf) { _clear_surface(surf, VK_IMAGE_ASPECT_STENCIL_BIT | VK_IMAGE_ASPECT_COLOR_BIT); } -VkvgSurface vkvg_surface_create(VkvgDevice dev, uint32_t width, uint32_t height) { - VkvgSurface surf = _create_surface(dev, FB_COLOR_FORMAT, VK_SAMPLE_COUNT_1_BIT); +VkvgSurface vkvg_surface_create_ms(VkvgDevice dev, uint32_t width, uint32_t height, VkSampleCountFlags sampleCount) { + VkvgSurface surf = _create_surface(dev, FB_COLOR_FORMAT, sampleCount); if (surf->status) return surf; @@ -54,6 +54,10 @@ VkvgSurface vkvg_surface_create(VkvgDevice dev, uint32_t width, uint32_t height) surf->status = VKVG_STATUS_SUCCESS; return surf; } + +VkvgSurface vkvg_surface_create(VkvgDevice dev, uint32_t width, uint32_t height) { + return vkvg_surface_create_ms(dev, width, height, VK_SAMPLE_COUNT_1_BIT); +} VkvgSurface vkvg_surface_create_for_VkhImage(VkvgDevice dev, void* vkhImg) { VkvgSurface surf = _create_surface(dev, FB_COLOR_FORMAT, VK_SAMPLE_COUNT_1_BIT); if (surf->status) |