Repository: pixijs/pixijs
File: src/rendering/renderers/gl/shader/GenerateShaderSyncCode.ts (TypeScript)

Code before:
                {
                    const resName = shader._uniformBindMap[i][Number(j)];

                    funcFragments.push(`
                        res_name = s._uniformBindMap[${i}][${j}];
                        sS.bindUniformBlock(
                            resources[${j}],
                            '${resName}',
                            ${shader.glProgram._uniformBlockData[resName].index}
                        );
                    `);
                }
                else
                {
                    funcFragments.push(`
                        ugS.updateUniformGroup(resources[${j}], p, sD);
                    `);
                }
            }
            else if (resource instanceof BufferResource)
            {
                const resName = shader._uniformBindMap[i][Number(j)];

                funcFragments.push(`
                    sS.bindUniformBlock(
                        resources[${j}],
                        '${resName}',
                        ${shader.glProgram._uniformBlockData[resName].index}
                    );
                `);
            }
            else if (resource instanceof TextureSource)
            {
                const uniformName = shader._uniformBindMap[i as unknown as number][j as unknown as number];

                const uniformData = programData.uniformData[uniformName];

                if (uniformData)
                {
                    if (!addedTextreSystem)
                    {
                        addedTextreSystem = true;
                        headerFragments.push(`
                        var tS = r.texture;
                        `);
                    }

                    shaderSystem._gl.uniform1i(uniformData.location, textureCount);

                    funcFragments.push(`
                        tS.bind(resources[${j}], ${textureCount});

Review comment (suggestion):
im sure there is a reason, curious about why we are using `${resName}` rather than `resName`? directly

Code after:
                {
                    const resName = shader._uniformBindMap[i][Number(j)];

                    funcFragments.push(`
                        sS.bindUniformBlock(
                            resources[${j}],
                            '${resName}',
                            ${shader.glProgram._uniformBlockData[resName].index}
                        );
                    `);
                }
                else
                {
                    funcFragments.push(`
                        ugS.updateUniformGroup(resources[${j}], p, sD);
                    `);
                }
            }
            else if (resource instanceof BufferResource)
            {
                const resName = shader._uniformBindMap[i][Number(j)];

                funcFragments.push(`
                    sS.bindUniformBlock(
                        resources[${j}],
                        '${resName}',
                        ${shader.glProgram._uniformBlockData[resName].index}
                    );
                `);
            }
            else if (resource instanceof TextureSource)
            {
                const uniformName = shader._uniformBindMap[i as unknown as number][j as unknown as number];

                const uniformData = programData.uniformData[uniformName];

                if (uniformData)
                {
                    if (!addedTextreSystem)
                    {
                        addedTextreSystem = true;
                        headerFragments.push(`
                        var tS = r.texture;
                        `);
                    }

                    shaderSystem._gl.uniform1i(uniformData.location, textureCount);

                    funcFragments.push(`
                        tS.bind(resources[${j}], ${textureCount});
                    `);