1
1
export const description = `
2
- Tests render results with different depth bias values like 'positive', 'negative', 'infinity',
2
+ Tests render results with different depth bias values like 'positive', 'negative',
3
3
'slope', 'clamp', etc.
4
4
` ;
5
5
@@ -11,7 +11,6 @@ import {
11
11
kTextureFormatInfo ,
12
12
} from '../../../capability_info.js' ;
13
13
import { GPUTest } from '../../../gpu_test.js' ;
14
- import { kValue } from '../../../util/constants.js' ;
15
14
import { TexelView } from '../../../util/texture/texel_view.js' ;
16
15
import { textureContentIsOKByT2B } from '../../../util/texture/texture_ok.js' ;
17
16
@@ -155,13 +154,13 @@ class DepthBiasTest extends GPUTest {
155
154
bias,
156
155
biasSlopeScale,
157
156
biasClamp,
158
- expectedDepth ,
157
+ _expectedDepth ,
159
158
} : {
160
159
quadAngle : QuadAngle ;
161
160
bias : number ;
162
161
biasSlopeScale : number ;
163
162
biasClamp : number ;
164
- expectedDepth : number ;
163
+ _expectedDepth : number ;
165
164
}
166
165
) {
167
166
const { renderTarget, depthTexture } = this . runDepthBiasTestInternal ( depthFormat , {
@@ -172,7 +171,7 @@ class DepthBiasTest extends GPUTest {
172
171
initialDepth : 0 ,
173
172
} ) ;
174
173
175
- const expColor = { Depth : expectedDepth } ;
174
+ const expColor = { Depth : _expectedDepth } ;
176
175
const expTexelView = TexelView . fromTexelsAsColors ( depthFormat , coords => expColor ) ;
177
176
178
177
const result = textureContentIsOKByT2B (
@@ -194,13 +193,13 @@ class DepthBiasTest extends GPUTest {
194
193
bias,
195
194
biasSlopeScale,
196
195
biasClamp,
197
- expectedColor ,
196
+ _expectedColor ,
198
197
} : {
199
198
quadAngle : QuadAngle ;
200
199
bias : number ;
201
200
biasSlopeScale : number ;
202
201
biasClamp : number ;
203
- expectedColor : Float32Array ;
202
+ _expectedColor : Float32Array ;
204
203
}
205
204
) {
206
205
const { renderTarget, depthTexture } = this . runDepthBiasTestInternal ( depthFormat , {
@@ -213,10 +212,10 @@ class DepthBiasTest extends GPUTest {
213
212
214
213
const renderTargetFormat = 'rgba8unorm' ;
215
214
const expColor = {
216
- R : expectedColor [ 0 ] ,
217
- G : expectedColor [ 1 ] ,
218
- B : expectedColor [ 2 ] ,
219
- A : expectedColor [ 3 ] ,
215
+ R : _expectedColor [ 0 ] ,
216
+ G : _expectedColor [ 1 ] ,
217
+ B : _expectedColor [ 2 ] ,
218
+ A : _expectedColor [ 3 ] ,
220
219
} ;
221
220
const expTexelView = TexelView . fromTexelsAsColors ( renderTargetFormat , coords => expColor ) ;
222
221
@@ -264,7 +263,7 @@ export const g = makeTestGroup(DepthBiasTest);
264
263
g . test ( 'depth_bias' )
265
264
. desc (
266
265
`
267
- Tests that a square with different depth bias values like 'positive', 'negative', 'infinity',
266
+ Tests that a square with different depth bias values like 'positive', 'negative',
268
267
'slope', 'clamp', etc. is drawn as expected.
269
268
`
270
269
)
@@ -276,63 +275,49 @@ g.test('depth_bias')
276
275
bias : kPointTwoFiveBiasForPointTwoFiveZOnFloat ,
277
276
biasSlopeScale : 0 ,
278
277
biasClamp : 0 ,
279
- expectedDepth : 0.5 ,
278
+ _expectedDepth : 0.5 ,
280
279
} ,
281
280
{
282
281
quadAngle : QuadAngle . Flat ,
283
282
bias : kPointTwoFiveBiasForPointTwoFiveZOnFloat ,
284
283
biasSlopeScale : 0 ,
285
284
biasClamp : 0.125 ,
286
- expectedDepth : 0.375 ,
285
+ _expectedDepth : 0.375 ,
287
286
} ,
288
287
{
289
288
quadAngle : QuadAngle . Flat ,
290
289
bias : - kPointTwoFiveBiasForPointTwoFiveZOnFloat ,
291
290
biasSlopeScale : 0 ,
292
291
biasClamp : 0.125 ,
293
- expectedDepth : 0 ,
292
+ _expectedDepth : 0 ,
294
293
} ,
295
294
{
296
295
quadAngle : QuadAngle . Flat ,
297
296
bias : - kPointTwoFiveBiasForPointTwoFiveZOnFloat ,
298
297
biasSlopeScale : 0 ,
299
298
biasClamp : - 0.125 ,
300
- expectedDepth : 0.125 ,
299
+ _expectedDepth : 0.125 ,
301
300
} ,
302
301
{
303
302
quadAngle : QuadAngle . TiltedX ,
304
303
bias : 0 ,
305
304
biasSlopeScale : 0 ,
306
305
biasClamp : 0 ,
307
- expectedDepth : 0.25 ,
306
+ _expectedDepth : 0.25 ,
308
307
} ,
309
308
{
310
309
quadAngle : QuadAngle . TiltedX ,
311
310
bias : 0 ,
312
311
biasSlopeScale : 1 ,
313
312
biasClamp : 0 ,
314
- expectedDepth : 0.75 ,
313
+ _expectedDepth : 0.75 ,
315
314
} ,
316
315
{
317
316
quadAngle : QuadAngle . TiltedX ,
318
317
bias : 0 ,
319
318
biasSlopeScale : - 0.5 ,
320
319
biasClamp : 0 ,
321
- expectedDepth : 0 ,
322
- } ,
323
- {
324
- quadAngle : QuadAngle . TiltedX ,
325
- bias : 0 ,
326
- biasSlopeScale : kValue . f32 . infinity . positive ,
327
- biasClamp : 0 ,
328
- expectedDepth : 1 ,
329
- } ,
330
- {
331
- quadAngle : QuadAngle . TiltedX ,
332
- bias : 0 ,
333
- biasSlopeScale : kValue . f32 . infinity . negative ,
334
- biasClamp : 0 ,
335
- expectedDepth : 0 ,
320
+ _expectedDepth : 0 ,
336
321
} ,
337
322
] as const )
338
323
)
@@ -360,21 +345,21 @@ g.test('depth_bias_24bit_format')
360
345
bias : 0.25 * ( 1 << 25 ) ,
361
346
biasSlopeScale : 0 ,
362
347
biasClamp : 0 ,
363
- expectedColor : new Float32Array ( [ 1.0 , 0.0 , 0.0 , 1.0 ] ) ,
348
+ _expectedColor : new Float32Array ( [ 1.0 , 0.0 , 0.0 , 1.0 ] ) ,
364
349
} ,
365
350
{
366
351
quadAngle : QuadAngle . TiltedX ,
367
352
bias : 0.25 * ( 1 << 25 ) ,
368
353
biasSlopeScale : 1 ,
369
354
biasClamp : 0 ,
370
- expectedColor : new Float32Array ( [ 1.0 , 0.0 , 0.0 , 1.0 ] ) ,
355
+ _expectedColor : new Float32Array ( [ 1.0 , 0.0 , 0.0 , 1.0 ] ) ,
371
356
} ,
372
357
{
373
358
quadAngle : QuadAngle . Flat ,
374
359
bias : 0.25 * ( 1 << 25 ) ,
375
360
biasSlopeScale : 0 ,
376
361
biasClamp : 0.1 ,
377
- expectedColor : new Float32Array ( [ 0.0 , 0.0 , 0.0 , 0.0 ] ) ,
362
+ _expectedColor : new Float32Array ( [ 0.0 , 0.0 , 0.0 , 0.0 ] ) ,
378
363
} ,
379
364
] as const )
380
365
)
0 commit comments