c - GLSL:片段着色器计数 'out' s

标签 c opengl glsl

我正在尝试编写一个处理 glsl 并自动收集数量的类:

  • 在(到顶点)/属性
  • 制服
  • 输出(来自片段)

我知道如何使用 openGL 的 api 获取前 2 个的计数,但我找不到第三个的方法。如果有一种使用 openGL 的方法,我更愿意使用它。否则,我将使用类似 grep 的方法来扫描 frag 程序并返回数据。

最佳答案

我想你想要glGetProgramInterfaceiv() 。像这样的事情:

GLint numActiveOutputs = 0;
glGetProgramInterfaceiv(prog, GL_PROGRAM_OUTPUT​, GL_ACTIVE_RESOURCES​, &numActiveOutputs );

关于c - GLSL:片段着色器计数 'out' s,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19486864/

相关文章:

c++ - 使用 Intel PIN 在寻址模式下使用特定寄存器检测 mov dword ptr [rbp - ...] 指令

c++ -/usr/bin/ld : cannot find -lGL

sprite-kit - 如何在 SpriteKit 中创建自定义混合模式

c - 使用常量结构时为 "initializer element is not constant"

常量的另一个名字

c - 声明 float 变量只包含 3 个小数位

C++ GLSL 着色器 : "error: GLSL 3.30 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES" or black window

opengl - 如何在可执行文件和DLL之间使用OpenGL函数指针?

opengl - 如何将 3D 图像输出到 3D 电视?

opengl - 如何调试 GLSL 着色器?