Gpu cleanup
This commit is contained in:
@@ -81,29 +81,6 @@ function material_context_create(raw: material_context_t): material_context_t {
|
||||
|
||||
let image: gpu_texture_t = data_get_image(tex.file);
|
||||
array_push(raw._.textures, image);
|
||||
|
||||
// Set mipmaps
|
||||
if (tex.mipmaps != null) {
|
||||
let mipmaps: gpu_texture_t[] = [];
|
||||
while (mipmaps.length < tex.mipmaps.length) {
|
||||
array_push(mipmaps, null);
|
||||
}
|
||||
|
||||
for (let j: i32 = 0; j < tex.mipmaps.length; ++j) {
|
||||
let name: string = tex.mipmaps[j];
|
||||
let mipimg: gpu_texture_t = data_get_image(name);
|
||||
mipmaps[j] = mipimg;
|
||||
}
|
||||
|
||||
gpu_set_mipmaps(image, mipmaps);
|
||||
tex.mipmaps = null;
|
||||
tex.generate_mipmaps = false;
|
||||
}
|
||||
else if (tex.generate_mipmaps == true && image != null) {
|
||||
// gpu_texture_generate_mipmaps(image, 1000);
|
||||
tex.mipmaps = null;
|
||||
tex.generate_mipmaps = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user