From 9418b0b4f403e6b51cb8ac991802216e8b0a5a73 Mon Sep 17 00:00:00 2001 From: devZoGok Date: Wed, 8 Jul 2026 20:04:17 +0300 Subject: [PATCH] crash bugfix --- gui.frag | 2 +- phong4.frag | 2 +- root.cpp | 7 +------ 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/gui.frag b/gui.frag index a96787b..3291a1a 100755 --- a/gui.frag +++ b/gui.frag @@ -16,7 +16,7 @@ layout(std430, binding = 0) readonly restrict buffer objSSBO { GuiObjectData guiObjData[]; }; -uniform sampler2DArray textureSamplers[256]; +uniform sampler2DArray textureSamplers[128]; void main(){ int id = ID; diff --git a/phong4.frag b/phong4.frag index e8cd232..dc64591 100755 --- a/phong4.frag +++ b/phong4.frag @@ -42,7 +42,7 @@ layout(std430, binding = 2) readonly buffer lightsSSBO { const int numLights = 0; uniform vec3 camPos; -uniform sampler2DArray textureSamplers[256]; +uniform sampler2DArray textureSamplers[128]; float linDepth(float depth, int i){ float z = depth * 2 - 1, near = lights[i].near, far = lights[i].far; diff --git a/root.cpp b/root.cpp index c2e0c5a..8bf029d 100755 --- a/root.cpp +++ b/root.cpp @@ -685,8 +685,6 @@ namespace vb01{ return proj * view; } - //TODO replace sorting algorithm - //TODO specify differentiation of nodes with translucent meshes AND texts void Root::updateNodeTree(Shader *shader, bool gui){ shader->use(); @@ -695,9 +693,6 @@ namespace vb01{ objFragData.clear(); drawCmds.clear(); - for(DrawElementsIndirectCommand &cmd : drawCmds) - cmd.instanceCount = 0; - Vector3 camPos = camera->getPosition(); shader->setVec3(camPos, "camPos"); projView = calculateProjView(camPos); @@ -707,7 +702,7 @@ namespace vb01{ shader->setVec2(Vector2(width, height), "screen"); } - for(int i = 0; i < currTextureDims.size(); i++) + for(int i = 0; i < NUM_MAX_TEXTURE_UNITS; i++) shader->setInt(i, "textureSamplers[" + to_string(i) + "]"); }