Skip to content

Commit 0ddd9aa

Browse files
authored
Merge pull request #227 from Absulit/dev
v0.5.1
2 parents 3f8f544 + dbcdb63 commit 0ddd9aa

7 files changed

Lines changed: 43 additions & 34 deletions

File tree

apidocs/Points.html

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ <h4 class="name" id="canvas"><span class="attributes"></span>canvas<span class="
146146
<dl class="details">
147147
<dt class="tag-source">Source:</dt>
148148
<dd class="tag-source">
149-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2403">line 2403</a>
149+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2406">line 2406</a>
150150
</dd>
151151
</dl>
152152

@@ -169,7 +169,7 @@ <h4 class="name" id="device"><span class="attributes"></span>device<span class="
169169
<dl class="details">
170170
<dt class="tag-source">Source:</dt>
171171
<dd class="tag-source">
172-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2410">line 2410</a>
172+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2413">line 2413</a>
173173
</dd>
174174
</dl>
175175

@@ -197,7 +197,7 @@ <h4 class="name" id="fitWindow"><span class="attributes"></span>fitWindow<span c
197197
<dl class="details">
198198
<dt class="tag-source">Source:</dt>
199199
<dd class="tag-source">
200-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2460">line 2460</a>
200+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2463">line 2463</a>
201201
</dd>
202202
</dl>
203203

@@ -231,7 +231,7 @@ <h4 class="name" id="fullscreen"><span class="attributes"></span>fullscreen<span
231231
<dl class="details">
232232
<dt class="tag-source">Source:</dt>
233233
<dd class="tag-source">
234-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2433">line 2433</a>
234+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2436">line 2436</a>
235235
</dd>
236236
</dl>
237237

@@ -265,7 +265,7 @@ <h4 class="name" id="renderPasses"><span class="attributes"></span>renderPasses<
265265
<dl class="details">
266266
<dt class="tag-source">Source:</dt>
267267
<dd class="tag-source">
268-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1353">line 1353</a>
268+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1355">line 1355</a>
269269
</dd>
270270
</dl>
271271

@@ -420,7 +420,7 @@ <h5>Parameters:</h5>
420420
<dl class="details">
421421
<dt class="tag-source">Source:</dt>
422422
<dd class="tag-source">
423-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line982">line 982</a>
423+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line984">line 984</a>
424424
</dd>
425425
</dl>
426426

@@ -552,7 +552,7 @@ <h5>Parameters:</h5>
552552
<dl class="details">
553553
<dt class="tag-source">Source:</dt>
554554
<dd class="tag-source">
555-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1332">line 1332</a>
555+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1334">line 1334</a>
556556
</dd>
557557
</dl>
558558

@@ -655,7 +655,7 @@ <h5>Parameters:</h5>
655655
<dl class="details">
656656
<dt class="tag-source">Source:</dt>
657657
<dd class="tag-source">
658-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1264">line 1264</a>
658+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1266">line 1266</a>
659659
</dd>
660660
</dl>
661661

@@ -877,7 +877,7 @@ <h5>Parameters:</h5>
877877
<dl class="details">
878878
<dt class="tag-source">Source:</dt>
879879
<dd class="tag-source">
880-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line841">line 841</a>
880+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line843">line 843</a>
881881
</dd>
882882
</dl>
883883

@@ -1098,7 +1098,7 @@ <h5>Parameters:</h5>
10981098
<dl class="details">
10991099
<dt class="tag-source">Source:</dt>
11001100
<dd class="tag-source">
1101-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line927">line 927</a>
1101+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line929">line 929</a>
11021102
</dd>
11031103
</dl>
11041104

@@ -1272,7 +1272,7 @@ <h5>Parameters:</h5>
12721272
<dl class="details">
12731273
<dt class="tag-source">Source:</dt>
12741274
<dd class="tag-source">
1275-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line292">line 292</a>
1275+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line293">line 293</a>
12761276
</dd>
12771277
</dl>
12781278

@@ -1423,7 +1423,7 @@ <h5>Parameters:</h5>
14231423
<dl class="details">
14241424
<dt class="tag-source">Source:</dt>
14251425
<dd class="tag-source">
1426-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line464">line 464</a>
1426+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line465">line 465</a>
14271427
</dd>
14281428
</dl>
14291429

@@ -1556,7 +1556,7 @@ <h5>Parameters:</h5>
15561556
<dl class="details">
15571557
<dt class="tag-source">Source:</dt>
15581558
<dd class="tag-source">
1559-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1155">line 1155</a>
1559+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line1157">line 1157</a>
15601560
</dd>
15611561
</dl>
15621562

@@ -1688,7 +1688,7 @@ <h5>Parameters:</h5>
16881688
<dl class="details">
16891689
<dt class="tag-source">Source:</dt>
16901690
<dd class="tag-source">
1691-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line507">line 507</a>
1691+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line508">line 508</a>
16921692
</dd>
16931693
</dl>
16941694

@@ -1886,7 +1886,7 @@ <h5>Parameters:</h5>
18861886
<dl class="details">
18871887
<dt class="tag-source">Source:</dt>
18881888
<dd class="tag-source">
1889-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line338">line 338</a>
1889+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line339">line 339</a>
18901890
</dd>
18911891
</dl>
18921892

@@ -2136,7 +2136,7 @@ <h5>Parameters:</h5>
21362136
<dl class="details">
21372137
<dt class="tag-source">Source:</dt>
21382138
<dd class="tag-source">
2139-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line401">line 401</a>
2139+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line402">line 402</a>
21402140
</dd>
21412141
</dl>
21422142

@@ -2317,7 +2317,7 @@ <h5>Parameters:</h5>
23172317
<dl class="details">
23182318
<dt class="tag-source">Source:</dt>
23192319
<dd class="tag-source">
2320-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line562">line 562</a>
2320+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line563">line 563</a>
23212321
</dd>
23222322
</dl>
23232323

@@ -2506,7 +2506,7 @@ <h5>Parameters:</h5>
25062506
<dl class="details">
25072507
<dt class="tag-source">Source:</dt>
25082508
<dd class="tag-source">
2509-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line634">line 634</a>
2509+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line635">line 635</a>
25102510
</dd>
25112511
</dl>
25122512

@@ -2677,7 +2677,7 @@ <h5>Parameters:</h5>
26772677
<dl class="details">
26782678
<dt class="tag-source">Source:</dt>
26792679
<dd class="tag-source">
2680-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line719">line 719</a>
2680+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line721">line 721</a>
26812681
</dd>
26822682
</dl>
26832683

@@ -2925,7 +2925,7 @@ <h5>Parameters:</h5>
29252925
<dl class="details">
29262926
<dt class="tag-source">Source:</dt>
29272927
<dd class="tag-source">
2928-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line705">line 705</a>
2928+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line707">line 707</a>
29292929
</dd>
29302930
</dl>
29312931

@@ -3098,7 +3098,7 @@ <h5>Parameters:</h5>
30983098
<dl class="details">
30993099
<dt class="tag-source">Source:</dt>
31003100
<dd class="tag-source">
3101-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line762">line 762</a>
3101+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line764">line 764</a>
31023102
</dd>
31033103
</dl>
31043104

@@ -3270,7 +3270,7 @@ <h5>Parameters:</h5>
32703270
<dl class="details">
32713271
<dt class="tag-source">Source:</dt>
32723272
<dd class="tag-source">
3273-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line797">line 797</a>
3273+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line799">line 799</a>
32743274
</dd>
32753275
</dl>
32763276

@@ -3472,7 +3472,7 @@ <h5>Parameters:</h5>
34723472
<dl class="details">
34733473
<dt class="tag-source">Source:</dt>
34743474
<dd class="tag-source">
3475-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line208">line 208</a>
3475+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line209">line 209</a>
34763476
</dd>
34773477
</dl>
34783478

@@ -3552,7 +3552,7 @@ <h4 class="name" id="update"><span class="attributes"><span class="attribute">as
35523552
<dl class="details">
35533553
<dt class="tag-source">Source:</dt>
35543554
<dd class="tag-source">
3555-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2179">line 2179</a>
3555+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line2181">line 2181</a>
35563556
</dd>
35573557
</dl>
35583558

@@ -3662,7 +3662,7 @@ <h5>Parameters:</h5>
36623662
<dl class="details">
36633663
<dt class="tag-source">Source:</dt>
36643664
<dd class="tag-source">
3665-
<a href="points.js.html">points.js</a>, <a href="points.js.html#line260">line 260</a>
3665+
<a href="points.js.html">points.js</a>, <a href="points.js.html#line261">line 261</a>
36663666
</dd>
36673667
</dl>
36683668

@@ -3712,7 +3712,7 @@ <h5>Parameters:</h5>
37123712
Documentation generated by <a rel="external" href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a><wbr>
37133713
using <a rel="external" href="https://github.com/amekusa/docolatte">Docolatte</a> theme
37143714

3715-
<wbr>on <time datetime="2025-10-30T22:37:44.026Z">Thu, 30 Oct 2025 22:37:44 GMT</time>
3715+
<wbr>on <time datetime="2025-10-31T20:59:15.943Z">Fri, 31 Oct 2025 20:59:15 GMT</time>
37163716

37173717
</p>
37183718

apidocs/points.js.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ <h1 class="page-title">
130130
#events_ids = 0;
131131
#dataSize = null;
132132
#screenResized = false;
133+
#textureUpdated = false;
133134

134135
constructor(canvasId) {
135136
this.#canvasId = canvasId;
@@ -683,6 +684,7 @@ <h1 class="page-title">
683684
if (shaderType) {
684685
throw '`setTextureImage()` the param `shaderType` should not be updated after its creation.';
685686
}
687+
this.#textureUpdated = true;
686688
texture2dToUpdate.imageTexture.bitmap = imageBitmap;
687689
const cubeTexture = this.#device.createTexture({
688690
label: '_cubeTexture setTextureImage',
@@ -2271,7 +2273,7 @@ <h1 class="page-title">
22712273
// texturesExternal means there's a video
22722274
// if there's a video it needs to be updated no matter what.
22732275
// Also, it needs to be updated if the screen size changes
2274-
if (!isSameDevice || !renderPass.bundle || this.#texturesExternal.length || this.#screenResized) {
2276+
if (!isSameDevice || !renderPass.bundle || this.#texturesExternal.length || this.#screenResized || this.#textureUpdated) {
22752277
this.#passBindGroup(renderPass, GPUShaderStage.FRAGMENT);
22762278
this.#passBindGroup(renderPass, GPUShaderStage.VERTEX);
22772279
/** @type {GPURenderBundleEncoderDescriptor} */
@@ -2366,6 +2368,7 @@ <h1 class="page-title">
23662368
}
23672369
});
23682370
this.#screenResized = false;
2371+
this.#textureUpdated = false;
23692372

23702373

23712374
// let descriptor0 = null;
@@ -2548,7 +2551,7 @@ <h1 class="page-title">
25482551
Documentation generated by <a rel="external" href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a><wbr>
25492552
using <a rel="external" href="https://github.com/amekusa/docolatte">Docolatte</a> theme
25502553

2551-
<wbr>on <time datetime="2025-10-30T22:37:43.974Z">Thu, 30 Oct 2025 22:37:43 GMT</time>
2554+
<wbr>on <time datetime="2025-10-31T20:59:15.637Z">Fri, 31 Oct 2025 20:59:15 GMT</time>
25522555

25532556
</p>
25542557

build/points.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3385,6 +3385,7 @@ class Points {
33853385
#events_ids = 0;
33863386
#dataSize = null;
33873387
#screenResized = false;
3388+
#textureUpdated = false;
33883389

33893390
constructor(canvasId) {
33903391
this.#canvasId = canvasId;
@@ -3938,6 +3939,7 @@ class Points {
39383939
if (shaderType) {
39393940
throw '`setTextureImage()` the param `shaderType` should not be updated after its creation.';
39403941
}
3942+
this.#textureUpdated = true;
39413943
texture2dToUpdate.imageTexture.bitmap = imageBitmap;
39423944
const cubeTexture = this.#device.createTexture({
39433945
label: '_cubeTexture setTextureImage',
@@ -5525,7 +5527,7 @@ class Points {
55255527
// texturesExternal means there's a video
55265528
// if there's a video it needs to be updated no matter what.
55275529
// Also, it needs to be updated if the screen size changes
5528-
if (!isSameDevice || !renderPass.bundle || this.#texturesExternal.length || this.#screenResized) {
5530+
if (!isSameDevice || !renderPass.bundle || this.#texturesExternal.length || this.#screenResized || this.#textureUpdated) {
55295531
this.#passBindGroup(renderPass, GPUShaderStage.FRAGMENT);
55305532
this.#passBindGroup(renderPass, GPUShaderStage.VERTEX);
55315533
/** @type {GPURenderBundleEncoderDescriptor} */
@@ -5620,6 +5622,7 @@ class Points {
56205622
}
56215623
});
56225624
this.#screenResized = false;
5625+
this.#textureUpdated = false;
56235626

56245627

56255628
// let descriptor0 = null;

build/points.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://jsr.io/schema/config-file.v1.json",
33
"name": "@absulit/points",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"description": "A Generative Art library made in WebGPU",
66
"license": "MIT",
77
"exports": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@absulit/points",
3-
"version": "0.5.0",
3+
"version": "0.5.1",
44
"type": "module",
55
"publishConfig": {
66
"access": "public"

src/points.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ class Points {
8787
#events_ids = 0;
8888
#dataSize = null;
8989
#screenResized = false;
90+
#textureUpdated = false;
9091

9192
constructor(canvasId) {
9293
this.#canvasId = canvasId;
@@ -640,6 +641,7 @@ class Points {
640641
if (shaderType) {
641642
throw '`setTextureImage()` the param `shaderType` should not be updated after its creation.';
642643
}
644+
this.#textureUpdated = true;
643645
texture2dToUpdate.imageTexture.bitmap = imageBitmap;
644646
const cubeTexture = this.#device.createTexture({
645647
label: '_cubeTexture setTextureImage',
@@ -2228,7 +2230,7 @@ class Points {
22282230
// texturesExternal means there's a video
22292231
// if there's a video it needs to be updated no matter what.
22302232
// Also, it needs to be updated if the screen size changes
2231-
if (!isSameDevice || !renderPass.bundle || this.#texturesExternal.length || this.#screenResized) {
2233+
if (!isSameDevice || !renderPass.bundle || this.#texturesExternal.length || this.#screenResized || this.#textureUpdated) {
22322234
this.#passBindGroup(renderPass, GPUShaderStage.FRAGMENT);
22332235
this.#passBindGroup(renderPass, GPUShaderStage.VERTEX);
22342236
/** @type {GPURenderBundleEncoderDescriptor} */
@@ -2323,6 +2325,7 @@ class Points {
23232325
}
23242326
});
23252327
this.#screenResized = false;
2328+
this.#textureUpdated = false;
23262329

23272330

23282331
// let descriptor0 = null;

0 commit comments

Comments
 (0)