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

Function read_shader_bytes

samples/common/common/utils.h:47–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45}
46
47inline static void read_shader_bytes(const char8_t* virtual_path, uint32_t** bytes, uint32_t* length, ECGPUBackend backend)
48{
49 char8_t shader_file[256];
50 const char8_t* shader_path = SKR_UTF8("./../resources/shaders/");
51 strcpy((char*)shader_file, (const char*)shader_path);
52 strcat((char*)shader_file, (const char*)virtual_path);
53 switch (backend)
54 {
55 case CGPU_BACKEND_VULKAN:
56 strcat((char*)shader_file, (const char*)SKR_UTF8(".spv"));
57 break;
58 case CGPU_BACKEND_D3D12:
59 case CGPU_BACKEND_XBOX_D3D12:
60 strcat((char*)shader_file, (const char*)SKR_UTF8(".dxil"));
61 break;
62 default:
63 break;
64 }
65 read_bytes(shader_file, bytes, length);
66}
67
68#ifdef __cplusplus
69 #include <type_traits>

Callers 10

create_blit_pipelineMethod · 0.50
create_blit_pipelineMethod · 0.50
create_render_pipelineFunction · 0.50
mainFunction · 0.50
initialize_imguiMethod · 0.50

Calls 1

read_bytesFunction · 0.70

Tested by

no test coverage detected