MCPcopy Create free account
hub / github.com/KhronosGroup/glslang / ProcessResourceSetBindingBase

Function ProcessResourceSetBindingBase

StandAlone/StandAlone.cpp:405–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

403}
404
405void ProcessResourceSetBindingBase(int& argc, char**& argv, std::array<std::vector<std::string>, EShLangCount>& base)
406{
407 if (argc < 2)
408 usage();
409
410 if (!isdigit(argv[1][0])) {
411 if (argc < 3) // this form needs one more argument
412 usage();
413
414 // Parse form: --argname stage [regname set base...], or:
415 // --argname stage set
416 const EShLanguage lang = FindLanguage(argv[1], false);
417
418 argc--;
419 argv++;
420
421 while (argc > 1 && argv[1] != nullptr && argv[1][0] != '-') {
422 base[lang].push_back(argv[1]);
423
424 argc--;
425 argv++;
426 }
427
428 // Must have one arg, or a multiple of three (for [regname set binding] triples)
429 if (base[lang].size() != 1 && (base[lang].size() % 3) != 0)
430 usage();
431
432 } else {
433 // Parse form: --argname set
434 for (int lang=0; lang<EShLangCount; ++lang)
435 base[lang].push_back(argv[1]);
436
437 argc--;
438 argv++;
439 }
440}
441
442//
443// Process an optional binding base of one the forms:

Callers 1

ProcessArgumentsFunction · 0.85

Calls 4

usageFunction · 0.85
FindLanguageFunction · 0.85
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected