Minor fixes

This commit is contained in:
Jérôme Leclercq 2020-09-01 18:47:08 +02:00
parent 7d2673eabd
commit ae34533595
5 changed files with 11 additions and 11 deletions

View File

@ -23,7 +23,7 @@
namespace Nz
{
using DynLibFunc = int (*)(); // "Generic" type of pointer to function
using DynLibFunc = void (*)(void); // "Generic" type of pointer to function
class DynLibImpl;

View File

@ -55,7 +55,7 @@ namespace Nz
std::unique_ptr<CommandPool> OpenGLDevice::InstantiateCommandPool(QueueType /*queueType*/)
{
return std::make_unique<OpenGLCommandPool>(*this);
return std::make_unique<OpenGLCommandPool>();
}
std::unique_ptr<RenderPipeline> OpenGLDevice::InstantiateRenderPipeline(RenderPipelineInfo pipelineInfo)

View File

@ -677,20 +677,20 @@ namespace Nz
void SpirvConstantCache::Write(const AnyConstant& constant, UInt32 resultId, SpirvSection& constants)
{
std::visit([&](auto&& constant)
std::visit([&](auto&& arg)
{
using ConstantType = std::decay_t<decltype(constant)>;
using ConstantType = std::decay_t<decltype(arg)>;
if constexpr (std::is_same_v<ConstantType, ConstantBool>)
constants.Append((constant.value) ? SpirvOp::OpConstantTrue : SpirvOp::OpConstantFalse, resultId);
constants.Append((arg.value) ? SpirvOp::OpConstantTrue : SpirvOp::OpConstantFalse, resultId);
else if constexpr (std::is_same_v<ConstantType, ConstantComposite>)
{
constants.AppendVariadic(SpirvOp::OpConstantComposite, [&](const auto& appender)
{
appender(GetId(constant.type->type));
appender(GetId(arg.type->type));
appender(resultId);
for (const auto& value : constant.values)
for (const auto& value : arg.values)
appender(GetId(value->constant));
});
}
@ -718,7 +718,7 @@ namespace Nz
constants.Append(SpirvOp::OpConstant, typeId, resultId, SpirvSection::Raw{ &value, sizeof(value) });
}, constant.value);
}, arg.value);
}
else
static_assert(AlwaysFalse<ConstantType>::value, "non-exhaustive visitor");

View File

@ -25,15 +25,15 @@ namespace Nz
RichTextDrawer::RichTextDrawer(const RichTextDrawer& drawer) :
m_defaultColor(drawer.m_defaultColor),
m_defaultOutlineColor(drawer.m_defaultOutlineColor),
m_defaultStyle(drawer.m_defaultStyle),
m_fontIndexes(drawer.m_fontIndexes),
m_blocks(drawer.m_blocks),
m_glyphUpdated(false),
m_defaultOutlineColor(drawer.m_defaultOutlineColor),
m_maxLineWidth(drawer.m_maxLineWidth),
m_defaultCharacterSpacingOffset(drawer.m_defaultCharacterSpacingOffset),
m_defaultLineSpacingOffset(drawer.m_defaultLineSpacingOffset),
m_defaultOutlineThickness(drawer.m_defaultOutlineThickness),
m_maxLineWidth(drawer.m_maxLineWidth),
m_defaultCharacterSize(drawer.m_defaultCharacterSize)
{
m_fonts.resize(drawer.m_fonts.size());

View File

@ -188,7 +188,7 @@ namespace Nz
{
std::uint32_t binding = std::uint32_t(bufferData.binding);
for (const auto& componentInfo : *bufferData.declaration)
for (const auto& componentInfo : bufferData.declaration->GetComponents())
{
auto& bufferAttribute = vertexAttributes.emplace_back();
bufferAttribute.binding = binding;