Checks, at C++ compile-time, if the two pipeline stages are compatible. More...
#include <shader_stage_compatibility_checker.h>
Static Public Member Functions | |
static constexpr bool | CompileTimeStrEqual (const char *str1, const char *str2) |
static constexpr bool | Check () |
Checks, at C++ compile-time, if the two pipeline stages are compatible.
Stages may be incompatible if the outputs declared in the vertex stage don't line up with the inputs declared in the fragment stage. Additionally, the types of the inputs and outputs need to be identical. Some drivers like the one on the PowerVR GE8320 also have bugs the require the precision qualifier of the stage interfaces to match exactly.
Not ensuring stage compatibility will cause pipeline creation errors that will only be caught at runtime. In addition to the bugs discovered related to precision qualifier, some errors may only manifest at runtime on some devices.
This static compile-time C++ check ensures that all the possible runtime errors will be caught at build time.
There is no runtime overhead to using this class.
VertexShaderT | The vertex shader stage metadata. |
FragmentShaderT | The fragment shader stage metadata. |
Definition at line 39 of file shader_stage_compatibility_checker.h.
|
inlinestaticconstexpr |
Returns true
if the shader input slots for the fragment shader match the ones declared as outputs in the vertex shader.
Definition at line 49 of file shader_stage_compatibility_checker.h.
References impeller::ShaderStageIOSlot::binding, impeller::ShaderStageIOSlot::bit_width, impeller::ShaderStageIOSlot::columns, impeller::ShaderStageCompatibilityChecker< VertexShaderT, FragmentShaderT >::CompileTimeStrEqual(), impeller::ShaderStageIOSlot::location, impeller::ShaderStageIOSlot::name, impeller::ShaderStageIOSlot::offset, impeller::ShaderStageIOSlot::relaxed_precision, impeller::ShaderStageIOSlot::set, impeller::ShaderStageIOSlot::type, and impeller::ShaderStageIOSlot::vec_size.
|
inlinestaticconstexpr |
Definition at line 41 of file shader_stage_compatibility_checker.h.
Referenced by impeller::ShaderStageCompatibilityChecker< VertexShaderT, FragmentShaderT >::Check().