From 2d54a8372f213de672cd20f2c01b34642173cea2 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Mon, 11 Jan 2021 16:03:31 +0100 Subject: [PATCH] Set texture unit 0 in base class --- inferno/src/inferno/render/renderer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inferno/src/inferno/render/renderer.cpp b/inferno/src/inferno/render/renderer.cpp index ab001d8..5380c0a 100644 --- a/inferno/src/inferno/render/renderer.cpp +++ b/inferno/src/inferno/render/renderer.cpp @@ -47,6 +47,9 @@ namespace Inferno { uint32_t gpuTextureUnitCount = RenderCommand::textureUnitAmount(); m_supportedTextureUnitPerBatch = std::min(constTextureUnitCount, gpuTextureUnitCount); + // Texture unit 0 is reserved for no texture + m_textureUnits[0] = nullptr; + // Create texture unit samplers int32_t samplers[textureUnitPerBatch]; for (uint32_t i = 0; i < textureUnitPerBatch; i++) { @@ -136,9 +139,6 @@ namespace Inferno { m_vertexPositions[2] = { 0.5f, 0.5f, 0.0f, 1.0f }; m_vertexPositions[3] = { -0.5f, 0.5f, 0.0f, 1.0f }; - // Texture unit 0 is reserved for no texture - m_textureUnits[0] = nullptr; - // GPU // -----------------------------------------