From ae03c9cd7011e88646305f74775b3d1842c32971 Mon Sep 17 00:00:00 2001 From: Ivan Gagis's Bot Date: Tue, 24 Nov 2026 01:46:39 +0200 Subject: [PATCH 1/2] shaders: use the non-const context from context::current() context::current() now returns a non-const context& (ruis), so the const_cast is gone; the downcast to the vulkan context is guarded by a debug-only utki::assert(dynamic_cast). --- src/ruis/render/vulkan/shaders/shader_common.cpp | 8 +++++--- src/ruis/render/vulkan/shaders/shader_pos_tex.cpp | 5 +---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ruis/render/vulkan/shaders/shader_common.cpp b/src/ruis/render/vulkan/shaders/shader_common.cpp index 40b4213..489c4ce 100644 --- a/src/ruis/render/vulkan/shaders/shader_common.cpp +++ b/src/ruis/render/vulkan/shaders/shader_common.cpp @@ -43,10 +43,12 @@ void vulkan_shader_render( ) { // use the currently active context (set by ruis::render::context::apply()), - // not the context stored in the shader (which may be the shared resource-loader context). + // not the context stored in the shader (which may be the shared resource-loader context) + auto& cur = ruis::render::context::current(); + utki::assert(dynamic_cast(&cur) != nullptr, SL); auto& ctx = - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast, cppcoreguidelines-pro-type-static-cast-downcast, "the context is owned by the renderer; the const qualifier comes from the ruis API") - const_cast(static_cast(ruis::render::context::current())); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast, "assert(dynamic_cast) done above") + static_cast(cur); const bool textured = shader_has_texture(kind); diff --git a/src/ruis/render/vulkan/shaders/shader_pos_tex.cpp b/src/ruis/render/vulkan/shaders/shader_pos_tex.cpp index 0f5d81b..59f01c7 100644 --- a/src/ruis/render/vulkan/shaders/shader_pos_tex.cpp +++ b/src/ruis/render/vulkan/shaders/shader_pos_tex.cpp @@ -46,10 +46,7 @@ void shader_pos_tex::render( // textured quads always use alpha blending so that transparent/empty // textures do not overwrite the background { - auto& ctx = - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast, "vulkan context") - // NOLINTNEXTLINE(cppcoreguidelines-pro-type-const-cast) - const_cast(ruis::render::context::current()); + auto& ctx = ruis::render::context::current(); ctx.enable_blend(true); ctx.set_blend_func( ruis::render::context::blend_factor::src_alpha, // From ad3ed68d83489c810fa644f66fa73a121f6313f1 Mon Sep 17 00:00:00 2001 From: Ivan Gagis's Bot Date: Tue, 24 Nov 2026 19:26:57 +0200 Subject: [PATCH 2/2] Update vcpkg baseline to f76627645ebc --- build/vcpkg/test/vcpkg-configuration.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/vcpkg/test/vcpkg-configuration.json b/build/vcpkg/test/vcpkg-configuration.json index 88a4fb1..93eb18f 100644 --- a/build/vcpkg/test/vcpkg-configuration.json +++ b/build/vcpkg/test/vcpkg-configuration.json @@ -8,7 +8,7 @@ { "kind": "git", "repository": "https://github.com/cppfw/vcpkg-repo/", - "baseline": "093bba6063d6ab425b9d77e570ac3b0858b916b5", + "baseline": "f76627645ebc3b525f13a244a3ede6029b62244c", "reference": "main", "packages": [ "myci",