Diligent Engine  v.2.4.g
TextureViewD3D12Impl.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 
34 #include "TextureViewBase.hpp"
35 #include "DescriptorHeap.hpp"
36 
37 namespace Diligent
38 {
39 
41 class TextureViewD3D12Impl final : public TextureViewBase<EngineD3D12ImplTraits>
42 {
43 public:
45 
47  RenderDeviceD3D12Impl* pDevice,
48  const TextureViewDesc& ViewDesc,
49  ITexture* pTexture,
50  DescriptorHeapAllocation&& Descriptor,
51  DescriptorHeapAllocation&& TexArraySRVDescriptor,
52  DescriptorHeapAllocation&& MipLevelUAVDescriptors,
53  bool bIsDefaultView);
55 
57 
58 
59  virtual D3D12_CPU_DESCRIPTOR_HANDLE DILIGENT_CALL_TYPE GetCPUDescriptorHandle() override final
60  {
61  return m_Descriptor.GetCpuHandle();
62  }
63 
64  D3D12_CPU_DESCRIPTOR_HANDLE GetMipLevelUAV(Uint32 Mip)
65  {
68  }
69 
70  D3D12_CPU_DESCRIPTOR_HANDLE GetTexArraySRV()
71  {
74  }
75 
76 protected:
79 
80  // Extra descriptors used for mipmap generation
81  // [0] == texture array SRV used for mipmap generation
82  // [1] == mip level UAVs used for mipmap generation
84 };
85 
86 } // namespace Diligent
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
DescriptorHeap.hpp
Diligent::TextureViewD3D12Impl
Texture view object implementation in Direct3D12 backend.
Definition: TextureViewD3D12Impl.hpp:41
Diligent::TextureViewD3D12Impl::GetMipLevelUAV
D3D12_CPU_DESCRIPTOR_HANDLE GetMipLevelUAV(Uint32 Mip)
Definition: TextureViewD3D12Impl.hpp:64
Diligent::TextureViewDesc::NumMipLevels
Uint32 NumMipLevels
Total number of mip levels for the view of the texture. Render target and depth stencil views can add...
Definition: TextureView.h:104
Diligent::TextureViewD3D12Impl::TextureViewD3D12Impl
TextureViewD3D12Impl(IReferenceCounters *pRefCounters, RenderDeviceD3D12Impl *pDevice, const TextureViewDesc &ViewDesc, ITexture *pTexture, DescriptorHeapAllocation &&Descriptor, DescriptorHeapAllocation &&TexArraySRVDescriptor, DescriptorHeapAllocation &&MipLevelUAVDescriptors, bool bIsDefaultView)
Definition: TextureViewD3D12Impl.cpp:37
Diligent::DeviceObjectBase< EngineD3D12ImplTraits ::TextureViewInterface, EngineD3D12ImplTraits ::RenderDeviceImplType, TextureViewDesc >::m_Desc
TextureViewDesc m_Desc
Object description.
Definition: DeviceObjectBase.hpp:182
Diligent::TextureViewD3D12Impl::GetCPUDescriptorHandle
virtual D3D12_CPU_DESCRIPTOR_HANDLE GetCPUDescriptorHandle() override final
Implementation of ITextureViewD3D12::GetCPUDescriptorHandle().
Definition: TextureViewD3D12Impl.hpp:59
Diligent::TextureViewD3D12Impl::GetTexArraySRV
D3D12_CPU_DESCRIPTOR_HANDLE GetTexArraySRV()
Definition: TextureViewD3D12Impl.hpp:70
TextureViewBase.hpp
Diligent::RenderDeviceD3D12Impl
Render device implementation in Direct3D12 backend.
Definition: RenderDeviceD3D12Impl.hpp:70
Diligent::TextureViewD3D12Impl::~TextureViewD3D12Impl
~TextureViewD3D12Impl()
Definition: TextureViewD3D12Impl.cpp:65
Diligent::TextureViewD3D12Impl::m_MipGenerationDescriptors
DescriptorHeapAllocation * m_MipGenerationDescriptors
Definition: TextureViewD3D12Impl.hpp:83
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::TextureViewD3D12Impl::m_Descriptor
DescriptorHeapAllocation m_Descriptor
D3D12 view descriptor handle.
Definition: TextureViewD3D12Impl.hpp:78
Diligent::TextureViewBase
Template class implementing base functionality of the texture view interface.
Definition: TextureViewBase.hpp:45
DILIGENT_CALL_TYPE
#define DILIGENT_CALL_TYPE
Definition: CommonDefinitions.h:45
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
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::DescriptorHeapAllocation::GetCpuHandle
D3D12_CPU_DESCRIPTOR_HANDLE GetCpuHandle(Uint32 Offset=0) const
Definition: DescriptorHeap.hpp:162
EngineD3D12ImplTraits.hpp
VERIFY_EXPR
#define VERIFY_EXPR(...)
Definition: DebugUtilities.hpp:79
Diligent::TextureViewDesc
Texture view description.
Definition: TextureView.h:80
Diligent::DescriptorHeapAllocation
Definition: DescriptorHeap.hpp:67
Diligent::ITexture
Texture inteface.
Definition: Texture.h:273
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37