diff --git a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts index 0d568e573fd1..ed1406a679c6 100644 --- a/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts +++ b/src/webgpu/shader/execution/expression/call/builtin/texture_utils.ts @@ -2305,10 +2305,6 @@ const sumOfCharCodesOfString = (s: unknown) => .split('') .reduce((sum, c) => sum + c.charCodeAt(0), 0); -function roundDownToMultipleOf(v: number, multiple: number) { - return Math.floor(v / multiple) * multiple; -} - /** * Makes a function that fills a block portion of a Uint8Array with random valid data * for an astc block. @@ -3281,8 +3277,7 @@ function generateTextureBuiltinInputsImpl( // choose one axis to set const ndx = makeRangeValue({ num: coords.length - 1, type: 'u32' }, i, 8); assert(ndx < coords.length); - // Align to 3rds to avoid edge cases. - mult[ndx] = Math.pow(2, roundDownToMultipleOf(mipLevel, 1 / 3)); + mult[ndx] = Math.pow(2, mipLevel); return mult as T; }; @@ -3815,8 +3810,7 @@ export function generateSamplePointsCube( // choose one axis to set const ndx = makeRangeValue({ num: coords.length - 1, type: 'u32' }, i, 8); assert(ndx < coords.length); - // Align to 3rds to avoid edge cases. - mult[ndx] = Math.pow(2, roundDownToMultipleOf(mipLevel, 1 / 3)); + mult[ndx] = Math.pow(2, mipLevel); return mult as vec3; };