-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathmain_opcode_checker.cpp
More file actions
41 lines (34 loc) · 1.01 KB
/
main_opcode_checker.cpp
File metadata and controls
41 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <fstream>
#include <spirv_simulator.hpp>
#include <util.hpp>
int main(int argc, char** argv)
{
if (argc != 2)
{
std::cerr << "Usage: " << argv[0] << " <list_of_shader_paths>.txt\n";
return 1;
}
const std::string filename = argv[1];
std::ifstream file(filename);
if (!file.is_open())
{
std::cerr << "Error: could not open file " << filename << "\n";
return 1;
}
std::string line;
std::set<std::string> unsupported_instructions;
while (std::getline(file, line))
{
SPIRVSimulator::SimulationData inputs;
SPIRVSimulator::SimulationResults outputs;
SPIRVSimulator::SPIRVSimulator sim(util::ReadFile(line), &inputs, &outputs);
unsupported_instructions.insert(sim.unsupported_opcodes.begin(), sim.unsupported_opcodes.end());
}
for (const auto& opc : unsupported_instructions)
{
std::cout << opc << std::endl;
}
file.close();
return 0;
}