Skip to content

optimize atmosphere fragment shader for Intel GPUs - #565

Merged
nschimme merged 1 commit into
MUME:masterfrom
nschimme:master
Oct 20, 2026
Merged

nschimme merged 1 commit into
MUME:masterfrom
nschimme:master

Conversation

@nschimme

@nschimme nschimme commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #564

  • Replace dynamic textureSize() lookups with WEATHER_INV_NOISE_SIZE constant multiplier
  • Fully unroll the 4-octave fbm() function

- Replace dynamic textureSize() lookups with WEATHER_INV_NOISE_SIZE constant multiplier
- Fully unroll the 4-octave fbm() function
@sourcery-ai

sourcery-ai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Optimizes the legacy atmosphere fragment shader for Intel GPUs by ensuring noise sampling uses a compile-time inverse texture size and by explicitly unrolling all four fbm octaves, while centralizing the texture-size configuration used by both texture creation and shader compilation.

File-Level Changes

Change Details Files
Centralize the weather noise texture dimensions and inject the inverse size into generated shader source.
  • Define the noise texture size and inverse-size constants.
  • Create the noise texture using the shared size constant.
  • Add a compile-time WEATHER_INV_NOISE_SIZE shader define alongside existing weather defines.
  • Replace per-fragment textureSize() division with multiplication by the injected inverse size.
src/display/Textures.cpp
src/opengl/Weather.h
src/opengl/legacy/ShaderUtils.cpp
src/resources/shaders/legacy/weather/atmosphere/frag.glsl
Fully unroll the four-octave atmospheric fbm calculation in the fragment shader.
  • Replace the loop and mutable amplitude state with four explicit noise samples using equivalent octave weights and coordinate updates.
src/resources/shaders/legacy/weather/atmosphere/frag.glsl

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot 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.

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@nschimme
nschimme merged commit ecba7a3 into MUME:master Oct 20, 2026
19 checks passed
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.91%. Comparing base (6a0ae0e) to head (b2457b1).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
src/opengl/legacy/ShaderUtils.cpp 0.00% 5 Missing ⚠️
src/display/Textures.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #565      +/-   ##
==========================================
- Coverage   27.91%   27.91%   -0.01%     
==========================================
  Files         563      563              
  Lines       46171    46175       +4     
  Branches     4884     4884              
==========================================
  Hits        12889    12889              
- Misses      33282    33286       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Fog slowing down MMapper

1 participant