From b62a5db37b19b4a241d36049fd2d7df897bd5927 Mon Sep 17 00:00:00 2001 From: Douglas Paul Date: Mon, 30 Oct 2023 10:53:13 +0100 Subject: [PATCH] Fix: Node grid dot sizes on Metal The changes in #112906 (Vulkan: Use Point Shaders When Drawing Points) broke point sizes for the nodes editor grid on Metal. That PR switched the grid point drawing code to a shader that sets its own point size, but (at least on Metal) setting the point size in the shader has no effect unless `GPU_program_point_size(true)` has been called to allow shader-specified point sizes. This PR adds the necessary call to `GPU_program_point_size(true)` to fix that problem, as well as a corresponding "cleanup" call to set it to `false` again. Pull Request: https://projects.blender.org/blender/blender/pulls/114218 --- source/blender/editors/interface/view2d.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/editors/interface/view2d.cc b/source/blender/editors/interface/view2d.cc index 4e161c1d1be..aa2d572a1fc 100644 --- a/source/blender/editors/interface/view2d.cc +++ b/source/blender/editors/interface/view2d.cc @@ -1304,6 +1304,7 @@ void UI_view2d_dot_grid_draw(const View2D *v2d, GPUVertFormat *format = immVertexFormat(); const uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); + GPU_program_point_size(true); immBindBuiltinProgram(GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); /* Scaling the dots fully with the zoom looks too busy, but a bit of size variation is nice. */ @@ -1385,6 +1386,7 @@ void UI_view2d_dot_grid_draw(const View2D *v2d, } immUnbindProgram(); + GPU_program_point_size(false); } /** \} */