MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / read_bytes

Function read_bytes

samples/common/common/utils.h:36–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36inline static void read_bytes(const char8_t* file_name, uint32_t** bytes, uint32_t* length)
37{
38 FILE* f = fopen((const char*)file_name, "rb");
39 fseek(f, 0, SEEK_END);
40 *length = ftell(f);
41 fseek(f, 0, SEEK_SET);
42 *bytes = (uint32_t*)malloc(*length);
43 fread(*bytes, *length, 1, f);
44 fclose(f);
45}
46
47inline static void read_shader_bytes(const char8_t* virtual_path, uint32_t** bytes, uint32_t* length, ECGPUBackend backend)
48{

Callers 2

read_shader_bytesFunction · 0.70
mainFunction · 0.50

Calls 1

mallocFunction · 0.50

Tested by

no test coverage detected