fix(linux/vulkan): preserve host aspect ratio in encoder output#5130
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
neatnoise
left a comment
There was a problem hiding this comment.
As the original author of the Vulkan encoder path — this looks correct and clean. Single dispatch, no extra passes or sync, negligible overhead.
A few notes:
-
rgb2yuv.compL43-47: The black value computation assumesrange_y/range_uvare(1,0). Worth a comment noting this assumption so it doesn't break silently if those values change in the future. -
vulkan_encode.cppL115-116: Push constant struct layout changed (fields inserted in the middle) — fine since both C++ and GLSL are updated together, but worth being aware of for any future out-of-tree shader variants. -
vulkan_encode.cppL290-293: The& ~1rounding oneff_w/eff_hand offsets could theoretically leave a 1-pixel gap if frame dimensions are odd. Might want to assert or clamp thatdst_offset + eff_size <= frame_size.
|
I clarified the black-fill comment to describe that it uses the normal RGB=(0,0,0) conversion formula, and clamped the aspect-fit size after even alignment so dst_offset + dst_size stays within the full frame while preserving UV-plane alignment. The push constant layout is updated on both the C++ and GLSL sides in this PR, so I think that part is okay as-is. |
Bundle ReportBundle size has no change ✅ |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5130 +/- ##
=========================================
Coverage 17.79% 17.79%
=========================================
Files 111 111
Lines 24143 24154 +11
Branches 10687 10688 +1
=========================================
+ Hits 4296 4299 +3
- Misses 15364 16532 +1168
+ Partials 4483 3323 -1160
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 54 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|



Description
Fixes a behavior inconsistency between the VAAPI and Vulkan encoders on Linux: when the encoder target resolution differs in aspect from the captured source, the VAAPI path letterboxes the source into the encoded frame while the Vulkan path stretches it to fill.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Type of Change
Checklist
AI Usage