Diligent Engine API Reference
Graphics
GraphicsEngineD3D12
include
ShaderResourcesD3D12.h
1
/* Copyright 2015-2018 Egor Yusov
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
12
*
13
* In no event and under no legal theory, whether in tort (including negligence),
14
* contract, or otherwise, unless required by applicable law (such as deliberate
15
* and grossly negligent acts) or agreed to in writing, shall any Contributor be
16
* liable for any damages, including any direct, indirect, special, incidental,
17
* or consequential damages of any character arising as a result of this License or
18
* out of the use or inability to use the software (including but not limited to damages
19
* for loss of goodwill, work stoppage, computer failure or malfunction, or any and
20
* all other commercial damages or losses), even if such Contributor has been advised
21
* of the possibility of such damages.
22
*/
23
24
#pragma once
25
28
29
// ShaderResourcesD3D12 are created by ShaderD3D12Impl instances. They are then referenced by ShaderResourceLayoutD3D12 objects, which are in turn
30
// created by instances of PipelineStatesD3D12Impl and ShaderResourceBindingsD3D12Impl (and ShaderD3D12Impl too)
31
//
32
// _________________
33
// | |
34
// | ShaderD3D12Impl |
35
// |_________________|
36
// |
37
// |shared_ptr
38
// ________V_____________ _____________________________________________________________________
39
// | | unique_ptr | | | | | | |
40
// | ShaderResourcesD3D12 |--------------->| CBs | TexSRVs | TexUAVs | BufSRVs | BufUAVs | Samplers |
41
// |______________________| |________|___________|___________|___________|___________|____________|
42
// A A A A
43
// | \ / \
44
// |shared_ptr Ref Ref Ref
45
// ________|__________________ ________\________________________/_________________________\_________________________________________
46
// | | unique_ptr | | | | | | |
47
// | ShaderResourceLayoutD3D12 |--------------->| SRV_CBV_UAV[0] | SRV_CBV_UAV[1] | ... | Sampler[0] | Sampler[1] | ... |
48
// |___________________________| |___________________|_________________|_______________|__________________|_________________|__________|
49
// A | A
50
// | |___________________SamplerId________________________|
51
// |
52
// __________|_____________
53
// | |
54
// | PipelineStateD3D12Impl |
55
// |________________________|
56
//
57
//
58
// One ShaderResources instance can be referenced by multiple objects
59
//
60
//
61
// ________________________ _<m_ShaderResourceLayouts>_ ____<m_pResourceLayouts>___ ________________________________
62
// | | | | | | | |
63
// | PipelineStateD3D12Impl |-------->| ShaderResourceLayoutD3D12 | ----| ShaderResourceLayoutD3D12 |<-----| ShaderResourceBindingD3D12Impl |
64
// |________________________| |___________________________| | |___________________________| |________________________________|
65
// | |
66
// | shared_ptr |
67
// _________________ ___________V__________ | ____<m_pResourceLayouts>___ ________________________________
68
// | | shared_ptr | | shared_ptr| | | | |
69
// | ShaderD3D12Impl |--------------->| ShaderResourcesD3D12 |<---------------| ShaderResourceLayoutD3D12 |<-----| ShaderResourceBindingD3D12Impl |
70
// |_________________| |______________________| | |___________________________| |________________________________|
71
// | A |
72
// V | |
73
// ____<m_StaticResLayout>____ | | ____<m_pResourceLayouts>___ ________________________________
74
// | | shared_ptr | | | | | |
75
// | ShaderResourceLayoutD3D12 |------------------- ----| ShaderResourceLayoutD3D12 |<-----| ShaderResourceBindingD3D12Impl |
76
// |___________________________| |___________________________| |________________________________|
77
//
78
//
79
80
81
#include "ShaderResources.h"
82
83
namespace
Diligent
84
{
85
87
class
ShaderResourcesD3D12
:
public
ShaderResources
88
{
89
public
:
90
// Loads shader resources from the compiled shader bytecode
91
ShaderResourcesD3D12
(ID3DBlob *pShaderBytecode,
const
ShaderDesc
&ShdrDesc);
92
};
93
94
}
Diligent::ShaderDesc
Shader description.
Definition:
Shader.h:152
Diligent
Namespace for the OpenGL implementation of the graphics engine.
Definition:
BufferD3D11Impl.h:34
Diligent::ShaderResourcesD3D12
Diligent::ShaderResources class.
Definition:
ShaderResourcesD3D12.h:87