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

Method translateConstructorCall

src/GLSLCompiler.cpp:461–482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

459 }
460
461 void GLSLCompiler::translateConstructorCall(glsl::astConstructorCall *expression) {
462 m_exportLine(expression);
463
464 for (int i = expression->parameters.size()-1; i >= 0; i--)
465 translateExpression(expression->parameters[i]);
466
467 if (expression->type->builtin) {
468 std::string tName = kTypes[((glsl::astBuiltin*)expression->type)->type];
469 if (isTypeActuallyStruct(tName))
470 m_gen.Function.NewObjectByName(tName, expression->parameters.size());
471 else {
472 ag::Type btype = m_convertBaseType(tName);
473
474 if (btype != ag::Type::Void)
475 m_gen.Function.Convert(btype);
476 }
477 } else {
478 // TODO: push new object
479 // printf("[DEBUG] Calling %s constructor...\n", ((glsl::astStruct*)expression->type)->name);
480 m_gen.Function.NewObjectByName(((glsl::astStruct*)expression->type)->name, expression->parameters.size());
481 }
482 }
483
484 void GLSLCompiler::translateDeclarationVariable(glsl::astFunctionVariable *variable) {
485 m_exportLine(variable);

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
ConvertMethod · 0.80

Tested by

no test coverage detected