Compiler - Output debugging instruction

This commit is contained in:
Emmanuel BENOîT 2017-11-13 18:51:15 +01:00
parent e877f3f391
commit 83b76a96f6
3 changed files with 20 additions and 11 deletions

View file

@ -68,6 +68,7 @@ enum E_OpType
OP_UI_PENTER ,
OP_UI_PEXIT ,
OP_UI_INPUT_DFT ,
OP_UI_ODBG ,
};
M_LSHIFT_OP( T_StringBuilder , E_OpType );

View file

@ -620,17 +620,24 @@ bool T_CompilerImpl_::compileNode(
auto& in( (T_InputInstrNode&) node );
T_OpValue value;
value.f = in.defValue( );
addInstruction( OP_UI_INPUT_DFT , {
uint32_t( output->inputs.indexOf( in.id( ) ) ) ,
uint32_t( constants.indexOf( value.u ) + 3 ) } ,
node.location( ) );
}
break;
addInstruction( OP_FP_LOAD ,
constants.indexOf( value.u ) + 3 ,
in.defValueLocation( ) );
addInstruction( OP_PUSH , in.defValueLocation( ) );
addInstruction( OP_FP_SSTORE_INT , 0 , in.defValueLocation( ) );
addInstruction( OP_CONST , output->inputs.indexOf( in.id( ) ) , in.idLocation( ) );
addInstruction( OP_PUSH , in.defValueLocation( ) );
addInstruction( OP_UI_INPUT_DFT , node.location( ) );
case A_Node::OP_ODBG:
if ( exit ) {
auto& n( (T_OutputDebugInstrNode&) node );
if ( ! output->uiStrings.contains( n.description( ) ) ) {
output->uiStrings.add( n.description( ) );
}
processIdentifier( funcIndex , n.texture( ) , n.textureLocation( ) );
addInstruction( OP_UI_ODBG , {
uint32_t( n.mode( ) ) ,
uint32_t( output->uiStrings.indexOf( n.description( ) ) ) } ,
node.location( ) );
}
break;

3
ops.cc
View file

@ -139,7 +139,8 @@ static T_KeyValueTable< E_OpType , T_OpInfo > OpInfoTable_{ ([]() {
//
infos.add( E_OpType::OP_UI_PENTER , T_OpInfo{ "ui-prof-enter" , 1 } );
infos.add( E_OpType::OP_UI_PEXIT , T_OpInfo{ "ui-prof-exit" } );
infos.add( E_OpType::OP_UI_INPUT_DFT , T_OpInfo{ "ui-input-default" , 0 , OpStackMain{ -2 } } );
infos.add( E_OpType::OP_UI_INPUT_DFT , T_OpInfo{ "ui-input-default" , 2 } );
infos.add( E_OpType::OP_UI_ODBG , T_OpInfo{ "ui-odbg" , 2 , OpStackMain{ -1 } } );
return infos;
})( ) };