- if(type.type==INT)
- constants[id] = static_cast<int>(*(op+3));
- else if(type.type==UNSIGNED_INT)
- constants[id] = static_cast<unsigned>(*(op+3));
- else if(type.type==FLOAT)
- constants[id] = *reinterpret_cast<const float *>(&*(op+3));
-}
-
-void SpirVModule::Reflection::reflect_spec_constant(CodeIterator op)
-{
- unsigned id = *(op+2);
- SpecConstant &spec = spec_constants[id];
- spec.name = names[id];
- spec.type = types[*(op+1)].type;
+ Constant &cnst = constants[id];
+ cnst.name = names[id];
+ cnst.type = types[*(op+1)].type;
+ if(*op==OP_CONSTANT_TRUE || *op==OP_SPEC_CONSTANT_TRUE)
+ cnst.i_value = true;
+ else if(*op==OP_CONSTANT_FALSE || *op==OP_SPEC_CONSTANT_FALSE)
+ cnst.i_value = false;
+ else if(cnst.type==INT || cnst.type==UNSIGNED_INT)
+ cnst.i_value = *(op+3);
+ else if(cnst.type==FLOAT)
+ cnst.f_value = *reinterpret_cast<const float *>(&*(op+3));