FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: adding a request late update in the context for ui texts render by Divengerss · Pull Request #459 · EngineSquared/EngineSquared · GitHub

fix: adding a request late update in the context for ui texts render - #459

Merged
Divengerss merged 4 commits into
mainfrom
fix/rmlui-render
Jan 31, 2026
Merged

fix: adding a request late update in the context for ui texts render#459
Divengerss merged 4 commits into
mainfrom
fix/rmlui-render

Conversation

Divengerss commented Jan 31, 2026
edited by coderabbitai Bot
Loading

Copy link
Copy Markdown
Contributor

Not related to any issue.

Summary by CodeRabbit

  • New Features

    • Added late-update request mechanism for UI rendering.
    • Texture creation now accepts explicit format selection.
    • Overlay and loaded documents render at full viewport size.
  • Bug Fixes / Improvements

    • Alignment-aware texture uploads to handle padded rows.
    • Blending adjusted for premultiplied-alpha content.
    • Improved texture sampler validation and binding; default texture creation made consistent.

✏️ Tip: You can customize this high-level summary in your review settings.

Divengerss self-assigned this Jan 31, 2026

coderabbitai Bot commented Jan 31, 2026
edited
Loading

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Premultiplied alpha blending was enabled, texture uploads became alignment-aware, texture creation now requires explicit wgpu formats and uses descriptor-based creation with counted handles, and UIContext gained a RequestLateUpdate mechanism with overlays/documents sized to 100%.

Changes

Cohort / File(s) Summary
Blend State
src/plugin/graphic/src/resource/Shader.hpp
Changed blend color source from SrcAlpha to One for premultiplied alpha in the RMLUI_RENDER_PASS_SHADER path and updated comment.
Texture upload / alignment
src/plugin/graphic/src/resource/Texture.hpp
Added alignment-aware upload: compute aligned row bytes, early-return if already aligned, otherwise allocate padded buffer and copy rows before writeTexture. Added headers for sizes and vector usage.
RenderInterface: texture formats & handles
src/plugin/rmlui/src/utils/RenderInterface.hpp, src/plugin/rmlui/src/utils/RenderInterface.cpp
CreateTexture signature now accepts wgpu::TextureFormat; file-loaded textures use RGBA8UnormSrgb, generated textures use RGBA8Unorm; creation uses descriptor + writeTexture. Texture handles generated via _nextTextureHandle++ instead of reinterpret_cast. BeginFrame default texture created via descriptor path. ResolveTextureBindGroup now ensures gpuTexture and sampler (populates default sampler if missing) before creating bind group.
UIContext: deferred updates & sizing
src/plugin/rmlui/src/resource/UIContext.hpp, src/plugin/rmlui/src/resource/UIContext.cpp
Added public RequestLateUpdate() and private _lateUpdateRequested flag. Render() calls Update(core) when flag set and clears it. After Show()/overlay load, documents have width/height set to 100%.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~40 minutes

Possibly related PRs

Suggested reviewers

  • Miou-zora
  • ripel2

Poem

🐰 Bytes aligned in tidy rows so neat,
Handles counted, no more casts to meet,
Blends now premultiplied in light,
Late updates wait, then dance in sight,
A rabbit cheers: the render’s sweet! 🎨✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2 ❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title references late update for UI text rendering, which aligns with UIContext changes, but does not reflect the broader scope of changes including texture alignment fixes, shader blend state updates, and RenderInterface texture format changes. Revise the title to accurately represent the main changes: 'fix: improve UI rendering with late update, texture alignment, and texture format handling' or similar to better capture the scope of modifications across multiple components.
Docstring Coverage ⚠️ Warning Docstring coverage is 7.14% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/rmlui-render

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/plugin/graphic/src/resource/Texture.hpp (1)

185-216: ⚠️ Potential issue | 🔴 Critical

Add early return for mismatched texture dimensions

Size mismatch can cause out-of-bounds buffer reads. The code calculates row read sizes based on textureSize.width but reads from a buffer allocated to image.width. If the image is smaller than the texture in either dimension, the memcpy loop will read past the source buffer bounds. Add an early return when dimensions don't match:

Fix
        if (image.width != this->_webgpuTexture.getWidth() || image.height != this->_webgpuTexture.getHeight())
        {
            Log::Warn("Image data size does not match texture size.");
+           return;
        }

Divengerss enabled auto-merge (squash) January 31, 2026 20:17

Copy link
Copy Markdown

Divengerss merged commit d9d709d into main Jan 31, 2026
13 checks passed
Divengerss deleted the fix/rmlui-render branch January 31, 2026 20:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL