Skip to content

rend: clamp xBRZ texture upscale factor to 2..6 - #2545

Merged
flyinghead merged 1 commit into
flyinghead:masterfrom
Provenance-Emu:fix/xbrz-scale-clamp
Oct 16, 2026
Merged

flyinghead merged 1 commit into
flyinghead:masterfrom
Provenance-Emu:fix/xbrz-scale-clamp

Conversation

@JoeMatt

@JoeMatt JoeMatt commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

xbrz::scale() only implements factors 2 to 6. Any other value hits an
assert that's compiled out in release builds, and scale() returns
without writing the destination buffer. The texture is then uploaded
from uninitialized memory at the requested size.

rend.TextureUpscale2 can be set to 8 or 16 through emu.cfg or Lua.
Clamp the factor once and use it for the buffer size, the scale call
and the upscaled dimensions so they always agree.

Testing: compiles in the libretro core and the standalone build (macOS arm64). Not run on content.

🤖 Generated with Claude Code

xbrz::scale() only implements factors 2 to 6. Any other value hits an
assert that's compiled out in release builds, and scale() returns
without writing the destination buffer. The texture is then uploaded
from uninitialized memory at the requested size.

rend.TextureUpscale2 can be set to 8 or 16 through emu.cfg or Lua.
Clamp the factor once and use it for the buffer size, the scale call
and the upscaled dimensions so they always agree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 13, 2026 21:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@flyinghead
flyinghead merged commit 08afcbe into flyinghead:master Oct 16, 2026
13 of 19 checks passed
@JoeMatt
JoeMatt deleted the fix/xbrz-scale-clamp branch October 17, 2026 05:11
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.

3 participants