Plasma Engine  2.0
Loading...
Searching...
No Matches
ShaderResource.h
1#pragma once
2
3#include <Core/ResourceManager/Resource.h>
4#include <Foundation/Strings/HashedString.h>
5#include <RendererCore/RendererCoreDLL.h>
6
8
12
13class PL_RENDERERCORE_DLL plShaderResource : public plResource
14{
15 PL_ADD_DYNAMIC_REFLECTION(plShaderResource, plResource);
16 PL_RESOURCE_DECLARE_COMMON_CODE(plShaderResource);
17 PL_RESOURCE_DECLARE_CREATEABLE(plShaderResource, plShaderResourceDescriptor);
18
19public:
21
22 bool IsShaderValid() const { return m_bShaderResourceIsValid; }
23
24 plArrayPtr<const plHashedString> GetUsedPermutationVars() const { return m_PermutationVarsUsed; }
25
26private:
27 virtual plResourceLoadDesc UnloadData(Unload WhatToUnload) override;
28 virtual plResourceLoadDesc UpdateContent(plStreamReader* Stream) override;
29 virtual void UpdateMemoryUsage(MemoryUsage& out_NewMemoryUsage) override;
30
31private:
32 plHybridArray<plHashedString, 16> m_PermutationVarsUsed;
33 bool m_bShaderResourceIsValid;
34};
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
The base class for all resources.
Definition Resource.h:10
virtual plResourceLoadDesc UnloadData(Unload WhatToUnload)=0
Requests the resource to unload another quality level. If bFullUnload is true, the resource should un...
virtual plResourceLoadDesc UpdateContent(plStreamReader *pStream)=0
Called whenever more data for the resource is available. The resource must read the stream to update ...
virtual void UpdateMemoryUsage(MemoryUsage &out_NewMemoryUsage)=0
This function must be overridden by all resource types.
Definition ShaderResource.h:14
Interface for binary in (read) streams.
Definition Stream.h:22
Definition Resource.h:34
Describes in which loading state a resource currently is, and how many different quality levels there...
Definition Declarations.h:102
Definition ShaderResource.h:10