Skip to content

hal/vulkan: Only decrement counter for raw shaders #8066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

DeltaEvo
Copy link

@DeltaEvo DeltaEvo commented Aug 8, 2025

Description

The counter is decremented for raw and intermediate shaders but only incremented for raw shaders, this lead to a negative counter value and did not represent the number of allocated shaders.

Testing

Verified that the counter was not negative anymore and had an expected value

Screenshot 2025-08-08 at 14 22 35

Squash or Rebase?

Rebase

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

The counter is decremented for raw and intermediate shaders but
only incremented for raw shaders, this lead to a negative counter
value and did not represent the number of allocated shaders.
@DeltaEvo DeltaEvo requested a review from a team as a code owner August 8, 2025 12:23
@cwfitzgerald cwfitzgerald self-assigned this Aug 13, 2025
Comment on lines +1957 to +1958

self.counters.shader_modules.sub(1);
Copy link
Member

Choose a reason for hiding this comment

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

I think this is the wrong fix to the problem, we should always be incrementing the counter, no matter what kind of shader module.

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