MCPcopy Create free account
hub / github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator / LoadShader

Function LoadShader

src/VulkanSample.cpp:299–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299void LoadShader(std::vector<char>& out, const char* fileName)
300{
301 std::ifstream file(std::string(SHADER_PATH1) + fileName, std::ios::ate | std::ios::binary);
302 if(file.is_open() == false)
303 file.open(std::string(SHADER_PATH2) + fileName, std::ios::ate | std::ios::binary);
304 assert(file.is_open());
305 size_t fileSize = (size_t)file.tellg();
306 if(fileSize > 0)
307 {
308 out.resize(fileSize);
309 file.seekg(0);
310 file.read(out.data(), fileSize);
311 file.close();
312 }
313 else
314 out.clear();
315}
316
317static VkBool32 VKAPI_PTR MyDebugReportCallback(
318 VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,

Callers 2

CreateSwapchainFunction · 0.85
ValidateContentMethod · 0.85

Calls 3

resizeMethod · 0.80
dataMethod · 0.45
clearMethod · 0.45

Tested by 1

ValidateContentMethod · 0.68