X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fmodule.cpp;h=116c6241a184d321b6408122713873b16657412e;hb=4f79ac1988e401b5242db437caccc0a98cf5dba1;hp=4eefc0347494ecadb077e8b0bc8a984688b08464;hpb=5cbd8664a7300d0c0076862572adeda9955b1c97;p=libs%2Fgl.git diff --git a/source/core/module.cpp b/source/core/module.cpp index 4eefc034..116c6241 100644 --- a/source/core/module.cpp +++ b/source/core/module.cpp @@ -376,7 +376,7 @@ void SpirVModule::Reflection::reflect_image_type(CodeIterator op) unsigned dimensions = *(op+3); bool depth = *(op+4)==1; bool array = *(op+5); - type.type = static_cast((depth*0x200000) | (array*0x80000) | (dimensions+1) | sample); + type.type = static_cast((depth*0x200000) | (array*0x80000) | ((dimensions+1)<<16) | sample); } void SpirVModule::Reflection::reflect_sampled_image_type(CodeIterator op) @@ -428,13 +428,14 @@ void SpirVModule::Reflection::reflect_pointer_type(CodeIterator op) void SpirVModule::Reflection::reflect_constant(CodeIterator op) { + unsigned opcode = get_opcode(*op); unsigned id = *(op+2); Constant &cnst = constants[id]; cnst.name = names[id]; cnst.type = types[*(op+1)].type; - if(*op==OP_CONSTANT_TRUE || *op==OP_SPEC_CONSTANT_TRUE) + if(opcode==OP_CONSTANT_TRUE || opcode==OP_SPEC_CONSTANT_TRUE) cnst.i_value = true; - else if(*op==OP_CONSTANT_FALSE || *op==OP_SPEC_CONSTANT_FALSE) + else if(opcode==OP_CONSTANT_FALSE || opcode==OP_SPEC_CONSTANT_FALSE) cnst.i_value = false; else if(cnst.type==INT || cnst.type==UNSIGNED_INT) cnst.i_value = *(op+3);