Fix mip_level bug in frame_texture causing crash#223
Open
alekslovesonome wants to merge 1 commit intol1npengtul:0.10from
Open
Fix mip_level bug in frame_texture causing crash#223alekslovesonome wants to merge 1 commit intol1npengtul:0.10from
alekslovesonome wants to merge 1 commit intol1npengtul:0.10from
Conversation
The frame_texture method was trying to write to mip_level 1 when the texture only has 1 mip level (index 0). This causes a crash because of the validation error: 'Unable to select texture mip level 1 out of 1' Changed mip_level from 1 to 0 to match the texture descriptor which sets mip_level_count to 1.
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.
Problem
The
frame_texturemethod in nokhwa-core 0.1.8 crashes with a wgpu validation error:Root Cause
In
nokhwa-core/src/traits.rsline 228, the code writes tomip_level: 1but the texture is created withmip_level_count: 1(line 213), meaning only mip level 0 exists.Fix
Changed
mip_level: 1tomip_level: 0to match the texture descriptor.Impact
This is a one-line fix for a crash that affects anyone using the
output-wgpufeature withframe_texturemethod in the 0.10.x release.Tested on macOS with wgpu 27.0.1.