mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Rewrite shaders to use OpenGL ES3 syntax
Signed-off-by: renderexpert <expert@renderconsulting.co.uk>
This commit is contained in:
committed by
Konstantin Pastbin
parent
9b3507211f
commit
6d0daf6fe7
@@ -48,17 +48,22 @@ private:
|
||||
|
||||
#define ALIGNMENT alignas(16)
|
||||
|
||||
// NOTE: structs may contain dummy elements to fit MSL and GLSL struct alignment rules
|
||||
// 1. Add new fields in order from the highest byte size to the lowest, it minimizes alignment overhead
|
||||
// 2. Keep 16 bytes alignment for the whole struct, it complements the size of the latest element to vec4
|
||||
// 3. Consider vec3 as vec4, add float complement and don't reuse it
|
||||
|
||||
struct ALIGNMENT MapProgramParams
|
||||
{
|
||||
glsl::mat4 m_modelView;
|
||||
glsl::mat4 m_projection;
|
||||
glsl::mat4 m_pivotTransform;
|
||||
glsl::vec2 m_contrastGamma;
|
||||
float m_opacity = 1.0f;
|
||||
float m_zScale = 1.0f;
|
||||
float m_interpolation = 1.0f;
|
||||
float m_isOutlinePass = 1.0f;
|
||||
glsl::vec2 m_contrastGamma;
|
||||
|
||||
|
||||
BIND_PROGRAMS(MapProgramParams,
|
||||
Program::Area,
|
||||
Program::Area3d,
|
||||
@@ -100,14 +105,14 @@ struct ALIGNMENT RouteProgramParams
|
||||
glsl::vec4 m_color;
|
||||
glsl::vec4 m_maskColor;
|
||||
glsl::vec4 m_outlineColor;
|
||||
glsl::vec4 m_fakeColor;
|
||||
glsl::vec4 m_fakeOutlineColor;
|
||||
glsl::vec2 m_fakeBorders;
|
||||
glsl::vec2 m_pattern;
|
||||
glsl::vec2 m_angleCosSin;
|
||||
float m_arrowHalfWidth = 0.0f;
|
||||
float m_opacity = 1.0f;
|
||||
glsl::vec2 m_fakeBorders;
|
||||
glsl::vec4 m_fakeColor;
|
||||
glsl::vec4 m_fakeOutlineColor;
|
||||
|
||||
|
||||
BIND_PROGRAMS(RouteProgramParams,
|
||||
Program::Route,
|
||||
Program::RouteDash,
|
||||
@@ -122,10 +127,13 @@ struct ALIGNMENT TrafficProgramParams
|
||||
glsl::mat4 m_pivotTransform;
|
||||
glsl::vec4 m_trafficParams;
|
||||
glsl::vec3 m_outlineColor;
|
||||
float m_outline = 0.0f;
|
||||
float m_dummy1; // alignment
|
||||
glsl::vec3 m_lightArrowColor;
|
||||
float m_opacity = 1.0f;
|
||||
float m_dummy2; // alignment
|
||||
glsl::vec3 m_darkArrowColor;
|
||||
float m_dummy3; // alignment
|
||||
float m_outline = 0.0f;
|
||||
float m_opacity = 1.0f;
|
||||
|
||||
BIND_PROGRAMS(TrafficProgramParams,
|
||||
Program::Traffic,
|
||||
@@ -139,6 +147,7 @@ struct ALIGNMENT TransitProgramParams
|
||||
glsl::mat4 m_projection;
|
||||
glsl::mat4 m_pivotTransform;
|
||||
glsl::vec3 m_params;
|
||||
float m_dummy1; // alignment
|
||||
float m_lineHalfWidth = 0.0f;
|
||||
float m_maxRadius = 0.0f;
|
||||
|
||||
@@ -171,8 +180,9 @@ struct ALIGNMENT ShapesProgramParams
|
||||
glsl::mat4 m_projection;
|
||||
glsl::mat4 m_pivotTransform;
|
||||
glsl::vec3 m_position;
|
||||
float m_accuracy = 0.0;
|
||||
float m_dummy1; // alignment
|
||||
glsl::vec2 m_lineParams;
|
||||
float m_accuracy = 0.0;
|
||||
float m_zScale = 1.0f;
|
||||
float m_opacity = 1.0f;
|
||||
float m_azimut = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user