Minor fixes

This commit is contained in:
SirLynix 2023-11-12 12:51:56 +01:00
parent 2ff2cd4a9c
commit 86e26008b3
10 changed files with 7 additions and 11 deletions

View File

@ -9,7 +9,7 @@
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Config.hpp> #include <Nazara/Core/Config.hpp>
#include <NazaraUtils/Algorithm.hpp> #include <NazaraUtils/TypeTraits.hpp>
#include <string> #include <string>
#ifdef NAZARA_COMPILER_MSVC #ifdef NAZARA_COMPILER_MSVC

View File

@ -9,7 +9,6 @@
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Core/Unicode.hpp> #include <Nazara/Core/Unicode.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <NazaraUtils/FunctionRef.hpp> #include <NazaraUtils/FunctionRef.hpp>
#include <string> #include <string>

View File

@ -7,7 +7,7 @@
namespace Nz namespace Nz
{ {
template<typename T, typename ...Args> template<typename T, typename... Args>
RenderElementOwner ElementRendererRegistry::AllocateElement(Args&&... args) RenderElementOwner ElementRendererRegistry::AllocateElement(Args&&... args)
{ {
ElementRenderer& elementRenderer = GetElementRenderer(SafeCast<std::size_t>(T::ElementType)); ElementRenderer& elementRenderer = GetElementRenderer(SafeCast<std::size_t>(T::ElementType));

View File

@ -9,7 +9,6 @@
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <Nazara/Graphics/FramePipelinePass.hpp> #include <Nazara/Graphics/FramePipelinePass.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <functional> #include <functional>
#include <list> #include <list>
#include <string> #include <string>

View File

@ -8,7 +8,6 @@
#define NAZARA_GRAPHICS_MATERIALPASSREGISTRY_HPP #define NAZARA_GRAPHICS_MATERIALPASSREGISTRY_HPP
#include <NazaraUtils/Prerequisites.hpp> #include <NazaraUtils/Prerequisites.hpp>
#include <NazaraUtils/Algorithm.hpp>
#include <list> #include <list>
#include <string> #include <string>
#include <unordered_map> #include <unordered_map>

View File

@ -2,7 +2,7 @@
// This file is part of the "Nazara Engine - Graphics module" // This file is part of the "Nazara Engine - Graphics module"
// For conditions of distribution and use, see copyright notice in Config.hpp // For conditions of distribution and use, see copyright notice in Config.hpp
#include <NazaraUtils/Algorithm.hpp> #include <NazaraUtils/TypeTraits.hpp>
#include <stdexcept> #include <stdexcept>
#include <Nazara/Graphics/Debug.hpp> #include <Nazara/Graphics/Debug.hpp>

View File

@ -6,7 +6,7 @@
namespace Nz namespace Nz
{ {
template<typename ...Args> template<typename... Args>
Window& AppWindowingComponent::CreateWindow(Args&&... args) Window& AppWindowingComponent::CreateWindow(Args&&... args)
{ {
return *m_windows.emplace_back(std::make_unique<Window>(std::forward<Args>(args)...)); return *m_windows.emplace_back(std::make_unique<Window>(std::forward<Args>(args)...));

View File

@ -5,6 +5,7 @@
#include <Nazara/Core/StringExt.hpp> #include <Nazara/Core/StringExt.hpp>
#include <Nazara/Core/Algorithm.hpp> #include <Nazara/Core/Algorithm.hpp>
#include <Nazara/Core/Error.hpp> #include <Nazara/Core/Error.hpp>
#include <NazaraUtils/FunctionTraits.hpp>
#include <Utfcpp/utf8.h> #include <Utfcpp/utf8.h>
#include <cinttypes> #include <cinttypes>
#include <Nazara/Core/Debug.hpp> #include <Nazara/Core/Debug.hpp>

View File

@ -26,9 +26,7 @@ fn ComputeDirectionalLightShadow(light: DirectionalLight, shadowmap: depth_sampl
break; break;
} }
} }
cascadeIndex = min(cascadeIndex, light.cascadeCount - u32(1));
if (cascadeIndex >= light.cascadeCount)
cascadeIndex = light.cascadeCount - u32(1);
let lightProjPos = light.viewProjMatrices[cascadeIndex] * vec4[f32](worldPos, 1.0); let lightProjPos = light.viewProjMatrices[cascadeIndex] * vec4[f32](worldPos, 1.0);
let shadowCoords = lightProjPos.xyz / lightProjPos.w; let shadowCoords = lightProjPos.xyz / lightProjPos.w;

View File

@ -212,7 +212,7 @@ namespace Nz
inline void OpenGLCommandBuffer::Execute(const GL::Context* context, const InsertDebugLabelCommand& command) inline void OpenGLCommandBuffer::Execute(const GL::Context* context, const InsertDebugLabelCommand& command)
{ {
if (context->glDebugMessageInsert) if (context->glDebugMessageInsert)
context->glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 0, GL_DEBUG_SEVERITY_NOTIFICATION, command.label.size(), command.label.data()); context->glDebugMessageInsert(GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_MARKER, 0, GL_DEBUG_SEVERITY_NOTIFICATION, SafeCast<GLsizei>(command.label.size()), command.label.data());
} }
inline void OpenGLCommandBuffer::Execute(const GL::Context* context, const MemoryBarrier& command) inline void OpenGLCommandBuffer::Execute(const GL::Context* context, const MemoryBarrier& command)