Files
ps4-switch-emu 9146a38f7c PS4 Switch Emu: build scripts, tools and docs
Builds the emulator core (submodule eden/) for jailbroken PS4 consoles and packages it as a .pkg.
DolphinPS4 (vendor/DolphinPS4) provides the PS4 runtime and the Vulkan driver patch.
2026-10-08 10:23:27 -07:00

28 lines
590 B
C++

/*
** Sample Framework for deko3d Applications
** FileLoader.cpp: Helpers for loading data from the filesystem directly into GPU memory
*/
#include "FileLoader.h"
CMemPool::Handle LoadFile(CMemPool& pool, const char* path, uint32_t alignment)
{
FILE *f = fopen(path, "rb");
if (!f) return nullptr;
fseek(f, 0, SEEK_END);
uint32_t fsize = ftell(f);
rewind(f);
CMemPool::Handle mem = pool.allocate(fsize, alignment);
if (!mem)
{
fclose(f);
return nullptr;
}
fread(mem.getCpuAddr(), fsize, 1, f);
fclose(f);
return mem;
}