MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / translateTernary

Method translateTernary

src/GLSLCompiler.cpp:1354–1367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1352 }
1353
1354 void GLSLCompiler::translateTernary(glsl::astTernaryExpression *expression) {
1355 m_exportLine(expression);
1356
1357 translateExpression(expression->condition);
1358 size_t pos = m_gen.Function.If();
1359 // ?
1360 translateExpression(expression->onTrue);
1361 size_t goto_skip = m_gen.Function.Goto();
1362 // :
1363 m_gen.Function.SetAddress(pos, m_gen.Function.GetCurrentAddress());
1364 translateExpression(expression->onFalse);
1365
1366 m_gen.Function.SetAddress(goto_skip, m_gen.Function.GetCurrentAddress());
1367 }
1368
1369 void GLSLCompiler::translateExpression(glsl::astExpression *expression) {
1370 switch (expression->type) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected