| 42 | |
| 43 | |
| 44 | class Tr2ResourceSetDescriptionAL |
| 45 | { |
| 46 | public: |
| 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 | |
| 71 | private: |
| 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 | { |
no outgoing calls
no test coverage detected