@@ -4,7 +4,7 @@ import { EXTMeshGPUInstancing } from '@gltf-transform/extensions';
44import { getSceneVertexCount , VertexCountMethod } from '@gltf-transform/functions' ;
55import { logger } from '@gltf-transform/test-utils' ;
66
7- const { RENDER , RENDER_OPTIMISTIC , UPLOAD , UPLOAD_OPTIMISTIC , UNUSED } = VertexCountMethod ;
7+ const { RENDER , RENDER_CACHED , GPU , GPU_NAIVE , UNUSED } = VertexCountMethod ;
88
99test ( 'render' , async ( t ) => {
1010 const document = new Document ( ) . setLogger ( logger ) ;
@@ -15,31 +15,31 @@ test('render', async (t) => {
1515 t . is ( getSceneVertexCount ( createSceneUnused ( document ) , RENDER ) , 15 , 'unused' ) ;
1616} ) ;
1717
18- test ( 'render-optimistic ' , async ( t ) => {
18+ test ( 'render-cached ' , async ( t ) => {
1919 const document = new Document ( ) . setLogger ( logger ) ;
20- t . is ( getSceneVertexCount ( createSceneBasic ( document ) , RENDER_OPTIMISTIC ) , 32 * 4 , 'basic' ) ;
21- t . is ( getSceneVertexCount ( createSceneIndexed ( document ) , RENDER_OPTIMISTIC ) , 32 + 5 , 'indexed' ) ;
22- t . is ( getSceneVertexCount ( createSceneInstanced ( document ) , RENDER_OPTIMISTIC ) , 32 * 5 , 'instanced' ) ;
23- t . is ( getSceneVertexCount ( createSceneMixedAttributes ( document ) , RENDER_OPTIMISTIC ) , 32 * 2 , 'mixed attributes' ) ;
24- t . is ( getSceneVertexCount ( createSceneUnused ( document ) , RENDER_OPTIMISTIC ) , 11 , 'unused' ) ;
20+ t . is ( getSceneVertexCount ( createSceneBasic ( document ) , RENDER_CACHED ) , 32 * 4 , 'basic' ) ;
21+ t . is ( getSceneVertexCount ( createSceneIndexed ( document ) , RENDER_CACHED ) , 32 + 5 , 'indexed' ) ;
22+ t . is ( getSceneVertexCount ( createSceneInstanced ( document ) , RENDER_CACHED ) , 32 * 5 , 'instanced' ) ;
23+ t . is ( getSceneVertexCount ( createSceneMixedAttributes ( document ) , RENDER_CACHED ) , 32 * 2 , 'mixed attributes' ) ;
24+ t . is ( getSceneVertexCount ( createSceneUnused ( document ) , RENDER_CACHED ) , 11 , 'unused' ) ;
2525} ) ;
2626
27- test ( 'upload ' , async ( t ) => {
27+ test ( 'gpu-naive ' , async ( t ) => {
2828 const document = new Document ( ) . setLogger ( logger ) ;
29- t . is ( getSceneVertexCount ( createSceneBasic ( document ) , UPLOAD ) , 32 * 4 , 'basic' ) ;
30- t . is ( getSceneVertexCount ( createSceneIndexed ( document ) , UPLOAD ) , 32 * 2 , 'indexed' ) ;
31- t . is ( getSceneVertexCount ( createSceneInstanced ( document ) , UPLOAD ) , 32 , 'instanced' ) ;
32- t . is ( getSceneVertexCount ( createSceneMixedAttributes ( document ) , UPLOAD ) , 32 * 2 , 'mixed attributes' ) ;
33- t . is ( getSceneVertexCount ( createSceneUnused ( document ) , UPLOAD ) , 32 * 2 , 'unused' ) ;
29+ t . is ( getSceneVertexCount ( createSceneBasic ( document ) , GPU_NAIVE ) , 32 * 4 , 'basic' ) ;
30+ t . is ( getSceneVertexCount ( createSceneIndexed ( document ) , GPU_NAIVE ) , 32 * 2 , 'indexed' ) ;
31+ t . is ( getSceneVertexCount ( createSceneInstanced ( document ) , GPU_NAIVE ) , 32 , 'instanced' ) ;
32+ t . is ( getSceneVertexCount ( createSceneMixedAttributes ( document ) , GPU_NAIVE ) , 32 * 2 , 'mixed attributes' ) ;
33+ t . is ( getSceneVertexCount ( createSceneUnused ( document ) , GPU_NAIVE ) , 32 * 2 , 'unused' ) ;
3434} ) ;
3535
36- test ( 'upload-optimistic ' , async ( t ) => {
36+ test ( 'gpu ' , async ( t ) => {
3737 const document = new Document ( ) . setLogger ( logger ) ;
38- t . is ( getSceneVertexCount ( createSceneBasic ( document ) , UPLOAD_OPTIMISTIC ) , 32 * 4 , 'basic' ) ;
39- t . is ( getSceneVertexCount ( createSceneIndexed ( document ) , UPLOAD_OPTIMISTIC ) , 32 , 'indexed' ) ;
40- t . is ( getSceneVertexCount ( createSceneInstanced ( document ) , UPLOAD_OPTIMISTIC ) , 32 , 'instanced' ) ;
41- t . is ( getSceneVertexCount ( createSceneMixedAttributes ( document ) , UPLOAD_OPTIMISTIC ) , 32 , 'mixed attributes' ) ;
42- t . is ( getSceneVertexCount ( createSceneUnused ( document ) , UPLOAD_OPTIMISTIC ) , 32 , 'unused' ) ;
38+ t . is ( getSceneVertexCount ( createSceneBasic ( document ) , GPU ) , 32 * 4 , 'basic' ) ;
39+ t . is ( getSceneVertexCount ( createSceneIndexed ( document ) , GPU ) , 32 , 'indexed' ) ;
40+ t . is ( getSceneVertexCount ( createSceneInstanced ( document ) , GPU ) , 32 , 'instanced' ) ;
41+ t . is ( getSceneVertexCount ( createSceneMixedAttributes ( document ) , GPU ) , 32 , 'mixed attributes' ) ;
42+ t . is ( getSceneVertexCount ( createSceneUnused ( document ) , GPU ) , 32 , 'unused' ) ;
4343} ) ;
4444
4545test . skip ( 'distinct' , async ( t ) => {
0 commit comments