Home | History | Annotate | Download | only in vkjson

Lines Matching defs:options

33 struct Options {
40 bool ParseOptions(int argc, char* argv[], Options* options) {
44 options->instance = true;
46 options->device_index = 0;
55 int result = sscanf(arg2.c_str(), "%u", &options->device_index);
57 options->device_index = -1;
62 options->device_name = arg2;
64 options->output_file = arg2;
71 if (options->instance && (options->device_index != unsignedNegOne ||
72 !options->device_name.empty())) {
77 if (options->device_index != unsignedNegOne && !options->device_name.empty()) {
82 if (options->instance && options->output_file.empty()) {
87 if (!options->output_file.empty() && !options->instance &&
88 options->device_index == unsignedNegOne && options->device_name.empty()) {
97 bool Dump(const VkJsonInstance& instance, const Options& options) {
99 if (options.device_index != unsignedNegOne) {
100 if (static_cast<uint32_t>(options.device_index) >=
102 std::cerr << "Error: device " << options.device_index
107 out_device = &instance.devices[options.device_index];
108 } else if (!options.device_name.empty()) {
110 if (device.properties.deviceName == options.device_name) {
115 std::cerr << "Error: device '" << options.device_name
122 if (options.output_file.empty()) {
127 output_file = options.output_file;
156 Options options;
157 if (!ParseOptions(argc, argv, &options))
161 if (options.instance || options.device_index != unsignedNegOne ||
162 !options.device_name.empty()) {
163 Dump(instance, options);
166 options.device_index = i;
167 Dump(instance, options);