Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/webgpu/mod.ts>getRowPadding

The Deno Standard Library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function getRowPadding
Re-export
import { getRowPadding } from "https://deno.land/std@0.222.1/webgpu/mod.ts";

Calculates the number of bytes including necessary padding when passing a GPUImageCopyBuffer.

Ref: https://en.wikipedia.org/wiki/Data_structure_alignment#Computing_padding

Examples

Example 1

import { getRowPadding } from "https://deno.land/std@0.222.1/webgpu/row_padding.ts";

getRowPadding(2); // { unpadded: 8, padded: 256 }

Parameters

width: number