Diligent Engine API Reference: Diligent::ShaderCreationAttribs Struct Reference

Diligent Engine API Reference

Public Attributes | List of all members
Diligent::ShaderCreationAttribs Struct Reference

Shader creation attributes. More...

## Public Attributes
const Char * | FilePath = nullptr
| Source file path. More...
IShaderSourceInputStreamFactory * | pShaderSourceStreamFactory = nullptr
| Pointer to the shader source input stream factory. More...
class IHLSL2GLSLConversionStream ** | ppConversionStream = nullptr
| HLSL->GLSL conversion stream. More...
const Char * | Source = nullptr
| Shader source. More...
const void * | ByteCode = nullptr
| Compiled shader bytecode. More...
size_t | ByteCodeSize = 0
| Size of the compiled shader bytecode. More...
const Char * | EntryPoint = "main"
| Shader entry point. More...
const ShaderMacro * | Macros = nullptr
| Shader macros. More...
ShaderDesc | Desc
| Shader description. See Diligent::ShaderDesc.
SHADER_SOURCE_LANGUAGE | SourceLanguage = SHADER_SOURCE_LANGUAGE_DEFAULT
| Shader source language. See Diligent::SHADER_SOURCE_LANGUAGE.

## Detailed Description

Shader creation attributes.

## Member Data Documentation

## ◆ ByteCode

const void* Diligent::ShaderCreationAttribs::ByteCode = nullptr

Compiled shader bytecode.

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

Note
  . This option is currently only supported for D3D11 and D3D12

## ◆ ByteCodeSize

size_t Diligent::ShaderCreationAttribs::ByteCodeSize = 0

Size of the compiled shader bytecode.

Byte code size must be provided if ByteCode is not null

## ◆ EntryPoint

const Char* Diligent::ShaderCreationAttribs::EntryPoint = "main"

Shader entry point.

This member is ignored if ByteCode is not null

## ◆ FilePath

const Char* Diligent::ShaderCreationAttribs::FilePath = nullptr

Source file path.

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

## ◆ Macros

const ShaderMacro* Diligent::ShaderCreationAttribs::Macros = nullptr

Shader macros.

This member is ignored if ByteCode is not null

## ◆ ppConversionStream

class IHLSL2GLSLConversionStream** Diligent::ShaderCreationAttribs::ppConversionStream = nullptr

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.

## ◆ pShaderSourceStreamFactory

IShaderSourceInputStreamFactory* Diligent::ShaderCreationAttribs::pShaderSourceStreamFactory = nullptr

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

## ◆ Source

const Char* Diligent::ShaderCreationAttribs::Source = nullptr

Shader source.

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