Conversation
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.
This PR
Round the interpolated texture ID before selecting a texture or its resolution. An ID slightly above or below an integer previously fell through the exact-equality checks, returning a transparent sample or a zero resolution. Both helpers now use
floor(outTexDatum + 0.5). Single-texture batches and the fallback for out-of-range integer IDs are unchanged.Based on DainDwarf's report and suggested rounding approach in #7372. Related to #7372; the original SwiftShader rotation reproduction still needs confirmation with this patch.
Validation:
tests/renderer/webgl/texture-id-regression.html, a manual WebGL 1 test that compiles the actual generated GLSL helpers and reads back pixels. It supplies exact IDs, positive/negative perturbations, and out-of-range integer controls; tests texture sampling and resolution lookup,mediump/highp, and 1, 2, and the device maximum number of texture units. Serve the repository root over HTTP, open the file, and click Run shader checks.npm test -- tests/renderer/webgl --maxWorkers=2: 69 files / 1,544 tests passed. An existing circular-dependency warning was emitted.npm run build: webpack compiled successfully. The optional copy step reports that the sibling examples repository is absent.--no-ignorepassed for both changed generated JavaScript files. The repository-widenpm run lintfails to load.eslintrc.jsonunder its installed ESLint 10 (ERR_IMPORT_ATTRIBUTE_MISSING); this PR does not alter dependencies or lint configuration.git diff --checkpassed.The GLSL sources and their generated JavaScript modules are included; README, changelog, and distribution bundles are unchanged.