DECO_SPEC_ID = 1,
DECO_ARRAY_STRIDE = 6,
DECO_MATRIX_STRIDE = 7,
+ DECO_BUILTIN = 11,
DECO_LOCATION = 30,
DECO_BINDING = 33,
DECO_DESCRIPTOR_SET = 34,
void SpirVModule::load_code(IO::Base &io)
{
- UInt32 buffer[1024];
+ uint32_t buffer[1024];
while(1)
{
unsigned len = io.read(reinterpret_cast<char *>(buffer), sizeof(buffer));
if(code[0]==SPIRV_MAGIC_REVERSED)
{
- for(UInt32 &c: code)
+ for(uint32_t &c: code)
c = ((c&0xFF)<<24) || ((c&0xFF00)<<8) | ((c>>8)&0xFF00) | ((c>>24)&0xFF);
}
else if(code[0]!=SPIRV_MAGIC)
}
-SpirVModule::EntryPoint::EntryPoint():
- stage(VERTEX)
-{ }
-
-
-SpirVModule::StructMember::StructMember():
- type(VOID),
- struct_type(0),
- offset(0),
- array_size(0),
- array_size_spec(0),
- array_stride(0),
- matrix_stride(0)
-{ }
-
-
-SpirVModule::Variable::Variable():
- type(VOID),
- struct_type(0),
- location(-1),
- descriptor_set(-1),
- binding(-1)
-{ }
-
bool SpirVModule::Variable::operator==(const Variable &other) const
{
if(storage!=UNIFORM_CONSTANT && storage!=UNIFORM)
}
-SpirVModule::TypeInfo::TypeInfo():
- type(VOID),
- struct_type(0),
- array_size_spec(0),
- array_size(0),
- array_stride(0),
- storage(static_cast<StorageClass>(-1))
-{ }
-
-
-UInt32 SpirVModule::Reflection::get_opcode(UInt32 op)
+uint32_t SpirVModule::Reflection::get_opcode(uint32_t op)
{
return op&0xFFFF;
}
throw invalid_module("Unterminated SPIR-V string literal");
}
-void SpirVModule::Reflection::reflect_code(const vector<UInt32> &code)
+void SpirVModule::Reflection::reflect_code(const vector<uint32_t> &code)
{
for(CodeIterator op=code.begin()+5; op!=code.end(); )
{
case DECO_ARRAY_STRIDE:
types[id].array_stride = *op;
break;
+ case DECO_BUILTIN:
+ variables[id].builtin = static_cast<BuiltinSemantic>(*op);
+ break;
case DECO_LOCATION:
variables[id].location = *op;
break;
case DECO_MATRIX_STRIDE:
member.matrix_stride = *op;
break;
+ case DECO_BUILTIN:
+ member.builtin = static_cast<BuiltinSemantic>(*op);
+ break;
case DECO_OFFSET:
member.offset = *op;
break;