Minor stuff
This commit is contained in:
parent
0442db1c53
commit
68708c54f7
|
|
@ -12,7 +12,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
/*!
|
/*!
|
||||||
* \ingroup core
|
* \ingroup core
|
||||||
* \class Nz::Color
|
* \class Color
|
||||||
* \brief Core class that represents a color
|
* \brief Core class that represents a color
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void OpenGLCommandBuffer::BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color)
|
inline void OpenGLCommandBuffer::BeginDebugRegion(const std::string_view& regionName, const Color& color)
|
||||||
{
|
{
|
||||||
BeginDebugRegionData beginDebugRegion;
|
BeginDebugRegionData beginDebugRegion;
|
||||||
beginDebugRegion.color = color;
|
beginDebugRegion.color = color;
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace Nz
|
||||||
OpenGLCommandBufferBuilder(OpenGLCommandBufferBuilder&&) noexcept = default;
|
OpenGLCommandBufferBuilder(OpenGLCommandBufferBuilder&&) noexcept = default;
|
||||||
~OpenGLCommandBufferBuilder() = default;
|
~OpenGLCommandBufferBuilder() = default;
|
||||||
|
|
||||||
void BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color) override;
|
void BeginDebugRegion(const std::string_view& regionName, const Color& color) override;
|
||||||
void BeginRenderPass(const Framebuffer& framebuffer, const RenderPass& renderPass, const Recti& renderRect, const ClearValues* clearValues, std::size_t clearValueCount) override;
|
void BeginRenderPass(const Framebuffer& framebuffer, const RenderPass& renderPass, const Recti& renderRect, const ClearValues* clearValues, std::size_t clearValueCount) override;
|
||||||
|
|
||||||
void BindIndexBuffer(const AbstractBuffer& indexBuffer, UInt64 offset = 0) override;
|
void BindIndexBuffer(const AbstractBuffer& indexBuffer, UInt64 offset = 0) override;
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ namespace Nz
|
||||||
inline void ConnectFontSlots();
|
inline void ConnectFontSlots();
|
||||||
inline void DisconnectFontSlots();
|
inline void DisconnectFontSlots();
|
||||||
|
|
||||||
bool GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Nz::Color color, int renderOrder, int* advance) const;
|
bool GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Color color, int renderOrder, int* advance) const;
|
||||||
void GenerateGlyphs(const std::string_view& text) const;
|
void GenerateGlyphs(const std::string_view& text) const;
|
||||||
|
|
||||||
inline float GetLineHeight(const Font::SizeInfo& sizeInfo) const;
|
inline float GetLineHeight(const Font::SizeInfo& sizeInfo) const;
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ namespace Nz
|
||||||
inline bool Begin(VkCommandBufferUsageFlags flags, bool occlusionQueryEnable, VkQueryControlFlags queryFlags, VkQueryPipelineStatisticFlags pipelineStatistics);
|
inline bool Begin(VkCommandBufferUsageFlags flags, bool occlusionQueryEnable, VkQueryControlFlags queryFlags, VkQueryPipelineStatisticFlags pipelineStatistics);
|
||||||
|
|
||||||
inline void BeginDebugRegion(const char* label);
|
inline void BeginDebugRegion(const char* label);
|
||||||
inline void BeginDebugRegion(const char* label, Nz::Color color);
|
inline void BeginDebugRegion(const char* label, Color color);
|
||||||
inline void BeginRenderPass(const VkRenderPassBeginInfo& beginInfo, VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
|
inline void BeginRenderPass(const VkRenderPassBeginInfo& beginInfo, VkSubpassContents contents = VK_SUBPASS_CONTENTS_INLINE);
|
||||||
|
|
||||||
inline void BindDescriptorSet(VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, UInt32 firstSet, const VkDescriptorSet& descriptorSets);
|
inline void BindDescriptorSet(VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, UInt32 firstSet, const VkDescriptorSet& descriptorSets);
|
||||||
|
|
@ -79,7 +79,7 @@ namespace Nz
|
||||||
inline void ImageBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkImageLayout oldLayout, VkImageLayout newLayout, VkImage image, VkImageAspectFlags aspectFlags);
|
inline void ImageBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkDependencyFlags dependencyFlags, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkImageLayout oldLayout, VkImageLayout newLayout, VkImage image, VkImageAspectFlags aspectFlags);
|
||||||
|
|
||||||
inline void InsertDebugLabel(const char* label);
|
inline void InsertDebugLabel(const char* label);
|
||||||
inline void InsertDebugLabel(const char* label, Nz::Color color);
|
inline void InsertDebugLabel(const char* label, Color color);
|
||||||
|
|
||||||
inline void MemoryBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask);
|
inline void MemoryBarrier(VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,10 +120,10 @@ namespace Nz
|
||||||
|
|
||||||
inline void CommandBuffer::BeginDebugRegion(const char* label)
|
inline void CommandBuffer::BeginDebugRegion(const char* label)
|
||||||
{
|
{
|
||||||
return BeginDebugRegion(label, Nz::Color(0, 0, 0, 0));
|
return BeginDebugRegion(label, Color(0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CommandBuffer::BeginDebugRegion(const char* label, Nz::Color color)
|
inline void CommandBuffer::BeginDebugRegion(const char* label, Color color)
|
||||||
{
|
{
|
||||||
Vk::Device* device = m_pool->GetDevice();
|
Vk::Device* device = m_pool->GetDevice();
|
||||||
if (device->vkCmdBeginDebugUtilsLabelEXT)
|
if (device->vkCmdBeginDebugUtilsLabelEXT)
|
||||||
|
|
@ -364,10 +364,10 @@ namespace Nz
|
||||||
|
|
||||||
inline void CommandBuffer::InsertDebugLabel(const char* label)
|
inline void CommandBuffer::InsertDebugLabel(const char* label)
|
||||||
{
|
{
|
||||||
return InsertDebugLabel(label, Nz::Color(0, 0, 0, 0));
|
return InsertDebugLabel(label, Color(0, 0, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void CommandBuffer::InsertDebugLabel(const char* label, Nz::Color color)
|
inline void CommandBuffer::InsertDebugLabel(const char* label, Color color)
|
||||||
{
|
{
|
||||||
Vk::Device* device = m_pool->GetDevice();
|
Vk::Device* device = m_pool->GetDevice();
|
||||||
if (device->vkCmdInsertDebugUtilsLabelEXT)
|
if (device->vkCmdInsertDebugUtilsLabelEXT)
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
std::size_t attachmentIndex = colorIndexes[i];
|
std::size_t attachmentIndex = colorIndexes[i];
|
||||||
|
|
||||||
Nz::Color color = command.clearValues[attachmentIndex].color;
|
Color color = command.clearValues[attachmentIndex].color;
|
||||||
std::array<GLfloat, 4> clearColor = { color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f };
|
std::array<GLfloat, 4> clearColor = { color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f };
|
||||||
|
|
||||||
const auto& attachmentInfo = command.renderpass->GetAttachment(attachmentIndex);
|
const auto& attachmentInfo = command.renderpass->GetAttachment(attachmentIndex);
|
||||||
|
|
@ -230,7 +230,7 @@ namespace Nz
|
||||||
{
|
{
|
||||||
context->ResetColorWriteMasks();
|
context->ResetColorWriteMasks();
|
||||||
|
|
||||||
Nz::Color color = command.clearValues[colorAttachmentIndex].color;
|
Color color = command.clearValues[colorAttachmentIndex].color;
|
||||||
context->glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f);
|
context->glClearColor(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f);
|
||||||
|
|
||||||
clearFields |= GL_COLOR_BUFFER_BIT;
|
clearFields |= GL_COLOR_BUFFER_BIT;
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
void OpenGLCommandBufferBuilder::BeginDebugRegion(const std::string_view& regionName, const Nz::Color& color)
|
void OpenGLCommandBufferBuilder::BeginDebugRegion(const std::string_view& regionName, const Color& color)
|
||||||
{
|
{
|
||||||
m_commandBuffer.BeginDebugRegion(regionName, color);
|
m_commandBuffer.BeginDebugRegion(regionName, color);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1468,7 +1468,7 @@ namespace Nz::ShaderAst
|
||||||
throw AstError{ "pow only works with primitive and vector types" };
|
throw AstError{ "pow only works with primitive and vector types" };
|
||||||
|
|
||||||
if ((IsPrimitiveType(type) && std::get<PrimitiveType>(type) != PrimitiveType::Float32) ||
|
if ((IsPrimitiveType(type) && std::get<PrimitiveType>(type) != PrimitiveType::Float32) ||
|
||||||
(IsVectorType(type) && std::get<VectorType>(type).type != PrimitiveType::Float32))
|
(IsVectorType(type) && std::get<VectorType>(type).type != PrimitiveType::Float32))
|
||||||
throw AstError{ "pow only works with floating-point primitive or vectors" };
|
throw AstError{ "pow only works with floating-point primitive or vectors" };
|
||||||
|
|
||||||
node.cachedExpressionType = type;
|
node.cachedExpressionType = type;
|
||||||
|
|
|
||||||
|
|
@ -740,7 +740,7 @@ namespace Nz::ShaderLang
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
throw UnexpectedToken{};
|
||||||
}
|
}
|
||||||
|
|
||||||
return statement;
|
return statement;
|
||||||
|
|
|
||||||
|
|
@ -326,7 +326,7 @@ namespace Nz
|
||||||
if (auto colorPtr = vertexMapper.GetComponentPtr<Color>(VertexComponent::Color))
|
if (auto colorPtr = vertexMapper.GetComponentPtr<Color>(VertexComponent::Color))
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < vertexCount; ++i)
|
for (unsigned int i = 0; i < vertexCount; ++i)
|
||||||
colorPtr[i] = Nz::Color::White;
|
colorPtr[i] = Color::White;
|
||||||
}
|
}
|
||||||
|
|
||||||
vertexMapper.Unmap();
|
vertexMapper.Unmap();
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ namespace Nz
|
||||||
m_lines.emplace_back(Line{Rectf::Zero(), 0});
|
m_lines.emplace_back(Line{Rectf::Zero(), 0});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SimpleTextDrawer::GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Nz::Color color, int renderOrder, int* advance) const
|
bool SimpleTextDrawer::GenerateGlyph(Glyph& glyph, char32_t character, float outlineThickness, bool lineWrap, Color color, int renderOrder, int* advance) const
|
||||||
{
|
{
|
||||||
const Font::Glyph& fontGlyph = m_font->GetGlyph(m_characterSize, m_style, outlineThickness, character);
|
const Font::Glyph& fontGlyph = m_font->GetGlyph(m_characterSize, m_style, outlineThickness, character);
|
||||||
if (fontGlyph.valid && fontGlyph.fauxOutlineThickness <= 0.f)
|
if (fontGlyph.valid && fontGlyph.fauxOutlineThickness <= 0.f)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue