Fix a lot of small bugs/warnings
This commit is contained in:
@@ -15,9 +15,9 @@
|
||||
namespace Nz
|
||||
{
|
||||
SpriteChainRenderer::SpriteChainRenderer(RenderDevice& device, std::size_t maxVertexBufferSize) :
|
||||
m_device(device),
|
||||
m_maxVertexBufferSize(maxVertexBufferSize),
|
||||
m_maxVertexCount(m_maxVertexBufferSize / (2 * sizeof(float))) // Treat vec2 as the minimum declaration possible
|
||||
m_maxVertexCount(m_maxVertexBufferSize / (2 * sizeof(float))), // Treat vec2 as the minimum declaration possible
|
||||
m_device(device)
|
||||
{
|
||||
m_vertexBufferPool = std::make_shared<VertexBufferPool>();
|
||||
|
||||
|
||||
@@ -419,7 +419,7 @@ namespace Nz
|
||||
return static_cast<unsigned int>(result);
|
||||
}
|
||||
|
||||
SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& address, UInt64 msTimeout, SocketError* error)
|
||||
SocketState SocketImpl::PollConnection(SocketHandle handle, const IpAddress& /*address*/, UInt64 msTimeout, SocketError* error)
|
||||
{
|
||||
// Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails)
|
||||
pollfd descriptor;
|
||||
|
||||
@@ -63,9 +63,9 @@ namespace Nz
|
||||
|
||||
RigidBody3D::RigidBody3D(RigidBody3D&& object) noexcept :
|
||||
m_geom(std::move(object.m_geom)),
|
||||
m_body(std::move(object.m_body)),
|
||||
m_forceAccumulator(std::move(object.m_forceAccumulator)),
|
||||
m_torqueAccumulator(std::move(object.m_torqueAccumulator)),
|
||||
m_body(std::move(object.m_body)),
|
||||
m_world(object.m_world),
|
||||
m_gravityFactor(object.m_gravityFactor),
|
||||
m_mass(object.m_mass)
|
||||
|
||||
@@ -534,7 +534,7 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::exception e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
NazaraError(e.what());
|
||||
}
|
||||
|
||||
@@ -206,21 +206,6 @@ namespace Nz::ShaderAst
|
||||
else if (IsPrimitiveType(exprType) || IsVectorType(exprType))
|
||||
{
|
||||
// Swizzle expression
|
||||
PrimitiveType baseType;
|
||||
std::size_t componentCount;
|
||||
|
||||
if (IsVectorType(exprType))
|
||||
{
|
||||
const VectorType& swizzledVec = std::get<VectorType>(exprType);
|
||||
baseType = swizzledVec.type;
|
||||
componentCount = swizzledVec.componentCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseType = std::get<PrimitiveType>(exprType);
|
||||
componentCount = 1;
|
||||
}
|
||||
|
||||
std::size_t swizzleComponentCount = identifier.size();
|
||||
if (swizzleComponentCount > 4)
|
||||
throw AstError{ "cannot swizzle more than four elements" };
|
||||
@@ -239,6 +224,12 @@ namespace Nz::ShaderAst
|
||||
// Use a Cast expression to replace swizzle
|
||||
indexedExpr = CacheResult(std::move(indexedExpr)); //< Since we are going to use a value multiple times, cache it if required
|
||||
|
||||
PrimitiveType baseType;
|
||||
if (IsVectorType(exprType))
|
||||
baseType = std::get<VectorType>(exprType).type;
|
||||
else
|
||||
baseType = std::get<PrimitiveType>(exprType);
|
||||
|
||||
auto cast = std::make_unique<CastExpression>();
|
||||
cast->targetType = VectorType{ swizzleComponentCount, baseType };
|
||||
for (std::size_t j = 0; j < swizzleComponentCount; ++j)
|
||||
|
||||
@@ -1023,6 +1023,7 @@ namespace Nz
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case ShaderAst::UnaryType::Plus:
|
||||
|
||||
@@ -134,7 +134,9 @@ namespace Nz
|
||||
const auto& expressionType = GetExpressionType(*node.expression);
|
||||
assert(IsVectorType(expressionType));
|
||||
|
||||
SwizzledPointer swizzledPointer{ pointer };
|
||||
SwizzledPointer swizzledPointer;
|
||||
swizzledPointer.pointerId = pointer.pointerId;
|
||||
swizzledPointer.storage = pointer.storage;
|
||||
swizzledPointer.swizzledType = std::get<ShaderAst::VectorType>(expressionType);
|
||||
swizzledPointer.componentCount = node.componentCount;
|
||||
swizzledPointer.swizzleIndices = node.components;
|
||||
|
||||
@@ -72,8 +72,8 @@ namespace Nz
|
||||
else
|
||||
UnrecognizedLine();
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case 'd':
|
||||
@@ -471,6 +471,7 @@ namespace Nz
|
||||
UnrecognizedLine();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
@@ -269,12 +269,14 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
|
||||
VkInstanceCreateInfo instanceInfo = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO };
|
||||
VkInstanceCreateInfo instanceInfo = {};
|
||||
instanceInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
|
||||
#ifdef NAZARA_DEBUG
|
||||
// Handle VK_LAYER_KHRONOS_validation extended features
|
||||
|
||||
VkValidationFeaturesEXT features = { VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT };
|
||||
VkValidationFeaturesEXT features = {};
|
||||
features.sType = VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT;
|
||||
|
||||
std::array<VkValidationFeatureEnableEXT, 1> enabledFeatures = {
|
||||
//VK_VALIDATION_FEATURE_ENABLE_GPU_ASSISTED_EXT,
|
||||
|
||||
@@ -55,7 +55,8 @@ namespace Nz
|
||||
}
|
||||
}
|
||||
|
||||
VkRenderPassBeginInfo beginInfo = { VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO };
|
||||
VkRenderPassBeginInfo beginInfo = {};
|
||||
beginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
|
||||
beginInfo.renderPass = vkRenderPass.GetRenderPass();
|
||||
beginInfo.framebuffer = vkFramebuffer.GetFramebuffer();
|
||||
beginInfo.renderArea.offset.x = renderRect.x;
|
||||
@@ -190,15 +191,16 @@ namespace Nz
|
||||
SafeCast<Int32>(fromBox.y),
|
||||
SafeCast<Int32>(fromBox.z)
|
||||
},
|
||||
todo,
|
||||
{
|
||||
SafeCast<Int32>(toPos.x),
|
||||
SafeCast<Int32>(toPos.y),
|
||||
SafeCast<Int32>(toPos.z),
|
||||
},
|
||||
{
|
||||
SafeCast<Int32>(fromBox.width),
|
||||
SafeCast<Int32>(fromBox.height),
|
||||
SafeCast<Int32>(fromBox.depth)
|
||||
SafeCast<UInt32>(fromBox.width),
|
||||
SafeCast<UInt32>(fromBox.height),
|
||||
SafeCast<UInt32>(fromBox.depth)
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -27,7 +27,8 @@ namespace Nz
|
||||
createInfo.tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
createInfo.usage = ToVulkan(params.usageFlags);
|
||||
|
||||
VkImageViewCreateInfo createInfoView = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO };
|
||||
VkImageViewCreateInfo createInfoView = {};
|
||||
createInfoView.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO;
|
||||
createInfoView.subresourceRange = {
|
||||
ToVulkan(PixelFormatInfo::GetContent(params.pixelFormat)),
|
||||
0,
|
||||
|
||||
@@ -13,7 +13,8 @@ namespace Nz
|
||||
{
|
||||
ValidateSamplerInfo(device, samplerInfo);
|
||||
|
||||
VkSamplerCreateInfo createInfo = { VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO };
|
||||
VkSamplerCreateInfo createInfo = {};
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
|
||||
createInfo.magFilter = ToVulkan(samplerInfo.magFilter);
|
||||
createInfo.minFilter = ToVulkan(samplerInfo.minFilter);
|
||||
createInfo.addressModeU = ToVulkan(samplerInfo.wrapModeU);
|
||||
|
||||
@@ -218,7 +218,8 @@ namespace Nz
|
||||
return;
|
||||
}
|
||||
|
||||
VkDebugUtilsMessengerCreateInfoEXT callbackCreateInfo = { VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT };
|
||||
VkDebugUtilsMessengerCreateInfoEXT callbackCreateInfo = {};
|
||||
callbackCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT;
|
||||
callbackCreateInfo.messageSeverity = VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT;
|
||||
callbackCreateInfo.messageType = VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT;
|
||||
callbackCreateInfo.pfnUserCallback = &DebugCallback;
|
||||
|
||||
@@ -11,12 +11,12 @@ namespace Nz
|
||||
{
|
||||
Canvas::Canvas(entt::registry& registry, Nz::EventHandler& eventHandler, Nz::CursorControllerHandle cursorController, UInt32 renderMask, int initialRenderLayer) :
|
||||
BaseWidget(std::make_shared<DefaultWidgetTheme>()),
|
||||
m_cursorController(cursorController),
|
||||
m_renderMask(renderMask),
|
||||
m_keyboardOwner(InvalidCanvasIndex),
|
||||
m_hoveredWidget(InvalidCanvasIndex),
|
||||
m_mouseOwner(InvalidCanvasIndex),
|
||||
m_registry(registry),
|
||||
m_cursorController(cursorController)
|
||||
m_registry(registry)
|
||||
{
|
||||
m_canvas = this;
|
||||
BaseWidget::m_registry = &m_registry;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Nz
|
||||
Layout();
|
||||
}
|
||||
|
||||
void LabelWidget::UpdateText(const AbstractTextDrawer& drawer, float scale)
|
||||
void LabelWidget::UpdateText(const AbstractTextDrawer& drawer)
|
||||
{
|
||||
m_style->UpdateText(drawer);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ void TextureValue::BuildNodeEdition(QFormLayout* layout)
|
||||
layout->addRow(tr("Texture"), textureSelection);
|
||||
}
|
||||
|
||||
Nz::ShaderAst::NodePtr TextureValue::BuildNode(Nz::ShaderAst::ExpressionPtr* expressions, std::size_t count, std::size_t outputIndex) const
|
||||
Nz::ShaderAst::NodePtr TextureValue::BuildNode(Nz::ShaderAst::ExpressionPtr* /*expressions*/, std::size_t count, std::size_t outputIndex) const
|
||||
{
|
||||
if (!m_currentTextureIndex)
|
||||
throw std::runtime_error("invalid texture input");
|
||||
|
||||
@@ -96,7 +96,7 @@ void TextureEditor::OnTextureSelectionUpdate(int textureIndex)
|
||||
m_currentTextureIndex.reset();
|
||||
}
|
||||
|
||||
void TextureEditor::OnTextureListUpdate(ShaderGraph* graph)
|
||||
void TextureEditor::OnTextureListUpdate(ShaderGraph* /*graph*/)
|
||||
{
|
||||
RefreshTextures();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user