Graphics: Fix EnableInstancing(bool) having no impact

This commit is contained in:
Lynix 2016-10-17 14:47:15 +02:00
parent 5a07bbd001
commit 7e594a861f
2 changed files with 3 additions and 3 deletions

View File

@ -82,7 +82,7 @@ namespace Nz
if (pipelineEntry.maxInstanceCount > 0) if (pipelineEntry.maxInstanceCount > 0)
{ {
bool instancing = (pipelineEntry.maxInstanceCount > NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT); bool instancing = instancingEnabled && (pipelineEntry.maxInstanceCount > NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT);
UInt32 flags = ShaderFlags_Deferred; UInt32 flags = ShaderFlags_Deferred;
if (instancing) if (instancing)

View File

@ -412,7 +412,7 @@ namespace Nz
const Shader* lastShader = nullptr; const Shader* lastShader = nullptr;
const ShaderUniforms* shaderUniforms = nullptr; const ShaderUniforms* shaderUniforms = nullptr;
if (Renderer::HasCapability(RendererCap_Instancing)) if (m_instancingEnabled && Renderer::HasCapability(RendererCap_Instancing))
{ {
VertexBuffer* instanceBuffer = Renderer::GetInstanceBuffer(); VertexBuffer* instanceBuffer = Renderer::GetInstanceBuffer();
instanceBuffer->SetVertexDeclaration(&s_billboardInstanceDeclaration); instanceBuffer->SetVertexDeclaration(&s_billboardInstanceDeclaration);
@ -592,7 +592,7 @@ namespace Nz
if (pipelineEntry.maxInstanceCount > 0) if (pipelineEntry.maxInstanceCount > 0)
{ {
bool instancing = (pipelineEntry.maxInstanceCount > NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT); bool instancing = m_instancingEnabled && (pipelineEntry.maxInstanceCount > NAZARA_GRAPHICS_INSTANCING_MIN_INSTANCES_COUNT);
const MaterialPipeline::Instance& pipelineInstance = pipeline->Apply((instancing) ? ShaderFlags_Instancing : 0); const MaterialPipeline::Instance& pipelineInstance = pipeline->Apply((instancing) ? ShaderFlags_Instancing : 0);
const Shader* shader = pipelineInstance.uberInstance->GetShader(); const Shader* shader = pipelineInstance.uberInstance->GetShader();