@@ -667,7 +667,7 @@ void ParseBlockMembersToTextLines(
667667 SpvReflectValue val{};
668668 SpvReflectResult res = obj.EvaluateResult (member.array .spec_constant_op_ids [array_dim_index], val);
669669 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) && (val.type ->traits .numeric .scalar .width == 32 )) {
670- dim = val.values [ 0 ] .value .uint32_bool_value ;
670+ dim = val.data . numeric . scalar .value .uint32_bool_value ;
671671 }
672672 }
673673 ss_array << " [" << dim << " ]" ;
@@ -710,7 +710,7 @@ void ParseBlockMembersToTextLines(
710710 SpvReflectValue val{};
711711 SpvReflectResult res = obj.EvaluateResult (member.array .spec_constant_op_ids [array_dim_index], val);
712712 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) && (val.type ->traits .numeric .scalar .width == 32 )) {
713- dim = val.values [ 0 ] .value .uint32_bool_value ;
713+ dim = val.data . numeric . scalar .value .uint32_bool_value ;
714714 }
715715 }
716716 ss_array << " [" << dim << " ]" ;
@@ -1041,7 +1041,7 @@ void StreamWriteInterfaceVariable(std::ostream& os, const spv_reflect::ShaderMod
10411041 SpvReflectValue val{};
10421042 SpvReflectResult res = shader.EvaluateResult (obj.array .spec_constant_op_ids [dim_index], val);
10431043 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) && (val.type ->traits .numeric .scalar .width == 32 )) {
1044- dim = val.values [ 0 ] .value .uint32_bool_value ;
1044+ dim = val.data . numeric . scalar .value .uint32_bool_value ;
10451045 }
10461046 }
10471047 os << " [" << obj.array .dims [dim_index] << " ]" ;
@@ -1071,12 +1071,22 @@ void StreamWriteSpecializationConstant(std::ostream& os, const SpvReflectSpecial
10711071 os << t << " constant id: " << obj.constant_id << " \n " ;
10721072 os << t << " name : " << (obj.name != NULL ? obj.name : " " ) << ' \n ' ;
10731073 os << t << " type : " ;
1074- switch (obj.general_type ) {
1075- case SPV_REFLECT_SCALAR_TYPE_BOOL:
1074+ int type = 0 ;
1075+ if (!obj.type || obj.type ->type_flags == SPV_REFLECT_TYPE_FLAG_BOOL) {
1076+ type = 1 ;
1077+ }
1078+ else if (obj.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) {
1079+ type = 2 ;
1080+ }
1081+ else if (obj.type ->type_flags == SPV_REFLECT_TYPE_FLAG_FLOAT) {
1082+ type = 3 ;
1083+ }
1084+ switch (type) {
1085+ case 1 :
10761086 os << " boolean\n " ;
10771087 os << t << " default : " << obj.default_value .value .uint32_bool_value ;
10781088 break ;
1079- case SPV_REFLECT_SCALAR_TYPE_INT :
1089+ case 2 :
10801090 if (obj.type ->traits .numeric .scalar .signedness ) {
10811091 os << " signed " ;
10821092 }
@@ -1106,7 +1116,7 @@ void StreamWriteSpecializationConstant(std::ostream& os, const SpvReflectSpecial
11061116 os << " default value not native in c/cpp" ;
11071117 }
11081118 break ;
1109- case SPV_REFLECT_SCALAR_TYPE_FLOAT :
1119+ case 3 :
11101120 os << obj.type ->traits .numeric .scalar .width << " bit floating point\n " ;
11111121 os << t << " default : " ;
11121122 if (obj.type ->traits .numeric .scalar .width == 32 ) {
@@ -1141,7 +1151,9 @@ void StreamWriteEntryPoint(std::ostream& os, const spv_reflect::ShaderModule& sh
11411151 SpvReflectResult res = shader.EvaluateResult (obj.local_size .x , val);
11421152 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == (SPV_REFLECT_TYPE_FLAG_INT | SPV_REFLECT_TYPE_FLAG_VECTOR))
11431153 && (val.type ->traits .numeric .scalar .width == 32 )) {
1144- os << " (" << val.values [0 ].value .uint32_bool_value << " , " << val.values [1 ].value .uint32_bool_value << " , " << val.values [2 ].value .uint32_bool_value << " )" ;
1154+ os << " (" << val.data .numeric .vector .value [0 ].value .uint32_bool_value << " , "
1155+ << val.data .numeric .vector .value [1 ].value .uint32_bool_value << " , "
1156+ << val.data .numeric .vector .value [2 ].value .uint32_bool_value << " )" ;
11451157 }
11461158 else {
11471159 os << " (failed evaluation of WorkGroupSize Builtin)" ;
@@ -1152,22 +1164,22 @@ void StreamWriteEntryPoint(std::ostream& os, const spv_reflect::ShaderModule& sh
11521164 SpvReflectValue val = {0 };
11531165 SpvReflectResult res = shader.EvaluateResult (obj.local_size .x , val);
11541166 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) && (val.type ->traits .numeric .scalar .width == 32 )) {
1155- os << val.values [ 0 ] .value .uint32_bool_value ;
1167+ os << val.data . numeric . scalar .value .uint32_bool_value ;
11561168 }
11571169 else {
11581170 os << " unknown" ;
11591171 }
11601172 os << " , " ;
11611173 res = shader.EvaluateResult (obj.local_size .y , val);
11621174 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) && (val.type ->traits .numeric .scalar .width == 32 )) {
1163- os << val.values [ 0 ] .value .uint32_bool_value ;
1175+ os << val.data . numeric . scalar .value .uint32_bool_value ;
11641176 }
11651177 else {
11661178 os << " unknown" ;
11671179 } os << " , " ;
11681180 res = shader.EvaluateResult (obj.local_size .z , val);
11691181 if ((res == SPV_REFLECT_RESULT_SUCCESS) && val.type && (val.type ->type_flags == SPV_REFLECT_TYPE_FLAG_INT) && (val.type ->traits .numeric .scalar .width == 32 )) {
1170- os << val.values [ 0 ].value .uint32_bool_value ;
1182+ os << val.data . numeric . vector . value [ 2 ].value .uint32_bool_value ;
11711183 }
11721184 else {
11731185 os << " unknown" ;
0 commit comments