MCPcopy Create free account
hub / github.com/carbonengine/trinity / Tr2ResourceSetDescriptionAL

Class Tr2ResourceSetDescriptionAL

trinityal/include/Tr2ResourceSetAL.h:44–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42
43
44class Tr2ResourceSetDescriptionAL
45{
46public:
47 static const uint32_t MAX_RESOURCES_IN_STAGE = 32;
48
49 Tr2ResourceSetDescriptionAL();
50 Tr2ResourceSetDescriptionAL( const Tr2ResourceSetDescriptionAL& );
51 Tr2ResourceSetDescriptionAL( Tr2ResourceSetDescriptionAL&& );
52 explicit Tr2ResourceSetDescriptionAL( const Tr2ShaderProgramAL& program );
53 explicit Tr2ResourceSetDescriptionAL( const Tr2RegisterMapAL& registers );
54 Tr2ResourceSetDescriptionAL& operator=( const Tr2ResourceSetDescriptionAL& other );
55 Tr2ResourceSetDescriptionAL& operator=( Tr2ResourceSetDescriptionAL&& other );
56
57 bool SetSrv( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex, const Tr2BufferAL& buffer );
58 bool SetSrv( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex, const Tr2TextureAL& texture, Tr2RenderContextEnum::ColorSpace colorSpace = Tr2RenderContextEnum::COLOR_SPACE_LINEAR );
59 bool SetUav( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex, const Tr2BufferAL& buffer );
60 bool SetUav( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex, const Tr2TextureAL& texture, uint32_t mip = 0 );
61 bool SetSrvHeapView( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex );
62 bool SetUavHeapView( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex );
63 bool SetSamplerHeapView( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex );
64 bool SetSampler( Tr2RenderContextEnum::ShaderType stage, uint32_t registerIndex, const Tr2SamplerStateAL& sampler );
65 void ClearResources();
66
67 uint32_t ComputeHash() const;
68
69 bool operator==( const Tr2ResourceSetDescriptionAL& other ) const;
70
71private:
72 struct Resource
73 {
74 enum Type
75 {
76 NONE,
77 BUFFER,
78 TEXTURE,
79 HEAP_VIEW,
80 };
81
82 Resource();
83
84 bool operator==( const Resource& other ) const;
85 bool Is( const Tr2BufferAL& other ) const;
86 bool Is( const Tr2TextureAL& other, Tr2RenderContextEnum::ColorSpace otherColorSpace ) const;
87 bool Is( const Tr2TextureAL& other, uint32_t otherMip ) const;
88 void UpdateHash( uint32_t& hash ) const;
89
90 Tr2TextureAL texture;
91 Tr2BufferAL buffer;
92 Type type;
93 union
94 {
95 Tr2RenderContextEnum::ColorSpace colorSpace;
96 uint32_t mip;
97 };
98 };
99
100 struct Sampler
101 {

Callers 2

ReadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected