Nebula
Loading...
Searching...
No Matches
textureloader.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
13//------------------------------------------------------------------------------
15
16namespace CoreGraphics
17{
18
19struct TextureStreamData;
20
22{
24public:
28 virtual ~TextureLoader();
29
30private:
31
32 friend void FinishMips(TextureLoader* loader, TextureStreamData* streamData, uint mipBits, const CoreGraphics::TextureId texture, const char* name);
33
41 void Unload(const Resources::ResourceId id) override;
43 uint LodMask(const _StreamData& stream, float lod, bool async) const override;
44
46 void UpdateLoaderSyncState() override;
47
48
49 // First step of the load chain is to invoke a mip load on the main thread
58
59 // Then, we have to wait for the GPU to finish before we can issue a mip finish on the loader thread
68 Threading::CriticalSection handoverLock;
69
71};
72
73} // namespace CoreGraphics
ResourceLoader::ResourceInitOutput InitializeResource(const ResourceLoadJob &job, const Ptr< IO::Stream > &stream) override
load texture
Definition textureloader.cc:201
CoreGraphics::CmdBufferPoolId asyncHandoverPool
Definition textureloader.h:70
CoreGraphics::CmdBufferPoolId immediateHandoverPool
Definition textureloader.h:70
void UpdateLoaderSyncState() override
Update intermediate loaded state.
Definition textureloader.cc:526
friend void FinishMips(TextureLoader *loader, TextureStreamData *streamData, uint mipBits, const CoreGraphics::TextureId texture, const char *name)
CoreGraphics::CmdBufferPoolId asyncTransferPool
Definition textureloader.h:70
CoreGraphics::CmdBufferPoolId immediateTransferPool
Definition textureloader.h:70
ResourceLoader::ResourceInitOutput ReinitializeResource(const ResourceLoadJob &job, const Ptr< IO::Stream > &stream) override
load texture
Definition textureloader.cc:289
uint LodMask(const _StreamData &stream, float lod, bool async) const override
Create load mask based on LOD.
Definition textureloader.cc:552
Threading::SafeQueue< MipLoadMainThread > mipLoadsToSubmit
Definition textureloader.h:57
ResourceLoader::ResourceStreamOutput StreamResource(const ResourceLoadJob &job) override
Stream texture.
Definition textureloader.cc:379
Util::HashTable< Resources::ResourceId, Util::Array< MipHandoverLoaderThread > > mipHandovers
Definition textureloader.h:67
TextureLoader()
constructor
Definition textureloader.cc:161
void Unload(const Resources::ResourceId id) override
unload texture
Definition textureloader.cc:514
Threading::CriticalSection handoverLock
Definition textureloader.h:68
__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:62
Util::Array< Memory::RangeAllocation > rangesToFree
Definition textureloader.h:64
CoreGraphics::CmdBufferId uploadBuffer
Definition textureloader.h:65
CoreGraphics::CmdBufferId receiveBuffer
Definition textureloader.h:65
uint bits
Definition textureloader.h:53
CoreGraphics::CmdBufferId graphicsCmdBuf
Definition textureloader.h:55
Resources::ResourceId id
Definition textureloader.h:52
CoreGraphics::CmdBufferId transferCmdBuf
Definition textureloader.h:55
Util::Array< Memory::RangeAllocation > rangesToFlush
Definition textureloader.h:54
Definition textureloader.cc:16
Definition resourceloader.h:142
Definition resourceloader.h:158
Definition resourceloader.h:182
unsigned int uint
Definition types.h:33