@@ -51,7 +51,7 @@ TypeHandle CLP(ShaderContext)::_type_handle;
51
51
// actually picked up and the appropriate ShaderMatSpec pushed onto _mat_spec.
52
52
// //////////////////////////////////////////////////////////////////
53
53
bool CLP (ShaderContext)::
54
- parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objShader) {
54
+ parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, GLenum param_type, Shader *objShader) {
55
55
Shader::ShaderArgInfo p;
56
56
p._id = arg_id;
57
57
p._cat = GLCAT;
@@ -167,6 +167,14 @@ parse_and_set_short_hand_shader_vars(Shader::ShaderArgId &arg_id, Shader *objSha
167
167
else if (pieces[0 ] == " col2" ) bind._piece = Shader::SMP_col2;
168
168
else if (pieces[0 ] == " col3" ) bind._piece = Shader::SMP_col3;
169
169
170
+ if (param_type == GL_FLOAT_MAT3) {
171
+ if (bind._piece == Shader::SMP_whole) {
172
+ bind._piece = Shader::SMP_upper3x3;
173
+ } else if (bind._piece == Shader::SMP_transpose) {
174
+ bind._piece = Shader::SMP_transpose3x3;
175
+ }
176
+ }
177
+
170
178
if (!objShader->cp_parse_coord_sys (p, pieces, next, bind, true )) {
171
179
return false ;
172
180
}
@@ -614,7 +622,7 @@ CLP(ShaderContext)(CLP(GraphicsStateGuardian) *glgsg, Shader *s) : ShaderContext
614
622
}
615
623
616
624
// Tries to parse shorthand notations like mspos_XXX and trans_model_to_clip_of_XXX
617
- if (parse_and_set_short_hand_shader_vars (arg_id, s)) {
625
+ if (parse_and_set_short_hand_shader_vars (arg_id, param_type, s)) {
618
626
continue ;
619
627
}
620
628
0 commit comments