Merge branch 'master' into automatic-file-fix

This commit is contained in:
Jérôme Leclercq
2021-10-28 09:57:59 +02:00
committed by GitHub
55 changed files with 780 additions and 517 deletions

View File

@@ -373,12 +373,6 @@ namespace Nz
return m_pipelineInfo.shaders[UnderlyingCast(shaderStage)].uberShader;
}
inline ShaderBinding& MaterialPass::GetShaderBinding()
{
assert(m_shaderBinding);
return *m_shaderBinding;
}
inline const std::shared_ptr<Texture>& MaterialPass::GetTexture(std::size_t textureIndex) const
{
NazaraAssert(textureIndex < m_textures.size(), "Invalid texture index");
@@ -614,7 +608,8 @@ namespace Nz
if (m_textures[textureIndex].texture != texture)
{
m_textures[textureIndex].texture = std::move(texture);
InvalidateShaderBinding();
InvalidateCommandBuffer();
}
}
@@ -624,6 +619,7 @@ namespace Nz
if (m_textures[textureIndex].samplerInfo != samplerInfo)
{
m_textures[textureIndex].samplerInfo = std::move(samplerInfo);
InvalidateTextureSampler(textureIndex);
}
}
@@ -635,10 +631,17 @@ namespace Nz
{
m_uniformBuffers[bufferIndex].buffer = std::move(uniformBuffer);
m_uniformBuffers[bufferIndex].dataInvalidated = true;
InvalidateShaderBinding();
InvalidateCommandBuffer();
}
}
inline void MaterialPass::InvalidateCommandBuffer()
{
m_forceCommandBufferRegeneration = true;
OnMaterialInvalidated(this);
}
inline void MaterialPass::InvalidatePipeline()
{
m_forceCommandBufferRegeneration = true;
@@ -647,20 +650,12 @@ namespace Nz
OnMaterialInvalidated(this);
}
inline void MaterialPass::InvalidateShaderBinding()
{
m_forceCommandBufferRegeneration = true;
m_shaderBindingUpdated = false;
OnMaterialInvalidated(this);
}
inline void MaterialPass::InvalidateTextureSampler(std::size_t textureIndex)
{
assert(textureIndex < m_textures.size());
m_textures[textureIndex].sampler.reset();
InvalidateShaderBinding();
InvalidateCommandBuffer();
}
inline void MaterialPass::InvalidateUniformData(std::size_t uniformBufferIndex)
@@ -674,4 +669,3 @@ namespace Nz
}
#include <Nazara/Graphics/DebugOff.hpp>
#include "MaterialPass.hpp"