diff --git a/source/blender/draw/engines/overlay/overlay_armature.cc b/source/blender/draw/engines/overlay/overlay_armature.cc index 4a704847f35..ccb18b01cff 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.cc +++ b/source/blender/draw/engines/overlay/overlay_armature.cc @@ -663,7 +663,7 @@ static void drw_shgroup_bone_relationship_lines(const Armatures::DrawContext *ct const float start[3], const float end[3]) { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; drw_shgroup_bone_relationship_lines_ex(ctx, start, end, theme.colors.wire); } @@ -671,7 +671,7 @@ static void drw_shgroup_bone_ik_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3]) { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; drw_shgroup_bone_relationship_lines_ex(ctx, start, end, theme.colors.bone_ik_line); } @@ -679,7 +679,7 @@ static void drw_shgroup_bone_ik_no_target_lines(const Armatures::DrawContext *ct const float start[3], const float end[3]) { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; drw_shgroup_bone_relationship_lines_ex(ctx, start, end, theme.colors.bone_ik_line_no_target); } @@ -687,7 +687,7 @@ static void drw_shgroup_bone_ik_spline_lines(const Armatures::DrawContext *ctx, const float start[3], const float end[3]) { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; drw_shgroup_bone_relationship_lines_ex(ctx, start, end, theme.colors.bone_ik_line_spline); } @@ -751,7 +751,7 @@ static void use_bone_color(float *r_color, const uint8_t *color_from_theme, cons srgb_to_linearrgb_v4(r_color, r_color); }; -static void get_pchan_color_wire(const GlobalsUboStorage &theme, +static void get_pchan_color_wire(const UniformData &theme, const ThemeWireColor *bcolor, const eArmatureDrawMode draw_mode, const eBone_Flag boneflag, @@ -793,7 +793,7 @@ static void get_pchan_color_wire(const GlobalsUboStorage &theme, } } -static void get_pchan_color_solid(const GlobalsUboStorage &theme, +static void get_pchan_color_solid(const UniformData &theme, const ThemeWireColor *bcolor, float r_color[4]) { @@ -806,7 +806,7 @@ static void get_pchan_color_solid(const GlobalsUboStorage &theme, } } -static void get_pchan_color_constraint(const GlobalsUboStorage &theme, +static void get_pchan_color_constraint(const UniformData &theme, const ThemeWireColor *bcolor, const UnifiedBonePtr bone, float r_color[4]) @@ -848,7 +848,7 @@ static void get_pchan_color_constraint(const GlobalsUboStorage &theme, /** \name Drawing Color Helpers * \{ */ -static void bone_locked_color_shade(const GlobalsUboStorage &theme, float color[4]) +static void bone_locked_color_shade(const UniformData &theme, float color[4]) { const float *locked_color = theme.colors.bone_locked; @@ -858,7 +858,7 @@ static void bone_locked_color_shade(const GlobalsUboStorage &theme, float color[ static const float *get_bone_solid_color(const Armatures::DrawContext *ctx, const eBone_Flag boneflag) { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; if (ctx->const_color) { return theme.colors.bone_solid; } @@ -877,7 +877,7 @@ static const float *get_bone_solid_with_consts_color(const Armatures::DrawContex const UnifiedBonePtr bone, const eBone_Flag boneflag) { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; if (ctx->const_color) { return theme.colors.bone_solid; } @@ -914,7 +914,7 @@ static const float *get_bone_wire_color(const Armatures::DrawContext *ctx, copy_v3_v3(disp_color, ctx->const_color); } else { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; switch (ctx->draw_mode) { case ARM_DRAW_MODE_EDIT: get_pchan_color_wire(theme, ctx->bcolor, ctx->draw_mode, boneflag, disp_color); @@ -1259,7 +1259,7 @@ static void draw_points(const Armatures::DrawContext *ctx, float col_wire_root[4], col_wire_tail[4]; float col_hint_root[4], col_hint_tail[4]; - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; copy_v4_v4(col_wire_root, (ctx->const_color) ? ctx->const_color : &theme.colors.vert.x); copy_v4_v4(col_wire_tail, (ctx->const_color) ? ctx->const_color : &theme.colors.vert.x); @@ -1745,7 +1745,7 @@ class ArmatureBoneDrawStrategyLine : public ArmatureBoneDrawStrategy { col_bone = col_head = col_tail = ctx->const_color; } else { - const GlobalsUboStorage &theme = ctx->res->theme; + const UniformData &theme = ctx->res->theme; if (bone.is_editbone() && bone.flag() & BONE_TIPSEL) { col_tail = &theme.colors.vert_select.x; diff --git a/source/blender/draw/engines/overlay/overlay_instance.cc b/source/blender/draw/engines/overlay/overlay_instance.cc index 719d529e686..e5e3b9d89c9 100644 --- a/source/blender/draw/engines/overlay/overlay_instance.cc +++ b/source/blender/draw/engines/overlay/overlay_instance.cc @@ -235,7 +235,7 @@ void Resources::update_clip_planes(const State &state) void Resources::update_theme_settings(const DRWContext *ctx, const State &state) { using namespace math; - GlobalsUboStorage &gb = theme; + UniformData &gb = theme; auto rgba_uchar_to_float = [](uchar r, uchar b, uchar g, uchar a) { return float4(r, g, b, a) / 255.0f; diff --git a/source/blender/draw/engines/overlay/overlay_private.hh b/source/blender/draw/engines/overlay/overlay_private.hh index 060aff93df1..2c02e9443f1 100644 --- a/source/blender/draw/engines/overlay/overlay_private.hh +++ b/source/blender/draw/engines/overlay/overlay_private.hh @@ -678,8 +678,8 @@ struct Resources : public select::SelectMap { detail::SubPassVector depth_planes; int64_t depth_planes_count = 0; - draw::UniformBuffer globals_buf; - GlobalsUboStorage &theme = globals_buf; + draw::UniformBuffer globals_buf; + UniformData &theme = globals_buf; draw::UniformArrayBuffer clip_planes_buf; /* Wrappers around #DefaultTextureList members. */ TextureRef depth_in_front_tx; diff --git a/source/blender/draw/engines/overlay/overlay_shader_shared.hh b/source/blender/draw/engines/overlay/overlay_shader_shared.hh index 4a2c0cdf40c..a58383c111b 100644 --- a/source/blender/draw/engines/overlay/overlay_shader_shared.hh +++ b/source/blender/draw/engines/overlay/overlay_shader_shared.hh @@ -298,7 +298,7 @@ struct ThemeSizes { }; BLI_STATIC_ASSERT_ALIGN(ThemeSizes, 16) -struct GlobalsUboStorage { +struct UniformData { ThemeColors colors; ThemeSizes sizes; @@ -311,119 +311,120 @@ struct GlobalsUboStorage { bool32_t backface_culling; float _pad1; }; -BLI_STATIC_ASSERT_ALIGN(GlobalsUboStorage, 16) +BLI_STATIC_ASSERT_ALIGN(UniformData, 16) #ifdef GPU_SHADER +# define theme uniform_buf /* Keep compatibility_with old global scope syntax. */ /* TODO(@fclem) Mass rename and remove the camel case. */ -# define colorWire globalsBlock.colors.wire -# define colorWireEdit globalsBlock.colors.wire_edit -# define colorActive globalsBlock.colors.active -# define colorSelect globalsBlock.colors.select -# define colorLibrarySelect globalsBlock.colors.library_select -# define colorLibrary globalsBlock.colors.library -# define colorTransform globalsBlock.colors.transform -# define colorLight globalsBlock.colors.light -# define colorSpeaker globalsBlock.colors.speaker -# define colorCamera globalsBlock.colors.camera -# define colorCameraPath globalsBlock.colors.camera_path -# define colorEmpty globalsBlock.colors.empty -# define colorVertex globalsBlock.colors.vert -# define colorVertexSelect globalsBlock.colors.vert_select -# define colorVertexUnreferenced globalsBlock.colors.vert_unreferenced -# define colorVertexMissingData globalsBlock.colors.vert_missing_data -# define colorEditMeshActive globalsBlock.colors.edit_mesh_active -# define colorEdgeSelect globalsBlock.colors.edge_select -# define colorEdgeModeSelect globalsBlock.colors.edge_mode_select -# define colorEdgeSeam globalsBlock.colors.edge_seam -# define colorEdgeSharp globalsBlock.colors.edge_sharp -# define colorEdgeCrease globalsBlock.colors.edge_crease -# define colorEdgeBWeight globalsBlock.colors.edge_bweight -# define colorEdgeFaceSelect globalsBlock.colors.edge_face_select -# define colorEdgeFreestyle globalsBlock.colors.edge_freestyle -# define colorFace globalsBlock.colors.face -# define colorFaceSelect globalsBlock.colors.face_select -# define colorFaceModeSelect globalsBlock.colors.face_mode_select -# define colorFaceRetopology globalsBlock.colors.face_retopology -# define colorFaceFreestyle globalsBlock.colors.face_freestyle -# define colorGpencilVertex globalsBlock.colors.gpencil_vertex -# define colorGpencilVertexSelect globalsBlock.colors.gpencil_vertex_select -# define colorNormal globalsBlock.colors.normal -# define colorVNormal globalsBlock.colors.vnormal -# define colorLNormal globalsBlock.colors.lnormal -# define colorFaceDot globalsBlock.colors.facedot -# define colorSkinRoot globalsBlock.colors.skinroot -# define colorDeselect globalsBlock.colors.deselect -# define colorOutline globalsBlock.colors.outline -# define colorLightNoAlpha globalsBlock.colors.light_no_alpha -# define colorBackground globalsBlock.colors.background -# define colorBackgroundGradient globalsBlock.colors.background_gradient -# define colorCheckerPrimary globalsBlock.colors.checker_primary -# define colorCheckerSecondary globalsBlock.colors.checker_secondary -# define colorClippingBorder globalsBlock.colors.clipping_border -# define colorEditMeshMiddle globalsBlock.colors.edit_mesh_middle -# define colorHandleFree globalsBlock.colors.handle_free -# define colorHandleAuto globalsBlock.colors.handle_auto -# define colorHandleVect globalsBlock.colors.handle_vect -# define colorHandleAlign globalsBlock.colors.handle_align -# define colorHandleAutoclamp globalsBlock.colors.handle_autoclamp -# define colorHandleSelFree globalsBlock.colors.handle_sel_free -# define colorHandleSelAuto globalsBlock.colors.handle_sel_auto -# define colorHandleSelVect globalsBlock.colors.handle_sel_vect -# define colorHandleSelAlign globalsBlock.colors.handle_sel_align -# define colorHandleSelAutoclamp globalsBlock.colors.handle_sel_autoclamp -# define colorNurbUline globalsBlock.colors.nurb_uline -# define colorNurbVline globalsBlock.colors.nurb_vline -# define colorNurbSelUline globalsBlock.colors.nurb_sel_uline -# define colorNurbSelVline globalsBlock.colors.nurb_sel_vline -# define colorActiveSpline globalsBlock.colors.active_spline -# define colorBonePose globalsBlock.colors.bone_pose -# define colorBonePoseActive globalsBlock.colors.bone_pose_active -# define colorBonePoseActiveUnsel globalsBlock.colors.bone_pose_active_unsel -# define colorBonePoseConstraint globalsBlock.colors.bone_pose_constraint -# define colorBonePoseIK globalsBlock.colors.bone_pose_ik -# define colorBonePoseSplineIK globalsBlock.colors.bone_pose_spline_ik -# define colorBonePoseTarget globalsBlock.colors.bone_pose_no_target -# define colorBoneSolid globalsBlock.colors.bone_solid -# define colorBoneLocked globalsBlock.colors.bone_locked -# define colorBoneActive globalsBlock.colors.bone_active -# define colorBoneActiveUnsel globalsBlock.colors.bone_active_unsel -# define colorBoneSelect globalsBlock.colors.bone_select -# define colorBoneIKLine globalsBlock.colors.bone_ik_line -# define colorBoneIKLineNoTarget globalsBlock.colors.bone_ik_line_no_target -# define colorBoneIKLineSpline globalsBlock.colors.bone_ik_line_spline -# define colorText globalsBlock.colors.text -# define colorTextHi globalsBlock.colors.text_hi -# define colorBundleSolid globalsBlock.colors.bundle_solid -# define colorMballRadius globalsBlock.colors.mball_radius -# define colorMballRadiusSelect globalsBlock.colors.mball_radius_select -# define colorMballStiffness globalsBlock.colors.mball_stiffness -# define colorMballStiffnessSelect globalsBlock.colors.mball_stiffness_select -# define colorCurrentFrame globalsBlock.colors.current_frame -# define colorBeforeFrame globalsBlock.colors.before_frame -# define colorAfterFrame globalsBlock.colors.after_frame -# define colorGrid globalsBlock.colors.grid -# define colorGridEmphasis globalsBlock.colors.grid_emphasis -# define colorGridAxisX globalsBlock.colors.grid_axis_x -# define colorGridAxisY globalsBlock.colors.grid_axis_y -# define colorGridAxisZ globalsBlock.colors.grid_axis_z -# define colorFaceBack globalsBlock.colors.face_back -# define colorFaceFront globalsBlock.colors.face_front -# define colorUVShadow globalsBlock.colors.uv_shadow -# define sizeViewport float2(globalsBlock.size_viewport.xy) -# define sizeViewportInv float2(globalsBlock.size_viewport.zw) -# define sizePixel globalsBlock.sizes.pixel -# define pixelFac globalsBlock.pixel_fac -# define sizeObjectCenter globalsBlock.sizes.object_center -# define sizeLightCenter globalsBlock.sizes.light_center -# define sizeLightCircle globalsBlock.sizes.light_circle -# define sizeLightCircleShadow globalsBlock.sizes.light_circle_shadow -# define sizeVertex globalsBlock.sizes.vert -# define sizeEdge globalsBlock.sizes.edge -# define sizeFaceDot globalsBlock.sizes.face_dot -# define sizeChecker globalsBlock.sizes.checker -# define sizeVertexGpencil globalsBlock.sizes.vertex_gpencil -# define fresnelMixEdit globalsBlock.fresnel_mix_edit +# define colorWire theme.colors.wire +# define colorWireEdit theme.colors.wire_edit +# define colorActive theme.colors.active +# define colorSelect theme.colors.select +# define colorLibrarySelect theme.colors.library_select +# define colorLibrary theme.colors.library +# define colorTransform theme.colors.transform +# define colorLight theme.colors.light +# define colorSpeaker theme.colors.speaker +# define colorCamera theme.colors.camera +# define colorCameraPath theme.colors.camera_path +# define colorEmpty theme.colors.empty +# define colorVertex theme.colors.vert +# define colorVertexSelect theme.colors.vert_select +# define colorVertexUnreferenced theme.colors.vert_unreferenced +# define colorVertexMissingData theme.colors.vert_missing_data +# define colorEditMeshActive theme.colors.edit_mesh_active +# define colorEdgeSelect theme.colors.edge_select +# define colorEdgeModeSelect theme.colors.edge_mode_select +# define colorEdgeSeam theme.colors.edge_seam +# define colorEdgeSharp theme.colors.edge_sharp +# define colorEdgeCrease theme.colors.edge_crease +# define colorEdgeBWeight theme.colors.edge_bweight +# define colorEdgeFaceSelect theme.colors.edge_face_select +# define colorEdgeFreestyle theme.colors.edge_freestyle +# define colorFace theme.colors.face +# define colorFaceSelect theme.colors.face_select +# define colorFaceModeSelect theme.colors.face_mode_select +# define colorFaceRetopology theme.colors.face_retopology +# define colorFaceFreestyle theme.colors.face_freestyle +# define colorGpencilVertex theme.colors.gpencil_vertex +# define colorGpencilVertexSelect theme.colors.gpencil_vertex_select +# define colorNormal theme.colors.normal +# define colorVNormal theme.colors.vnormal +# define colorLNormal theme.colors.lnormal +# define colorFaceDot theme.colors.facedot +# define colorSkinRoot theme.colors.skinroot +# define colorDeselect theme.colors.deselect +# define colorOutline theme.colors.outline +# define colorLightNoAlpha theme.colors.light_no_alpha +# define colorBackground theme.colors.background +# define colorBackgroundGradient theme.colors.background_gradient +# define colorCheckerPrimary theme.colors.checker_primary +# define colorCheckerSecondary theme.colors.checker_secondary +# define colorClippingBorder theme.colors.clipping_border +# define colorEditMeshMiddle theme.colors.edit_mesh_middle +# define colorHandleFree theme.colors.handle_free +# define colorHandleAuto theme.colors.handle_auto +# define colorHandleVect theme.colors.handle_vect +# define colorHandleAlign theme.colors.handle_align +# define colorHandleAutoclamp theme.colors.handle_autoclamp +# define colorHandleSelFree theme.colors.handle_sel_free +# define colorHandleSelAuto theme.colors.handle_sel_auto +# define colorHandleSelVect theme.colors.handle_sel_vect +# define colorHandleSelAlign theme.colors.handle_sel_align +# define colorHandleSelAutoclamp theme.colors.handle_sel_autoclamp +# define colorNurbUline theme.colors.nurb_uline +# define colorNurbVline theme.colors.nurb_vline +# define colorNurbSelUline theme.colors.nurb_sel_uline +# define colorNurbSelVline theme.colors.nurb_sel_vline +# define colorActiveSpline theme.colors.active_spline +# define colorBonePose theme.colors.bone_pose +# define colorBonePoseActive theme.colors.bone_pose_active +# define colorBonePoseActiveUnsel theme.colors.bone_pose_active_unsel +# define colorBonePoseConstraint theme.colors.bone_pose_constraint +# define colorBonePoseIK theme.colors.bone_pose_ik +# define colorBonePoseSplineIK theme.colors.bone_pose_spline_ik +# define colorBonePoseTarget theme.colors.bone_pose_no_target +# define colorBoneSolid theme.colors.bone_solid +# define colorBoneLocked theme.colors.bone_locked +# define colorBoneActive theme.colors.bone_active +# define colorBoneActiveUnsel theme.colors.bone_active_unsel +# define colorBoneSelect theme.colors.bone_select +# define colorBoneIKLine theme.colors.bone_ik_line +# define colorBoneIKLineNoTarget theme.colors.bone_ik_line_no_target +# define colorBoneIKLineSpline theme.colors.bone_ik_line_spline +# define colorText theme.colors.text +# define colorTextHi theme.colors.text_hi +# define colorBundleSolid theme.colors.bundle_solid +# define colorMballRadius theme.colors.mball_radius +# define colorMballRadiusSelect theme.colors.mball_radius_select +# define colorMballStiffness theme.colors.mball_stiffness +# define colorMballStiffnessSelect theme.colors.mball_stiffness_select +# define colorCurrentFrame theme.colors.current_frame +# define colorBeforeFrame theme.colors.before_frame +# define colorAfterFrame theme.colors.after_frame +# define colorGrid theme.colors.grid +# define colorGridEmphasis theme.colors.grid_emphasis +# define colorGridAxisX theme.colors.grid_axis_x +# define colorGridAxisY theme.colors.grid_axis_y +# define colorGridAxisZ theme.colors.grid_axis_z +# define colorFaceBack theme.colors.face_back +# define colorFaceFront theme.colors.face_front +# define colorUVShadow theme.colors.uv_shadow +# define sizeViewport float2(uniform_buf.size_viewport.xy) +# define sizeViewportInv float2(uniform_buf.size_viewport.zw) +# define sizePixel theme.sizes.pixel +# define pixelFac uniform_buf.pixel_fac +# define sizeObjectCenter theme.sizes.object_center +# define sizeLightCenter theme.sizes.light_center +# define sizeLightCircle theme.sizes.light_circle +# define sizeLightCircleShadow theme.sizes.light_circle_shadow +# define sizeVertex theme.sizes.vert +# define sizeEdge theme.sizes.edge +# define sizeFaceDot theme.sizes.face_dot +# define sizeChecker theme.sizes.checker +# define sizeVertexGpencil theme.sizes.vertex_gpencil +# define fresnelMixEdit theme.fresnel_mix_edit #endif struct ExtraInstanceData { diff --git a/source/blender/draw/engines/overlay/shaders/infos/overlay_common_info.hh b/source/blender/draw/engines/overlay/shaders/infos/overlay_common_info.hh index 0f8760d019c..e43188c7973 100644 --- a/source/blender/draw/engines/overlay/shaders/infos/overlay_common_info.hh +++ b/source/blender/draw/engines/overlay/shaders/infos/overlay_common_info.hh @@ -18,7 +18,7 @@ GPU_SHADER_CREATE_INFO(draw_globals) TYPEDEF_SOURCE("overlay_shader_shared.hh") -UNIFORM_BUF_FREQ(OVERLAY_GLOBALS_SLOT, GlobalsUboStorage, globalsBlock, PASS) +UNIFORM_BUF_FREQ(OVERLAY_GLOBALS_SLOT, UniformData, uniform_buf, PASS) GPU_SHADER_CREATE_END() GPU_SHADER_INTERFACE_INFO(select_id_patch_iface) diff --git a/source/blender/draw/engines/overlay/shaders/overlay_depth_only_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_depth_only_frag.glsl index ca16330adcb..1108d4b2179 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_depth_only_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_depth_only_frag.glsl @@ -11,7 +11,7 @@ FRAGMENT_SHADER_CREATE_INFO(overlay_depth_mesh_base) void main() { #ifdef SELECT_ENABLE - if (globalsBlock.backface_culling && !gl_FrontFacing) { + if (uniform_buf.backface_culling && !gl_FrontFacing) { /* Return early since we are not using early depth testing. */ return; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_curves_handle_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_curves_handle_vert.glsl index 4c4aaa4cf07..517a6743e43 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_curves_handle_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_curves_handle_vert.glsl @@ -108,15 +108,15 @@ float4 get_bezier_handle_color(uint color_id, float sel) { switch (color_id) { case 0u: /* BEZIER_HANDLE_FREE */ - return mix(globalsBlock.colors.handle_free, globalsBlock.colors.handle_sel_free, sel); + return mix(theme.colors.handle_free, theme.colors.handle_sel_free, sel); case 1u: /* BEZIER_HANDLE_AUTO */ - return mix(globalsBlock.colors.handle_auto, globalsBlock.colors.handle_sel_auto, sel); + return mix(theme.colors.handle_auto, theme.colors.handle_sel_auto, sel); case 2u: /* BEZIER_HANDLE_VECTOR */ - return mix(globalsBlock.colors.handle_vect, globalsBlock.colors.handle_sel_vect, sel); + return mix(theme.colors.handle_vect, theme.colors.handle_sel_vect, sel); case 3u: /* BEZIER_HANDLE_ALIGN */ - return mix(globalsBlock.colors.handle_align, globalsBlock.colors.handle_sel_align, sel); + return mix(theme.colors.handle_align, theme.colors.handle_sel_align, sel); } - return mix(globalsBlock.colors.handle_autoclamp, globalsBlock.colors.handle_sel_autoclamp, sel); + return mix(theme.colors.handle_autoclamp, theme.colors.handle_sel_autoclamp, sel); } void geometry_main(VertOut geom_in[2], @@ -154,13 +154,11 @@ void geometry_main(VertOut geom_in[2], inner_color = get_bezier_handle_color(color_id, geom_in[line_end_point].sel); } else if ((geom_in[line_end_point].flag & EDIT_CURVES_NURBS_CONTROL_POINT) != 0u) { - inner_color = mix(globalsBlock.colors.nurb_uline, - globalsBlock.colors.nurb_sel_uline, - geom_in[line_end_point].sel); + inner_color = mix( + theme.colors.nurb_uline, theme.colors.nurb_sel_uline, geom_in[line_end_point].sel); } else { - inner_color = mix( - globalsBlock.colors.wire, globalsBlock.colors.vert_select, geom_in[line_end_point].sel); + inner_color = mix(theme.colors.wire, theme.colors.vert_select, geom_in[line_end_point].sel); } /* Minimize active color bleeding on inner_color. */ diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_normal_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_normal_vert.glsl index 21469761bd8..ef5f4aea47a 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_normal_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_mesh_normal_vert.glsl @@ -124,11 +124,11 @@ void main() if (is_persp) { float dist_fac = length(drw_view_position() - world_pos); float cos_fac = dot(drw_view_forward(), drw_world_incident_vector(world_pos)); - world_pos += n * normal_screen_size * dist_fac * cos_fac * globalsBlock.pixel_fac * + world_pos += n * normal_screen_size * dist_fac * cos_fac * uniform_buf.pixel_fac * sizePixel; } else { - float frustrum_fac = mul_project_m4_v3_zfac(globalsBlock.pixel_fac, n) * sizePixel; + float frustrum_fac = mul_project_m4_v3_zfac(uniform_buf.pixel_fac, n) * sizePixel; world_pos += n * normal_screen_size * frustrum_fac; } } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_extra_groundline_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_extra_groundline_vert.glsl index 4a24f7d5905..22241afcbbc 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_extra_groundline_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_extra_groundline_vert.glsl @@ -21,7 +21,7 @@ void main() float3 inst_pos = data_buf[gl_InstanceID].xyz; float3 p = inst_pos; p.z *= (pos.z == 0.0f) ? 0.0f : 1.0f; - float screen_size = mul_project_m4_v3_zfac(globalsBlock.pixel_fac, p) * sizePixel; + float screen_size = mul_project_m4_v3_zfac(uniform_buf.pixel_fac, p) * sizePixel; float3 world_pos = p + screen_pos * screen_size; gl_Position = drw_point_world_to_homogenous(world_pos); diff --git a/source/blender/draw/engines/overlay/shaders/overlay_extra_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_extra_vert.glsl index 0acc62012e6..2a7a015ba1b 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_extra_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_extra_vert.glsl @@ -170,7 +170,7 @@ void main() /* Relative to DPI scaling. Have constant screen size. */ float3 screen_pos = drw_view().viewinv[0].xyz * vpos.x + drw_view().viewinv[1].xyz * vpos.y; float3 p = (obmat * float4(vofs, 1.0f)).xyz; - float screen_size = mul_project_m4_v3_zfac(globalsBlock.pixel_fac, p) * sizePixel; + float screen_size = mul_project_m4_v3_zfac(uniform_buf.pixel_fac, p) * sizePixel; world_pos = p + screen_pos * screen_size; } else if ((vclass & VCLASS_SCREENALIGNED) != 0) { diff --git a/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl index 9a796b2a556..d8cea0325f7 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_curves_vert.glsl @@ -49,7 +49,7 @@ void main() if (hairThicknessRes > 1) { /* Calculate the thickness, thick-time, world-position taken into account the outline. */ float outline_width = drw_point_world_to_homogenous(center_wpos).w * 1.25f * - globalsBlock.size_viewport.w * drw_view().wininv[1][1]; + uniform_buf.size_viewport.w * drw_view().wininv[1][1]; thickness += outline_width; float thick_time = float(gl_VertexID % hairThicknessRes) / float(hairThicknessRes - 1); thick_time = thickness * (thick_time * 2.0f - 1.0f); diff --git a/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl index 45b80bbd717..65f19443b03 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_particle_vert.glsl @@ -22,7 +22,7 @@ void main() gl_Position = drw_point_world_to_homogenous(world_pos); /* World sized points. */ - gl_PointSize = sizePixel * draw_size * drw_view().winmat[1][1] * globalsBlock.size_viewport.y / + gl_PointSize = sizePixel * draw_size * drw_view().winmat[1][1] * uniform_buf.size_viewport.y / gl_Position.w; /* Coloring */