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 :
3063
3063
};
3064
3064
3065
3065
class u_ColorGlobal :
3066
- GLUniform1ui {
3066
+ GLUniform1i {
3067
3067
public:
3068
3068
u_ColorGlobal ( GLShader* shader ) :
3069
- GLUniform1ui ( shader, " u_ColorGlobal" , true ) {
3069
+ GLUniform1i ( shader, " u_ColorGlobal" , true ) {
3070
3070
}
3071
3071
3072
3072
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 );
3074
3079
}
3075
3080
};
3076
3081
You can’t perform that action at this time.
0 commit comments