Berserk
RHITexture.hpp
Go to the documentation of this file.
1 /**********************************************************************************/
2 /* This file is part of Berserk Engine project */
3 /* https://github.com/EgorOrachyov/Berserk */
4 /**********************************************************************************/
5 /* MIT License */
6 /* */
7 /* Copyright (c) 2018 - 2021 Egor Orachyov */
8 /* */
9 /* Permission is hereby granted, free of charge, to any person obtaining a copy */
10 /* of this software and associated documentation files (the "Software"), to deal */
11 /* in the Software without restriction, including without limitation the rights */
12 /* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13 /* copies of the Software, and to permit persons to whom the Software is */
14 /* furnished to do so, subject to the following conditions: */
15 /* */
16 /* The above copyright notice and this permission notice shall be included in all */
17 /* copies or substantial portions of the Software. */
18 /* */
19 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20 /* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21 /* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22 /* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23 /* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24 /* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25 /* SOFTWARE. */
26 /**********************************************************************************/
27 
28 #ifndef BERSERK_RHITEXTURE_HPP
29 #define BERSERK_RHITEXTURE_HPP
30 
31 #include <core/Config.hpp>
32 #include <core/Typedefs.hpp>
34 #include <core/templates/Mask.hpp>
35 #include <rhi/RHIResource.hpp>
36 
38 
58 };
59 
64 class RHITexture : public RHIResource {
65 public:
66  BRK_API ~RHITexture() override = default;
67 
69  const StringName &GetName() const { return mDesc.name; }
70 
72  uint32 GetWidth() const { return mDesc.width; }
73 
75  uint32 GetHeight() const { return mDesc.height; }
76 
78  uint32 GetDepth() const { return mDesc.depth; }
79 
81  uint32 GetMipsCount() const { return mDesc.mipsCount; }
82 
84  uint32 GetArraySlices() const { return mDesc.arraySlices; }
85 
88 
91 
94 
96  bool UsageShaderSampling() const {
98  }
99 
101  bool UsageColorAttachment() const {
103  }
104 
109  }
110 
112  const RHITextureDesc &GetDesc() const { return mDesc; }
113 
114 protected:
117 };
118 
124 
125 #endif//BERSERK_RHITEXTURE_HPP
#define BRK_NS_END
Definition: Config.hpp:48
#define BRK_API
Definition: Config.hpp:32
std::uint32_t uint32
Definition: Typedefs.hpp:44
bool Get(T v) const
Definition: Mask.hpp:69
Base class for RHI resource.
Definition: RHIResource.hpp:55
RHI Texture primitive.
Definition: RHITexture.hpp:64
uint32 GetHeight() const
Definition: RHITexture.hpp:75
bool UsageDepthStencilAttachment() const
Definition: RHITexture.hpp:106
const StringName & GetName() const
Definition: RHITexture.hpp:69
bool UsageColorAttachment() const
Definition: RHITexture.hpp:101
BRK_API ~RHITexture() override=default
RHITextureType GetTextureType() const
Definition: RHITexture.hpp:87
Mask< RHITextureUsage > GetTextureUsage() const
Definition: RHITexture.hpp:93
bool UsageShaderSampling() const
Definition: RHITexture.hpp:96
RHITextureFormat GetTextureFormat() const
Definition: RHITexture.hpp:90
uint32 GetArraySlices() const
Definition: RHITexture.hpp:84
uint32 GetWidth() const
Definition: RHITexture.hpp:72
uint32 GetDepth() const
Definition: RHITexture.hpp:78
uint32 GetMipsCount() const
Definition: RHITexture.hpp:81
RHITextureDesc mDesc
Definition: RHITexture.hpp:116
const RHITextureDesc & GetDesc() const
Definition: RHITexture.hpp:112
Cached shared utf-8 string id.
Definition: StringName.hpp:61
RHITextureFormat
Definition: RHIDefs.hpp:135
RHITextureType
Definition: RHIDefs.hpp:114
Definition: GLDevice.cpp:46
RHI Texture primitive descriptor.
Definition: RHITexture.hpp:48
RHITextureType textureType
Definition: RHITexture.hpp:55
uint32 arraySlices
Definition: RHITexture.hpp:54
uint32 width
Definition: RHITexture.hpp:50
uint32 mipsCount
Definition: RHITexture.hpp:53
uint32 depth
Definition: RHITexture.hpp:52
uint32 height
Definition: RHITexture.hpp:51
StringName name
Definition: RHITexture.hpp:49
Mask< RHITextureUsage > textureUsage
Definition: RHITexture.hpp:57
RHITextureFormat textureFormat
Definition: RHITexture.hpp:56