Minor stuff

This commit is contained in:
Jérôme Leclercq 2021-08-10 10:35:59 +02:00
parent f5dac32020
commit 7aafcfaae9
8 changed files with 8 additions and 6 deletions

View File

@ -20,6 +20,7 @@ namespace Nz
struct UniformOffsets; struct UniformOffsets;
BasicMaterial(MaterialPass& material); BasicMaterial(MaterialPass& material);
~BasicMaterial() = default;
inline void EnableAlphaTest(bool alphaTest); inline void EnableAlphaTest(bool alphaTest);

View File

@ -22,7 +22,7 @@ namespace Nz
namespace namespace
{ {
const UInt8 r_shader[] = { const UInt8 r_shader[] = {
#include <Nazara/Graphics/Resources/Shaders/basicmaterial.nzsl.h> #include <Nazara/Graphics/Resources/Shaders/basic_material.nzsl.h>
}; };
} }

View File

@ -44,7 +44,7 @@ namespace Nz
} }
RenderPipelineInfo renderPipelineInfo; RenderPipelineInfo renderPipelineInfo;
static_cast<RenderStates&>(renderPipelineInfo).operator=(m_pipelineInfo); // Not my proudest line static_cast<RenderStates&>(renderPipelineInfo).operator=(m_pipelineInfo); // Not the line I4m the most proud of
renderPipelineInfo.pipelineLayout = m_pipelineInfo.settings->GetRenderPipelineLayout(); renderPipelineInfo.pipelineLayout = m_pipelineInfo.settings->GetRenderPipelineLayout();
@ -58,6 +58,7 @@ namespace Nz
return m_renderPipelines.emplace_back(Graphics::Instance()->GetRenderDevice()->InstantiateRenderPipeline(std::move(renderPipelineInfo))); return m_renderPipelines.emplace_back(Graphics::Instance()->GetRenderDevice()->InstantiateRenderPipeline(std::move(renderPipelineInfo)));
} }
/*! /*!
* \brief Returns a reference to a MaterialPipeline built with MaterialPipelineInfo * \brief Returns a reference to a MaterialPipeline built with MaterialPipelineInfo
* *

View File

@ -40,7 +40,7 @@ namespace Nz
ShaderAst::AstReflect reflect; ShaderAst::AstReflect reflect;
reflect.Reflect(*m_shaderAst, callbacks); reflect.Reflect(*m_shaderAst, callbacks);
if (m_shaderStages & shaderStages != m_shaderStages) if (m_shaderStages & supportedStageType != m_shaderStages)
throw std::runtime_error("shader doesn't support all required shader stages"); throw std::runtime_error("shader doesn't support all required shader stages");
if (optionCount >= 64) if (optionCount >= 64)

View File

@ -128,7 +128,7 @@ namespace Nz
CheckCompilationStatus(shader); CheckCompilationStatus(shader);
program.AttachShader(shader.GetObjectId()); program.AttachShader(shader.GetObjectId());
// Shader can be deleted now (it won't be deleted by the driver until program gets deleted) // Shader object can be safely released now (it won't be deleted by the driver until program gets deleted)
stageFlags |= shaderEntry.stage; stageFlags |= shaderEntry.stage;
} }

View File

@ -679,7 +679,7 @@ namespace Nz::GL
bool Context::SetCurrentContext(const Context* context) bool Context::SetCurrentContext(const Context* context)
{ {
const Context*& currentContext = s_currentContext; //< Pay TLS cost only once const Context*& currentContext = s_currentContext; //< Pay TLS cost once
if (currentContext == context) if (currentContext == context)
return true; return true;

View File

@ -192,7 +192,7 @@ namespace Nz
{ {
assert(stagePtr); assert(stagePtr);
Nz::VulkanShaderModule& vulkanModule = *static_cast<Nz::VulkanShaderModule*>(stagePtr.get()); VulkanShaderModule& vulkanModule = static_cast<VulkanShaderModule&>(*stagePtr);
for (auto& stage : vulkanModule.GetStages()) for (auto& stage : vulkanModule.GetStages())
{ {
VkPipelineShaderStageCreateInfo& createInfo = shaderStageCreateInfos.emplace_back(); VkPipelineShaderStageCreateInfo& createInfo = shaderStageCreateInfos.emplace_back();