File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -3063,14 +3063,19 @@ class u_Color :
30633063};
30643064
30653065class u_ColorGlobal :
3066- GLUniform1ui {
3066+ GLUniform1i {
30673067 public:
30683068 u_ColorGlobal ( GLShader* shader ) :
3069- GLUniform1ui ( shader, " u_ColorGlobal" , true ) {
3069+ GLUniform1i ( shader, " u_ColorGlobal" , true ) {
30703070 }
30713071
30723072 void SetUniform_ColorGlobal ( const Color::Color& color ) {
3073- this ->SetValue ( packUnorm4x8 ( color.ToArray () ) );
3073+ /* HACK: Store uint32_t as int32_t to be compatible with GLSL 1.20,
3074+ the GLSL code will convert back to uint32_t. */
3075+ uint32_t uColor = packUnorm4x8 ( color.ToArray () );
3076+ int32_t iColor;
3077+ memcpy ( &iColor, &uColor, sizeof ( iColor ) );
3078+ this ->SetValue ( iColor );
30743079 }
30753080};
30763081
You can’t perform that action at this time.
0 commit comments