The WGSL texture functions have an offset parameter of signed integral type (with same number of components as the coordinate). So far these are not otherwise constrained.
But Vulkan requires these to be compile-time constants.
Also, implementations have defined limits minTexelOffset (no higher than -8) and maxTexelOffset (no lower than 7)
See the Required Limits table.
Metal/MSL also limit the range from -8 through 7+.
Background: The offset operand in texture functions for Vulkan/SPIR-V has a few limitations that we need to account for:
- There are 3 relevant image operands in SPIR-V
Offset: allows non-constant integer coordinate offset.
- Vulkan limits this to only the OpImageGather and OpImageDrefGather instructions. See Vulkan spir-v environment: "Image operand Offset must only be used with OpImage*Gather instructions."
ConstOffsets: allows array of compile-time-constant offsets for Gather and DrefGather.
ConstOffset : usable by many image instructions. This only allows a compile-time-constant offset.
@ben-clayton