From df28f4b6a7ad5f1b60210b4c126b1bb437398d6e Mon Sep 17 00:00:00 2001 From: Joel Auterson Date: Wed, 4 Sep 2024 21:45:14 +0100 Subject: [PATCH] Use viewport in metal batch --- src/plugins/metal/src/metal_batch.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/metal/src/metal_batch.mm b/src/plugins/metal/src/metal_batch.mm index 6010d804..b1c5dcb2 100644 --- a/src/plugins/metal/src/metal_batch.mm +++ b/src/plugins/metal/src/metal_batch.mm @@ -69,6 +69,10 @@ encoder = [metal_graphics.getCommandBuffer() renderCommandEncoderWithDescriptor:renderPassDescriptor()]; + [encoder setViewport:MTLViewport{ + 0, 0, static_cast(getTargetWidth()), + static_cast(getTargetHeight()), 0, 1}]; + auto projection = glm::ortho(0, getTargetWidth(), getTargetHeight(), 0, 1, -1);