summaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>2026-10-02 08:22:22 +0200
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>2026-10-02 08:22:22 +0200
commitcb4dd3f4274aecd243f6de9e5c162a1b2a1b0ed8 (patch)
tree5cc30079dfa4b4c41750bb4e0585a6ebe34c0514
parent1e47b44f5e5284d2f0e8c8a2cab84c0f5680d8f4 (diff)
remove usage of internal vector.h in tests
-rw-r--r--tests/bezier.c9
-rw-r--r--tests/common/vkengine.c47
2 files changed, 16 insertions, 40 deletions
diff --git a/tests/bezier.c b/tests/bezier.c
index 39cbdf9..19c1cb7 100644
--- a/tests/bezier.c
+++ b/tests/bezier.c
@@ -1,5 +1,4 @@
#include "test.h"
-#include "vectors.h"
vkvg_fill_rule_t fillrule = VKVG_FILL_RULE_NON_ZERO;
static VkSampleCountFlags samples = VK_SAMPLE_COUNT_8_BIT;
@@ -10,7 +9,13 @@ bool isClosed = false, isFilled = false;
int ptsCount = 4;
int initPtsCount = 4;
-vec2 pts[] = {
+
+typedef struct {
+ float x;
+ float y;
+} point;
+
+point pts[] = {
{1000, 1000},
{50, 50},
{2000, 50},
diff --git a/tests/common/vkengine.c b/tests/common/vkengine.c
index e96b2e2..8bb10b7 100644
--- a/tests/common/vkengine.c
+++ b/tests/common/vkengine.c
@@ -1,24 +1,6 @@
-/*
- * Copyright (c) 2018-2021 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of
- * this software and associated documentation files (the "Software"), to deal in
- * the Software without restriction, including without limitation the rights to use,
- * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
- * Software, and to permit persons to whom the Software is furnished to do so, subject
- * to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
+// Copyright (c) 2018-2024 Jean-Philippe Bruyère <jp_bruyere@hotmail.com>
+//
+// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
#include "vkh.h"
#include "vkengine.h"
@@ -38,23 +20,12 @@ static void glfw_error_callback(int error, const char* description) {
}
VkSampleCountFlagBits getMaxUsableSampleCount(VkSampleCountFlags counts) {
- if (counts & VK_SAMPLE_COUNT_64_BIT) {
- return VK_SAMPLE_COUNT_64_BIT;
- }
- if (counts & VK_SAMPLE_COUNT_32_BIT) {
- return VK_SAMPLE_COUNT_32_BIT;
- }
- if (counts & VK_SAMPLE_COUNT_16_BIT) {
- return VK_SAMPLE_COUNT_16_BIT;
- }
- if (counts & VK_SAMPLE_COUNT_8_BIT) {
- return VK_SAMPLE_COUNT_8_BIT;
- }
- if (counts & VK_SAMPLE_COUNT_4_BIT) {
- return VK_SAMPLE_COUNT_4_BIT;
- }
- if (counts & VK_SAMPLE_COUNT_2_BIT) {
- return VK_SAMPLE_COUNT_2_BIT;
+ VkSampleCountFlags mask = VK_SAMPLE_COUNT_64_BIT;
+ while (mask > VK_SAMPLE_COUNT_1_BIT) {
+ if (counts >= mask) {
+ return (VkSampleCountFlagBits)(counts & mask);
+ }
+ mask >>= 1;
}
return VK_SAMPLE_COUNT_1_BIT;
}