Skip to content

Commit 0eb5305

Browse files
MikhailGorobetsTheMostDiligent
authored andcommitted
Diligent-GraphicsEngine: Replaced char with Char to make the API more consistent (close #394)
1 parent f71f631 commit 0eb5305

File tree

12 files changed

+51
-51
lines changed

12 files changed

+51
-51
lines changed

Graphics/GraphicsEngine/interface/BottomLevelAS.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ struct BLASTriangleDesc
5555
{
5656
/// Geometry name.
5757
/// The name is used to map triangle data (BLASBuildTriangleData) to this geometry.
58-
const char* GeometryName DEFAULT_INITIALIZER(nullptr);
58+
const Char* GeometryName DEFAULT_INITIALIZER(nullptr);
5959

6060
/// The maximum vertex count in this geometry.
6161
/// Current number of vertices is defined in BLASBuildTriangleData::VertexCount.
@@ -111,7 +111,7 @@ struct BLASBoundingBoxDesc
111111
{
112112
/// Geometry name.
113113
/// The name is used to map AABB data (BLASBuildBoundingBoxData) to this geometry.
114-
const char* GeometryName DEFAULT_INITIALIZER(nullptr);
114+
const Char* GeometryName DEFAULT_INITIALIZER(nullptr);
115115

116116
/// The maximum AABB count.
117117
/// Current number of AABBs is defined in BLASBuildBoundingBoxData::BoxCount.
@@ -120,7 +120,7 @@ struct BLASBoundingBoxDesc
120120
#if DILIGENT_CPP_INTERFACE
121121
constexpr BLASBoundingBoxDesc() noexcept {}
122122

123-
constexpr BLASBoundingBoxDesc(const char* _GeometryName,
123+
constexpr BLASBoundingBoxDesc(const Char* _GeometryName,
124124
Uint32 _MaxBoxCount) noexcept :
125125
GeometryName{_GeometryName},
126126
MaxBoxCount {_MaxBoxCount }
@@ -292,7 +292,7 @@ DILIGENT_BEGIN_INTERFACE(IBottomLevelAS, IDeviceObject)
292292
///
293293
/// \note Access to the BLAS must be externally synchronized.
294294
VIRTUAL Uint32 METHOD(GetGeometryDescIndex)(THIS_
295-
const char* Name) CONST PURE;
295+
const Char* Name) CONST PURE;
296296

297297

298298
/// Returns the geometry index that can be used in a shader binding table.
@@ -302,7 +302,7 @@ DILIGENT_BEGIN_INTERFACE(IBottomLevelAS, IDeviceObject)
302302
///
303303
/// \note Access to the BLAS must be externally synchronized.
304304
VIRTUAL Uint32 METHOD(GetGeometryIndex)(THIS_
305-
const char* Name) CONST PURE;
305+
const Char* Name) CONST PURE;
306306

307307

308308
/// Returns the geometry count that was used to build AS.

Graphics/GraphicsEngine/interface/Dearchiver.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct ShaderUnpackInfo
4949
struct IRenderDevice* pDevice DEFAULT_INITIALIZER(nullptr);
5050

5151
/// Name of the shader to unpack.
52-
const char* Name DEFAULT_INITIALIZER(nullptr);
52+
const Char* Name DEFAULT_INITIALIZER(nullptr);
5353

5454
/// An optional function to be called by the dearchiver to let the application modify
5555
/// the shader description.
@@ -68,7 +68,7 @@ struct ResourceSignatureUnpackInfo
6868

6969
/// Name of the signature to unpack. If there is only
7070
/// one signature in the archive, the name may be null.
71-
const char* Name DEFAULT_INITIALIZER(nullptr);
71+
const Char* Name DEFAULT_INITIALIZER(nullptr);
7272

7373
/// Shader resource binding allocation granularity.
7474

@@ -127,7 +127,7 @@ struct PipelineStateUnpackInfo
127127

128128
/// Name of the PSO to unpack. If there is only
129129
/// one PSO in the archive, the name may be null.
130-
const char* Name DEFAULT_INITIALIZER(nullptr);
130+
const Char* Name DEFAULT_INITIALIZER(nullptr);
131131

132132
/// The type of the pipeline state to unpack, see Diligent::PIPELINE_TYPE.
133133
PIPELINE_TYPE PipelineType DEFAULT_INITIALIZER(PIPELINE_TYPE_INVALID);
@@ -187,7 +187,7 @@ struct RenderPassUnpackInfo
187187
struct IRenderDevice* pDevice DEFAULT_INITIALIZER(nullptr);
188188

189189
/// Name of the render pass to unpack.
190-
const char* Name DEFAULT_INITIALIZER(nullptr);
190+
const Char* Name DEFAULT_INITIALIZER(nullptr);
191191

192192
/// An optional function to be called by the dearchiver to let the application modify
193193
/// the render pass description.

Graphics/GraphicsEngine/interface/DeviceContext.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct DeviceContextDesc
7171
{
7272
/// Device context name. This name is what was specified in
7373
/// ImmediateContextCreateInfo::Name when the engine was initialized.
74-
const char* Name DEFAULT_INITIALIZER(nullptr);
74+
const Char* Name DEFAULT_INITIALIZER(nullptr);
7575

7676
/// Command queue type that this context uses.
7777

@@ -120,7 +120,7 @@ struct DeviceContextDesc
120120
constexpr DeviceContextDesc() noexcept {}
121121

122122
/// Initializes the structure with user-specified values.
123-
constexpr DeviceContextDesc(const char* _Name,
123+
constexpr DeviceContextDesc(const Char* _Name,
124124
COMMAND_QUEUE_TYPE _QueueType,
125125
Bool _IsDeferred,
126126
Uint32 _ContextId,
@@ -1100,7 +1100,7 @@ struct BLASBuildTriangleData
11001100
{
11011101
/// Geometry name used to map a geometry to a hit group in the shader binding table.
11021102
/// Add geometry data to the geometry that is allocated by BLASTriangleDesc with the same name.
1103-
const char* GeometryName DEFAULT_INITIALIZER(nullptr);
1103+
const Char* GeometryName DEFAULT_INITIALIZER(nullptr);
11041104

11051105
/// Triangle vertices data source.
11061106
/// Triangles are considered "inactive" if the x component of each vertex is NaN.
@@ -1168,7 +1168,7 @@ struct BLASBuildBoundingBoxData
11681168
{
11691169
/// Geometry name used to map geometry to hit group in shader binding table.
11701170
/// Put geometry data to geometry that allocated by BLASBoundingBoxDesc with the same name.
1171-
const char* GeometryName DEFAULT_INITIALIZER(nullptr);
1171+
const Char* GeometryName DEFAULT_INITIALIZER(nullptr);
11721172

11731173
/// AABB data source.
11741174
/// Each AABB defined as { float3 Min; float3 Max } structure.
@@ -1321,7 +1321,7 @@ typedef struct InstanceMatrix InstanceMatrix;
13211321
struct TLASBuildInstanceData
13221322
{
13231323
/// Instance name that is used to map an instance to a hit group in shader binding table.
1324-
const char* InstanceName DEFAULT_INITIALIZER(nullptr);
1324+
const Char* InstanceName DEFAULT_INITIALIZER(nullptr);
13251325

13261326
/// Bottom-level AS that represents instance geometry.
13271327
/// Once built, TLAS will hold strong reference to pBLAS until next build or copy operation.

Graphics/GraphicsEngine/interface/EngineFactory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ DILIGENT_BEGIN_INTERFACE(IEngineFactory, IObject)
143143
/// \remarks See AndroidFileSystem::Init.
144144
VIRTUAL void METHOD(InitAndroidFileSystem)(THIS_
145145
struct ANativeActivity* NativeActivity,
146-
const char* NativeActivityClassName,
146+
const Char* NativeActivityClassName,
147147
struct AAssetManager* AssetManager) CONST PURE;
148148
#endif
149149
};

Graphics/GraphicsEngine/interface/GraphicsTypes.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,7 @@ typedef struct CommandQueueInfo CommandQueueInfo;
31213121
struct GraphicsAdapterInfo
31223122
{
31233123
/// A string that contains the adapter description.
3124-
char Description[128] DEFAULT_INITIALIZER({});
3124+
Char Description[128] DEFAULT_INITIALIZER({});
31253125

31263126
/// Adapter type, see Diligent::ADAPTER_TYPE.
31273127
ADAPTER_TYPE Type DEFAULT_INITIALIZER(ADAPTER_TYPE_UNKNOWN);
@@ -3230,7 +3230,7 @@ typedef struct GraphicsAdapterInfo GraphicsAdapterInfo;
32303230
struct ImmediateContextCreateInfo
32313231
{
32323232
/// Context name.
3233-
const char* Name DEFAULT_INITIALIZER(nullptr);
3233+
const Char* Name DEFAULT_INITIALIZER(nullptr);
32343234

32353235
/// Queue index in GraphicsAdapterInfo::Queues.
32363236

@@ -3250,7 +3250,7 @@ struct ImmediateContextCreateInfo
32503250
#if DILIGENT_CPP_INTERFACE
32513251
constexpr ImmediateContextCreateInfo() noexcept {}
32523252

3253-
constexpr ImmediateContextCreateInfo(const char* _Name,
3253+
constexpr ImmediateContextCreateInfo(const Char* _Name,
32543254
Uint8 _QueueId,
32553255
QUEUE_PRIORITY _Priority = ImmediateContextCreateInfo{}.Priority) noexcept :
32563256
Name {_Name},
@@ -3461,7 +3461,7 @@ DEFINE_FLAG_ENUM_OPERATORS(D3D12_VALIDATION_FLAGS)
34613461
struct EngineD3D12CreateInfo DILIGENT_DERIVE(EngineCreateInfo)
34623462

34633463
/// Name of the D3D12 DLL to load. Ignored on UWP.
3464-
const char* D3D12DllName DEFAULT_INITIALIZER("d3d12.dll");
3464+
const Char* D3D12DllName DEFAULT_INITIALIZER("d3d12.dll");
34653465
/// Direct3D12-specific validation options, see Diligent::D3D12_VALIDATION_FLAGS.
34663466
D3D12_VALIDATION_FLAGS D3D12ValidationFlags DEFAULT_INITIALIZER(D3D12_VALIDATION_FLAG_BREAK_ON_CORRUPTION);
34673467

@@ -3565,7 +3565,7 @@ struct EngineD3D12CreateInfo DILIGENT_DERIVE(EngineCreateInfo)
35653565

35663566
/// Path to DirectX Shader Compiler, which is required to use Shader Model 6.0+ features.
35673567
/// By default, the engine will search for "dxcompiler.dll".
3568-
const char* pDxCompilerPath DEFAULT_INITIALIZER(nullptr);
3568+
const Char* pDxCompilerPath DEFAULT_INITIALIZER(nullptr);
35693569

35703570
#if DILIGENT_CPP_INTERFACE
35713571
EngineD3D12CreateInfo() noexcept :
@@ -3656,19 +3656,19 @@ struct EngineVkCreateInfo DILIGENT_DERIVE(EngineCreateInfo)
36563656
Uint32 InstanceLayerCount DEFAULT_INITIALIZER(0);
36573657

36583658
/// A list of additional Vulkan instance layers to enable.
3659-
const char* const* ppInstanceLayerNames DEFAULT_INITIALIZER(nullptr);
3659+
const Char* const* ppInstanceLayerNames DEFAULT_INITIALIZER(nullptr);
36603660

36613661
/// The number of Vulkan instance extensions in ppInstanceExtensionNames array.
36623662
Uint32 InstanceExtensionCount DEFAULT_INITIALIZER(0);
36633663

36643664
/// A list of additional Vulkan instance extensions to enable.
3665-
const char* const* ppInstanceExtensionNames DEFAULT_INITIALIZER(nullptr);
3665+
const Char* const* ppInstanceExtensionNames DEFAULT_INITIALIZER(nullptr);
36663666

36673667
/// Number of Vulkan device extensions in ppDeviceExtensionNames array.
36683668
Uint32 DeviceExtensionCount DEFAULT_INITIALIZER(0);
36693669

36703670
/// A list of additional Vulkan device extensions to enable.
3671-
const char* const* ppDeviceExtensionNames DEFAULT_INITIALIZER(nullptr);
3671+
const Char* const* ppDeviceExtensionNames DEFAULT_INITIALIZER(nullptr);
36723672

36733673
/// Pointer to Vulkan device extension features.
36743674
/// Will be added to VkDeviceCreateInfo::pNext.
@@ -3681,7 +3681,7 @@ struct EngineVkCreateInfo DILIGENT_DERIVE(EngineCreateInfo)
36813681
Uint32 IgnoreDebugMessageCount DEFAULT_INITIALIZER(0);
36823682

36833683
/// An optional list of IgnoreDebugMessageCount Vulkan validation message names to ignore.
3684-
const char* const* ppIgnoreDebugMessageNames DEFAULT_INITIALIZER(nullptr);
3684+
const Char* const* ppIgnoreDebugMessageNames DEFAULT_INITIALIZER(nullptr);
36853685

36863686
/// Size of the main descriptor pool that is used to allocate descriptor sets
36873687
/// for static and mutable variables. If allocation from the current pool fails,
@@ -3752,7 +3752,7 @@ struct EngineVkCreateInfo DILIGENT_DERIVE(EngineCreateInfo)
37523752

37533753
/// Path to DirectX Shader Compiler, which is required to use Shader Model 6.0+
37543754
/// features when compiling shaders from HLSL.
3755-
const char* pDxCompilerPath DEFAULT_INITIALIZER(nullptr);
3755+
const Char* pDxCompilerPath DEFAULT_INITIALIZER(nullptr);
37563756

37573757
#if DILIGENT_CPP_INTERFACE
37583758
EngineVkCreateInfo() noexcept :

Graphics/GraphicsEngine/interface/InputLayout.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct LayoutElement
7272
/// to GLSL and used in OpenGL backend as well as compiled to SPIRV and used
7373
/// in Vulkan backend.
7474
/// Any value other than default will only work in Direct3D11 and Direct3D12 backends.
75-
const char* HLSLSemantic DEFAULT_INITIALIZER("ATTRIB");
75+
const Char* HLSLSemantic DEFAULT_INITIALIZER("ATTRIB");
7676

7777
/// Input index of the element that is specified in the vertex shader.
7878
/// In Direct3D11 and Direct3D12 backends this is the semantic index.
@@ -139,7 +139,7 @@ struct LayoutElement
139139
{}
140140

141141
/// Initializes the structure
142-
constexpr LayoutElement(const char* _HLSLSemantic,
142+
constexpr LayoutElement(const Char* _HLSLSemantic,
143143
Uint32 _InputIndex,
144144
Uint32 _BufferSlot,
145145
Uint32 _NumComponents,

Graphics/GraphicsEngine/interface/PipelineResourceSignature.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ DEFINE_FLAG_ENUM_OPERATORS(PIPELINE_RESOURCE_FLAGS);
138138
struct PipelineResourceDesc
139139
{
140140
/// Resource name in the shader
141-
const char* Name DEFAULT_INITIALIZER(nullptr);
141+
const Char* Name DEFAULT_INITIALIZER(nullptr);
142142

143143
/// Shader stages that this resource applies to. When multiple shader stages are specified,
144144
/// all stages will share the same resource.
@@ -163,7 +163,7 @@ struct PipelineResourceDesc
163163
constexpr PipelineResourceDesc() noexcept {}
164164

165165
constexpr PipelineResourceDesc(SHADER_TYPE _ShaderStages,
166-
const char* _Name,
166+
const Char* _Name,
167167
Uint32 _ArraySize,
168168
SHADER_RESOURCE_TYPE _ResourceType,
169169
SHADER_RESOURCE_VARIABLE_TYPE _VarType = SHADER_RESOURCE_VARIABLE_TYPE_MUTABLE,

Graphics/GraphicsEngine/interface/PipelineState.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ typedef struct GraphicsPipelineDesc GraphicsPipelineDesc;
373373
struct RayTracingGeneralShaderGroup
374374
{
375375
/// Unique group name.
376-
const char* Name DEFAULT_INITIALIZER(nullptr);
376+
const Char* Name DEFAULT_INITIALIZER(nullptr);
377377

378378
/// Shader type must be SHADER_TYPE_RAY_GEN, SHADER_TYPE_RAY_MISS or SHADER_TYPE_CALLABLE.
379379
IShader* pShader DEFAULT_INITIALIZER(nullptr);
@@ -382,7 +382,7 @@ struct RayTracingGeneralShaderGroup
382382
constexpr RayTracingGeneralShaderGroup() noexcept
383383
{}
384384

385-
constexpr RayTracingGeneralShaderGroup(const char* _Name,
385+
constexpr RayTracingGeneralShaderGroup(const Char* _Name,
386386
IShader* _pShader) noexcept:
387387
Name {_Name },
388388
pShader{_pShader}
@@ -404,7 +404,7 @@ typedef struct RayTracingGeneralShaderGroup RayTracingGeneralShaderGroup;
404404
struct RayTracingTriangleHitShaderGroup
405405
{
406406
/// Unique group name.
407-
const char* Name DEFAULT_INITIALIZER(nullptr);
407+
const Char* Name DEFAULT_INITIALIZER(nullptr);
408408

409409
/// Closest hit shader.
410410
/// The shader type must be SHADER_TYPE_RAY_CLOSEST_HIT.
@@ -418,7 +418,7 @@ struct RayTracingTriangleHitShaderGroup
418418
constexpr RayTracingTriangleHitShaderGroup() noexcept
419419
{}
420420

421-
constexpr RayTracingTriangleHitShaderGroup(const char* _Name,
421+
constexpr RayTracingTriangleHitShaderGroup(const Char* _Name,
422422
IShader* _pClosestHitShader,
423423
IShader* _pAnyHitShader = nullptr) noexcept:
424424
Name {_Name },
@@ -444,7 +444,7 @@ typedef struct RayTracingTriangleHitShaderGroup RayTracingTriangleHitShaderGroup
444444
struct RayTracingProceduralHitShaderGroup
445445
{
446446
/// Unique group name.
447-
const char* Name DEFAULT_INITIALIZER(nullptr);
447+
const Char* Name DEFAULT_INITIALIZER(nullptr);
448448

449449
/// Intersection shader.
450450
/// The shader type must be SHADER_TYPE_RAY_INTERSECTION.
@@ -462,7 +462,7 @@ struct RayTracingProceduralHitShaderGroup
462462
constexpr RayTracingProceduralHitShaderGroup() noexcept
463463
{}
464464

465-
constexpr RayTracingProceduralHitShaderGroup(const char* _Name,
465+
constexpr RayTracingProceduralHitShaderGroup(const Char* _Name,
466466
IShader* _pIntersectionShader,
467467
IShader* _pClosestHitShader = nullptr,
468468
IShader* _pAnyHitShader = nullptr) noexcept:
@@ -822,7 +822,7 @@ struct RayTracingPipelineStateCreateInfo DILIGENT_DERIVE(PipelineStateCreateInfo
822822
/// Direct3D12 only: the name of the constant buffer that will be used by the local root signature.
823823
/// Ignored if RayTracingPipelineDesc::ShaderRecordSize is zero.
824824
/// In Vulkan backend in HLSL add [[vk::shader_record_ext]] attribute to the constant buffer, in GLSL add shaderRecord layout to buffer.
825-
const char* pShaderRecordName DEFAULT_INITIALIZER(nullptr);
825+
const Char* pShaderRecordName DEFAULT_INITIALIZER(nullptr);
826826

827827
/// Direct3D12 only: the maximum hit shader attribute size in bytes.
828828
/// If zero then maximum allowed size will be used.

Graphics/GraphicsEngine/interface/Shader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ struct ShaderDesc DILIGENT_DERIVE(DeviceObjectAttribs)
153153
constexpr ShaderDesc(const Char* _Name,
154154
SHADER_TYPE _ShaderType,
155155
Bool _UseCombinedTextureSamplers = ShaderDesc{}.UseCombinedTextureSamplers,
156-
const char* _CombinedSamplerSuffix = ShaderDesc{}.CombinedSamplerSuffix) :
156+
const Char* _CombinedSamplerSuffix = ShaderDesc{}.CombinedSamplerSuffix) :
157157
DeviceObjectAttribs{_Name},
158158
ShaderType {_ShaderType},
159159
UseCombinedTextureSamplers{_UseCombinedTextureSamplers},
@@ -511,7 +511,7 @@ struct ShaderResourceDesc
511511
{
512512
// clang-format off
513513
/// Shader resource name
514-
const char* Name DEFAULT_INITIALIZER(nullptr);
514+
const Char* Name DEFAULT_INITIALIZER(nullptr);
515515

516516
/// Shader resource type, see Diligent::SHADER_RESOURCE_TYPE.
517517
SHADER_RESOURCE_TYPE Type DEFAULT_INITIALIZER(SHADER_RESOURCE_TYPE_UNKNOWN);
@@ -524,7 +524,7 @@ struct ShaderResourceDesc
524524
constexpr ShaderResourceDesc() noexcept
525525
{}
526526

527-
constexpr ShaderResourceDesc(const char* _Name,
527+
constexpr ShaderResourceDesc(const Char* _Name,
528528
SHADER_RESOURCE_TYPE _Type,
529529
Uint32 _ArraySize) noexcept :
530530
Name{_Name},

0 commit comments

Comments
 (0)