Blender V5.0
overlay_mode_transfer.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6
7#include "BLI_math_color.h"
8
9#include "ED_object.hh"
10
11namespace blender::draw::overlay {
12
14{
16
17 enabled_ = state.is_space_v3d() && !res.is_selection() && !object_factors_.is_empty();
18
19 if (!enabled_) {
20 /* Not used. But release the data. */
21 ps_.init();
22 return;
23 }
24
26 srgb_to_linearrgb_v4(flash_color_, flash_color_);
27
28 ps_.init();
30 state.clipping_plane_count);
31 ps_.shader_set(res.shaders->uniform_color.get());
32 ps_.bind_ubo(OVERLAY_GLOBALS_SLOT, &res.globals_buf);
33 ps_.bind_ubo(DRW_CLIPPING_UBO_SLOT, &res.clip_planes_buf);
34}
35
36} // namespace blender::draw::overlay
MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4])
void UI_GetThemeColor3fv(int colorid, float col[3])
@ TH_VERTEX_SELECT
void begin_sync(Resources &res, const State &state) final
blender::gpu::Shader * get()
#define DRW_CLIPPING_UBO_SLOT
#define OVERLAY_GLOBALS_SLOT
@ DRW_STATE_WRITE_DEPTH
Definition draw_state.hh:29
@ DRW_STATE_WRITE_COLOR
Definition draw_state.hh:30
@ DRW_STATE_DEPTH_LESS_EQUAL
Definition draw_state.hh:38
static ulong state[N]
Map< std::string, float, 1 > mode_transfer_overlay_current_state()
draw::UniformArrayBuffer< float4, 6 > clip_planes_buf
draw::UniformBuffer< UniformData > globals_buf