@@ -146,6 +146,7 @@ struct PCstruct
146
146
float Ni;
147
147
uint extra; //flags copied from MTL metadata
148
148
};
149
+
149
150
layout (push_constant) uniform Block {
150
151
PCstruct params;
151
152
} PC;
@@ -512,10 +513,18 @@ void createVirtualTexture(video::IVideoDriver* driver, core::vector<ICPUMeshBuff
512
513
}
513
514
assert (pipelineMetadata);
514
515
516
+ vt->shrink ();
517
+ for (const auto & cm : vt_commits)
518
+ {
519
+ vt->commit (cm.addr , cm.texture .get (), cm.subresource , cm.uwrap , cm.vwrap , cm.border );
520
+ }
521
+
522
+ /* TODO: zamieniæ push constants na ssbo (dla ka¿dego mdi)*/
523
+
515
524
outputGPUvt = core::make_smart_refctd_ptr<video::IGPUVirtualTexture>(driver, vt.get ());
516
525
}
517
526
518
- void setPipeline (IVideoDriver* driver, ICPUSpecializedShader* vs, ICPUSpecializedShader* fs,
527
+ void createPipeline (IVideoDriver* driver, ICPUSpecializedShader* vs, ICPUSpecializedShader* fs,
519
528
core::smart_refctd_ptr<IGPUBuffer>& vtxBuffer, core::smart_refctd_ptr<IGPUBuffer>& outputUBO, core::smart_refctd_ptr<IGPUBuffer>& virtualAttribBuffer,
520
529
core::smart_refctd_ptr<IGPUVirtualTexture>& vt,
521
530
core::smart_refctd_ptr<IGPUDescriptorSet>& outputGPUDescriptorSet0,
@@ -759,7 +768,7 @@ int main()
759
768
760
769
packMeshBuffers (driver, meshBuffers, mdiCallParams, virtualAttribTable);
761
770
762
- setPipeline (driver, vs.get (), fs.get (), mdiCallParams.vtxBuffer .buffer , ubo, virtualAttribTable, gpuvt, ds0, ds1, ds2, gpuPipeline);
771
+ createPipeline (driver, vs.get (), fs.get (), mdiCallParams.vtxBuffer .buffer , ubo, virtualAttribTable, gpuvt, ds0, ds1, ds2, gpuPipeline);
763
772
}
764
773
765
774
// ! we want to move around the scene and view it from different angles
0 commit comments