MCPcopy Create free account
hub / github.com/carbonengine/trinity / ParseStateAssignment

Function ParseStateAssignment

shadercompiler/FXAnalyzer.cpp:1614–1636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1612}
1613
1614bool ParseStateAssignment( ParserState& parserState, ASTNode* state, StateDescription* states, void* dataBlob )
1615{
1616 if( state->GetNodeType() != NT_STATE_ASSIGNMENT )
1617 {
1618 return false;
1619 }
1620 std::string name = ToString( state->GetToken()->stringValue );
1621 ASTNode* value = state->GetChildOrNull( 0 );
1622 if( value == nullptr )
1623 {
1624 return false;
1625 }
1626 // BYTE* blob = reinterpret_cast<BYTE*>( dataBlob );
1627 for( int i = 0; states[i].stateName; ++i )
1628 {
1629 if( _stricmp( name.c_str(), states[i].stateName ) == 0 )
1630 {
1631 return GetStateValue( parserState, value, states[i], dataBlob );
1632 }
1633 }
1634 parserState.ShowMessage( state->GetToken()->fileLocation, EC_INVALID_STATE, name.c_str() );
1635 return false;
1636}
1637
1638bool GetSamplerState( ParserState& parserState, ASTNode* node, Sampler& sampler )
1639{

Callers 5

CompileEffectMethod · 0.85
ProcessReflectionFunction · 0.85
CompileEffectMethod · 0.85
GetSamplerStateFunction · 0.85

Calls 6

GetStateValueFunction · 0.85
GetNodeTypeMethod · 0.80
GetTokenMethod · 0.80
GetChildOrNullMethod · 0.80
ShowMessageMethod · 0.80
ToStringFunction · 0.70

Tested by

no test coverage detected