Fix compilation errors and warnings
This commit is contained in:
parent
1f6937ab1b
commit
309fd547e1
|
|
@ -130,7 +130,7 @@ int main()
|
||||||
|
|
||||||
std::vector<GLint> uniformIndices = program.GetActiveUniformBlockUniformIndices(blockIndex);
|
std::vector<GLint> uniformIndices = program.GetActiveUniformBlockUniformIndices(blockIndex);
|
||||||
|
|
||||||
std::vector<GLint> offsets = program.GetActiveUniforms(uniformIndices.size(), reinterpret_cast<GLuint*>(uniformIndices.data()), GL_UNIFORM_OFFSET);
|
std::vector<GLint> offsets = program.GetActiveUniforms(GLsizei(uniformIndices.size()), reinterpret_cast<GLuint*>(uniformIndices.data()), GL_UNIFORM_OFFSET);
|
||||||
|
|
||||||
auto p = SortIndexes(offsets, std::less<std::size_t>());
|
auto p = SortIndexes(offsets, std::less<std::size_t>());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp>
|
#include <Nazara/OpenGLRenderer/Wrapper/DeviceObject.hpp>
|
||||||
#include <Nazara/Core/Error.hpp>
|
#include <Nazara/Core/Error.hpp>
|
||||||
|
#include <Nazara/OpenGLRenderer/OpenGLDevice.hpp>
|
||||||
#include <Nazara/OpenGLRenderer/Utils.hpp>
|
#include <Nazara/OpenGLRenderer/Utils.hpp>
|
||||||
#include <Nazara/OpenGLRenderer/Debug.hpp>
|
#include <Nazara/OpenGLRenderer/Debug.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -910,7 +910,7 @@ namespace Nz
|
||||||
bufferBits = bufferPos = 0; // reset buffer
|
bufferBits = bufferPos = 0; // reset buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[bufferPos] = b << (8 - bufferRem);
|
buffer[bufferPos] = static_cast<UInt8>(b << (8 - bufferRem));
|
||||||
bufferBits += bufferRem;
|
bufferBits += bufferRem;
|
||||||
|
|
||||||
// proceed to remaining data
|
// proceed to remaining data
|
||||||
|
|
@ -945,7 +945,7 @@ namespace Nz
|
||||||
bufferBits = bufferPos = 0; // reset buffer
|
bufferBits = bufferPos = 0; // reset buffer
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer[bufferPos] = b << (8 - bufferRem);
|
buffer[bufferPos] = UInt8(b << (8 - bufferRem));
|
||||||
bufferBits += len;
|
bufferBits += len;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ namespace Nz
|
||||||
if (value > 65535) // must be 16 bit quantity
|
if (value > 65535) // must be 16 bit quantity
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
*(resultPtr++) = value >> 8;
|
*(resultPtr++) = static_cast<UInt8>(value >> 8);
|
||||||
*(resultPtr++) = value & 0xFF;
|
*(resultPtr++) = value & 0xFF;
|
||||||
|
|
||||||
if (*addressPtr == ':') // typical case inside; carry on
|
if (*addressPtr == ':') // typical case inside; carry on
|
||||||
|
|
|
||||||
|
|
@ -831,7 +831,7 @@ namespace Nz
|
||||||
command.header.channelID = acknowledgement.command.header.channelID;
|
command.header.channelID = acknowledgement.command.header.channelID;
|
||||||
command.header.reliableSequenceNumber = reliableSequenceNumber;
|
command.header.reliableSequenceNumber = reliableSequenceNumber;
|
||||||
command.acknowledge.receivedReliableSequenceNumber = reliableSequenceNumber;
|
command.acknowledge.receivedReliableSequenceNumber = reliableSequenceNumber;
|
||||||
command.acknowledge.receivedSentTime = HostToNet<UInt16>(acknowledgement.sentTime);
|
command.acknowledge.receivedSentTime = HostToNet(UInt16(acknowledgement.sentTime));
|
||||||
|
|
||||||
if ((acknowledgement.command.header.command & ENetProtocolCommand_Mask) == ENetProtocolCommand_Disconnect)
|
if ((acknowledgement.command.header.command & ENetProtocolCommand_Mask) == ENetProtocolCommand_Disconnect)
|
||||||
peer->DispatchState(ENetPeerState::Zombie);
|
peer->DispatchState(ENetPeerState::Zombie);
|
||||||
|
|
@ -1219,7 +1219,7 @@ namespace Nz
|
||||||
|
|
||||||
void ENetHost::ThrottleBandwidth()
|
void ENetHost::ThrottleBandwidth()
|
||||||
{
|
{
|
||||||
UInt32 currentTime = GetElapsedMilliseconds();
|
UInt32 currentTime = UInt32(GetElapsedMilliseconds());
|
||||||
UInt32 elapsedTime = currentTime - m_bandwidthThrottleEpoch;
|
UInt32 elapsedTime = currentTime - m_bandwidthThrottleEpoch;
|
||||||
|
|
||||||
if (elapsedTime < ENetConstants::ENetHost_BandwidthThrottleInterval)
|
if (elapsedTime < ENetConstants::ENetHost_BandwidthThrottleInterval)
|
||||||
|
|
@ -1230,8 +1230,8 @@ namespace Nz
|
||||||
if (m_connectedPeers == 0)
|
if (m_connectedPeers == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UInt32 dataTotal = ~0;
|
UInt32 dataTotal = ~UInt32(0);
|
||||||
UInt32 bandwidth = ~0;
|
UInt32 bandwidth = ~UInt32(0);
|
||||||
|
|
||||||
if (m_outgoingBandwidth != 0)
|
if (m_outgoingBandwidth != 0)
|
||||||
{
|
{
|
||||||
|
|
@ -1248,8 +1248,8 @@ namespace Nz
|
||||||
}
|
}
|
||||||
|
|
||||||
UInt32 peersRemaining = m_connectedPeers;
|
UInt32 peersRemaining = m_connectedPeers;
|
||||||
UInt32 bandwidthLimit = ~0;
|
UInt32 bandwidthLimit = ~UInt32(0);
|
||||||
UInt32 throttle = ~0;
|
UInt32 throttle = ~UInt32(0);
|
||||||
bool needsAdjustment = m_bandwidthLimitedPeers > 0;
|
bool needsAdjustment = m_bandwidthLimitedPeers > 0;
|
||||||
|
|
||||||
while (peersRemaining > 0 && needsAdjustment)
|
while (peersRemaining > 0 && needsAdjustment)
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ namespace Nz
|
||||||
command.sendUnreliable.dataLength = HostToNet(UInt16(packetRef->data.GetDataSize()));
|
command.sendUnreliable.dataLength = HostToNet(UInt16(packetRef->data.GetDataSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
QueueOutgoingCommand(command, packetRef, 0, packetSize);
|
QueueOutgoingCommand(command, packetRef, 0, UInt16(packetSize));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -355,7 +355,7 @@ namespace Nz
|
||||||
channel.incomingReliableSequenceNumber = incomingCommand.reliableSequenceNumber;
|
channel.incomingReliableSequenceNumber = incomingCommand.reliableSequenceNumber;
|
||||||
|
|
||||||
if (incomingCommand.fragments.GetSize() > 0)
|
if (incomingCommand.fragments.GetSize() > 0)
|
||||||
channel.incomingReliableSequenceNumber += incomingCommand.fragments.GetSize() - 1;
|
channel.incomingReliableSequenceNumber += static_cast<UInt16>(incomingCommand.fragments.GetSize() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentCommand == channel.incomingReliableCommands.begin())
|
if (currentCommand == channel.incomingReliableCommands.begin())
|
||||||
|
|
@ -608,7 +608,7 @@ namespace Nz
|
||||||
|
|
||||||
ENetPeer::Channel& channel = m_channels[command->header.channelID];
|
ENetPeer::Channel& channel = m_channels[command->header.channelID];
|
||||||
UInt32 startSequenceNumber = NetToHost(command->sendFragment.startSequenceNumber);
|
UInt32 startSequenceNumber = NetToHost(command->sendFragment.startSequenceNumber);
|
||||||
UInt16 startWindow = startSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
UInt16 startWindow = UInt16(startSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize);
|
||||||
UInt16 currentWindow = channel.incomingReliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
UInt16 currentWindow = channel.incomingReliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
||||||
|
|
||||||
if (startSequenceNumber < channel.incomingReliableSequenceNumber)
|
if (startSequenceNumber < channel.incomingReliableSequenceNumber)
|
||||||
|
|
@ -656,7 +656,7 @@ namespace Nz
|
||||||
if (!startCommand)
|
if (!startCommand)
|
||||||
{
|
{
|
||||||
ENetProtocol hostCommand = *command;
|
ENetProtocol hostCommand = *command;
|
||||||
hostCommand.header.reliableSequenceNumber = startSequenceNumber;
|
hostCommand.header.reliableSequenceNumber = static_cast<UInt16>(startSequenceNumber);
|
||||||
|
|
||||||
startCommand = QueueIncomingCommand(hostCommand, nullptr, totalLength, ENetPacketFlag_Reliable, fragmentCount);
|
startCommand = QueueIncomingCommand(hostCommand, nullptr, totalLength, ENetPacketFlag_Reliable, fragmentCount);
|
||||||
if (!startCommand)
|
if (!startCommand)
|
||||||
|
|
@ -727,7 +727,7 @@ namespace Nz
|
||||||
UInt32 reliableSequenceNumber = command->header.reliableSequenceNumber;
|
UInt32 reliableSequenceNumber = command->header.reliableSequenceNumber;
|
||||||
UInt32 startSequenceNumber = NetToHost(command->sendFragment.startSequenceNumber);
|
UInt32 startSequenceNumber = NetToHost(command->sendFragment.startSequenceNumber);
|
||||||
|
|
||||||
UInt16 reliableWindow = reliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
UInt16 reliableWindow = UInt16(reliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize);
|
||||||
UInt16 currentWindow = channel.incomingReliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
UInt16 currentWindow = channel.incomingReliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
||||||
|
|
||||||
if (startSequenceNumber < channel.incomingReliableSequenceNumber)
|
if (startSequenceNumber < channel.incomingReliableSequenceNumber)
|
||||||
|
|
@ -829,7 +829,7 @@ namespace Nz
|
||||||
|
|
||||||
if (unsequencedGroup - index != m_incomingUnsequencedGroup)
|
if (unsequencedGroup - index != m_incomingUnsequencedGroup)
|
||||||
{
|
{
|
||||||
m_incomingUnsequencedGroup = unsequencedGroup - index;
|
m_incomingUnsequencedGroup = static_cast<UInt16>(unsequencedGroup - index);
|
||||||
|
|
||||||
m_unsequencedWindow.fill(0);
|
m_unsequencedWindow.fill(0);
|
||||||
}
|
}
|
||||||
|
|
@ -1120,7 +1120,7 @@ namespace Nz
|
||||||
if ((command.header.command & ENetProtocolCommand_Mask) != ENetProtocolCommand_SendUnsequenced)
|
if ((command.header.command & ENetProtocolCommand_Mask) != ENetProtocolCommand_SendUnsequenced)
|
||||||
{
|
{
|
||||||
reliableSequenceNumber = command.header.reliableSequenceNumber;
|
reliableSequenceNumber = command.header.reliableSequenceNumber;
|
||||||
reliableWindow = reliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
reliableWindow = static_cast<UInt16>(reliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize);
|
||||||
currentWindow = channel.incomingReliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
currentWindow = channel.incomingReliableSequenceNumber / ENetConstants::ENetPeer_ReliableWindowSize;
|
||||||
|
|
||||||
if (reliableSequenceNumber < channel.incomingReliableSequenceNumber)
|
if (reliableSequenceNumber < channel.incomingReliableSequenceNumber)
|
||||||
|
|
@ -1225,7 +1225,7 @@ namespace Nz
|
||||||
if (m_totalWaitingData >= m_host->m_maximumWaitingData)
|
if (m_totalWaitingData >= m_host->m_maximumWaitingData)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
ENetPacketRef packet = m_host->AllocatePacket(flags);
|
ENetPacketRef packet = m_host->AllocatePacket(ENetPacketFlags(flags));
|
||||||
packet->data.Reset(0, data, dataLength);
|
packet->data.Reset(0, data, dataLength);
|
||||||
|
|
||||||
IncomingCommmand incomingCommand;
|
IncomingCommmand incomingCommand;
|
||||||
|
|
|
||||||
|
|
@ -264,8 +264,8 @@ namespace Nz
|
||||||
for (unsigned int i = 0; i < 8; ++i)
|
for (unsigned int i = 0; i < 8; ++i)
|
||||||
{
|
{
|
||||||
u_short addressPart = htons(address[i]);
|
u_short addressPart = htons(address[i]);
|
||||||
socketAddress->sin6_addr.s6_addr[i * 2 + 0] = addressPart >> 0;
|
socketAddress->sin6_addr.s6_addr[i * 2 + 0] = static_cast<UCHAR>(addressPart >> 0);
|
||||||
socketAddress->sin6_addr.s6_addr[i * 2 + 1] = addressPart >> 8;
|
socketAddress->sin6_addr.s6_addr[i * 2 + 1] = static_cast<UCHAR>(addressPart >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
return sizeof(sockaddr_in6);
|
return sizeof(sockaddr_in6);
|
||||||
|
|
|
||||||
|
|
@ -452,7 +452,7 @@ namespace Nz
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
// Wait until socket is available for writing or an error occurs (ie when connection succeeds or fails)
|
||||||
WSAPOLLFD descriptor;
|
WSAPOLLFD descriptor;
|
||||||
|
|
|
||||||
|
|
@ -126,6 +126,9 @@ namespace Nz
|
||||||
const auto& attachmentInfo = command.renderpass->GetAttachment(i);
|
const auto& attachmentInfo = command.renderpass->GetAttachment(i);
|
||||||
switch (PixelFormatInfo::GetContent(attachmentInfo.format))
|
switch (PixelFormatInfo::GetContent(attachmentInfo.format))
|
||||||
{
|
{
|
||||||
|
case PixelFormatContent::Undefined:
|
||||||
|
break;
|
||||||
|
|
||||||
case PixelFormatContent::ColorRGBA:
|
case PixelFormatContent::ColorRGBA:
|
||||||
colorIndexes[colorIndex++] = i;
|
colorIndexes[colorIndex++] = i;
|
||||||
break;
|
break;
|
||||||
|
|
@ -139,6 +142,12 @@ namespace Nz
|
||||||
if (!depthStencilIndex)
|
if (!depthStencilIndex)
|
||||||
depthStencilIndex = i;
|
depthStencilIndex = i;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PixelFormatContent::Stencil:
|
||||||
|
//FIXME: I'm not sure stencil is properly handled here
|
||||||
|
if (!depthStencilIndex)
|
||||||
|
depthStencilIndex = i;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -164,7 +173,7 @@ namespace Nz
|
||||||
context->glClearBufferfv(GL_COLOR, GLint(i), clearColor.data());
|
context->glClearBufferfv(GL_COLOR, GLint(i), clearColor.data());
|
||||||
}
|
}
|
||||||
else if (attachmentInfo.loadOp == AttachmentLoadOp::Discard)
|
else if (attachmentInfo.loadOp == AttachmentLoadOp::Discard)
|
||||||
invalidateAttachments.push_back(GL_COLOR_ATTACHMENT0 + i);
|
invalidateAttachments.push_back(static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + i));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (depthStencilIndex)
|
if (depthStencilIndex)
|
||||||
|
|
@ -210,7 +219,6 @@ namespace Nz
|
||||||
|
|
||||||
if (colorIndex > 0)
|
if (colorIndex > 0)
|
||||||
{
|
{
|
||||||
std::size_t colorBufferCount = command.framebuffer->GetColorBufferCount();
|
|
||||||
assert(colorBufferCount <= 1);
|
assert(colorBufferCount <= 1);
|
||||||
|
|
||||||
std::size_t colorAttachmentIndex = colorIndexes.front();
|
std::size_t colorAttachmentIndex = colorIndexes.front();
|
||||||
|
|
|
||||||
|
|
@ -35,14 +35,14 @@ namespace Nz
|
||||||
return RenderFrame(m_renderImage[m_currentFrame].get(), invalidateFramebuffer, m_size, 0);
|
return RenderFrame(m_renderImage[m_currentFrame].get(), invalidateFramebuffer, m_size, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenGLRenderWindow::Create(RendererImpl* renderer, RenderSurface* surface, const RenderWindowParameters& parameters)
|
bool OpenGLRenderWindow::Create(RendererImpl* /*renderer*/, RenderSurface* surface, const RenderWindowParameters& parameters)
|
||||||
{
|
{
|
||||||
DummySurface* dummySurface = static_cast<DummySurface*>(surface);
|
DummySurface* dummySurface = static_cast<DummySurface*>(surface);
|
||||||
OpenGLRenderer* glRenderer = static_cast<OpenGLRenderer*>(renderer);
|
|
||||||
|
|
||||||
OpenGLDevice& device = static_cast<OpenGLDevice&>(*m_owner.GetRenderDevice());
|
OpenGLDevice& device = static_cast<OpenGLDevice&>(*m_owner.GetRenderDevice());
|
||||||
|
|
||||||
GL::ContextParams contextParams;
|
GL::ContextParams contextParams;
|
||||||
|
//TODO: Pass render window parameters to context
|
||||||
|
|
||||||
m_context = device.CreateContext(contextParams, dummySurface->GetWindowHandle());
|
m_context = device.CreateContext(contextParams, dummySurface->GetWindowHandle());
|
||||||
if (!m_context)
|
if (!m_context)
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Nz
|
||||||
return m_device;
|
return m_device;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenGLRenderer::Prepare(const ParameterList& parameters)
|
bool OpenGLRenderer::Prepare(const ParameterList& /*parameters*/)
|
||||||
{
|
{
|
||||||
std::unique_ptr<GL::Loader> loader = SelectLoader();
|
std::unique_ptr<GL::Loader> loader = SelectLoader();
|
||||||
if (!loader)
|
if (!loader)
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#include <Nazara/Shader/Ast/AstRecursiveVisitor.hpp>
|
#include <Nazara/Shader/Ast/AstRecursiveVisitor.hpp>
|
||||||
#include <Nazara/Shader/Debug.hpp>
|
#include <Nazara/Shader/Debug.hpp>
|
||||||
#include "..\..\..\..\include\Nazara\Shader\Ast\AstRecursiveVisitor.hpp"
|
|
||||||
|
|
||||||
namespace Nz::ShaderAst
|
namespace Nz::ShaderAst
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -551,7 +551,6 @@ namespace Nz::ShaderAst
|
||||||
|
|
||||||
#define NAZARA_SHADERAST_STATEMENT(Node) case NodeType:: Node : node = std::make_unique<Node>(); break;
|
#define NAZARA_SHADERAST_STATEMENT(Node) case NodeType:: Node : node = std::make_unique<Node>(); break;
|
||||||
#include <Nazara/Shader/Ast/AstNodeList.hpp>
|
#include <Nazara/Shader/Ast/AstNodeList.hpp>
|
||||||
#include "..\..\..\..\include\Nazara\Shader\Ast\AstSerializer.hpp"
|
|
||||||
|
|
||||||
default: throw std::runtime_error("unexpected node type");
|
default: throw std::runtime_error("unexpected node type");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@ namespace Nz
|
||||||
m_device(device),
|
m_device(device),
|
||||||
m_params(params)
|
m_params(params)
|
||||||
{
|
{
|
||||||
VkImageCreateInfo createInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
|
VkImageCreateInfo createInfo = {};
|
||||||
|
createInfo.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO;
|
||||||
createInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
createInfo.initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
|
||||||
createInfo.mipLevels = params.mipmapLevel;
|
createInfo.mipLevels = params.mipmapLevel;
|
||||||
createInfo.samples = VK_SAMPLE_COUNT_1_BIT;
|
createInfo.samples = VK_SAMPLE_COUNT_1_BIT;
|
||||||
|
|
@ -207,7 +208,7 @@ namespace Nz
|
||||||
VK_IMAGE_ASPECT_COLOR_BIT,
|
VK_IMAGE_ASPECT_COLOR_BIT,
|
||||||
0, //< mipLevel
|
0, //< mipLevel
|
||||||
0, //< baseArrayLayer
|
0, //< baseArrayLayer
|
||||||
(m_params.type == ImageType::Cubemap) ? 6 : 1 //< layerCount
|
UInt32((m_params.type == ImageType::Cubemap) ? 6 : 1) //< layerCount
|
||||||
};
|
};
|
||||||
|
|
||||||
VkImageSubresourceRange subresourceRange = { //< FIXME
|
VkImageSubresourceRange subresourceRange = { //< FIXME
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue