MCPcopy Create free account
hub / github.com/comaps/comaps / ReadShadersPackFile

Function ReadShadersPackFile

libs/shaders/vulkan_program_pool.cpp:39–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37std::string const kShadersPackFile = "shaders_pack.spv";
38
39std::vector<uint8_t> ReadShadersPackFile(std::string const & filename)
40{
41 std::vector<uint8_t> result;
42 try
43 {
44 ReaderPtr<Reader> reader(GetPlatform().GetReader(filename));
45 auto const size = static_cast<size_t>(reader.Size());
46 CHECK(size % sizeof(uint32_t) == 0, ("Incorrect SPIR-V file alignment."));
47 result.resize(size);
48 reader.Read(0, result.data(), size);
49 }
50 catch (RootException const & e)
51 {
52 CHECK(false, ("Error reading shader file ", filename, " : ", e.what()));
53 return {};
54 }
55 return result;
56}
57
58struct TextureBindingReflectionInfo
59{

Callers 1

VulkanProgramPoolMethod · 0.85

Calls 6

GetReaderMethod · 0.45
SizeMethod · 0.45
resizeMethod · 0.45
ReadMethod · 0.45
dataMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected