qgsmaterial: Fix removal of parameters when clipping is disabled#61135
Merged
nyalldawson merged 5 commits intoqgis:masterfrom Mar 23, 2025
Merged
Conversation
Plane clipping uses two `QParameters` named `CLIP_PLANE_ARRAY_PARAMETER_NAME` and `CLIP_PLANE_MAX_PLANE_PARAMETER_NAME`. When clipping is disabled both parameters need to be removed to prevent side effects on the shader code. However, the loops which iterates through the parameters breaks as soon one parameter is found. This means that the second parameter is never removed. This issue is fixed by removing the `break` condition. This way, both parameters are always removed from the material.
This will make it easier to test enabling/disabling clipping multiple times with the other reference image.
Contributor
🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. 🪟 Windows buildsDownload Windows builds of this PR for testing. |
This tests that enabling and disabling clipping multiple times works.
This tests that enabling and disabling clipping multiple times works.
728b1c1 to
f00a644
Compare
nyalldawson
approved these changes
Mar 23, 2025
Collaborator
|
The backport to stderrstdoutTo backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-queued_ltr_backports queued_ltr_backports
# Navigate to the new working tree
cd .worktrees/backport-queued_ltr_backports
# Create a new branch
git switch --create backport-61135-to-queued_ltr_backports
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick b2c158d3aa19243435a74342ff610d8bf94fe10e,d1b62f478b9b386e6ad7b675fa10ad73d1261a4b,ce697de56faa5e0c77eca16cb76424d738d51af6,dc0ecc26387afeeb2abe2d37794c592b83573580,f00a644d51244daae50c478a43d0e3ef2d5d5f99
# Push it to GitHub
git push --set-upstream origin backport-61135-to-queued_ltr_backports
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-queued_ltr_backportsThen, create a pull request where the |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Plane clipping uses two
QParametersnamedCLIP_PLANE_ARRAY_PARAMETER_NAMEandCLIP_PLANE_MAX_PLANE_PARAMETER_NAME. When clipping is disabled bothparameters need to be removed to prevent side effects on the shader
code. However, the loops which iterates through the parameters breaks
as soon one parameter is found. This means that the second parameter
is never removed.
This issue is fixed by removing the
breakcondition. This way, bothparameters are always removed from the material.
The first commit is factored out from #61057 for backport.