Diligent Engine  v.2.4.g
ShaderResourcesGL.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 
30 // ShaderResourcesGL class allocates single continuous chunk of memory to store all program resources, as follows:
31 //
32 //
33 // m_UniformBuffers m_Textures m_Images m_StorageBlocks
34 // | | | | | |
35 // | UB[0] ... UB[Nu-1] | Tex[0] ... Tex[Ns-1] | Img[0] ... Img[Ni-1] | SB[0] ... SB[Nsb-1] | Resource Names |
36 //
37 // Nu - number of uniform buffers
38 // Ns - number of samplers
39 // Ni - number of images
40 // Nsb - number of storage blocks
41 
42 #include <vector>
43 
44 #include "Object.h"
45 #include "StringPool.hpp"
46 #include "HashUtils.hpp"
48 
49 namespace Diligent
50 {
51 
53 {
54 public:
57  // clang-format off
58  ShaderResourcesGL (ShaderResourcesGL&& Program)noexcept;
59 
60  ShaderResourcesGL (const ShaderResourcesGL&) = delete;
63  // clang-format on
64 
66  void LoadUniforms(SHADER_TYPE ShaderStages,
67  const GLObjectWrappers::GLProgramObj& GLProgram,
68  class GLContextState& State);
69 
71  {
72  // clang-format off
73 /* 0 */ const Char* Name;
74 /* 8 */ const SHADER_TYPE ShaderStages;
76 /* 16 */ Uint32 ArraySize;
77 /* 20 */
78 /* 24 */ // End of data
79  // clang-format on
80 
81  GLResourceAttribs(const Char* _Name,
82  SHADER_TYPE _ShaderStages,
83  SHADER_RESOURCE_TYPE _ResourceType,
84  Uint32 _ArraySize) noexcept :
85  // clang-format off
86  Name {_Name },
87  ShaderStages {_ShaderStages},
88  ResourceType {_ResourceType},
89  ArraySize {_ArraySize }
90  // clang-format on
91  {
92  VERIFY(_ShaderStages != SHADER_TYPE_UNKNOWN, "At least one shader stage must be specified");
93  VERIFY(_ResourceType != SHADER_RESOURCE_TYPE_UNKNOWN, "Unknown shader resource type");
94  VERIFY(_ArraySize >= 1, "Array size must be greater than 1");
95  }
96 
98  StringPool& NamesPool) noexcept :
99  // clang-format off
101  {
102  NamesPool.CopyString(Attribs.Name),
103  Attribs.ShaderStages,
104  Attribs.ResourceType,
105  Attribs.ArraySize
106  }
107  // clang-format on
108  {
109  }
110 
112  {
113  ShaderResourceDesc ResourceDesc;
114  ResourceDesc.Name = Name;
115  ResourceDesc.ArraySize = ArraySize;
116  ResourceDesc.Type = ResourceType;
117  return ResourceDesc;
118  }
119  };
120 
122  {
123  // clang-format off
124  UniformBufferInfo (const UniformBufferInfo&) = delete;
126  UniformBufferInfo ( UniformBufferInfo&&) = default;
128 
129  UniformBufferInfo(const Char* _Name,
130  SHADER_TYPE _ShaderStages,
131  SHADER_RESOURCE_TYPE _ResourceType,
132  Uint32 _ArraySize,
133  GLuint _UBIndex)noexcept :
134  GLResourceAttribs{_Name, _ShaderStages, _ResourceType, _ArraySize},
135  UBIndex {_UBIndex}
136  {}
137 
139  StringPool& NamesPool)noexcept :
140  GLResourceAttribs{UB, NamesPool},
141  UBIndex {UB.UBIndex }
142  {}
143  // clang-format on
144 
145  const GLuint UBIndex;
146  };
147  static_assert((sizeof(UniformBufferInfo) % sizeof(void*)) == 0, "sizeof(UniformBufferInfo) must be multiple of sizeof(void*)");
148 
149 
151  {
152  // clang-format off
153  TextureInfo (const TextureInfo&) = delete;
154  TextureInfo& operator= (const TextureInfo&) = delete;
155  TextureInfo ( TextureInfo&&) = default;
156  TextureInfo& operator= ( TextureInfo&&) = delete;
157 
158  TextureInfo(const Char* _Name,
159  SHADER_TYPE _ShaderStages,
160  SHADER_RESOURCE_TYPE _ResourceType,
161  Uint32 _ArraySize,
162  GLenum _TextureType,
163  RESOURCE_DIMENSION _ResourceDim,
164  bool _IsMultisample) noexcept :
165  GLResourceAttribs{_Name, _ShaderStages, _ResourceType, _ArraySize},
166  TextureType {_TextureType},
167  ResourceDim {_ResourceDim},
168  IsMultisample {_IsMultisample}
169  {}
170 
172  StringPool& NamesPool) noexcept :
173  GLResourceAttribs{Tex, NamesPool},
174  TextureType {Tex.TextureType},
175  ResourceDim {Tex.ResourceDim},
176  IsMultisample {Tex.IsMultisample}
177  {}
178  // clang-format on
179 
180  const GLenum TextureType;
182  const bool IsMultisample;
183  };
184  static_assert((sizeof(TextureInfo) % sizeof(void*)) == 0, "sizeof(TextureInfo) must be multiple of sizeof(void*)");
185 
186 
188  {
189  // clang-format off
190  ImageInfo (const ImageInfo&) = delete;
191  ImageInfo& operator= (const ImageInfo&) = delete;
192  ImageInfo ( ImageInfo&&) = default;
193  ImageInfo& operator= ( ImageInfo&&) = delete;
194 
195  ImageInfo(const Char* _Name,
196  SHADER_TYPE _ShaderStages,
197  SHADER_RESOURCE_TYPE _ResourceType,
198  Uint32 _ArraySize,
199  GLenum _ImageType,
200  RESOURCE_DIMENSION _ResourceDim,
201  bool _IsMultisample) noexcept :
202  GLResourceAttribs{_Name, _ShaderStages, _ResourceType, _ArraySize},
203  ImageType {_ImageType},
204  ResourceDim {_ResourceDim},
205  IsMultisample {_IsMultisample}
206  {}
207 
208  ImageInfo(const ImageInfo& Img,
209  StringPool& NamesPool) noexcept :
210  GLResourceAttribs{Img, NamesPool},
211  ImageType {Img.ImageType},
212  ResourceDim {Img.ResourceDim},
213  IsMultisample {Img.IsMultisample}
214  {}
215  // clang-format on
216 
217  const GLenum ImageType;
219  const bool IsMultisample;
220  };
221  static_assert((sizeof(ImageInfo) % sizeof(void*)) == 0, "sizeof(ImageInfo) must be multiple of sizeof(void*)");
222 
223 
225  {
226  // clang-format off
227  StorageBlockInfo (const StorageBlockInfo&) = delete;
228  StorageBlockInfo& operator= (const StorageBlockInfo&) = delete;
229  StorageBlockInfo ( StorageBlockInfo&&) = default;
231 
232  StorageBlockInfo(const Char* _Name,
233  SHADER_TYPE _ShaderStages,
234  SHADER_RESOURCE_TYPE _ResourceType,
235  Uint32 _ArraySize,
236  GLint _SBIndex)noexcept :
237  GLResourceAttribs{_Name, _ShaderStages, _ResourceType, _ArraySize},
238  SBIndex {_SBIndex}
239  {}
240 
242  StringPool& NamesPool)noexcept :
243  GLResourceAttribs{SB, NamesPool},
244  SBIndex {SB.SBIndex}
245  {}
246  // clang-format on
247 
248  const GLint SBIndex;
249  };
250  static_assert((sizeof(StorageBlockInfo) % sizeof(void*)) == 0, "sizeof(StorageBlockInfo) must be multiple of sizeof(void*)");
251 
252 
253  // clang-format off
254  Uint32 GetNumUniformBuffers()const { return m_NumUniformBuffers; }
255  Uint32 GetNumTextures() const { return m_NumTextures; }
256  Uint32 GetNumImages() const { return m_NumImages; }
257  Uint32 GetNumStorageBlocks() const { return m_NumStorageBlocks; }
258  // clang-format on
259 
261  {
262  VERIFY(Index < m_NumUniformBuffers, "Uniform buffer index (", Index, ") is out of range");
263  return m_UniformBuffers[Index];
264  }
265 
267  {
268  VERIFY(Index < m_NumTextures, "Texture index (", Index, ") is out of range");
269  return m_Textures[Index];
270  }
271 
273  {
274  VERIFY(Index < m_NumImages, "Image index (", Index, ") is out of range");
275  return m_Images[Index];
276  }
277 
279  {
280  VERIFY(Index < m_NumStorageBlocks, "Storage block index (", Index, ") is out of range");
281  return m_StorageBlocks[Index];
282  }
283 
284 
286  {
287  VERIFY(Index < m_NumUniformBuffers, "Uniform buffer index (", Index, ") is out of range");
288  return m_UniformBuffers[Index];
289  }
290 
291  const TextureInfo& GetTexture(Uint32 Index) const
292  {
293  VERIFY(Index < m_NumTextures, "Texture index (", Index, ") is out of range");
294  return m_Textures[Index];
295  }
296 
297  const ImageInfo& GetImage(Uint32 Index) const
298  {
299  VERIFY(Index < m_NumImages, "Image index (", Index, ") is out of range");
300  return m_Images[Index];
301  }
302 
304  {
305  VERIFY(Index < m_NumStorageBlocks, "Storage block index (", Index, ") is out of range");
306  return m_StorageBlocks[Index];
307  }
308 
310  {
311  return m_NumUniformBuffers + m_NumTextures + m_NumImages + m_NumStorageBlocks;
312  }
313 
315 
316  SHADER_TYPE GetShaderStages() const { return m_ShaderStages; }
317 
318  template <typename THandleUB,
319  typename THandleTexture,
320  typename THandleImg,
321  typename THandleSB>
322  void ProcessConstResources(THandleUB HandleUB,
323  THandleTexture HandleTexture,
324  THandleImg HandleImg,
325  THandleSB HandleSB,
326  const PipelineResourceLayoutDesc* pResourceLayout = nullptr,
327  const SHADER_RESOURCE_VARIABLE_TYPE* AllowedVarTypes = nullptr,
328  Uint32 NumAllowedTypes = 0) const
329  {
330  const Uint32 AllowedTypeBits = GetAllowedTypeBits(AllowedVarTypes, NumAllowedTypes);
331 
332  auto CheckResourceType = [&](const char* Name) //
333  {
334  if (pResourceLayout == nullptr)
335  return true;
336  else
337  {
338  auto VarType = GetShaderVariableType(m_ShaderStages, Name, *pResourceLayout);
339  return IsAllowedType(VarType, AllowedTypeBits);
340  }
341  };
342 
343  for (Uint32 ub = 0; ub < m_NumUniformBuffers; ++ub)
344  {
345  const auto& UB = GetUniformBuffer(ub);
346  if (CheckResourceType(UB.Name))
347  HandleUB(UB);
348  }
349 
350  for (Uint32 s = 0; s < m_NumTextures; ++s)
351  {
352  const auto& Sam = GetTexture(s);
353  if (CheckResourceType(Sam.Name))
354  HandleTexture(Sam);
355  }
356 
357  for (Uint32 img = 0; img < m_NumImages; ++img)
358  {
359  const auto& Img = GetImage(img);
360  if (CheckResourceType(Img.Name))
361  HandleImg(Img);
362  }
363 
364  for (Uint32 sb = 0; sb < m_NumStorageBlocks; ++sb)
365  {
366  const auto& SB = GetStorageBlock(sb);
367  if (CheckResourceType(SB.Name))
368  HandleSB(SB);
369  }
370  }
371 
372  template <typename THandleUB,
373  typename THandleTexture,
374  typename THandleImg,
375  typename THandleSB>
376  void ProcessResources(THandleUB HandleUB,
377  THandleTexture HandleTexture,
378  THandleImg HandleImg,
379  THandleSB HandleSB)
380  {
381  for (Uint32 ub = 0; ub < m_NumUniformBuffers; ++ub)
382  HandleUB(GetUniformBuffer(ub));
383 
384  for (Uint32 s = 0; s < m_NumTextures; ++s)
385  HandleTexture(GetTexture(s));
386 
387  for (Uint32 img = 0; img < m_NumImages; ++img)
388  HandleImg(GetImage(img));
389 
390  for (Uint32 sb = 0; sb < m_NumStorageBlocks; ++sb)
391  HandleSB(GetStorageBlock(sb));
392  }
393 
394 private:
395  void AllocateResources(std::vector<UniformBufferInfo>& UniformBlocks,
396  std::vector<TextureInfo>& Textures,
397  std::vector<ImageInfo>& Images,
398  std::vector<StorageBlockInfo>& StorageBlocks);
399 
400  // clang-format off
401  // There could be more than one stage if using non-separable programs
402  SHADER_TYPE m_ShaderStages = SHADER_TYPE_UNKNOWN;
403 
404  // Memory layout:
405  //
406  // | Uniform buffers | Textures | Images | Storage Blocks | String Pool Data |
407  //
408 
409  UniformBufferInfo* m_UniformBuffers = nullptr;
410  TextureInfo* m_Textures = nullptr;
411  ImageInfo* m_Images = nullptr;
412  StorageBlockInfo* m_StorageBlocks = nullptr;
413 
414  Uint32 m_NumUniformBuffers = 0;
415  Uint32 m_NumTextures = 0;
416  Uint32 m_NumImages = 0;
417  Uint32 m_NumStorageBlocks = 0;
418  // clang-format on
419  // When adding new member DO NOT FORGET TO UPDATE ShaderResourcesGL( ShaderResourcesGL&& ProgramResources )!!!
420 };
421 
422 } // namespace Diligent
Diligent::ShaderResourcesGL::TextureInfo::operator=
TextureInfo & operator=(const TextureInfo &)=delete
Diligent::ShaderResourceDesc::Type
SHADER_RESOURCE_TYPE Type
Shader resource type, see Diligent::SHADER_RESOURCE_TYPE.
Definition: Shader.h:410
Diligent::ShaderResourcesGL::GLResourceAttribs
Definition: ShaderResourcesGL.hpp:70
Diligent::Char
char Char
Definition: BasicTypes.h:64
Diligent::ShaderResourcesGL::GetNumStorageBlocks
Uint32 GetNumStorageBlocks() const
Definition: ShaderResourcesGL.hpp:257
Diligent::ShaderResourcesGL::ImageInfo::IsMultisample
const bool IsMultisample
Definition: ShaderResourcesGL.hpp:219
Diligent::ShaderResourcesGL::GLResourceAttribs::ResourceType
const SHADER_RESOURCE_TYPE ResourceType
Definition: ShaderResourcesGL.hpp:75
Diligent::ShaderResourceDesc::ArraySize
Uint32 ArraySize
Array size. For non-array resource this value is 1.
Definition: Shader.h:413
Diligent::ShaderResourcesGL::UniformBufferInfo::UniformBufferInfo
UniformBufferInfo(const UniformBufferInfo &)=delete
Diligent::SHADER_TYPE
SHADER_TYPE
Describes the shader type.
Definition: GraphicsTypes.h:65
Diligent::SHADER_RESOURCE_TYPE
SHADER_RESOURCE_TYPE
Describes shader resource type.
Definition: Shader.h:356
Diligent::ShaderResourcesGL::StorageBlockInfo::SBIndex
const GLint SBIndex
Definition: ShaderResourcesGL.hpp:248
Diligent::IsAllowedType
bool IsAllowedType(SHADER_RESOURCE_VARIABLE_TYPE VarType, Uint32 AllowedTypeBits) noexcept
Definition: ShaderResourceVariableBase.hpp:102
Diligent::GetAllowedTypeBits
Uint32 GetAllowedTypeBits(const SHADER_RESOURCE_VARIABLE_TYPE *AllowedVarTypes, Uint32 NumAllowedTypes) noexcept
Definition: ShaderResourceVariableBase.hpp:112
Diligent::ShaderResourcesGL::LoadUniforms
void LoadUniforms(SHADER_TYPE ShaderStages, const GLObjectWrappers::GLProgramObj &GLProgram, class GLContextState &State)
Loads program uniforms and assigns bindings.
Definition: ShaderResourcesGL.cpp:209
ShaderResourceVariableBase.hpp
Diligent::ShaderResourcesGL::GetImage
ImageInfo & GetImage(Uint32 Index)
Definition: ShaderResourcesGL.hpp:272
Diligent::ShaderResourcesGL::GLResourceAttribs::ShaderStages
const SHADER_TYPE ShaderStages
Definition: ShaderResourcesGL.hpp:74
Diligent::ShaderResourcesGL::GetTexture
const TextureInfo & GetTexture(Uint32 Index) const
Definition: ShaderResourcesGL.hpp:291
Diligent::ShaderResourcesGL::GetVariableCount
Uint32 GetVariableCount() const
Definition: ShaderResourcesGL.hpp:309
Diligent::ShaderResourcesGL::TextureInfo::TextureInfo
TextureInfo(const TextureInfo &)=delete
Diligent::ShaderResourcesGL::StorageBlockInfo::operator=
StorageBlockInfo & operator=(const StorageBlockInfo &)=delete
Diligent::ShaderResourcesGL::GLResourceAttribs::GLResourceAttribs
GLResourceAttribs(const Char *_Name, SHADER_TYPE _ShaderStages, SHADER_RESOURCE_TYPE _ResourceType, Uint32 _ArraySize) noexcept
Definition: ShaderResourcesGL.hpp:81
Diligent::ShaderResourcesGL::GLResourceAttribs::ArraySize
Uint32 ArraySize
Definition: ShaderResourcesGL.hpp:76
Diligent::ShaderResourcesGL::StorageBlockInfo::StorageBlockInfo
StorageBlockInfo(const Char *_Name, SHADER_TYPE _ShaderStages, SHADER_RESOURCE_TYPE _ResourceType, Uint32 _ArraySize, GLint _SBIndex) noexcept
Definition: ShaderResourcesGL.hpp:232
Diligent::ShaderResourcesGL::TextureInfo::IsMultisample
const bool IsMultisample
Definition: ShaderResourcesGL.hpp:182
Diligent::ShaderResourcesGL::GetNumImages
Uint32 GetNumImages() const
Definition: ShaderResourcesGL.hpp:256
Diligent::ShaderResourcesGL::ImageInfo::ImageInfo
ImageInfo(const Char *_Name, SHADER_TYPE _ShaderStages, SHADER_RESOURCE_TYPE _ResourceType, Uint32 _ArraySize, GLenum _ImageType, RESOURCE_DIMENSION _ResourceDim, bool _IsMultisample) noexcept
Definition: ShaderResourcesGL.hpp:195
Diligent::ShaderResourcesGL::StorageBlockInfo::StorageBlockInfo
StorageBlockInfo(const StorageBlockInfo &)=delete
Diligent::ShaderResourcesGL::GLResourceAttribs::GetResourceDesc
ShaderResourceDesc GetResourceDesc() const
Definition: ShaderResourcesGL.hpp:111
Diligent::ShaderResourcesGL::ImageInfo::operator=
ImageInfo & operator=(const ImageInfo &)=delete
Diligent::ShaderResourcesGL::GetNumUniformBuffers
Uint32 GetNumUniformBuffers() const
Definition: ShaderResourcesGL.hpp:254
Diligent::ShaderResourcesGL::GetUniformBuffer
const UniformBufferInfo & GetUniformBuffer(Uint32 Index) const
Definition: ShaderResourcesGL.hpp:285
Diligent::ShaderResourcesGL::ImageInfo::ImageInfo
ImageInfo(const ImageInfo &Img, StringPool &NamesPool) noexcept
Definition: ShaderResourcesGL.hpp:208
Diligent::ShaderResourcesGL::ImageInfo
Definition: ShaderResourcesGL.hpp:187
Diligent::ShaderResourcesGL::TextureInfo::TextureType
const GLenum TextureType
Definition: ShaderResourcesGL.hpp:180
Diligent::ShaderResourcesGL::~ShaderResourcesGL
~ShaderResourcesGL()
Definition: ShaderResourcesGL.cpp:177
Diligent::ShaderResourceDesc::Name
const char * Name
Shader resource name.
Definition: Shader.h:407
Diligent::ShaderResourcesGL::UniformBufferInfo::operator=
UniformBufferInfo & operator=(const UniformBufferInfo &)=delete
Diligent::ShaderResourcesGL::UniformBufferInfo::UniformBufferInfo
UniformBufferInfo(const Char *_Name, SHADER_TYPE _ShaderStages, SHADER_RESOURCE_TYPE _ResourceType, Uint32 _ArraySize, GLuint _UBIndex) noexcept
Definition: ShaderResourcesGL.hpp:129
Diligent::ShaderResourcesGL::GetStorageBlock
const StorageBlockInfo & GetStorageBlock(Uint32 Index) const
Definition: ShaderResourcesGL.hpp:303
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::ShaderResourcesGL::ImageInfo::ResourceDim
const RESOURCE_DIMENSION ResourceDim
Definition: ShaderResourcesGL.hpp:218
Diligent::SHADER_TYPE_UNKNOWN
@ SHADER_TYPE_UNKNOWN
Unknown shader type.
Definition: GraphicsTypes.h:67
Object.h
Diligent::ShaderResourcesGL::GLResourceAttribs::GLResourceAttribs
GLResourceAttribs(const GLResourceAttribs &Attribs, StringPool &NamesPool) noexcept
Definition: ShaderResourcesGL.hpp:97
Diligent::ShaderResourcesGL::UniformBufferInfo::UniformBufferInfo
UniformBufferInfo(const UniformBufferInfo &UB, StringPool &NamesPool) noexcept
Definition: ShaderResourcesGL.hpp:138
Diligent::ShaderResourcesGL::GetShaderStages
SHADER_TYPE GetShaderStages() const
Definition: ShaderResourcesGL.hpp:316
Diligent::ShaderResourcesGL::TextureInfo
Definition: ShaderResourcesGL.hpp:150
Diligent::ShaderResourcesGL::GetImage
const ImageInfo & GetImage(Uint32 Index) const
Definition: ShaderResourcesGL.hpp:297
Diligent::ShaderResourcesGL::TextureInfo::TextureInfo
TextureInfo(const TextureInfo &Tex, StringPool &NamesPool) noexcept
Definition: ShaderResourcesGL.hpp:171
Diligent::ShaderResourcesGL::GLResourceAttribs::Name
const Char * Name
Definition: ShaderResourcesGL.hpp:73
Diligent::GetShaderVariableType
SHADER_RESOURCE_VARIABLE_TYPE GetShaderVariableType(SHADER_TYPE ShaderStage, SHADER_RESOURCE_VARIABLE_TYPE DefaultVariableType, const ShaderResourceVariableDesc *Variables, Uint32 NumVars, TNameCompare NameCompare)
Definition: ShaderResourceVariableBase.hpp:45
Diligent::ShaderResourcesGL::UniformBufferInfo::UBIndex
const GLuint UBIndex
Definition: ShaderResourcesGL.hpp:145
HashUtils.hpp
Diligent::ShaderResourcesGL::GetNumTextures
Uint32 GetNumTextures() const
Definition: ShaderResourcesGL.hpp:255
Diligent::ShaderResourceDesc
Shader resource description.
Definition: Shader.h:390
GLObjectWrappers::GLObjWrapper
Definition: GLObjectWrapper.hpp:36
Diligent::ShaderResourcesGL::UniformBufferInfo
Definition: ShaderResourcesGL.hpp:121
Diligent::ShaderResourcesGL::StorageBlockInfo
Definition: ShaderResourcesGL.hpp:224
StringPool.hpp
Diligent::GLContextState
Definition: GLContextState.hpp:39
VERIFY
#define VERIFY(...)
Definition: DebugUtilities.hpp:76
Diligent::ShaderResourcesGL::GetStorageBlock
StorageBlockInfo & GetStorageBlock(Uint32 Index)
Definition: ShaderResourcesGL.hpp:278
Diligent::ShaderResourcesGL::GetResourceDesc
ShaderResourceDesc GetResourceDesc(Uint32 Index) const
Definition: ShaderResourcesGL.cpp:552
Diligent::StringPool
Implementation of a simple fixed-size string pool.
Definition: StringPool.hpp:42
Diligent::ShaderResourcesGL::GetTexture
TextureInfo & GetTexture(Uint32 Index)
Definition: ShaderResourcesGL.hpp:266
Diligent::ShaderResourcesGL::ProcessConstResources
void ProcessConstResources(THandleUB HandleUB, THandleTexture HandleTexture, THandleImg HandleImg, THandleSB HandleSB, const PipelineResourceLayoutDesc *pResourceLayout=nullptr, const SHADER_RESOURCE_VARIABLE_TYPE *AllowedVarTypes=nullptr, Uint32 NumAllowedTypes=0) const
Definition: ShaderResourcesGL.hpp:322
Diligent::RESOURCE_DIMENSION
RESOURCE_DIMENSION
Describes resource dimension.
Definition: GraphicsTypes.h:256
Diligent::ShaderResourcesGL::ImageInfo::ImageInfo
ImageInfo(const ImageInfo &)=delete
Diligent::ShaderResourcesGL::operator=
ShaderResourcesGL & operator=(const ShaderResourcesGL &)=delete
Diligent::ShaderResourcesGL::ProcessResources
void ProcessResources(THandleUB HandleUB, THandleTexture HandleTexture, THandleImg HandleImg, THandleSB HandleSB)
Definition: ShaderResourcesGL.hpp:376
Diligent::ShaderResourcesGL
Definition: ShaderResourcesGL.hpp:52
Diligent::ShaderResourcesGL::GetUniformBuffer
UniformBufferInfo & GetUniformBuffer(Uint32 Index)
Definition: ShaderResourcesGL.hpp:260
Diligent::SHADER_RESOURCE_TYPE_UNKNOWN
@ SHADER_RESOURCE_TYPE_UNKNOWN
Shader resource type is unknown.
Definition: Shader.h:359
Diligent::PipelineResourceLayoutDesc
Pipeline layout description.
Definition: PipelineState.h:103
Diligent::ShaderResourcesGL::TextureInfo::ResourceDim
const RESOURCE_DIMENSION ResourceDim
Definition: ShaderResourcesGL.hpp:181
Diligent::ShaderResourcesGL::ImageInfo::ImageType
const GLenum ImageType
Definition: ShaderResourcesGL.hpp:217
Diligent::ShaderResourcesGL::StorageBlockInfo::StorageBlockInfo
StorageBlockInfo(const StorageBlockInfo &SB, StringPool &NamesPool) noexcept
Definition: ShaderResourcesGL.hpp:241
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::ShaderResourcesGL::TextureInfo::TextureInfo
TextureInfo(const Char *_Name, SHADER_TYPE _ShaderStages, SHADER_RESOURCE_TYPE _ResourceType, Uint32 _ArraySize, GLenum _TextureType, RESOURCE_DIMENSION _ResourceDim, bool _IsMultisample) noexcept
Definition: ShaderResourcesGL.hpp:158
Diligent::SHADER_RESOURCE_VARIABLE_TYPE
SHADER_RESOURCE_VARIABLE_TYPE
Describes the type of the shader resource variable.
Definition: ShaderResourceVariable.h:48
Diligent::ShaderResourcesGL::ShaderResourcesGL
ShaderResourcesGL()
Definition: ShaderResourcesGL.hpp:55