Kanzi 3.9.10
kanzi::ShaderProgram::CreateInfoShaderBinary Struct Reference

ShaderProgram creation parameters for initialized from vendor specific GL shader binary. More...

#include <kanzi/core.ui/platform/graphics_backend/gl/shader_create_info.hpp>

Inheritance diagram for kanzi::ShaderProgram::CreateInfoShaderBinary:
[legend]

Public Member Functions

 CreateInfoShaderBinary (unsigned int shaderBinaryFormat, unsigned int dataSize, void *data)
 Construct a create info structure for shader program creation from precompiled shader binary.
 
 CreateInfoShaderBinary (unsigned int shaderBinaryFormat, unsigned int vertexShaderBinaryByteCount, void *vertexShaderBinary, unsigned int fragmentShaderBinaryByteCount, void *fragmentShaderBinary)
 Construct a create info structure for shader program creation from precompiled shader binary data.
 
- Public Member Functions inherited from kanzi::ShaderProgram::CreateInfo
void addBinaryShader (ShaderType type, ConstByteSpan binary)
 Adds a binary shader to the program.
 
void addFixedUniform (string_view name)
 Adds a fixed uniform to a shader.
 
void addFixedUniform (string_view name, ShaderProgram::FixedUniform uniform)
 Adds a fixed uniform to a shader.
 
void addFixedUniform (string_view name, ShaderProgram::FixedUniform uniform, ShaderProgram::UniformTransformation transformation)
 Adds a fixed uniform to a shader.
 
void addFixedUniform (string_view name, ShaderProgram::UniformTransformation transformation)
 Adds a fixed uniform to a shader.
 
void addSourceShader (ShaderType type, const char *source)
 Adds a source shader to the program.
 
void addSourceShader (ShaderType type, string_view source)
 Adds a source shader to the program.
 
void addUniform (AbstractPropertyType propertyType)
 Adds a property type uniform to shader.
 
void addUniform (AbstractPropertyType propertyType, PropertyDataType dataType, unsigned int elementCount)
 Adds a property type uniform to shader.
 
void addUniform (AbstractPropertyType propertyType, PropertyDataType dataType, unsigned int elementCount, ShaderProgram::UniformTransformation transformation)
 Adds a property type uniform to shader.
 
void addUniform (AbstractPropertyType propertyType, ShaderProgram::UniformTransformation transformation)
 Adds a property type uniform to shader.
 
void addUniform (string_view name, PropertyDataType dataType, unsigned int elementCount, optional< AbstractPropertyType > propertyType, UniformBindingType bindingType, optional< FixedUniform > fixedOperation, FixedUniformFunction func, UniformTransformation transform)
 Adds an uniform to shader.
 
void addUniformAndBinding (AbstractPropertyType propertyType)
 Adds a property type uniform to a shader and creates for that uniform a default render value binding.
 
void addUniformAndBinding (AbstractPropertyType propertyType, ShaderProgram::UniformTransformation transformation)
 Adds a property type uniform to a shader with a given uniform transformation and creates for that uniform a default render value binding.
 
 CreateInfo ()
 Constructs empty create info structure for shader program creation.
 
Status validate (const Renderer &renderer) const
 Perform validation of shader creation parameters.
 

Additional Inherited Members

- Public Types inherited from kanzi::ShaderProgram::CreateInfo
using BindingContainer
 Binding container type.
 
using BindingInfo
 Binding info.
 
enum  Status {
  StatusUnsupportedFormat , StatusCompileError , StatusLinkError , StatusInvalidAttributeLocation ,
  StatusMissingShaderStage , StatusValid
}
 Status tells if shader creation parameters can be used to create a shader. More...
 
- Public Attributes inherited from kanzi::ShaderProgram::CreateInfo
BindingContainer bindings
 Bindings.
 
bool blendingControl
 Indicates whether ShaderProgram created from this createInfo should be able to change blending mode.
 
vector< bytecombinedShaderBinaryData
 Combined shader binary data.
 
unsigned int combinedShaderBinaryFormat
 Format for combined shader binary.
 
vector< byteprogramBinaryData
 Program binary data.
 
unsigned int programBinaryFormat
 Format for program binary.
 
unsigned int separateShaderBinaryFormat
 Format for separate shader binaries.
 
vector< BinaryShaderStageshaderBinaries
 All shader stages in binary format.
 
vector< ShaderStageshaderSources
 All shader stages in source code format.
 
UniformContainer uniforms
 Uniforms.
 
ShaderAttributeCollection vertexFormat
 Shader vertex attributes.
 

Detailed Description

ShaderProgram creation parameters for initialized from vendor specific GL shader binary.

Constructor & Destructor Documentation

◆ CreateInfoShaderBinary() [1/2]

kanzi::ShaderProgram::CreateInfoShaderBinary::CreateInfoShaderBinary ( unsigned int shaderBinaryFormat,
unsigned int dataSize,
void * data )
explicit

Construct a create info structure for shader program creation from precompiled shader binary.

Note
Supported shader binary formats are vendor specific. Each vendor uses their own shader binary formats. Use Renderer::isGlShaderBinaryFormatSupported() to verify that shaderBinaryFormat is supported.
After constructing the create info, you must insert used attributes to createInfo.vertexFormat.
Parameters
shaderBinaryFormatGL shader binary format.
dataSizeSize of shader binary data in bytes.
dataPointer to shader binary data.

◆ CreateInfoShaderBinary() [2/2]

kanzi::ShaderProgram::CreateInfoShaderBinary::CreateInfoShaderBinary ( unsigned int shaderBinaryFormat,
unsigned int vertexShaderBinaryByteCount,
void * vertexShaderBinary,
unsigned int fragmentShaderBinaryByteCount,
void * fragmentShaderBinary )
explicit

Construct a create info structure for shader program creation from precompiled shader binary data.

This version takes in two data blobs, one for vertex shader and another one for fragment shader.

Note
Supported shader binary formats are vendor specific. Each vendor uses their own shader binary formats. Use Renderer::isGlShaderBinaryFormatSupported() to verify that shaderBinaryFormat is supported.
After constructing the create info, you must insert used attributes to createInfo.vertexFormat.
Parameters
shaderBinaryFormatGL shader binary format.
vertexShaderBinaryByteCountSize of vertex shader binary data in bytes.
vertexShaderBinaryPointer to vertex shader binary data.
fragmentShaderBinaryByteCountSize of fragment shader binary data in bytes.
fragmentShaderBinaryPointer to fragment shader binary data.

The documentation for this struct was generated from the following file: