/*cp.x = x3;
cp.y = y3;
if (!vec2_equ(ctx->points[ctx->pointCount-1],cp))*/
- _add_point(ctx,x3,y3);
+ _add_point(ctx,x3,y3);
_set_curve_end (ctx);
}
void vkvg_rel_curve_to (VkvgContext ctx, float x1, float y1, float x2, float y2, float x3, float y3) {
LOG(LOG_INFO, "FILL: ctx = %lu; path cpt = %d;\n", ctx, ctx->pathPtr / 2);
- if (ctx->curFillRule == VKVG_FILL_RULE_EVEN_ODD){
+ if (ctx->curFillRule == VKVG_FILL_RULE_EVEN_ODD){
_poly_fill (ctx);
_bind_draw_pipeline (ctx);
CmdSetStencilCompareMask(ctx->cmd, VK_STENCIL_FRONT_AND_BACK, STENCIL_FILL_BIT);
v.pos = vec2_sub(p0, vhw);
_add_vertex(ctx, v);
- if (ctx->lineCap == VKVG_LINE_CAP_ROUND){
- firstIdx = (VKVG_IBO_INDEX_TYPE)(ctx->vertCount - ctx->curVertOffset);
+ firstIdx = (VKVG_IBO_INDEX_TYPE)(ctx->vertCount - ctx->curVertOffset);
+
+ if (ctx->lineCap == VKVG_LINE_CAP_ROUND){
float step = M_PIF / hw;
float a = acosf(n.x)+ M_PIF_2;
if (n.y < 0)
ctx->indCount+=6;
_check_ibo_size(ctx);
+ LOG(LOG_INFO, "Rectangle IDX: %d %d %d | %d %d %d (count=%d)\n", inds[0], inds[1], inds[2], inds[3], inds[4], inds[5], ctx->indCount);
}
void _add_triangle_indices(VkvgContext ctx, VKVG_IBO_INDEX_TYPE i0, VKVG_IBO_INDEX_TYPE i1, VKVG_IBO_INDEX_TYPE i2){
VKVG_IBO_INDEX_TYPE* inds = &ctx->indexCache[ctx->indCount];
ctx->indCount+=3;
_check_ibo_size(ctx);
+ LOG(LOG_INFO, "Triangle IDX: %d %d %d (count=%d)\n", i0,i1,i2,ctx->indCount);
}
void _vao_add_rectangle (VkvgContext ctx, float x, float y, float width, float height){
Vertex v[4] =
vkResetFences (ctx->pSurf->dev->vkDev, 1, &ctx->flushFence);
}
void _wait_and_submit_cmd (VkvgContext ctx){
- if (!ctx->cmdStarted)
+ if (!ctx->cmdStarted)//current cmd buff is empty, be aware that wait is also canceled!!
return;
_wait_flush_fence (ctx);
_check_cmd_buff_state(ctx);
CmdDrawIndexed(ctx->cmd, ctx->indCount - ctx->curIndStart, 1, ctx->curIndStart, (int32_t)ctx->curVertOffset, 0);
- LOG(LOG_INFO, "RECORD DRAW CMD: ctx = %lu; vertices = %d; indices = %d\n", (ulong)ctx, ctx->vertCount - ctx->indexCache[ctx->curIndStart], ctx->indCount - ctx->curIndStart);
+ LOG(LOG_INFO, "RECORD DRAW CMD: ctx = %lu; vertices = %d; indices = %d (vxOff = %d idxStart = %d idxTot = %d )\n",
+ (ulong)ctx, ctx->vertCount - ctx->curVertOffset,
+ ctx->indCount - ctx->curIndStart, ctx->curVertOffset, ctx->curIndStart, ctx->indCount);
#ifdef VKVG_WIRED_DEBUG
CmdBindPipeline(ctx->cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, ctx->pSurf->dev->pipelineWired);
ptrPath+=2;
}
- _record_draw_cmd(ctx);
+ _record_draw_cmd(ctx);
}
static const uint32_t one = 1;
uint32_t* pathes;
size_t sizePathes;
- //if current path contains curves, start/end points are store next to the path start/stop
+ //if current path contains curves, curve's start/end points are store next to the path start/stop
//curve start point = pathPtr + curvePtr
//when closing of finishing path, pathPtr is incremented by 1 + pathPtr
- //note:number of pathes can no longuer be computed from pathPtr/2, the array contains now curves datas
+ //note:number of pathes can no longer be computed from pathPtr/2, the array contains now curves datas
uint32_t curvePtr;
float lineWidth;