gpuweb / cts

WebGPU Conformance Test Suite
https://gpuweb.github.io/cts/
BSD 3-Clause "New" or "Revised" License
128 stars 80 forks source link

Fix textureGather #3922

Closed greggman closed 1 month ago

greggman commented 1 month ago

The code wasn't correctly discarding edge cases for negative texture coordinates. For example -2.5 sits in the center of a texel and for textureGather could go either left or right. We need to avoid that case.

Also, textureGather always does nearest filtering mipmapFilter. This was fine as it was since it would always pass 0 for mipLevel which mean the 2nd mip level always provided zero contribution but arguably it should take the nearest path.