Nebula
Loading...
Searching...
No Matches
textureloader.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13//------------------------------------------------------------------------------
15#include "gliml.h"
16
17namespace CoreGraphics
18{
19
20struct TextureStreamData;
21
23{
25public:
29 virtual ~TextureLoader();
30
31private:
32
33 friend void FinishMips(TextureLoader* loader, TextureStreamData* streamData, uint mipBits, const CoreGraphics::TextureId texture, const char* name);
34
42 void Unload(const Resources::ResourceId id) override;
44 uint LodMask(const _StreamData& stream, float lod, bool async) const override;
45
47 void UpdateLoaderSyncState() override;
48
49
50 // First step of the load chain is to invoke a mip load on the main thread
59
60 // Then, we have to wait for the GPU to finish before we can issue a mip finish on the loader thread
69 Threading::CriticalSection handoverLock;
70
72};
73
74} // namespace CoreGraphics
ResourceLoader::ResourceInitOutput InitializeResource(const ResourceLoadJob &job, const Ptr< IO::Stream > &stream) override
load texture
Definition textureloader.cc:200
CoreGraphics::CmdBufferPoolId asyncHandoverPool
Definition textureloader.h:71
CoreGraphics::CmdBufferPoolId immediateHandoverPool
Definition textureloader.h:71
void UpdateLoaderSyncState() override
Update intermediate loaded state.
Definition textureloader.cc:525
friend void FinishMips(TextureLoader *loader, TextureStreamData *streamData, uint mipBits, const CoreGraphics::TextureId texture, const char *name)
CoreGraphics::CmdBufferPoolId asyncTransferPool
Definition textureloader.h:71
CoreGraphics::CmdBufferPoolId immediateTransferPool
Definition textureloader.h:71
ResourceLoader::ResourceInitOutput ReinitializeResource(const ResourceLoadJob &job, const Ptr< IO::Stream > &stream) override
load texture
Definition textureloader.cc:288
uint LodMask(const _StreamData &stream, float lod, bool async) const override
Create load mask based on LOD.
Definition textureloader.cc:551
Threading::SafeQueue< MipLoadMainThread > mipLoadsToSubmit
Definition textureloader.h:58
ResourceLoader::ResourceStreamOutput StreamResource(const ResourceLoadJob &job) override
Stream texture.
Definition textureloader.cc:378
Util::HashTable< Resources::ResourceId, Util::Array< MipHandoverLoaderThread > > mipHandovers
Definition textureloader.h:68
TextureLoader()
constructor
Definition textureloader.cc:160
void Unload(const Resources::ResourceId id) override
unload texture
Definition textureloader.cc:513
Threading::CriticalSection handoverLock
Definition textureloader.h:69
__DeclareClass(TextureLoader)
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Definition resourceloader.h:61
bool async
Definition resourceloader.h:314
Thread-safe version of Util::Queue.
Definition safequeue.h:27
Nebula's dynamic array class.
Definition array.h:61
Organizes key/value pairs by a hash code.
Definition hashtable.h:42
Acceleration structures are used to enable ray tracing on the GPU by dividing the scene into a BVH.
Definition accelerationstructure.h:24
Definition commandbuffer.h:176
Definition commandbuffer.h:103
texture type
Definition texture.h:25
uint64_t handoverSubmissionId
Definition textureloader.h:63
Util::Array< Memory::RangeAllocation > rangesToFree
Definition textureloader.h:65
CoreGraphics::CmdBufferId uploadBuffer
Definition textureloader.h:66
CoreGraphics::CmdBufferId receiveBuffer
Definition textureloader.h:66
uint bits
Definition textureloader.h:54
CoreGraphics::CmdBufferId graphicsCmdBuf
Definition textureloader.h:56
Resources::ResourceId id
Definition textureloader.h:53
CoreGraphics::CmdBufferId transferCmdBuf
Definition textureloader.h:56
Util::Array< Memory::RangeAllocation > rangesToFlush
Definition textureloader.h:55
Definition textureloader.cc:15
Definition resourceloader.h:142
Definition resourceloader.h:158
Definition resourceloader.h:182
unsigned int uint
Definition types.h:33