GPUState: Fix Point Size issues
The point size was not updated in the right branch and setting the point size via GPU_point_size was effectively disabling its use.
This commit is contained in:
parent
7f4799a189
commit
72f63ba7e9
Notes:
blender-bot
2023-02-14 08:08:54 +01:00
Referenced by issue #80782, GPU: Curve editing widget point size broken after recent commit Referenced by issue #80664, Tiny node sockets Referenced by issue #80538, Knife Tool Glitches
|
@ -173,12 +173,15 @@ void GPU_line_width(float width)
|
|||
|
||||
void GPU_point_size(float size)
|
||||
{
|
||||
SET_MUTABLE_STATE(point_size, size * PIXELSIZE);
|
||||
GPUStateManager *stack = Context::get()->state_manager;
|
||||
auto &state = stack->mutable_state;
|
||||
/* Set point size sign negative to disable. */
|
||||
state.point_size = size * signf(state.point_size);
|
||||
}
|
||||
|
||||
/* Programmable point size
|
||||
* - shaders set their own point size when enabled
|
||||
* - use glPointSize when disabled */
|
||||
* - use GPU_point_size when disabled */
|
||||
/* TODO remove and use program point size everywhere */
|
||||
void GPU_program_point_size(bool enable)
|
||||
{
|
||||
|
|
|
@ -141,13 +141,13 @@ void GLStateManager::set_mutable_state(const GPUStateMutable &state)
|
|||
GPUStateMutable changed = state ^ current_mutable_;
|
||||
|
||||
/* TODO remove, should be uniform. */
|
||||
if (changed.point_size != 0) {
|
||||
if (changed.point_size != 0.0f) {
|
||||
if (state.point_size > 0.0f) {
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
glPointSize(state.point_size);
|
||||
}
|
||||
else {
|
||||
glDisable(GL_PROGRAM_POINT_SIZE);
|
||||
glPointSize(fabsf(state.point_size));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue