GLSL统一块会消耗组件吗? [英] Do GLSL uniform blocks consume components?

查看:113
本文介绍了GLSL统一块会消耗组件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在GLSL着色器中使用统一块-它们是否消耗组件(来自GL_MAX_VERTEX_UNIFORM_COMPONENTS或GL_MAX_FRAGMENT_UNIFORM_COMPONENTS).

If I use uniform blocks in a GLSL shader - do they consume components (from GL_MAX_VERTEX_UNIFORM_COMPONENTS or GL_MAX_FRAGMENT_UNIFORM_COMPONENTS).

推荐答案

是.参见 ARB_Uniform_Buffer_Object :

默认情况下可用于统一变量的存储量 顶点着色器访问的统一块由的值指定 与实现有关的常量MAX_VERTEX_UNIFORM_COMPONENTS. 可用于统一变量的合并存储的总量 在顶点着色器访问的所有统一块中(包括 默认的统一代码块)由 与实现有关的常量 MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS.这些值代表 单个浮点数,整数或布尔值的数量 可以保存在用于顶点着色器的统一变量存储中.

The amount of storage available for uniform variables in the default uniform block accessed by a vertex shader is specified by the value of the implementation-dependent constant MAX_VERTEX_UNIFORM_COMPONENTS. The total amount of combined storage available for uniform variables in all uniform blocks accessed by a vertex shader (including the default uniform block) is specified by the value of the implementation-dependent constant MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS. These values represent the numbers of individual floating-point, integer, or boolean values that can be held in uniform variable storage for a vertex shader.

这篇关于GLSL统一块会消耗组件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆