mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-12 07:03:34 +00:00
suppress warnings
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/08 18:55:57 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/16 13:54:25 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 23:05:14 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace mlx
|
||||
_buffer = VK_NULL_HANDLE;
|
||||
}
|
||||
|
||||
void Buffer::createBuffer(VkBufferUsageFlags usage, VmaAllocationCreateInfo info, VkDeviceSize size, const char* name)
|
||||
void Buffer::createBuffer(VkBufferUsageFlags usage, VmaAllocationCreateInfo info, VkDeviceSize size, [[maybe_unused]] const char* name)
|
||||
{
|
||||
VkBufferCreateInfo bufferInfo{};
|
||||
bufferInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
|
||||
@@ -74,7 +74,7 @@ namespace mlx
|
||||
alloc_name.append("_index_buffer");
|
||||
else if(usage & VK_BUFFER_USAGE_VERTEX_BUFFER_BIT)
|
||||
alloc_name.append("_vertex_buffer");
|
||||
else if((usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT) != 1)
|
||||
else if(!(usage & VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT))
|
||||
alloc_name.append("_buffer");
|
||||
_allocation = Render_Core::get().getAllocator().createBuffer(&bufferInfo, &info, _buffer, alloc_name.c_str());
|
||||
#else
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:45:52 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/16 13:57:42 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:22:28 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
void UBO::create(Renderer* renderer, uint32_t size, const char* name)
|
||||
void UBO::create(Renderer* renderer, uint32_t size, [[maybe_unused]] const char* name)
|
||||
{
|
||||
_renderer = renderer;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: kbz_8 <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/10/20 22:02:37 by kbz_8 #+# #+# */
|
||||
/* Updated: 2023/11/14 12:45:29 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:44:55 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -22,9 +22,18 @@
|
||||
|
||||
#ifdef MLX_COMPILER_CLANG
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wnullability-completeness"
|
||||
#pragma clang diagnostic ignored "-Weverything"
|
||||
#include <renderer/core/memory.h>
|
||||
#pragma clang diagnostic pop
|
||||
#elif defined(MLX_COMPILER_GCC)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-variable"
|
||||
#pragma GCC diagnostic ignored "-Wparentheses"
|
||||
#include <renderer/core/memory.h>
|
||||
#pragma GCC diagnostic pop
|
||||
#else
|
||||
#include <renderer/core/memory.h>
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/17 23:33:34 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/20 12:04:51 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 23:04:04 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -25,7 +25,14 @@
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifndef MLX_COMPILER_MSVC
|
||||
#ifdef MLX_COMPILER_CLANG
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-W#warnings"
|
||||
#endif
|
||||
#warning "MLX is being compiled in debug mode, this activates Vulkan's validation layers and debug messages which may impact rendering performances"
|
||||
#ifdef MLX_COMPILER_CLANG
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
#else
|
||||
#pragma NOTE("MLX is being compiled in debug mode, this activates Vulkan's validation layers and debug messages which may impact rendering performances")
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/02 17:53:06 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/18 17:07:21 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:45:21 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -16,9 +16,6 @@ namespace mlx
|
||||
{
|
||||
void Fence::init()
|
||||
{
|
||||
VkSemaphoreCreateInfo semaphoreInfo{};
|
||||
semaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO;
|
||||
|
||||
VkFenceCreateInfo fenceInfo{};
|
||||
fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
|
||||
fenceInfo.flags = VK_FENCE_CREATE_SIGNALED_BIT;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/19 14:05:25 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/20 07:21:57 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:25:36 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace mlx
|
||||
createInfo.pfnUserCallback = ValidationLayers::debugCallback;
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL ValidationLayers::debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData)
|
||||
VKAPI_ATTR VkBool32 VKAPI_CALL ValidationLayers::debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, [[maybe_unused]] VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, [[maybe_unused]] void* pUserData)
|
||||
{
|
||||
if(messageSeverity == VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/01/23 18:37:28 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/18 17:23:16 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:25:59 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace mlx
|
||||
void DescriptorSetLayout::init(std::vector<std::pair<int, VkDescriptorType>> binds, VkShaderStageFlagBits stage)
|
||||
{
|
||||
std::vector<VkDescriptorSetLayoutBinding> bindings(binds.size());
|
||||
for(int i = 0; i < binds.size(); i++)
|
||||
for(std::size_t i = 0; i < binds.size(); i++)
|
||||
{
|
||||
bindings[i].binding = binds[i].first;
|
||||
bindings[i].descriptorCount = 1;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/31 18:03:35 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/16 14:01:47 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:46:08 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace mlx
|
||||
|
||||
void Texture::setPixel(int x, int y, uint32_t color) noexcept
|
||||
{
|
||||
if(x < 0 || y < 0 || x > getWidth() || y > getHeight())
|
||||
if(x < 0 || y < 0 || static_cast<uint32_t>(x) > getWidth() || static_cast<uint32_t>(y) > getHeight())
|
||||
return;
|
||||
if(_map == nullptr)
|
||||
openCPUmap();
|
||||
@@ -79,7 +79,7 @@ namespace mlx
|
||||
|
||||
int Texture::getPixel(int x, int y) noexcept
|
||||
{
|
||||
if(x < 0 || y < 0 || x > getWidth() || y > getHeight())
|
||||
if(x < 0 || y < 0 || static_cast<uint32_t>(x) > getWidth() || static_cast<uint32_t>(y) > getHeight())
|
||||
return 0;
|
||||
if(_map == nullptr)
|
||||
openCPUmap();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/03/31 15:14:50 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/16 13:44:58 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:33:59 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace mlx
|
||||
|
||||
void PixelPutPipeline::setPixel(uint32_t x, uint32_t y, uint32_t color) noexcept
|
||||
{
|
||||
if(x < 0 || y < 0 || x > _width || y > _height)
|
||||
if(x > _width || y > _height)
|
||||
return;
|
||||
_cpu_map[(y * _width) + x] = color;
|
||||
_has_been_modified = true;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/18 17:25:16 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/20 07:25:47 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:21:10 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -23,9 +23,9 @@ namespace mlx
|
||||
_pass.init(_swapchain.getImagesFormat());
|
||||
_cmd.init();
|
||||
|
||||
for(int i = 0; i < _swapchain.getImagesNumber(); i++)
|
||||
for(std::size_t i = 0; i < _swapchain.getImagesNumber(); i++)
|
||||
_framebuffers.emplace_back().init(_pass, _swapchain.getImage(i));
|
||||
for(int i = 0; i < MAX_FRAMES_IN_FLIGHT; i++)
|
||||
for(std::size_t i = 0; i < MAX_FRAMES_IN_FLIGHT; i++)
|
||||
_semaphores[i].init();
|
||||
|
||||
_uniform_buffer.reset(new UBO);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/18 17:14:45 by maldavid #+# #+# */
|
||||
/* Updated: 2023/12/08 19:12:06 by kbz_8 ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:19:41 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace mlx
|
||||
inline uint32_t getActiveImageIndex() noexcept { return _current_frame_index; }
|
||||
inline uint32_t getImageIndex() noexcept { return _image_index; }
|
||||
|
||||
constexpr inline void requireFrameBufferResize(int index) noexcept { _framebufferResized = true; }
|
||||
constexpr inline void requireFrameBufferResize() noexcept { _framebufferResized = true; }
|
||||
|
||||
~Renderer() = default;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:21:36 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/20 07:24:40 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:32:27 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
namespace mlx
|
||||
{
|
||||
static const VkClearValue clearColor = { 0.0f, 0.0f, 0.0f, 1.0f };
|
||||
static const VkClearValue clearColor = {{{ 0.0f, 0.0f, 0.0f, 1.0f }}}; // wtf, this mess to satisfy a warning
|
||||
|
||||
void RenderPass::init(VkFormat attachement_format)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/06 18:22:28 by maldavid #+# #+# */
|
||||
/* Updated: 2023/11/18 17:15:10 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:32:54 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace mlx
|
||||
tmp.resize(imageCount);
|
||||
vkGetSwapchainImagesKHR(device, _swapChain, &imageCount, tmp.data());
|
||||
|
||||
for(int i = 0; i < imageCount; i++)
|
||||
for(std::size_t i = 0; i < imageCount; i++)
|
||||
{
|
||||
_images[i].create(tmp[i], surfaceFormat.format, _extent.width, _extent.height);
|
||||
_images[i].transitionLayout(VK_IMAGE_LAYOUT_PRESENT_SRC_KHR);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/06 16:41:13 by maldavid #+# #+# */
|
||||
/* Updated: 2023/12/07 22:29:45 by kbz_8 ### ########.fr */
|
||||
/* Updated: 2023/12/10 22:34:35 by kbz_8 ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace mlx
|
||||
|
||||
for(char c : text)
|
||||
{
|
||||
if(c < 32 || c > 127)
|
||||
if(c < 32)
|
||||
continue;
|
||||
|
||||
stbtt_aligned_quad q;
|
||||
|
||||
Reference in New Issue
Block a user