GPUState: Fix missing changed program point size state
Also avoid a case where size is zero and making it impossible to change it back. This fix T80664 Tiny node sockets
This commit is contained in:
parent
8ff397b3b1
commit
66078594d1
Notes:
blender-bot
2023-02-13 21:12:23 +01:00
Referenced by issue #80664, Tiny node sockets
|
@ -175,8 +175,8 @@ void GPU_point_size(float size)
|
|||
{
|
||||
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);
|
||||
/* Keep the sign of point_size since it represents the enable state. */
|
||||
state.point_size = size * ((state.point_size > 0.0) ? 1.0f : -1.0f);
|
||||
}
|
||||
|
||||
/* Programmable point size
|
||||
|
|
|
@ -141,7 +141,7 @@ void GLStateManager::set_mutable_state(const GPUStateMutable &state)
|
|||
GPUStateMutable changed = state ^ current_mutable_;
|
||||
|
||||
/* TODO remove, should be uniform. */
|
||||
if (changed.point_size != 0.0f) {
|
||||
if (float_as_uint(changed.point_size) != 0) {
|
||||
if (state.point_size > 0.0f) {
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue