Diligent Engine  v.2.4.g
TextureBase.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
32 
33 #include <memory>
34 
35 #include "Texture.h"
36 #include "GraphicsTypes.h"
37 #include "DeviceObjectBase.hpp"
38 #include "GraphicsAccessories.hpp"
39 #include "STDAllocator.hpp"
40 #include "FormatString.hpp"
41 
42 namespace Diligent
43 {
44 
45 struct CopyTextureAttribs;
46 
48 void ValidateTextureDesc(const TextureDesc& TexDesc) noexcept(false);
49 
51 void ValidatedAndCorrectTextureViewDesc(const TextureDesc& TexDesc, TextureViewDesc& ViewDesc) noexcept(false);
52 
54 void ValidateUpdateTextureParams(const TextureDesc& TexDesc, Uint32 MipLevel, Uint32 Slice, const Box& DstBox, const TextureSubResData& SubresData);
55 
57 void ValidateCopyTextureParams(const CopyTextureAttribs& CopyAttribs);
58 
60 void ValidateMapTextureParams(const TextureDesc& TexDesc,
61  Uint32 MipLevel,
62  Uint32 ArraySlice,
63  MAP_TYPE MapType,
64  Uint32 MapFlags,
65  const Box* pMapRegion);
66 
68 
70 template <typename EngineImplTraits>
71 class TextureBase : public DeviceObjectBase<typename EngineImplTraits::TextureInterface, typename EngineImplTraits::RenderDeviceImplType, TextureDesc>
72 {
73 public:
74  // Base interface this class inherits (ITextureD3D12, ITextureVk, etc.)
75  using BaseInterface = typename EngineImplTraits::TextureInterface;
76 
77  // Render device implementation type (RenderDeviceD3D12Impl, RenderDeviceVkImpl, etc.).
78  using RenderDeviceImplType = typename EngineImplTraits::RenderDeviceImplType;
79 
80  // Texture view implementation type (TextureViewD3D12Impl, TextureViewVkImpl, etc.).
81  using TextureViewImplType = typename EngineImplTraits::TextureViewImplType;
82 
83  // Type of the texture view object allocator.
84  using TexViewObjAllocatorType = typename EngineImplTraits::TexViewObjAllocatorType;
85 
87 
96  TexViewObjAllocatorType& TexViewObjAllocator,
97  RenderDeviceImplType* pDevice,
98  const TextureDesc& Desc,
99  bool bIsDeviceInternal = false) :
100  TDeviceObjectBase(pRefCounters, pDevice, Desc, bIsDeviceInternal),
101 #ifdef DILIGENT_DEBUG
102  m_dbgTexViewObjAllocator(TexViewObjAllocator),
103 #endif
106  m_pDefaultDSV{nullptr, STDDeleter<TextureViewImplType, TexViewObjAllocatorType>(TexViewObjAllocator)},
107  m_pDefaultUAV{nullptr, STDDeleter<TextureViewImplType, TexViewObjAllocatorType>(TexViewObjAllocator)}
108  {
109  if (this->m_Desc.MipLevels == 0)
110  {
111  // Compute the number of levels in the full mipmap chain
112  if (this->m_Desc.Type == RESOURCE_DIM_TEX_1D ||
113  this->m_Desc.Type == RESOURCE_DIM_TEX_1D_ARRAY)
114  {
116  }
117  else if (this->m_Desc.Type == RESOURCE_DIM_TEX_2D ||
118  this->m_Desc.Type == RESOURCE_DIM_TEX_2D_ARRAY ||
119  this->m_Desc.Type == RESOURCE_DIM_TEX_CUBE ||
120  this->m_Desc.Type == RESOURCE_DIM_TEX_CUBE_ARRAY)
121  {
122  this->m_Desc.MipLevels = ComputeMipLevelsCount(this->m_Desc.Width, this->m_Desc.Height);
123  }
124  else if (this->m_Desc.Type == RESOURCE_DIM_TEX_3D)
125  {
126  this->m_Desc.MipLevels = ComputeMipLevelsCount(this->m_Desc.Width, this->m_Desc.Height, this->m_Desc.Depth);
127  }
128  else
129  {
130  UNEXPECTED("Unknown texture type");
131  }
132  }
133 
134  Uint64 DeviceQueuesMask = pDevice->GetCommandQueueMask();
135  DEV_CHECK_ERR((this->m_Desc.CommandQueueMask & DeviceQueuesMask) != 0,
136  "No bits in the command queue mask (0x", std::hex, this->m_Desc.CommandQueueMask,
137  ") correspond to one of ", pDevice->GetCommandQueueCount(), " available device command queues");
138  this->m_Desc.CommandQueueMask &= DeviceQueuesMask;
139 
140  if ((this->m_Desc.BindFlags & BIND_INPUT_ATTACHMENT) != 0)
142 
143  // Validate correctness of texture description
145  }
146 
148 
149 
150  virtual void DILIGENT_CALL_TYPE CreateView(const struct TextureViewDesc& ViewDesc, ITextureView** ppView) override
152  {
153  DEV_CHECK_ERR(ViewDesc.ViewType != TEXTURE_VIEW_UNDEFINED, "Texture view type is not specified");
154  if (ViewDesc.ViewType == TEXTURE_VIEW_SHADER_RESOURCE)
155  DEV_CHECK_ERR(this->m_Desc.BindFlags & BIND_SHADER_RESOURCE, "Attempting to create SRV for texture '", this->m_Desc.Name, "' that was not created with BIND_SHADER_RESOURCE flag.");
156  else if (ViewDesc.ViewType == TEXTURE_VIEW_UNORDERED_ACCESS)
157  DEV_CHECK_ERR(this->m_Desc.BindFlags & BIND_UNORDERED_ACCESS, "Attempting to create UAV for texture '", this->m_Desc.Name, "' that was not created with BIND_UNORDERED_ACCESS flag.");
158  else if (ViewDesc.ViewType == TEXTURE_VIEW_RENDER_TARGET)
159  DEV_CHECK_ERR(this->m_Desc.BindFlags & BIND_RENDER_TARGET, "Attempting to create RTV for texture '", this->m_Desc.Name, "' that was not created with BIND_RENDER_TARGET flag.");
160  else if (ViewDesc.ViewType == TEXTURE_VIEW_DEPTH_STENCIL)
161  DEV_CHECK_ERR(this->m_Desc.BindFlags & BIND_DEPTH_STENCIL, "Attempting to create DSV for texture '", this->m_Desc.Name, "' that was not created with BIND_DEPTH_STENCIL flag.");
162  else
163  UNEXPECTED("Unexpected texture view type.");
164 
165  CreateViewInternal(ViewDesc, ppView, false);
166  }
167 
169 
178  {
179  const auto& TexFmtAttribs = GetTextureFormatAttribs(this->m_Desc.Format);
180  if (TexFmtAttribs.ComponentType == COMPONENT_TYPE_UNDEFINED)
181  {
182  // Cannot create default view for TYPELESS formats
183  return;
184  }
185 
186  auto CreateDefaultView = [&](TEXTURE_VIEW_TYPE ViewType) //
187  {
188  TextureViewDesc ViewDesc;
189  ViewDesc.ViewType = ViewType;
190 
191  std::string ViewName;
192  switch (ViewType)
193  {
197  ViewName = "Default SRV of texture '";
198  break;
199 
201  ViewName = "Default RTV of texture '";
202  break;
203 
205  ViewName = "Default DSV of texture '";
206  break;
207 
210 
211  ViewName = "Default UAV of texture '";
212  break;
213 
214  default:
215  UNEXPECTED("Unexpected texture type");
216  }
217  ViewName += this->m_Desc.Name;
218  ViewName += '\'';
219  ViewDesc.Name = ViewName.c_str();
220 
221  ITextureView* pView = nullptr;
222  CreateViewInternal(ViewDesc, &pView, true);
223  VERIFY(pView != nullptr, "Failed to create default view for texture '", this->m_Desc.Name, "'.");
224  VERIFY(pView->GetDesc().ViewType == ViewType, "Unexpected view type.");
225 
226  return static_cast<TextureViewImplType*>(pView);
227  };
228 
230  {
231  m_pDefaultSRV.reset(CreateDefaultView(TEXTURE_VIEW_SHADER_RESOURCE));
232  }
233 
234  if (this->m_Desc.BindFlags & BIND_RENDER_TARGET)
235  {
236  m_pDefaultRTV.reset(CreateDefaultView(TEXTURE_VIEW_RENDER_TARGET));
237  }
238 
239  if (this->m_Desc.BindFlags & BIND_DEPTH_STENCIL)
240  {
241  m_pDefaultDSV.reset(CreateDefaultView(TEXTURE_VIEW_DEPTH_STENCIL));
242  }
243 
245  {
246  m_pDefaultUAV.reset(CreateDefaultView(TEXTURE_VIEW_UNORDERED_ACCESS));
247  }
248  }
249 
250  virtual void DILIGENT_CALL_TYPE SetState(RESOURCE_STATE State) override final
251  {
252  this->m_State = State;
253  }
254 
255  virtual RESOURCE_STATE DILIGENT_CALL_TYPE GetState() const override final
256  {
257  return this->m_State;
258  }
259 
260  bool IsInKnownState() const
261  {
262  return this->m_State != RESOURCE_STATE_UNKNOWN;
263  }
264 
265  bool CheckState(RESOURCE_STATE State) const
266  {
267  VERIFY((State & (State - 1)) == 0, "Single state is expected");
268  VERIFY(IsInKnownState(), "Texture state is unknown");
269  return (this->m_State & State) == State;
270  }
271 
272  bool CheckAnyState(RESOURCE_STATE States) const
273  {
274  VERIFY(IsInKnownState(), "Texture state is unknown");
275  return (this->m_State & States) != 0;
276  }
277 
280  {
281  switch (ViewType)
282  {
283  // clang-format off
284  case TEXTURE_VIEW_SHADER_RESOURCE: return m_pDefaultSRV.get();
285  case TEXTURE_VIEW_RENDER_TARGET: return m_pDefaultRTV.get();
286  case TEXTURE_VIEW_DEPTH_STENCIL: return m_pDefaultDSV.get();
287  case TEXTURE_VIEW_UNORDERED_ACCESS: return m_pDefaultUAV.get();
288  // clang-format on
289  default: UNEXPECTED("Unknown view type"); return nullptr;
290  }
291  }
292 
293 protected:
295  virtual void CreateViewInternal(const struct TextureViewDesc& ViewDesc, ITextureView** ppView, bool bIsDefaultView) = 0;
296 
297 #ifdef DILIGENT_DEBUG
298  TexViewObjAllocatorType& m_dbgTexViewObjAllocator;
299 #endif
300  // WARNING! We cannot use ITextureView here, because ITextureView has no virtual dtor!
302  std::unique_ptr<TextureViewImplType, STDDeleter<TextureViewImplType, TexViewObjAllocatorType>> m_pDefaultSRV;
304  std::unique_ptr<TextureViewImplType, STDDeleter<TextureViewImplType, TexViewObjAllocatorType>> m_pDefaultRTV;
306  std::unique_ptr<TextureViewImplType, STDDeleter<TextureViewImplType, TexViewObjAllocatorType>> m_pDefaultDSV;
308  std::unique_ptr<TextureViewImplType, STDDeleter<TextureViewImplType, TexViewObjAllocatorType>> m_pDefaultUAV;
309 
311 };
312 
313 } // namespace Diligent
Diligent::RESOURCE_DIM_TEX_3D
@ RESOURCE_DIM_TEX_3D
Three-dimensional texture.
Definition: GraphicsTypes.h:264
Diligent::TEXTURE_VIEW_RENDER_TARGET
@ TEXTURE_VIEW_RENDER_TARGET
A texture view will define a render target view that will be used as the target for rendering operati...
Definition: GraphicsTypes.h:285
Texture.h
Diligent::RESOURCE_DIM_TEX_1D
@ RESOURCE_DIM_TEX_1D
One-dimensional texture.
Definition: GraphicsTypes.h:260
Diligent::RESOURCE_DIM_TEX_1D_ARRAY
@ RESOURCE_DIM_TEX_1D_ARRAY
One-dimensional texture array.
Definition: GraphicsTypes.h:261
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
GraphicsAccessories.hpp
Diligent::RESOURCE_DIM_TEX_2D_ARRAY
@ RESOURCE_DIM_TEX_2D_ARRAY
Two-dimensional texture array.
Definition: GraphicsTypes.h:263
Diligent::TextureDesc
struct TextureDesc TextureDesc
Definition: Texture.h:162
Diligent::TextureBase::CreateDefaultViews
void CreateDefaultViews()
Creates default texture views.
Definition: TextureBase.hpp:177
Diligent::UAV_ACCESS_FLAG_READ_WRITE
@ UAV_ACCESS_FLAG_READ_WRITE
Allow read and write operations on the UAV.
Definition: TextureView.h:61
Diligent::TextureDesc::Format
TEXTURE_FORMAT Format
Texture format, see Diligent::TEXTURE_FORMAT.
Definition: Texture.h:68
Diligent::BIND_UNORDERED_ACCESS
@ BIND_UNORDERED_ACCESS
A buffer or a texture can be bound as an unordered access view.
Definition: GraphicsTypes.h:127
DeviceObjectBase.hpp
Diligent::BIND_INPUT_ATTACHMENT
@ BIND_INPUT_ATTACHMENT
A texture can be used as render pass input attachment.
Definition: GraphicsTypes.h:129
Diligent::TextureBase::IsInKnownState
bool IsInKnownState() const
Definition: TextureBase.hpp:260
Diligent::TextureBase::m_State
RESOURCE_STATE m_State
Definition: TextureBase.hpp:310
Diligent::TextureBase::m_pDefaultDSV
std::unique_ptr< TextureViewImplType, STDDeleter< TextureViewImplType, TexViewObjAllocatorType > > m_pDefaultDSV
Default DSV addressing the most detailed mip level.
Definition: TextureBase.hpp:306
Diligent::TextureBase::m_pDefaultSRV
std::unique_ptr< TextureViewImplType, STDDeleter< TextureViewImplType, TexViewObjAllocatorType > > m_pDefaultSRV
Default SRV addressing the entire texture.
Definition: TextureBase.hpp:302
Diligent::ComputeMipLevelsCount
Uint32 ComputeMipLevelsCount(Uint32 Width)
Definition: GraphicsAccessories.cpp:1252
STDAllocator.hpp
Diligent::Uint64
uint64_t Uint64
64-bit unsigned integer
Definition: BasicTypes.h:50
Diligent::ITextureView::GetDesc
virtual const TextureViewDesc &METHOD() GetDesc() const override=0
Returns the texture view description used to create the object.
Diligent::TextureBase::GetDefaultView
virtual ITextureView * GetDefaultView(TEXTURE_VIEW_TYPE ViewType) override
Implementation of ITexture::GetDefaultView().
Definition: TextureBase.hpp:279
UNEXPECTED
#define UNEXPECTED(...)
Definition: DebugUtilities.hpp:77
Diligent::TextureBase::CheckAnyState
bool CheckAnyState(RESOURCE_STATE States) const
Definition: TextureBase.hpp:272
Diligent::TextureDesc::MiscFlags
MISC_TEXTURE_FLAGS MiscFlags
Miscellaneous flags, see Diligent::MISC_TEXTURE_FLAGS for details.
Definition: Texture.h:93
Diligent::ValidateTextureDesc
void ValidateTextureDesc(const TextureDesc &TexDesc) noexcept(false)
Validates texture description and throws an exception in case of an error.
Definition: TextureBase.cpp:38
Diligent::TextureBase::m_pDefaultRTV
std::unique_ptr< TextureViewImplType, STDDeleter< TextureViewImplType, TexViewObjAllocatorType > > m_pDefaultRTV
Default RTV addressing the most detailed mip level.
Definition: TextureBase.hpp:304
Diligent::TEXTURE_VIEW_UNORDERED_ACCESS
@ TEXTURE_VIEW_UNORDERED_ACCESS
A texture view will define an unordered access view that will be used for unordered read/write operat...
Definition: GraphicsTypes.h:293
Diligent::DeviceObjectBase< EngineImplTraits::TextureInterface, EngineImplTraits::RenderDeviceImplType, TextureDesc >::m_Desc
TextureDesc m_Desc
Object description.
Definition: DeviceObjectBase.hpp:182
Diligent::ITextureView
Texture view interface.
Definition: TextureView.h:202
Diligent::TextureBase::m_pDefaultUAV
std::unique_ptr< TextureViewImplType, STDDeleter< TextureViewImplType, TexViewObjAllocatorType > > m_pDefaultUAV
Default UAV addressing the entire texture.
Definition: TextureBase.hpp:308
Diligent::TextureViewDesc::AccessFlags
UAV_ACCESS_FLAG AccessFlags
For an unordered access view, allowed access flags. See Diligent::UAV_ACCESS_FLAG for details.
Definition: TextureView.h:128
DEV_CHECK_ERR
#define DEV_CHECK_ERR(...)
Definition: DebugUtilities.hpp:90
Diligent::RESOURCE_DIM_TEX_CUBE_ARRAY
@ RESOURCE_DIM_TEX_CUBE_ARRAY
Cube-map array texture.
Definition: GraphicsTypes.h:266
Diligent::TEXTURE_VIEW_TYPE
TEXTURE_VIEW_TYPE
Texture view type.
Definition: GraphicsTypes.h:274
Diligent::ValidateMapTextureParams
void ValidateMapTextureParams(const TextureDesc &TexDesc, Uint32 MipLevel, Uint32 ArraySlice, MAP_TYPE MapType, Uint32 MapFlags, const Box *pMapRegion)
Validates map texture command paramters.
Definition: TextureBase.cpp:291
Diligent::ValidatedAndCorrectTextureViewDesc
void ValidatedAndCorrectTextureViewDesc(const TextureDesc &TexDesc, TextureViewDesc &ViewDesc) noexcept(false)
Validates and corrects texture view description; throws an exception in case of an error.
Definition: TextureBase.cpp:317
Diligent::TextureBase::CreateView
virtual void CreateView(const struct TextureViewDesc &ViewDesc, ITextureView **ppView) override
Implementaiton of ITexture::CreateView(); calls CreateViewInternal() virtual function that creates te...
Definition: TextureBase.hpp:151
Diligent::TextureBase::CreateViewInternal
virtual void CreateViewInternal(const struct TextureViewDesc &ViewDesc, ITextureView **ppView, bool bIsDefaultView)=0
Pure virtual function that creates texture view for the specific engine implementation.
Diligent::ValidateUpdateTextureParams
void ValidateUpdateTextureParams(const TextureDesc &TexDesc, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData)
Validates update texture command paramters.
Definition: TextureBase.cpp:226
Diligent::TextureViewDesc::ViewType
TEXTURE_VIEW_TYPE ViewType
Describes the texture view type, see Diligent::TEXTURE_VIEW_TYPE for details.
Definition: TextureView.h:83
Diligent::TextureDesc
Texture description.
Definition: Texture.h:47
Diligent::RESOURCE_DIM_TEX_CUBE
@ RESOURCE_DIM_TEX_CUBE
Cube-map texture.
Definition: GraphicsTypes.h:265
Diligent::TextureBase::TextureBase
TextureBase(IReferenceCounters *pRefCounters, TexViewObjAllocatorType &TexViewObjAllocator, RenderDeviceImplType *pDevice, const TextureDesc &Desc, bool bIsDeviceInternal=false)
Definition: TextureBase.hpp:95
Diligent::Box
struct Box Box
Definition: GraphicsTypes.h:2440
Diligent::TextureDesc::Width
Uint32 Width
Texture width, in pixels.
Definition: Texture.h:53
IMPLEMENT_QUERY_INTERFACE_IN_PLACE
#define IMPLEMENT_QUERY_INTERFACE_IN_PLACE(InterfaceID, ParentClassName)
Definition: ObjectBase.hpp:59
Diligent::TextureViewDesc::Flags
TEXTURE_VIEW_FLAGS Flags
Texture view flags, see Diligent::TEXTURE_VIEW_FLAGS.
Definition: TextureView.h:131
Diligent::MISC_TEXTURE_FLAG_GENERATE_MIPS
@ MISC_TEXTURE_FLAG_GENERATE_MIPS
Allow automatic mipmap generation with ITextureView::GenerateMips()
Definition: GraphicsTypes.h:982
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Diligent::TextureViewDesc
struct TextureViewDesc TextureViewDesc
Definition: TextureView.h:183
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::TextureDesc::MipLevels
Uint32 MipLevels
Number of Mip levels in the texture. Multisampled textures can only have 1 Mip level....
Definition: Texture.h:72
Diligent::TextureBase
Base implementation of the ITexture interface.
Definition: TextureBase.hpp:71
FormatString.hpp
Diligent::RESOURCE_STATE_UNKNOWN
@ RESOURCE_STATE_UNKNOWN
The resource state is not known to the engine and is managed by the application.
Definition: GraphicsTypes.h:2817
Diligent::TEXTURE_VIEW_FLAG_ALLOW_MIP_MAP_GENERATION
@ TEXTURE_VIEW_FLAG_ALLOW_MIP_MAP_GENERATION
Allow automatic mipmap generation for this view. This flag is only allowed for TEXTURE_VIEW_SHADER_RE...
Definition: TextureView.h:74
Diligent::TextureBase::CheckState
bool CheckState(RESOURCE_STATE State) const
Definition: TextureBase.hpp:265
Diligent::STDDeleter
Definition: STDAllocator.hpp:182
Diligent::RESOURCE_DIM_TEX_2D
@ RESOURCE_DIM_TEX_2D
Two-dimensional texture.
Definition: GraphicsTypes.h:262
Diligent::CopyTextureAttribs
struct CopyTextureAttribs CopyTextureAttribs
Definition: DeviceContext.h:725
Diligent::TextureDesc::BindFlags
BIND_FLAGS BindFlags
Bind flags, see Diligent::BIND_FLAGS for details. The following bind flags are allowed: Diligent::BI...
Definition: Texture.h:86
Diligent::TextureBase< EngineGLImplTraits >::TexViewObjAllocatorType
typename EngineGLImplTraits ::TexViewObjAllocatorType TexViewObjAllocatorType
Definition: TextureBase.hpp:84
Diligent::BIND_DEPTH_STENCIL
@ BIND_DEPTH_STENCIL
A texture can be bound as a depth-stencil target.
Definition: GraphicsTypes.h:126
Diligent::TEXTURE_VIEW_DEPTH_STENCIL
@ TEXTURE_VIEW_DEPTH_STENCIL
A texture view will define a depth stencil view that will be used as the target for rendering operati...
Definition: GraphicsTypes.h:289
Diligent::TextureBase< EngineGLImplTraits >::TextureViewImplType
typename EngineGLImplTraits ::TextureViewImplType TextureViewImplType
Definition: TextureBase.hpp:81
Diligent::COMPONENT_TYPE_UNDEFINED
@ COMPONENT_TYPE_UNDEFINED
Undefined component type.
Definition: GraphicsTypes.h:2447
Diligent::ValidateCopyTextureParams
void ValidateCopyTextureParams(const CopyTextureAttribs &CopyAttribs)
Validates copy texture command paramters.
Definition: TextureBase.cpp:264
Diligent::TextureBase::SetState
virtual void SetState(RESOURCE_STATE State) override final
Definition: TextureBase.hpp:250
GraphicsTypes.h
Diligent::TextureBase< EngineGLImplTraits >::RenderDeviceImplType
typename EngineGLImplTraits ::RenderDeviceImplType RenderDeviceImplType
Definition: TextureBase.hpp:78
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Diligent::TextureDesc::CommandQueueMask
Uint64 CommandQueueMask
Defines which command queues this texture can be used with.
Definition: Texture.h:99
Diligent::BIND_RENDER_TARGET
@ BIND_RENDER_TARGET
A texture can be bound as a render target.
Definition: GraphicsTypes.h:125
Diligent::TextureBase::TDeviceObjectBase
DeviceObjectBase< BaseInterface, RenderDeviceImplType, TextureDesc > TDeviceObjectBase
Definition: TextureBase.hpp:86
Diligent::RESOURCE_STATE
RESOURCE_STATE
Resource usage state.
Definition: GraphicsTypes.h:2814
Diligent::TextureDesc::Type
RESOURCE_DIMENSION Type
Texture type. See Diligent::RESOURCE_DIMENSION for details.
Definition: Texture.h:50
Diligent::MAP_TYPE
MAP_TYPE
Resource mapping type.
Definition: GraphicsTypes.h:206
Diligent::TextureSubResData
struct TextureSubResData TextureSubResData
Definition: Texture.h:218
Diligent::TextureViewDesc
Texture view description.
Definition: TextureView.h:80
Diligent::TEXTURE_VIEW_UNDEFINED
@ TEXTURE_VIEW_UNDEFINED
Undefined view type.
Definition: GraphicsTypes.h:277
Diligent::GetTextureFormatAttribs
const TextureFormatAttribs & GetTextureFormatAttribs(TEXTURE_FORMAT Format)
Returns invariant texture format attributes, see TextureFormatAttribs for details.
Definition: GraphicsAccessories.cpp:250
Diligent::TextureBase< EngineGLImplTraits >::BaseInterface
typename EngineGLImplTraits ::TextureInterface BaseInterface
Definition: TextureBase.hpp:75
Diligent::TEXTURE_VIEW_SHADER_RESOURCE
@ TEXTURE_VIEW_SHADER_RESOURCE
A texture view will define a shader resource view that will be used as the source for the shader read...
Definition: GraphicsTypes.h:281
Diligent::DeviceObjectAttribs::Name
const Char * Name
Object name.
Definition: GraphicsTypes.h:1199
Diligent::TextureBase::GetState
virtual RESOURCE_STATE GetState() const override final
Definition: TextureBase.hpp:255
Diligent::DeviceObjectBase
Template class implementing base functionality of the device object.
Definition: DeviceObjectBase.hpp:45
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::BIND_SHADER_RESOURCE
@ BIND_SHADER_RESOURCE
A buffer or a texture can be bound as a shader resource.
Definition: GraphicsTypes.h:122