Skip to content

Commit

Permalink
Revert "tweak to match how defaulting actually works"
Browse files Browse the repository at this point in the history
This reverts commit fe944db.

made typescript unhappy because the type narrowing wasn't detected
properly
  • Loading branch information
kainino0x committed Sep 30, 2024
1 parent 5ad5fa0 commit eca1033
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/webgpu/util/texture/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ export function reifyTextureViewDescriptor(
const format = view.format ?? texture.format;
const mipLevelCount = view.mipLevelCount ?? texture.mipLevelCount - baseMipLevel;
const dimension = view.dimension ?? defaultViewDimensionsForTexture(texture);
const usage = (view.usage ?? 0) === 0 ? texture.usage : view.usage;
const usage = (view.usage === 0 || view.usage === undefined) ? texture.usage : view.usage;

let arrayLayerCount = view.arrayLayerCount;
if (arrayLayerCount === undefined) {
Expand Down

0 comments on commit eca1033

Please sign in to comment.