From 60e712f2248cf0db3f7ae1a27cecd96c88812472 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 28 Sep 2022 21:53:22 +0900 Subject: [PATCH] [vulkan] Use the right uvs for lines UVs being 0 meant that lines were picking up the upper left pixel of char 0 of conchars. With quake data, this meant a transparent pixel. Fixes invisible debug lines :P. --- libs/video/renderer/vulkan/vulkan_draw.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libs/video/renderer/vulkan/vulkan_draw.c b/libs/video/renderer/vulkan/vulkan_draw.c index 65bd3955e..f5da3468b 100644 --- a/libs/video/renderer/vulkan/vulkan_draw.c +++ b/libs/video/renderer/vulkan/vulkan_draw.c @@ -873,12 +873,25 @@ Vulkan_Draw_Line (int x0, int y0, int x1, int y1, int c, vulkan_ctx_t *ctx) QuatScale (color, 1/255.0, color); drawvert_t *verts = queue->verts + queue->count * VERTS_PER_LINE; + subpic_t *subpic = *(subpic_t **) dctx->white_pic->data; + int srcx = subpic->rect->x; + int srcy = subpic->rect->y; + int srcw = subpic->rect->width; + int srch = subpic->rect->height; + float size = subpic->size; + float sl = (srcx + 0.03125) * size; + float sr = (srcx + srcw - 0.03125) * size; + float st = (srcy + 0.03125) * size; + float sb = (srcy + srch - 0.03125) * size; + verts[0] = (drawvert_t) { .xy = { x0, y0 }, + .st = {sl, st}, .color = { QuatExpand (color) }, }; verts[1] = (drawvert_t) { .xy = { x1, y1 }, + .st = {sr, sb}, .color = { QuatExpand (color) }, };