JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
ShaderBytecode Struct Reference

A ShaderProgram's GLSL compiled at build time by jngl-shaderc, for the Vulkan (SPIR-V), the Direct3D 12 (DXBC) or the Metal (MSL, which it compiles when it loads it) renderer. More...

#include <jngl/ShaderBytecode.hpp>

Classes

struct  Uniform
 One of the program's uniforms, see ShaderProgram::getUniformLocation. More...
 

Public Attributes

std::span< const uint32_t > vertex
 As 32-bit words.
 
std::span< const uint32_t > fragment
 
std::span< const Uniform > uniforms
 
uint32_t uniformBlockSize
 
bool pushConstants
 Whether the uniforms are push constants rather than a uniform buffer.
 

Detailed Description

A ShaderProgram's GLSL compiled at build time by jngl-shaderc, for the Vulkan (SPIR-V), the Direct3D 12 (DXBC) or the Metal (MSL, which it compiles when it loads it) renderer.

Direct3D 12, Metal and Vulkan on Android can't compile GLSL at runtime, so they only support ShaderPrograms created from these, see JNGL_PRECOMPILED_SHADERS. jngl-shaderc generates a header with one for each program, see jngl_compile_shaders() in JNGL's CMakeLists.txt:

#include "shaders.hpp" // generated
const jngl::ShaderProgram blur(shaders::blur);
Linked vertex and fragment shaders.

Definition at line 25 of file ShaderBytecode.hpp.

Collaboration diagram for ShaderBytecode:
[legend]

Member Data Documentation

◆ vertex

std::span<const uint32_t> vertex

As 32-bit words.

Definition at line 34 of file ShaderBytecode.hpp.

◆ fragment

std::span<const uint32_t> fragment

Definition at line 35 of file ShaderBytecode.hpp.

◆ uniforms

std::span<const Uniform> uniforms

Definition at line 36 of file ShaderBytecode.hpp.

◆ uniformBlockSize

uint32_t uniformBlockSize

Definition at line 37 of file ShaderBytecode.hpp.

◆ pushConstants

bool pushConstants

Whether the uniforms are push constants rather than a uniform buffer.

Definition at line 39 of file ShaderBytecode.hpp.


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