Merge pull request #10 from 420verfl0w/indev

Indev
This commit is contained in:
kbz_8
2023-12-11 20:41:15 +01:00
committed by GitHub
45 changed files with 142 additions and 3277 deletions

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:07:40 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 20:35:41 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,19 +15,7 @@
#ifndef __MACRO_LIB_X_H__
#define __MACRO_LIB_X_H__
#if defined(_WIN32) || defined(_WIN64)
#define MLX_EXPORT __declspec(dllexport)
#define MLX_IMPORT __declspec(dllimport)
#else
#define MLX_EXPORT
#define MLX_IMPORT
#endif
#ifdef MLX_BUILD
#define MLX_API MLX_EXPORT
#else
#define MLX_API MLX_IMPORT
#endif
#include "mlx_profile.h"
#ifdef __cplusplus
extern "C" {

View File

@@ -1,12 +1,12 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* profile.h :+: :+: :+: */
/* mlx_profile.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/10 08:49:17 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:49:38 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 20:35:57 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -53,21 +53,48 @@
#error "Unknown environment!"
#endif
#ifdef MLX_COMPILER_MSVC
#ifdef MLX_BUILD
#define MLX_API __declspec(dllexport)
#else
#define MLX_API __declspec(dllimport)
#endif
#else
#define MLX_API
#endif
// Checking common assumptions
#include <climits>
#include <cstdint>
#ifdef __cplusplus
#include <climits>
#include <cstdint>
static_assert(CHAR_BIT == 8, "CHAR_BIT is expected to be 8");
static_assert(CHAR_BIT == 8, "CHAR_BIT is expected to be 8");
static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" );
static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size");
static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size");
static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size");
static_assert(sizeof(int8_t) == 1, "int8_t is not of the correct size" );
static_assert(sizeof(int16_t) == 2, "int16_t is not of the correct size");
static_assert(sizeof(int32_t) == 4, "int32_t is not of the correct size");
static_assert(sizeof(int64_t) == 8, "int64_t is not of the correct size");
static_assert(sizeof(uint8_t) == 1, "uint8_t is not of the correct size" );
static_assert(sizeof(uint16_t) == 2, "uint16_t is not of the correct size");
static_assert(sizeof(uint32_t) == 4, "uint32_t is not of the correct size");
static_assert(sizeof(uint64_t) == 8, "uint64_t is not of the correct size");
static_assert(sizeof(uint8_t) == 1, "uint8_t is not of the correct size" );
static_assert(sizeof(uint16_t) == 2, "uint16_t is not of the correct size");
static_assert(sizeof(uint32_t) == 4, "uint32_t is not of the correct size");
static_assert(sizeof(uint64_t) == 8, "uint64_t is not of the correct size");
#else
#define STATIC_ASSERT(COND, MSG) typedef char static_assertion___##MSG[(COND)?1:-1]
#include <limits.h>
#include <stdint.h>
STATIC_ASSERT(CHAR_BIT == 8, CHAR_BIT_is_expected_to_be_8);
STATIC_ASSERT(sizeof(int8_t) == 1, int8_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(int16_t) == 2, int16_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(int32_t) == 4, int32_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(int64_t) == 8, int64_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint8_t) == 1, uint8_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint16_t) == 2, uint16_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint32_t) == 4, uint32_t_is_not_of_the_correct_size);
STATIC_ASSERT(sizeof(uint64_t) == 8, uint64_t_is_not_of_the_correct_size);
#endif
#endif

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */
/* Updated: 2023/12/09 17:44:13 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:46:13 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,12 +15,14 @@
#include <renderer/core/render_core.h>
#include <array>
#include <core/errors.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <core/memory.h>
namespace mlx::core
{
Application::Application() : _in(std::make_unique<Input>())
{
SDL_SetMemoryFunctions(MemManager::malloc, MemManager::calloc, MemManager::realloc, MemManager::free);
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) != 0)
error::report(e_kind::fatal_error, "SDL error : unable to init all subsystems : %s", SDL_GetError());
}

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 21:49:46 by maldavid #+# #+# */
/* Updated: 2023/12/10 22:19:59 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:46:49 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -24,7 +24,7 @@
#include <core/graphics.h>
#include <platform/inputs.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx::core
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:35:20 by maldavid #+# #+# */
/* Updated: 2023/12/07 23:05:05 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 15:56:18 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,6 +16,7 @@
#include <renderer/core/render_core.h>
#include <filesystem>
#include <mlx.h>
#include <core/memory.h>
extern "C"
{
@@ -25,8 +26,9 @@ extern "C"
if(init)
{
mlx::core::error::report(e_kind::error, "MLX cannot be initialized multiple times");
return NULL;
return NULL; // not nullptr for the C compatibility
}
mlx::MemManager::get(); // just to initialize the C garbage collector
mlx::core::Application* app = new mlx::core::Application;
mlx::Render_Core::get().init();
if(app == nullptr)
@@ -219,4 +221,4 @@ extern "C"
static_cast<mlx::core::Application*>(mlx)->getScreenSize(w, h);
return 0;
}
}
}

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 17:42:32 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:53:11 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:46:57 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,7 @@
#define __MLX_ERRORS__
#include <string>
#include <core/profile.h>
#include <mlx_profile.h>
enum class e_kind
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */
/* Updated: 2023/12/08 19:04:59 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:47:03 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -26,7 +26,7 @@
#include <renderer/text_pipeline.h>
#include <utils/non_copyable.h>
#include <renderer/images/texture.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/07 16:32:01 by kbz_8 #+# #+# */
/* Updated: 2023/12/08 12:56:14 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 15:25:02 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -17,7 +17,7 @@
namespace mlx
{
void* MemManager::alloc(std::size_t size)
void* MemManager::malloc(std::size_t size)
{
void* ptr = std::malloc(size);
if(ptr != nullptr)
@@ -25,6 +25,25 @@ namespace mlx
return ptr;
}
void* MemManager::calloc(std::size_t n, std::size_t size)
{
void* ptr = std::calloc(n, size);
if(ptr != nullptr)
_blocks.push_back(ptr);
return ptr;
}
void* MemManager::realloc(void* ptr, std::size_t size)
{
void* ptr2 = std::realloc(ptr, size);
if(ptr2 != nullptr)
_blocks.push_back(ptr2);
auto it = std::find(_blocks.begin(), _blocks.end(), ptr);
if(it != _blocks.end())
_blocks.erase(it);
return ptr2;
}
void MemManager::free(void* ptr)
{
auto it = std::find(_blocks.begin(), _blocks.end(), ptr);

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/07 16:31:51 by kbz_8 #+# #+# */
/* Updated: 2023/12/08 19:05:15 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:47:13 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,7 @@
#define __MLX_MEMORY__
#include <utils/singleton.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <list>
namespace mlx
@@ -24,15 +24,17 @@ namespace mlx
friend class Singleton<MemManager>;
public:
void* alloc(std::size_t size);
void free(void* ptr);
static void* malloc(std::size_t size);
static void* calloc(std::size_t n, std::size_t size);
static void* realloc(void* ptr, std::size_t size);
static void free(void* ptr);
private:
MemManager() = default;
~MemManager();
private:
std::list<void*> _blocks;
inline static std::list<void*> _blocks;
};
}

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 16:30:19 by maldavid #+# #+# */
/* Updated: 2023/12/08 12:17:40 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:01:14 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,12 +16,6 @@
namespace mlx
{
Input::Input()
{
std::memset(_keys.data(), 0, SDL_NUM_SCANCODES);
std::memset(_mouse.data(), 0, 8);
}
void Input::update()
{
_xRel = 0;
@@ -47,7 +41,6 @@ namespace mlx
{
case SDL_KEYDOWN:
{
_keys[_event.key.keysym.scancode] = static_cast<uint8_t>(action::down);
if(hooks[MLX_KEYDOWN].hook)
hooks[MLX_KEYDOWN].hook(_event.key.keysym.scancode, hooks[MLX_KEYDOWN].param);
break;
@@ -55,7 +48,6 @@ namespace mlx
case SDL_KEYUP:
{
_keys[_event.key.keysym.scancode] = static_cast<uint8_t>(action::up);
if(hooks[MLX_KEYUP].hook)
hooks[MLX_KEYUP].hook(_event.key.keysym.scancode, hooks[MLX_KEYUP].param);
break;
@@ -63,7 +55,6 @@ namespace mlx
case SDL_MOUSEBUTTONDOWN:
{
_mouse[_event.button.button] = static_cast<uint8_t>(action::down);
if(hooks[MLX_MOUSEDOWN].hook)
hooks[MLX_MOUSEDOWN].hook(_event.button.button, hooks[MLX_MOUSEDOWN].param);
break;
@@ -71,7 +62,6 @@ namespace mlx
case SDL_MOUSEBUTTONUP:
{
_mouse[_event.button.button] = static_cast<uint8_t>(action::up);
if(hooks[MLX_MOUSEUP].hook)
hooks[MLX_MOUSEUP].hook(_event.button.button, hooks[MLX_MOUSEUP].param);
break;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/05 16:27:35 by maldavid #+# #+# */
/* Updated: 2023/12/08 18:54:03 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:47:20 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -18,14 +18,12 @@
#include <SDL2/SDL.h>
#include <unordered_map>
#include <core/profile.h>
#include <mlx_profile.h>
#include "window.h"
namespace mlx
{
enum class action : uint8_t { up = (1 << 1), down = (1 << 2) };
struct Hook
{
std::function<int(int, void*)> hook;
@@ -35,13 +33,10 @@ namespace mlx
class Input
{
public:
Input();
Input() = default;
void update();
inline bool getInKey(const SDL_Scancode key, action type = action::down) const noexcept { return _keys[key] & static_cast<uint8_t>(type); }
inline bool getInMouse(const uint8_t button, action type = action::down) const noexcept { return _mouse[button] & static_cast<uint8_t>(type); }
inline bool isMouseMoving() const noexcept { return _xRel || _yRel; }
inline int getX() const noexcept { return _x; }
@@ -68,11 +63,9 @@ namespace mlx
~Input() = default;
private:
std::array<uint8_t, SDL_NUM_SCANCODES> _keys;
std::unordered_map<uint32_t, std::shared_ptr<MLX_Window>> _windows;
std::unordered_map<uint32_t, std::array<Hook, 6>> _events_hooks;
SDL_Event _event;
std::array<uint8_t, 8> _mouse;
int _x = 0;
int _y = 0;

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/04 21:53:12 by maldavid #+# #+# */
/* Updated: 2023/12/09 16:35:57 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:47:26 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,7 +15,7 @@
#include <SDL2/SDL.h>
#include <string>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/06 23:18:52 by maldavid #+# #+# */
/* Updated: 2023/12/08 19:05:50 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:47:39 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -15,7 +15,7 @@
#include <volk.h>
#include <renderer/core/render_core.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/01/25 15:05:05 by maldavid #+# #+# */
/* Updated: 2023/12/08 19:06:07 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 19:47:47 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -16,7 +16,7 @@
#include <volk.h>
#include "vk_buffer.h"
#include <renderer/renderer.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -16,7 +16,7 @@
#include "vk_buffer.h"
#include <array>
#include <cstddef>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include "vk_buffer.h"
#include <renderer/renderer.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -16,7 +16,7 @@
#include <array>
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <renderer/core/render_core.h>
#include <renderer/command/vk_cmd_pool.h>
#include <renderer/command/vk_cmd_buffer.h>

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <renderer/core/vk_fence.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_CMD_POOL__
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -10,7 +10,7 @@
/* */
/* ************************************************************************** */
#include <core/profile.h>
#include <mlx_profile.h>
#include <core/errors.h>
#include <cstdio>

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <vma.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -24,7 +24,7 @@
#include <utils/singleton.h>
#include <core/errors.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include "vk_queues.h"
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_FENCE__
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <renderer/core/render_core.h>
namespace mlx

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <vector>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -16,7 +16,7 @@
#include <volk.h>
#include <optional>
#include <cstdint>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <vector>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <vector>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -14,7 +14,7 @@
#define __VK_VALIDATION_LAYERS__
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <cstddef>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include <volk.h>
#include <array>
#include <core/profile.h>
#include <mlx_profile.h>
#include <renderer/core/render_core.h>
namespace mlx

View File

@@ -17,7 +17,7 @@
#include <cstddef>
#include <vector>
#include <map>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -21,7 +21,7 @@
#include <renderer/descriptors/vk_descriptor_set.h>
#include <renderer/buffers/vk_ibo.h>
#include <renderer/buffers/vk_vbo.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -16,7 +16,7 @@
#include <renderer/images/texture.h>
#include <array>
#include <glm/glm.hpp>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -18,7 +18,7 @@
#include <vector>
#include <renderer/command/vk_cmd_buffer.h>
#include <renderer/command/vk_cmd_pool.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -14,7 +14,7 @@
#define __PIPELINE__
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <renderer/command/vk_cmd_buffer.h>
namespace mlx

View File

@@ -13,7 +13,7 @@
#ifndef __MLX_PIXEL_PUT__
#define __MLX_PIXEL_PUT__
#include <core/profile.h>
#include <mlx_profile.h>
#include <renderer/images/texture.h>
#include <renderer/descriptors/vk_descriptor_set.h>

View File

@@ -31,7 +31,7 @@
#include <renderer/descriptors/vk_descriptor_set_layout.h>
#include <core/errors.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <glm/glm.hpp>

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_FRAMEBUFFER__
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -14,7 +14,7 @@
#define __MLX_VK_RENDER_PASS__
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -15,7 +15,7 @@
#include <vector>
#include <volk.h>
#include <core/profile.h>
#include <mlx_profile.h>
#include <renderer/images/vk_image.h>
namespace mlx

View File

@@ -20,7 +20,7 @@
#include <memory>
#include <vector>
#include <cstdint>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

View File

@@ -6,7 +6,7 @@
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/04/06 16:41:13 by maldavid #+# #+# */
/* Updated: 2023/12/10 22:34:35 by kbz_8 ### ########.fr */
/* Updated: 2023/12/11 15:12:02 by kbz_8 ### ########.fr */
/* */
/* ************************************************************************** */
@@ -23,8 +23,8 @@
#include <core/memory.h>
#define STB_TRUETYPE_IMPLEMENTATION
#define STB_malloc(x, u) ((void)(u), MemManager::get().alloc(x))
#define STB_free(x, u) ((void)(u), MemManager::get().free(x))
#define STB_malloc(x, u) ((void)(u), MemManager::malloc(x))
#define STB_free(x, u) ((void)(u), MemManager::free(x))
#include <stb_truetype.h>
constexpr const int RANGE = 1024;

View File

@@ -20,7 +20,7 @@
#include <cstdint>
#include <unordered_set>
#include <renderer/text_library.h>
#include <core/profile.h>
#include <mlx_profile.h>
namespace mlx
{

File diff suppressed because it is too large Load Diff