From 3744f8b9399ded70ea9a41f7a127b58c8ab01151 Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Fri, 26 Mar 2021 21:49:00 -0300 Subject: [PATCH] metal: implement point sizes --- src/modules/graphics/metal/Graphics.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/modules/graphics/metal/Graphics.mm b/src/modules/graphics/metal/Graphics.mm index 795bcb30d..148063a25 100644 --- a/src/modules/graphics/metal/Graphics.mm +++ b/src/modules/graphics/metal/Graphics.mm @@ -707,6 +707,12 @@ void Graphics::applyShaderUniforms(id renderEncoder, lo } } + // Store DPI scale in an unused component of another vector. + builtins->normalMatrix[0].w = (float) getCurrentDPIScale(); + + // Same with point size. + builtins->normalMatrix[1].w = getPointSize(); + // FIXME: should be active RT dimensions builtins->screenSizeParams = Vector4(getPixelWidth(), getPixelHeight(), 1.0f, 0.0f); @@ -1280,7 +1286,10 @@ void Graphics::setBlendState(const BlendState &blend) void Graphics::setPointSize(float size) { - // TODO + if (size != states.back().pointSize) + flushBatchedDraws(); + + states.back().pointSize = size; } void Graphics::setWireframe(bool enable)