From 8b200c2b2f81d4c5d8e53c2abb50c771bd605909 Mon Sep 17 00:00:00 2001 From: yours3lf <0.tamas.marton@gmail.com> Date: Sun, 10 May 2020 19:13:06 +0100 Subject: [PATCH] added viewport offset handling --- driver/draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/driver/draw.c b/driver/draw.c index 2eca1e2..38c6ced 100644 --- a/driver/draw.c +++ b/driver/draw.c @@ -59,8 +59,8 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer, int32_t vertexOffset) //Clip Window clFit(commandBuffer, &commandBuffer->binCl, V3D21_CLIP_WINDOW_length); clInsertClipWindow(&commandBuffer->binCl, - vp.width, - vp.height, + vp.width - vp.x, + vp.height - vp.y, vp.y, //bottom pixel coord vp.x); //left pixel coord @@ -71,7 +71,7 @@ static uint32_t drawCommon(VkCommandBuffer commandBuffer, int32_t vertexOffset) //Viewport Offset clFit(commandBuffer, &commandBuffer->binCl, V3D21_VIEWPORT_OFFSET_length); - clInsertViewPortOffset(&commandBuffer->binCl, vp.width * 0.5f, vp.height * 0.5f); + clInsertViewPortOffset(&commandBuffer->binCl, vp.width * 0.5f + vp.x, vp.height * 0.5f - vp.y); cb->viewportDirty = 0; }