Diligent Engine  v.2.4.g
GraphicsUtilities.h
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 "../../GraphicsEngine/interface/Texture.h"
34 #include "../../GraphicsEngine/interface/Buffer.h"
35 #include "../../GraphicsEngine/interface/RenderDevice.h"
36 
38 
39 void DILIGENT_GLOBAL_FUNCTION(CreateUniformBuffer)(IRenderDevice* pDevice,
40  Uint32 Size,
41  const Char* Name,
42  IBuffer** ppBuffer,
46  void* pInitialData DEFAULT_VALUE(nullptr));
47 
49  Uint32 Height,
50  TEXTURE_FORMAT Fmt,
51  Uint32 HorzCells,
52  Uint32 VertCells,
53  Uint8* pData,
54  Uint32 StrideInBytes);
55 
57  Uint32 FineLevelHeight,
58  TEXTURE_FORMAT Fmt,
59  const void* pFineLevelData,
60  Uint32 FineDataStrideInBytes,
61  void* pCoarseLevelData,
62  Uint32 CoarseDataStrideInBytes);
63 
64 DILIGENT_END_NAMESPACE // namespace Diligent
Diligent::CPU_ACCESS_FLAGS
CPU_ACCESS_FLAGS
Allowed CPU access mode flags when mapping a resource.
Definition: GraphicsTypes.h:191
Diligent::Char
char Char
Definition: BasicTypes.h:64
Diligent::USAGE
USAGE
Resource usage.
Definition: GraphicsTypes.h:143
Diligent::CreateUniformBuffer
void CreateUniformBuffer(IRenderDevice *pDevice, Uint32 Size, const Char *Name, IBuffer **ppBuffer, USAGE Usage=USAGE_DYNAMIC, BIND_FLAGS BindFlags=BIND_UNIFORM_BUFFER, CPU_ACCESS_FLAGS CPUAccessFlags=CPU_ACCESS_WRITE, void *pInitialData=nullptr)
Definition: GraphicsUtilities.cpp:41
Diligent::ComputeMipLevel
void ComputeMipLevel(Uint32 FineLevelWidth, Uint32 FineLevelHeight, TEXTURE_FORMAT Fmt, const void *pFineLevelData, Uint32 FineDataStrideInBytes, void *pCoarseLevelData, Uint32 CoarseDataStrideInBytes)
Definition: GraphicsUtilities.cpp:257
DILIGENT_GLOBAL_FUNCTION
#define DILIGENT_GLOBAL_FUNCTION(FuncName)
Definition: CommonDefinitions.h:95
Diligent::USAGE_DYNAMIC
@ USAGE_DYNAMIC
A resource that can be read by the GPU and written at least once per frame by the CPU....
Definition: GraphicsTypes.h:161
Diligent::BIND_FLAGS
BIND_FLAGS
Resource binding flags.
Definition: GraphicsTypes.h:115
Diligent::BIND_UNIFORM_BUFFER
@ BIND_UNIFORM_BUFFER
A buffer can be bound as a uniform buffer.
Definition: GraphicsTypes.h:120
DILIGENT_END_NAMESPACE
#define DILIGENT_END_NAMESPACE
Definition: CommonDefinitions.h:86
Diligent::CPU_ACCESS_WRITE
@ CPU_ACCESS_WRITE
A resource can be mapped for writing.
Definition: GraphicsTypes.h:195
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::TEXTURE_FORMAT
TEXTURE_FORMAT
Texture formats.
Definition: GraphicsTypes.h:328
DEFAULT_VALUE
#define DEFAULT_VALUE(x)
Definition: CommonDefinitions.h:99
Diligent::Uint8
uint8_t Uint8
8-bit unsigned integer
Definition: BasicTypes.h:53
DILIGENT_BEGIN_NAMESPACE
#define DILIGENT_BEGIN_NAMESPACE(Name)
Definition: CommonDefinitions.h:82
Diligent::GenerateCheckerBoardPattern
void GenerateCheckerBoardPattern(Uint32 Width, Uint32 Height, TEXTURE_FORMAT Fmt, Uint32 HorzCells, Uint32 VertCells, Uint8 *pData, Uint32 StrideInBytes)
Definition: GraphicsUtilities.cpp:86
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37