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
40 void Unload(const Resources::ResourceId id) override;
42 uint LodMask(const _StreamData& stream, float lod, bool async) const override;
43
45 void UpdateLoaderSyncState() override;
46
47
48 // First step of the load chain is to invoke a mip load on the main thread
57
58 // Then, we have to wait for the GPU to finish before we can issue a mip finish on the loader thread
68
70};
71
72} // namespace CoreGraphics
Definition textureloader.h:23
ResourceLoader::ResourceInitOutput InitializeResource(const ResourceLoadJob &job, const Ptr< IO::Stream > &stream) override
load texture
Definition textureloader.cc:195
CoreGraphics::CmdBufferPoolId asyncHandoverPool
Definition textureloader.h:69
CoreGraphics::CmdBufferPoolId immediateHandoverPool
Definition textureloader.h:69
void UpdateLoaderSyncState() override
Update intermediate loaded state.
Definition textureloader.cc:427
friend void FinishMips(TextureLoader *loader, TextureStreamData *streamData, uint mipBits, const CoreGraphics::TextureId texture, const char *name)
CoreGraphics::CmdBufferPoolId asyncTransferPool
Definition textureloader.h:69
CoreGraphics::CmdBufferPoolId immediateTransferPool
Definition textureloader.h:69
virtual ~TextureLoader()
destructor
Definition textureloader.cc:182
uint LodMask(const _StreamData &stream, float lod, bool async) const override
Create load mask based on LOD.
Definition textureloader.cc:453
Threading::SafeQueue< MipLoadMainThread > mipLoadsToSubmit
Definition textureloader.h:56
ResourceLoader::ResourceStreamOutput StreamResource(const ResourceLoadJob &job) override
Stream texture.
Definition textureloader.cc:278
Util::HashTable< Resources::ResourceId, Util::Array< MipHandoverLoaderThread > > mipHandovers
Definition textureloader.h:66
TextureLoader()
constructor
Definition textureloader.cc:160
void Unload(const Resources::ResourceId id) override
unload texture
Definition textureloader.cc:414
Threading::CriticalSection handoverLock
Definition textureloader.h:67
__DeclareClass(TextureLoader)
Nebula's smart pointer class which manages the life time of RefCounted objects.
Definition ptr.h:38
Definition resourceloader.h:60
bool async
Definition resourceloader.h:291
Critical section objects are used to protect a portion of code from parallel execution.
Thread-safe version of Util::Queue.
Definition safequeue.h:27
Nebula's dynamic array class.
Definition array.h:60
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:155
Definition commandbuffer.h:101
texture type
Definition texture.h:25
uint64 handoverSubmissionId
Definition textureloader.h:61
Util::Array< Memory::RangeAllocation > rangesToFree
Definition textureloader.h:63
CoreGraphics::CmdBufferId uploadBuffer
Definition textureloader.h:64
CoreGraphics::CmdBufferId receiveBuffer
Definition textureloader.h:64
uint bits
Definition textureloader.h:52
CoreGraphics::CmdBufferId graphicsCmdBuf
Definition textureloader.h:54
Resources::ResourceId id
Definition textureloader.h:51
CoreGraphics::CmdBufferId transferCmdBuf
Definition textureloader.h:54
Util::Array< Memory::RangeAllocation > rangesToFlush
Definition textureloader.h:53
Definition textureloader.cc:15
Definition resourceloader.h:134
Definition resourceloader.h:140
Definition resourceloader.h:164
unsigned int uint
Definition types.h:31
uint64_t uint64
Definition types.h:36