Diligent::ShaderCreateInfo struct

Shader creation attributes.

Contents

Public variables

const Char* FilePath
Source file path.
IShaderSourceInputStreamFactory* pShaderSourceStreamFactory
Pointer to the shader source input stream factory.
struct IHLSL2GLSLConversionStream** ppConversionStream
HLSL->GLSL conversion stream.
const Char* Source
Shader source.
const void* ByteCode
Compiled shader bytecode.
size_t ByteCodeSize
Size of the compiled shader bytecode.
const Char* EntryPoint
Shader entry point.
const ShaderMacro* Macros
Shader macros.
bool UseCombinedTextureSamplers
If set to true, textures will be combined with texture samplers. The CombinedSamplerSuffix member defines the suffix added to the texture variable name to get corresponding sampler name. When using combined samplers, the sampler assigned to the shader resource view is automatically set when the view is bound. Otherwise samplers need to be explicitly set similar to other shader variables. This member has no effect if the shader is used in the PSO that uses pipeline resource signature(s).
const Char* CombinedSamplerSuffix
If UseCombinedTextureSamplers is true, defines the suffix added to the texture variable name to get corresponding sampler name. For example, for default value "_sampler", a texture named "tex" will be combined with sampler named "tex_sampler". If UseCombinedTextureSamplers is false, this member is ignored. This member has no effect if the shader is used in the PSO that uses pipeline resource signature(s).
ShaderDesc Desc
Shader description. See Diligent::ShaderDesc.
SHADER_SOURCE_LANGUAGE SourceLanguage
Shader source language. See Diligent::SHADER_SOURCE_LANGUAGE.
SHADER_COMPILER ShaderCompiler
Shader compiler. See Diligent::SHADER_COMPILER.
ShaderVersion HLSLVersion
HLSL shader model to use when compiling the shader. When default value is given (0, 0), the engine will attempt to use the highest HLSL shader model supported by the device. If the shader is created from the byte code, this value has no effect.
ShaderVersion GLSLVersion
GLSL version to use when creating the shader. When default value is given (0, 0), the engine will attempt to use the highest GLSL version supported by the device.
ShaderVersion GLESSLVersion
GLES shading language version to use when creating the shader. When default value is given (0, 0), the engine will attempt to use the highest GLESSL version supported by the device.
SHADER_COMPILE_FLAGS CompileFlags
Shader compile flags (see Diligent::SHADER_COMPILE_FLAGS).
IDataBlob** ppCompilerOutput
Memory address where pointer to the compiler messages data blob will be written.

Variable documentation

const Char* Diligent::ShaderCreateInfo::FilePath

Source file path.

If source file path is provided, Source and ByteCode members must be null

IShaderSourceInputStreamFactory* Diligent::ShaderCreateInfo::pShaderSourceStreamFactory

Pointer to the shader source input stream factory.

The factory is used to load the shader source file if FilePath is not null. It is also used to create additional input streams for shader include files

struct IHLSL2GLSLConversionStream** Diligent::ShaderCreateInfo::ppConversionStream

HLSL->GLSL conversion stream.

If HLSL->GLSL converter is used to convert HLSL shader source to GLSL, this member can provide pointer to the conversion stream. It is useful when the same file is used to create a number of different shaders. If ppConversionStream is null, the converter will parse the same file every time new shader is converted. If ppConversionStream is not null, the converter will write pointer to the conversion stream to *ppConversionStream the first time and will use it in all subsequent times. For all subsequent conversions, FilePath member must be the same, or new stream will be crated and warning message will be displayed.

const Char* Diligent::ShaderCreateInfo::Source

Shader source.

If shader source is provided, FilePath and ByteCode members must be null

const void* Diligent::ShaderCreateInfo::ByteCode

Compiled shader bytecode.

If shader byte code is provided, FilePath and Source members must be null

size_t Diligent::ShaderCreateInfo::ByteCodeSize

Size of the compiled shader bytecode.

Byte code size (in bytes) must be provided if ByteCode is not null

const Char* Diligent::ShaderCreateInfo::EntryPoint

Shader entry point.

This member is ignored if ByteCode is not null

const ShaderMacro* Diligent::ShaderCreateInfo::Macros

Shader macros.

This member is ignored if ByteCode is not null

ShaderVersion Diligent::ShaderCreateInfo::HLSLVersion

HLSL shader model to use when compiling the shader. When default value is given (0, 0), the engine will attempt to use the highest HLSL shader model supported by the device. If the shader is created from the byte code, this value has no effect.

IDataBlob** Diligent::ShaderCreateInfo::ppCompilerOutput

Memory address where pointer to the compiler messages data blob will be written.

The buffer contains two null-terminated strings. The first one is the compiler output message. The second one is the full shader source code including definitions added by the engine. Data blob object must be released by the client.