//populate vertice buff for stroke
bool _build_vb_step(VkvgContext ctx, stroke_context_t* str, bool isCurve){
Vertex v = {{0},ctx->curColor, {0,0,-1}};
- vec2 pL = ctx->points[str->iL];
vec2 p0 = ctx->points[str->cp];
- vec2 pR = ctx->points[str->iR];
-
- vec2 v0 = vec2_sub(p0, pL);
- vec2 v1 = vec2_sub(pR, p0);
+ vec2 v0 = vec2_sub(p0, ctx->points[str->iL]);
+ vec2 v1 = vec2_sub(ctx->points[str->iR], p0);
float length_v0 = vec2_length(v0);
float length_v1 = vec2_length(v1);
if (length_v0 < FLT_EPSILON || length_v1 < FLT_EPSILON) {
return true;
}
-
vec2 bisec_n = vec2_norm(vec2_add(v0n,v1n));//bisec/bisec_perp are inverted names
-
-
float alpha = acosf(dot);
-
if (det<0)
alpha = -alpha;
cache->uploadFence = vkh_fence_create((VkhDevice)dev);
- uint32_t buffLength = FONT_PAGE_SIZE*FONT_PAGE_SIZE*cache->texPixelSize;
+ const uint32_t buffLength = FONT_PAGE_SIZE*FONT_PAGE_SIZE*cache->texPixelSize;
vkh_buffer_init ((VkhDevice)dev,
VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
cache->cmd = vkh_cmd_buff_create((VkhDevice)dev,dev->cmdPool,VK_COMMAND_BUFFER_LEVEL_PRIMARY);
//Set texture cache initial layout to shaderReadOnly to prevent error msg if cache is not fill
- VkImageSubresourceRange subres = {VK_IMAGE_ASPECT_COLOR_BIT,0,1,0,cache->texLength};
+ const VkImageSubresourceRange subres = {VK_IMAGE_ASPECT_COLOR_BIT,0,1,0,cache->texLength};
vkh_cmd_begin (cache->cmd,VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT);
vkh_image_set_layout_subres(cache->cmd, cache->texture, subres,
VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
newSize.charLookup = (_char_ref**)calloc (newSize.face->num_glyphs, sizeof(_char_ref*));
if (FT_IS_SCALABLE(newSize.face))
- newSize.curLine.height = FT_MulFix(newSize.face->height, newSize.face->size->metrics.y_scale) >> 6;
+ newSize.curLine.height = newSize.face->size->metrics.height >> 6;
else
newSize.curLine.height = newSize.face->height >> 6;
#else
vkvg_fill_preserve (ctx);
}
- vkvg_set_source_rgba(ctx,1,0,0,1);
+ vkvg_set_source_rgba(ctx,1,0,0,0.3f);
vkvg_stroke (ctx);
vkvg_flush (ctx);
_print_usage_and_exit();
}
if (printTestDetailsAndExit) {
- #ifdef DEBUG
+#ifdef DEBUG
printf("Debug build\n");
- #else
+#else
printf("Release build\n");
- #endif
- #ifdef VKVG_USE_RENDERDOC
+#endif
+#ifdef VKVG_USE_RENDERDOC
printf("Render doc enabled\n");
- #endif
- #ifdef VKVG_USE_VALIDATION
- printf("Validation enabled\n");
- #endif
+#endif
+#ifdef VKVG_USE_VALIDATION
+ printf("Validation:\tenabled\n");
+#else
+ printf("Validation:\no\n");
+#endif
printf("surf dims:\t%d x %d\n", test_width, test_height);
printf("Samples:\t%d\n", samples);
printf("Gpu type:\t");
gettimeofday(¤tTime, NULL);
srand((unsigned)currentTime.tv_usec);
+ if (iterations == 0)
+ iterations = 9999;
+
if (single_test >= 0 && test_index != single_test) {
test_index++;
return;
| VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT
, VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT
| VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT
- | VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT
- | VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT
+ //| VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT
+ //| VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT
, NULL);
#endif
bool deferredResolve = false;
#define M_PIF 3.14159265359f /* float pi */
#define M_PIF_MULT_2 6.28318530718f
+#ifndef M_PI
+# define M_PI 3.14159265358979323846 /* pi */
+#endif
+#ifndef M_PI_2
+# define M_PI_2 1.57079632679489661923 /* pi/2 */
+#endif
#ifndef MIN
# define MIN(a,b) (((a) < (b)) ? (a) : (b))
int main(int argc, char *argv[]) {
no_test_size = true;
PERFORM_TEST(test3, argc, argv);
- return 0;
+ //return 0;
PERFORM_TEST(test, argc, argv);
PERFORM_TEST(test2, argc, argv);
PERFORM_TEST(curved_rect, argc, argv);
bool startWithArc = false, endWithArc = false;
int ptsCount = 4;
-int initPtsCount = 4;
+int initPtsCount = 5;
vec2 pts[] = {
{150,150},
{200,300},
{250,150},
{280,350},
+ {300,100},
};
/*vec2 pts[] = {
{150,150},
vkvg_clear(ctx);
if (dashCount > 0)
vkvg_set_dash(ctx, dash, dashCount,0);
- vkvg_set_source_rgba (ctx,1,0,0,1);
+ vkvg_set_source_rgba (ctx,1,0,0,0.3f);
vkvg_set_line_width (ctx,lineWidth);
vkvg_set_line_join (ctx, lineJoin);
vkvg_set_line_cap (ctx, lineCap);