Skip to content

Commit

Permalink
fix handling of max array layers per pass, fixes #5
Browse files Browse the repository at this point in the history
  • Loading branch information
JolifantoBambla committed Jun 20, 2024
1 parent afbd01b commit 18f82fe
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

## [v2.0.1] - 2024-06-20

### Fixed

- Fix handling of cases where a texture's number of array layers exceeds the maximum number of array layers per pass.

## [v2.0.0] - 2024-04-25

### Added
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ class DevicePipelines {
return undefined;
}
const passes = [];
for (let baseArrayLayer = 0; baseArrayLayer < this.maxArrayLayers - 1; baseArrayLayer += this.maxArrayLayers) {
for (let baseArrayLayer = 0; baseArrayLayer < target.depthOrArrayLayers; baseArrayLayer += this.maxArrayLayers) {
const numArrayLayersThisPass = Math.min(target.depthOrArrayLayers - baseArrayLayer, this.maxArrayLayers);
for (let baseMip = 0; baseMip < numMipsTotal - 1; baseMip += this.maxMipsPerPass) {
const numMipsThisPass = Math.min(numMipsTotal - 1 - baseMip, this.maxMipsPerPass);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgpu-spd",
"version": "2.0.0",
"version": "2.0.1",
"description": "A port of AMD's Single Pass Downsampler for WebGPU",
"type": "module",
"main": "dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ class DevicePipelines {
}

const passes = [];
for (let baseArrayLayer = 0; baseArrayLayer < this.maxArrayLayers - 1; baseArrayLayer += this.maxArrayLayers) {
for (let baseArrayLayer = 0; baseArrayLayer < target.depthOrArrayLayers; baseArrayLayer += this.maxArrayLayers) {
const numArrayLayersThisPass = Math.min(target.depthOrArrayLayers - baseArrayLayer, this.maxArrayLayers);
for (let baseMip = 0; baseMip < numMipsTotal - 1; baseMip += this.maxMipsPerPass) {
const numMipsThisPass = Math.min(numMipsTotal - 1 - baseMip, this.maxMipsPerPass);
Expand Down

0 comments on commit 18f82fe

Please sign in to comment.