Skip to content

Commit

Permalink
fixing gcc/msvc error
Browse files Browse the repository at this point in the history
  • Loading branch information
Kbz-8 committed Dec 17, 2024
1 parent 6de8d3a commit 8f4dc6e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
15 changes: 7 additions & 8 deletions runtime/Sources/Graphics/PutPixelManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ namespace mlx
MLX_PROFILE_FUNCTION();
Verify((bool)p_renderer, "invalid renderer pointer");

VkExtent2D extent;
if(p_renderer->GetWindow())
extent = kvfGetSwapchainImagesSize(p_renderer->GetSwapchain().Get());
else if(p_renderer->GetRenderTarget())
extent = VkExtent2D{ .width = p_renderer->GetRenderTarget()->GetWidth(), .height = p_renderer->GetRenderTarget()->GetHeight() };
else
FatalError("a renderer was created without window nor render target attached (wtf)");

auto it = m_placements.find(draw_layer);
if(it != m_placements.end())
{
Expand All @@ -62,6 +54,13 @@ namespace mlx

if(m_current_texture_index >= m_textures.size())
{
VkExtent2D extent;
if(p_renderer->GetWindow())
extent = kvfGetSwapchainImagesSize(p_renderer->GetSwapchain().Get());
else if(p_renderer->GetRenderTarget())
extent = VkExtent2D{ .width = p_renderer->GetRenderTarget()->GetWidth(), .height = p_renderer->GetRenderTarget()->GetHeight() };
else
FatalError("a renderer was created without window nor render target attached (wtf)");
#ifdef DEBUG
m_textures.push_back(std::make_unique<Texture>(CPUBuffer{}, extent.width, extent.height, VK_FORMAT_R8G8B8A8_SRGB, false, "mlx_put_pixel_layer_" + std::to_string(m_current_texture_index)));
#else
Expand Down
1 change: 1 addition & 0 deletions runtime/Sources/Renderer/Memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wparentheses"
#include <vma.h>
#pragma GCC diagnostic pop
Expand Down
4 changes: 2 additions & 2 deletions xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
add_requires("libsdl", { configs = { sdlmain = false } })

add_rules("mode.debug", "mode.release")
set_languages("cxx20", "c99")
set_languages("cxx20", "c11")

set_objectdir("objs/xmake/$(os)_$(arch)")
set_targetdir("./")
Expand Down Expand Up @@ -94,7 +94,7 @@ target("Test")

add_deps("mlx")

add_files("example/main.c")
add_files("example/main.c", { languages = "c99" })

add_defines("SDL_MAIN_HANDLED")

Expand Down

0 comments on commit 8f4dc6e

Please sign in to comment.