Skip to content

Commit 6088af8

Browse files
committed
Add [Clamp] to maxAnisotropy
The default behavior (`value % 65536`) doesn't make any sense here. We could use [EnforceRange], but [Clamp] makes sense: - Any value of maxAnisotropy > 65535 behaves identically to 65535 (that is, it's as if there's no maximum). - Any value of maxAnisotropy < 0 behaves identically to 0 (it's a validation error). Fixes #1269.
1 parent b5c36e3 commit 6088af8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

spec/index.bs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
22862286
float lodMinClamp = 0;
22872287
float lodMaxClamp = 0xffffffff; // TODO: What should this be? Was Number.MAX_VALUE.
22882288
GPUCompareFunction compare;
2289-
unsigned short maxAnisotropy = 1;
2289+
[Clamp] unsigned short maxAnisotropy = 1;
22902290
};
22912291
</script>
22922292

@@ -2303,6 +2303,7 @@ dictionary GPUSamplerDescriptor : GPUObjectDescriptorBase {
23032303
- If {{GPUSamplerDescriptor/compare}} is provided, the sampler will be a comparison sampler with the specified
23042304
{{GPUCompareFunction}}.
23052305
- {{GPUSamplerDescriptor/maxAnisotropy}} specifies the maximum anisotropy value clamp used by the sampler.
2306+
- It must be &ge; 1.
23062307

23072308
Note: most implementations support {{GPUSamplerDescriptor/maxAnisotropy}} values in range between 1 and 16, inclusive.
23082309

0 commit comments

Comments
 (0)