SPIR-V integer image sampling restriction - #1594
Open
bashbaug wants to merge 3 commits into
Open
Conversation
bashbaug
commented
Aug 4, 2026
Comment on lines
1518
to
+1519
|
|
||
| For the integer image data types, when reading from an image with a sampler, |
Contributor
Author
There was a problem hiding this comment.
Discussed in the August 4th teleconference. Need to use a more precise term here than "integer image data types".
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.
The main purpose of this change is to add a missing restriction to the SPIR-V environment spec when reading from an image with a sampler: If the image is an integer image, then the sampler must be using nearest filtering or behavior is undefined. This restriction is present in OpenCL C, e.g.:
It is also consistent with restrictions in the graphics APIs, so I do not believe this was ever intended to work via SPIR-V.
Additionally:
I'd like to make similar changes to the OpenCL C spec eventually. Right now, we're describing these rules for each of the image read and write overloads, which is redundant and error-prone. We should be able to describe these restrictions in one place instead, which would shorten the spec and improve understanding.