|
Foundation
|
#include "Scene.hpp"#include <Core/JobSystem.hpp>#include <Math/Decompose.hpp>#include <Math/Quantize.hpp>#include <algorithm>#include <cctype>#include <cgltf.h>#include <climits>#include <cstring>#include <lz4.h>#include <numeric>#include <type_traits>#include <RHICore/Application.hpp>#include <RHICore/Device.hpp>#include <Renderer/Postprocess.hpp>#include <Renderer/GPUScene.hpp>#include <Renderer/Mesh.hpp>#include "Curve.hpp"#include "../PathUtil.hpp"Classes | |
| struct | FBlobJob |
| struct | FPreparedBlob |
| struct | FResourceBlobJobs |
Macros | |
| #define | CGLTF_IMPLEMENTATION |
| #define | CGLTF_VALIDATE_ENABLE_ASSERTS 1 |
Functions | |
| FImportedMesh | LoadGLTFSubmesh (const cgltf_primitive *submesh, Allocator *scratchAlloc, Vector< uint16_t > const *jointRemap=nullptr) |
| Optional< FTexture > | LoadTexture (RHIApplication const &app, StringView path, Allocator *scratchAlloc, bool gamma=false) |
| Optional< FTexture > | LoadGLTFTexture (RHIApplication const &app, cgltf_texture *texture, StringView scenePath, Allocator *scratchAlloc, bool gamma=false) |
| void | LoadGLTFLineCurve (const cgltf_primitive *prim, FImportedCurve &curve, Allocator *scratchAlloc) |
| size_t | GetSceneJobGrain (JobSystem const &jobs, size_t count) |
| void | AppendBytesBlobJob (Vector< FBlobJob > &jobs, Vector< unsigned char > &&bytes, uint32_t count, uint32_t stride, FBlobCodec codec, FBlobRef &outRef, uint64_t alignment=16) |
| template<typename T > | |
| void | AppendArrayBlobJob (Vector< FBlobJob > &jobs, Vector< T > const &values, FBlobCodec codec, FBlobRef &outRef, uint64_t alignment=16) |
| void | PrepareBlobJob (FBlobJob const &job, FPreparedBlob &prepared) |
| FBlobRef | CommitPreparedBlob (FBlobSerializer &blobSerializer, FPreparedBlob const &blob) |
| void | CommitPreparedBlobJobs (FBlobSerializer &blobSerializer, Vector< FPreparedBlob > const &preparedBlobs) |
| void | AppendResourceBlobJobs (Vector< FBlobJob > &blobJobs, FResourceBlobJobs &resourceBlobJobs) |
| void | BuildTextureBlobJobs (FSerializedTexture &desc, Vector< FBlobJob > &blobJobs, FTexture &&texture) |
| void | BuildMeshBlobJobs (FSerializedMesh &desc, Vector< FBlobJob > &blobJobs, FImportedMesh const &mesh, FUUID skeleton=kNilUUID) |
| void | BuildCurveBlobJobs (FSerializedCurve &desc, Vector< FBlobJob > &blobJobs, FImportedCurve const &curve) |
| FSkeleton | BuildSkeletonFromSkin (cgltf_data *data, cgltf_skin const *skin, Vector< uint16_t > &outRemap, Allocator *alloc) |
| FAnimInterp | MapAnimInterp (cgltf_interpolation_type interp) |
| bool | MapAnimPath (cgltf_animation_path_type path, FAnimPath &out) |
| bool | BuildAnimChannel (cgltf_animation_channel const *ch, uint32_t joint, FAnimChannel &out, float &duration) |
| void | BuildGLTFSerializedScene (RHIApplication const &app, JobSystem *jobs, StringView path, FImportedScene &scene, Allocator *scratchAlloc, FSceneBuildOptions const &buildOptions) |
| uint32_t | CountGPUSceneBudget (size_t count) |
| uint32_t | RingGPUSceneBudget (size_t count) |
| uint32_t | ByteGPUSceneBudget (size_t bytes, size_t minBytes, size_t alignment, size_t maxBytes=UINT32_MAX) |
| void | BuildDOTSGeometry (FImportedCurve const &curve, Vector< FCurveDOTSVertex > &vertices, Vector< uint32_t > &indices, Vector< FCurveLeaf > &leaves) |
| void | FinalizeSceneWriter (FImportedScene &scene) |
| void | LoadGLTF (RHIApplication const &app, JobSystem *jobs, StringView path, FImportedScene &scene, Allocator *scratchAlloc, FSceneBuildOptions const &buildOptions) |
| void | LoadFSCN (FImportedScene &scene) |
| String | LoadScene (RHIApplication const &app, JobSystem *jobs, StringView path, FImportedScene &scene, Allocator *scratchAlloc, FSceneBuildOptions const &buildOptions) |
Variables | |
| static constexpr uint32_t | kGPUSceneRingFrameSlack = 4u |
| static constexpr uint32_t | kGPUScenePersistentTexture2DBindings = 2u |
| static constexpr uint32_t | kGPUScenePersistentTexture3DBindings = 2u |
| static constexpr uint32_t | kGPUSceneDefaultTextureBindings = 2u |
| static constexpr uint32_t | kGPUSceneEnvMapBindings = 3u |
| static constexpr uint32_t | kGPUSceneTextureBindingSlack = 8u |
| static constexpr size_t | kGPUSceneByteBudgetSlack = 64u << 10u |
| #define CGLTF_IMPLEMENTATION |
| #define CGLTF_VALIDATE_ENABLE_ASSERTS 1 |
| void AppendArrayBlobJob | ( | Vector< FBlobJob > & | jobs, |
| Vector< T > const & | values, | ||
| FBlobCodec | codec, | ||
| FBlobRef & | outRef, | ||
| uint64_t | alignment = 16 |
||
| ) |
| void AppendBytesBlobJob | ( | Vector< FBlobJob > & | jobs, |
| Vector< unsigned char > && | bytes, | ||
| uint32_t | count, | ||
| uint32_t | stride, | ||
| FBlobCodec | codec, | ||
| FBlobRef & | outRef, | ||
| uint64_t | alignment = 16 |
||
| ) |
| void AppendResourceBlobJobs | ( | Vector< FBlobJob > & | blobJobs, |
| FResourceBlobJobs & | resourceBlobJobs | ||
| ) |
| bool BuildAnimChannel | ( | cgltf_animation_channel const * | ch, |
| uint32_t | joint, | ||
| FAnimChannel & | out, | ||
| float & | duration | ||
| ) |
| void BuildCurveBlobJobs | ( | FSerializedCurve & | desc, |
| Vector< FBlobJob > & | blobJobs, | ||
| FImportedCurve const & | curve | ||
| ) |
| void BuildDOTSGeometry | ( | FImportedCurve const & | curve, |
| Vector< FCurveDOTSVertex > & | vertices, | ||
| Vector< uint32_t > & | indices, | ||
| Vector< FCurveLeaf > & | leaves | ||
| ) |
| void BuildGLTFSerializedScene | ( | RHIApplication const & | app, |
| JobSystem * | jobs, | ||
| StringView | path, | ||
| FImportedScene & | scene, | ||
| Allocator * | scratchAlloc, | ||
| FSceneBuildOptions const & | buildOptions | ||
| ) |
| void BuildMeshBlobJobs | ( | FSerializedMesh & | desc, |
| Vector< FBlobJob > & | blobJobs, | ||
| FImportedMesh const & | mesh, | ||
| FUUID | skeleton = kNilUUID |
||
| ) |
| FSkeleton BuildSkeletonFromSkin | ( | cgltf_data * | data, |
| cgltf_skin const * | skin, | ||
| Vector< uint16_t > & | outRemap, | ||
| Allocator * | alloc | ||
| ) |
| void BuildTextureBlobJobs | ( | FSerializedTexture & | desc, |
| Vector< FBlobJob > & | blobJobs, | ||
| FTexture && | texture | ||
| ) |
| uint32_t ByteGPUSceneBudget | ( | size_t | bytes, |
| size_t | minBytes, | ||
| size_t | alignment, | ||
| size_t | maxBytes = UINT32_MAX |
||
| ) |
| FBlobRef CommitPreparedBlob | ( | FBlobSerializer & | blobSerializer, |
| FPreparedBlob const & | blob | ||
| ) |
| void CommitPreparedBlobJobs | ( | FBlobSerializer & | blobSerializer, |
| Vector< FPreparedBlob > const & | preparedBlobs | ||
| ) |
| uint32_t CountGPUSceneBudget | ( | size_t | count | ) |
| void FinalizeSceneWriter | ( | FImportedScene & | scene | ) |
| size_t GetSceneJobGrain | ( | JobSystem const & | jobs, |
| size_t | count | ||
| ) |
| void LoadFSCN | ( | FImportedScene & | scene | ) |
| void LoadGLTF | ( | RHIApplication const & | app, |
| JobSystem * | jobs, | ||
| StringView | path, | ||
| FImportedScene & | scene, | ||
| Allocator * | scratchAlloc, | ||
| FSceneBuildOptions const & | buildOptions | ||
| ) |
| void LoadGLTFLineCurve | ( | const cgltf_primitive * | prim, |
| FImportedCurve & | curve, | ||
| Allocator * | scratchAlloc | ||
| ) |
| FImportedMesh LoadGLTFSubmesh | ( | const cgltf_primitive * | submesh, |
| Allocator * | scratchAlloc, | ||
| Vector< uint16_t > const * | jointRemap = nullptr |
||
| ) |
| Optional< FTexture > LoadGLTFTexture | ( | RHIApplication const & | app, |
| cgltf_texture * | texture, | ||
| StringView | scenePath, | ||
| Allocator * | scratchAlloc, | ||
| bool | gamma = false |
||
| ) |
| String LoadScene | ( | Foundation::RHI::RHIApplication const & | app, |
| JobSystem * | jobs, | ||
| StringView | path, | ||
| FImportedScene & | scene, | ||
| Allocator * | scratchAlloc = GLOBAL_ALLOC, |
||
| FSceneBuildOptions const & | buildOptions = FSceneBuildOptions{} |
||
| ) |
Loads a scene from a path, inferring format from extension. Returns the FSCN path that backs payload blob reads.
| Optional< FTexture > LoadTexture | ( | RHIApplication const & | app, |
| StringView | path, | ||
| Allocator * | scratchAlloc, | ||
| bool | gamma = false |
||
| ) |
| FAnimInterp MapAnimInterp | ( | cgltf_interpolation_type | interp | ) |
| bool MapAnimPath | ( | cgltf_animation_path_type | path, |
| FAnimPath & | out | ||
| ) |
| void PrepareBlobJob | ( | FBlobJob const & | job, |
| FPreparedBlob & | prepared | ||
| ) |
| uint32_t RingGPUSceneBudget | ( | size_t | count | ) |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |