Untitled

mail@pastecode.io avatar
unknown
c_cpp
4 months ago
584 B
19
Indexable
Never
gTextureHeapMin = grTexMinAddress(GR_TMU0);
	gTextureHeapMax = grTexMaxAddress(GR_TMU0);

        Gu3dfInfo info;
	gu3dfGetInfo(fileName, &info);

	FxU32 required = grTexCalcMemRequired(info.header.small_lod, info.header.large_lod, info.header.aspect_ratio, info.header.format);

	if (gTextureHeapMin + gTextureHeapUsage + required > gTextureHeapMax)
	{
		printf("Failed to allocate texture %s: VRAM exhausted\n", fileName);
		exit(-1);
	}

	FxU32 linearAddr = gTextureHeapMin + gTextureHeapUsage;

	info.data = malloc(info.mem_required);
	gu3dfLoad(fileName, &info);
Leave a Comment