diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index 29d3060d..d9319c2d 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -1255,6 +1255,8 @@ Texture* lovrTextureCreate(const TextureInfo* info) { uint32_t levelSizes[16]; gpu_buffer* scratchpad = NULL; + beginFrame(); + if (info->imageCount > 0) { levelCount = lovrImageGetLevelCount(info->images[0]); lovrCheck(info->type != TEXTURE_3D || levelCount == 1, "Images used to initialize 3D textures can not have mipmaps"); @@ -1284,8 +1286,6 @@ Texture* lovrTextureCreate(const TextureInfo* info) { } } - beginFrame(); - gpu_texture_init(texture->gpu, &(gpu_texture_info) { .type = (gpu_texture_type) info->type, .format = (gpu_texture_format) info->format,