mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-10 22:23:34 +00:00
removing now useless image optimisation flag
This commit is contained in:
5
Makefile
5
Makefile
@@ -4,7 +4,6 @@ MAKE = make --no-print-directory
|
||||
OS ?= $(shell uname -s)
|
||||
DEBUG ?= false
|
||||
TOOLCHAIN ?= clang
|
||||
IMAGES_OPTIMIZED ?= true
|
||||
FORCE_INTEGRATED_GPU ?= false
|
||||
GRAPHICS_MEMORY_DUMP ?= false
|
||||
PROFILER ?= false
|
||||
@@ -69,10 +68,6 @@ ifeq ($(FORCE_INTEGRATED_GPU), true)
|
||||
_ENABLEDFLAGS += FORCE_INTEGRATED_GPU
|
||||
endif
|
||||
|
||||
ifeq ($(IMAGES_OPTIMIZED), true)
|
||||
_ENABLEDFLAGS += IMAGE_OPTIMIZED
|
||||
endif
|
||||
|
||||
ifeq ($(GRAPHICS_MEMORY_DUMP), true)
|
||||
_ENABLEDFLAGS += GRAPHICS_MEMORY_DUMP
|
||||
endif
|
||||
|
||||
@@ -103,9 +103,6 @@ MacroLibX has a strong safety support, mainly by checking every pointer that you
|
||||
### 🛠️ Set the toolchain
|
||||
If you want to use `GCC` to build the mlx you can use `make TOOLCHAIN=gcc`
|
||||
|
||||
### ⚠️⚠️⚠️ 🖼️ Image optimisations ⚠️⚠️⚠️
|
||||
If you run into glitches when writing or reading pixels from images you can turn off images optimisations by using `make IMAGES_OPTIMIZED=false`.
|
||||
|
||||
### 🖥️ Force the integrated GPU (not recommended)
|
||||
You can force the mlx to use your integrated GPU by using `make FORCE_INTEGRATED_GPU=true`. Note that there are a lot of chances that your application crashes by using that.
|
||||
|
||||
|
||||
@@ -16,9 +16,6 @@ MacroLibX has a strong safety support, mainly by checking every pointer that you
|
||||
### 🛠️ Set the toolchain
|
||||
To change the compilation toolchain you can use `xmake config --toolchain=[gcc|clang|...]`
|
||||
|
||||
### ⚠️⚠️⚠️ 🖼️ Image optimisations ⚠️⚠️⚠️
|
||||
If you run into glitches when writing or reading pixels from images you can turn off images optimisations by using `xmake config --images_optimized=n`.
|
||||
|
||||
### 🖥️ Force the integrated GPU (not recommended)
|
||||
You can force the mlx to use your integrated GPU using `xmake config --force_integrated_gpu=y`. Note that there are a lot of chances that your application crashes by using that.
|
||||
|
||||
|
||||
@@ -7,6 +7,5 @@
|
||||
-DMLX_BUILD
|
||||
-DSDL_MAIN_HANDLED
|
||||
-DDEBUG
|
||||
-DIMAGE_OPTIMIZED
|
||||
-D_REENTRANT
|
||||
-isystem/usr/include/SDL2
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/04 16:56:35 by maldavid #+# #+# */
|
||||
/* Updated: 2025/03/12 22:26:32 by maldavid ### ########.fr */
|
||||
/* Updated: 2025/10/22 16:59:21 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -361,14 +361,6 @@ MLX_API void mlx_destroy_image(mlx_context mlx, mlx_image image);
|
||||
* @param y Y coordinate in the image
|
||||
*
|
||||
* @return (int) Return the pixel data
|
||||
*
|
||||
* /!\ If you run into glitches when writing or reading pixels from images /!\
|
||||
* You need to add IMAGES_OPTIMIZED=false to your make mlx command
|
||||
* ```
|
||||
* ~ git clone https://github.com/seekrs/MacroLibX.git
|
||||
* ~ cd MacroLibX
|
||||
* ~ make IMAGES_OPTIMIZED=false
|
||||
* ```
|
||||
*/
|
||||
MLX_API mlx_color mlx_get_image_pixel(mlx_context mlx, mlx_image image, int x, int y);
|
||||
|
||||
@@ -380,14 +372,6 @@ MLX_API mlx_color mlx_get_image_pixel(mlx_context mlx, mlx_image image, int x, i
|
||||
* @param x X coordinate in the image
|
||||
* @param y Y coordinate in the image
|
||||
* @param color Color of the pixel to set
|
||||
*
|
||||
* /!\ If you run into glitches when writing or reading pixels from images /!\
|
||||
* You need to add IMAGES_OPTIMIZED=false to your make mlx command
|
||||
* ```
|
||||
* ~ git clone https://github.com/seekrs/MacroLibX.git
|
||||
* ~ cd MacroLibX
|
||||
* ~ make IMAGES_OPTIMIZED=false
|
||||
* ```
|
||||
*/
|
||||
MLX_API void mlx_set_image_pixel(mlx_context mlx, mlx_image image, int x, int y, mlx_color color);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <contact@kbz8.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/12/14 16:17:10 by maldavid #+# #+# */
|
||||
/* Updated: 2025/03/12 22:03:45 by maldavid ### ########.fr */
|
||||
/* Updated: 2025/10/22 16:59:38 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -122,14 +122,6 @@ MLX_API void mlx_pixel_put_region(mlx_context mlx, mlx_window win, int x, int y,
|
||||
*
|
||||
* Note: it is responsability of the user to make sure the size of `dst` is
|
||||
* big enough for the given region.
|
||||
*
|
||||
* /!\ If you run into glitches when writing or reading pixels from images /!\
|
||||
* You need to add IMAGES_OPTIMIZED=false to your make mlx command
|
||||
* ```
|
||||
* ~ git clone https://github.com/seekrs/MacroLibX.git
|
||||
* ~ cd MacroLibX
|
||||
* ~ make IMAGES_OPTIMIZED=false
|
||||
* ```
|
||||
*/
|
||||
MLX_API void mlx_get_image_region(mlx_context mlx, mlx_image image, int x, int y, int w, int h, mlx_color* dst);
|
||||
|
||||
@@ -146,14 +138,6 @@ MLX_API void mlx_get_image_region(mlx_context mlx, mlx_image image, int x, int y
|
||||
*
|
||||
* Note: it is responsability of the user to make sure the size of `pixels` is
|
||||
* big enough for the given region.
|
||||
*
|
||||
* /!\ If you run into glitches when writing or reading pixels from images /!\
|
||||
* You need to add IMAGES_OPTIMIZED=false to your make mlx command
|
||||
* ```
|
||||
* ~ git clone https://github.com/seekrs/MacroLibX.git
|
||||
* ~ cd MacroLibX
|
||||
* ~ make IMAGES_OPTIMIZED=false
|
||||
* ```
|
||||
*/
|
||||
MLX_API void mlx_set_image_region(mlx_context mlx, mlx_image image, int x, int y, int w, int h, mlx_color* pixels);
|
||||
|
||||
|
||||
@@ -22,12 +22,6 @@
|
||||
#include <stb_image.h>
|
||||
#endif
|
||||
|
||||
#ifdef IMAGE_OPTIMIZED
|
||||
#define TILING VK_IMAGE_TILING_OPTIMAL
|
||||
#else
|
||||
#define TILING VK_IMAGE_TILING_LINEAR
|
||||
#endif
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
mlx_color ReverseColor(mlx_color color)
|
||||
@@ -186,7 +180,7 @@ namespace mlx
|
||||
void Texture::Init(CPUBuffer pixels, std::uint32_t width, std::uint32_t height, VkFormat format, bool is_multisampled, [[maybe_unused]] std::string_view debug_name)
|
||||
{
|
||||
MLX_PROFILE_FUNCTION();
|
||||
Image::Init(ImageType::Color, width, height, format, TILING, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, is_multisampled, std::move(debug_name));
|
||||
Image::Init(ImageType::Color, width, height, format, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_SAMPLED_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, is_multisampled, std::move(debug_name));
|
||||
Image::CreateImageView(VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_ASPECT_COLOR_BIT);
|
||||
Image::CreateSampler();
|
||||
if(pixels)
|
||||
|
||||
@@ -11,12 +11,6 @@ set_targetdir("./")
|
||||
set_optimize("fastest")
|
||||
|
||||
-- Options
|
||||
|
||||
option("images_optimized")
|
||||
set_default(true)
|
||||
add_defines("IMAGE_OPTIMIZED")
|
||||
option_end()
|
||||
|
||||
option("force_integrated_gpu")
|
||||
set_default(false)
|
||||
add_defines("FORCE_INTEGRATED_GPU")
|
||||
@@ -48,7 +42,6 @@ target("mlx")
|
||||
set_default(true)
|
||||
set_license("MIT")
|
||||
set_kind("shared")
|
||||
add_options("images_optimized")
|
||||
add_options("force_integrated_gpu")
|
||||
add_options("graphics_memory_dump")
|
||||
add_options("profiler")
|
||||
|
||||
Reference in New Issue
Block a user