Skip to content

Commit 28cdbbc

Browse files
authored
Remove STORAGE_ORDER shader define (playcanvas#8488)
1 parent d9fa03a commit 28cdbbc

3 files changed

Lines changed: 3 additions & 16 deletions

File tree

src/scene/gsplat-unified/gsplat-renderer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,12 @@ class GSplatRenderer {
161161
}
162162

163163
configureMaterial() {
164-
const { device, workBuffer } = this;
164+
const { workBuffer } = this;
165165

166166
// Inject format's shader chunks (uses workBuffer.format)
167167
this._injectFormatChunks();
168168

169169
// Set defines
170-
this._material.setDefine('STORAGE_ORDER', device.isWebGPU);
171170
this._material.setDefine('SH_BANDS', '0');
172171

173172
// Set GSPLAT_COLOR_FLOAT define based on work buffer's color format

src/scene/gsplat/gsplat-instance.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,9 @@ class GSplatInstance {
146146
setMaterialOrderData(material) {
147147
if (this.orderBuffer) {
148148
material.setParameter('splatOrder', this.orderBuffer);
149-
material.setDefine('STORAGE_ORDER', true);
150149
} else {
151150
material.setParameter('splatOrder', this.orderTexture);
152151
material.setParameter('splatTextureSize', this.orderTexture.width);
153-
material.setDefine('STORAGE_ORDER', false);
154152
}
155153
}
156154

src/scene/shader-lib/wgsl/chunks/gsplat/vert/gsplatSource.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,7 @@ attribute vertex_id_attrib: u32; // render order base
1111
#else
1212
uniform numSplats: u32; // total number of splats
1313
14-
#ifdef STORAGE_ORDER
15-
var<storage, read> splatOrder: array<u32>;
16-
#else
17-
// texture for non-unified gsplat rendering
18-
var splatOrder: texture_2d<u32>;
19-
#endif
14+
var<storage, read> splatOrder: array<u32>;
2015
#endif
2116
2217
// initialize the splat source structure
@@ -39,12 +34,7 @@ fn initSource(source: ptr<function, SplatSource>) -> bool {
3934
#ifdef GSPLAT_INDIRECT_DRAW
4035
splatId = compactedSplatIds[source.order];
4136
#else
42-
#ifdef STORAGE_ORDER
43-
splatId = splatOrder[source.order];
44-
#else
45-
let uv = vec2u(source.order % uniform.splatTextureSize, source.order / uniform.splatTextureSize);
46-
splatId = textureLoad(splatOrder, vec2i(uv), 0).r;
47-
#endif
37+
splatId = splatOrder[source.order];
4838
#endif
4939
setSplat(splatId);
5040

0 commit comments

Comments
 (0)